           @font-face { font-family: 'bulangni'; src: url('') format('truetype'); font-weight: normal; font-style: normal; font-display: swap; }
        :root { --screen-width: 350px; --screen-height: 650px; --secondary-bg: #ffffff; --border-color: #e0e0e0; --text-primary: #1f1f1f; --text-secondary: #8a8a8a; --accent-color: #007bff; }
        html {
            -webkit-text-size-adjust: 100%;
            height: 100%; 
        }
        body {
            margin: 0;
            font-family: 'bulangni', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
            font-weight: normal;
            background-color: #f0f2f5;
            height: 100%; 
            overflow: hidden; 
        }
        #phone-screen {
            width: 100%;
            height: 100vh; 
            position: relative;
            overflow: hidden;
            display: flex;
            flex-direction: column;
            background-color: #ffffff; 
        }
        #chat-input-area {
            flex-shrink: 0;
            padding: 8px;
            padding-bottom: calc(8px + env(safe-area-inset-bottom)); 
            background-color: rgba(247, 247, 247, 0.8);
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            border-top: 1px solid var(--border-color);
            display: flex;
            flex-direction: column;
            gap: 5px;
        }
#status-bar {
    display: none;
    padding: 0 20px;
    height: 40px;
    color: white;
    background-color: transparent; 
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    box-sizing: border-box;
    z-index: 100;
    text-shadow: 0 1px 3px rgba(0,0,0,0.4);
    pointer-events: none; 
}
#phone-screen.status-bar-visible #status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
        .header, .qzone-header {
            position: relative;
            z-index: 15;
            flex-shrink: 0;
            padding: 15px 20px;
            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;
        }
        #status-bar { 
            display: none; 
        }
        #status-bar-time { font-weight: 600; }
        .battery-container { display: flex; align-items: center; gap: 5px; }
        .battery-icon { width: 25px; height: 12px; border: 1px solid white; border-radius: 3px; position: relative; padding: 1px; }
        .battery-icon::after { content: ''; position: absolute; right: -3px; top: 2px; width: 2px; height: 6px; background-color: white; border-radius: 0 1px 1px 0; }
        .battery-level { height: 100%; background-color: white; border-radius: 1px; transition: width 0.5s ease; }
        .battery-container.charging .battery-level { background-color: #4cd964; animation: charge-breath 2s infinite; }
        .battery-container.charging .battery-text { color: #4cd964; }
        @keyframes charge-breath { 0%, 100% { opacity: 1; } 50% { opacity: 0.7; } }
        .screen { width: 100%; height: 100%; position: absolute; top: 0; left: 0; display: flex; flex-direction: column; overflow: hidden; opacity: 0; visibility: hidden; transition: opacity 0.3s, visibility 0.3s; }
        .screen.active { opacity: 1; visibility: visible; z-index: 1; }
        .header { position: relative; z-index: 15; flex-shrink: 0; padding: 15px 20px; padding-top: 45px; 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; }
        .header .header-actions { 
    display: flex; 
    align-items: center; 
    gap: 15px; 
    position: relative; /* 新增：创建堆叠上下文 */
    z-index: 1;         /* 新增：确保它在标题span之上 */
}
        .header .back-btn, .header .action-btn { font-size: 24px; cursor: pointer; width: 30px; text-align: center; color: var(--accent-color); display: flex; align-items: center; justify-content: center; }
        .header .action-btn {
            font-size: 16px; 
            font-weight: 600; 
        }
        .header .action-btn img { height: 26px; }
        .header .save-btn { font-size: 16px; color: var(--accent-color); font-weight: 600; cursor: pointer; }
        #home-screen {
            display: flex;
            flex-direction: column;
            justify-content: flex-start;
            align-items: center;
            box-sizing: border-box;
            background-size: cover;
            background-position: center;
            padding-left: 20px;
            padding-right: 20px;
        }
        #clock-container {
            text-align: center;
            color: white;
            text-shadow: 0 3px 8px rgba(0,0,0,0.4);
            margin-bottom: 20px;
            flex-shrink: 0;
            margin-top: calc(60px + env(safe-area-inset-top));
        }
        #app-grid {
            margin-top: auto; 
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 20px;
            width: 100%;
            padding: 20px;
            margin-bottom: calc(30px + env(safe-area-inset-bottom)); 
        }
        #main-time {
            font-size: 88px; 
            font-weight: 600; 
            letter-spacing: -2px; 
            font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;
        }
        #main-date { 
            font-size: 22px; 
            font-weight: normal; 
        }
        #app-grid { margin-top: auto; display: flex; flex-direction: column; align-items: center; gap: 20px; width: 100%; padding: 20px; }
        .app-row { display: flex; justify-content: center; gap: 25px; width: 100%; }
        .app-icon { display: flex; flex-direction: column; align-items: center; cursor: pointer; color: white; text-shadow: 0 1px 3px rgba(0,0,0,0.5); font-size: 14px; font-weight: 500; text-align: center; }
        .app-icon .icon-bg { width: 65px; height: 65px; border-radius: 18px; background-color: var(--secondary-bg); display: flex; justify-content: center; align-items: center; font-size: 32px; margin-bottom: 8px; box-shadow: 0 4px 8px rgba(0,0,0,0.15); transition: transform 0.2s ease; overflow: hidden; }
        .app-icon:active .icon-bg { transform: scale(0.9); }
        .app-icon .icon-bg img { width: 100%; height: 100%; object-fit: cover; }
        .app-icon .label { color: white; }
        .form-container, .list-container { padding: 20px; overflow-y: auto; flex-grow: 1; display:flex; flex-direction: column; }
        .form-group { margin-bottom: 20px; }
        .form-group label { display: block; margin-bottom: 8px; font-weight: 500; color: var(--text-secondary); }
        .form-group input, .form-group select, .form-group textarea { width: 100%; padding: 12px; border: 1px solid var(--border-color); border-radius: 8px; font-size: 16px; box-sizing: border-box; }
        .form-group textarea { min-height: 80px; resize: vertical; }
        #world-book-content-input { height: calc(100% - 120px); }
        .form-button { width: 100%; padding: 15px; background-color: var(--accent-color); color: white; border: none; border-radius: 8px; font-size: 16px; font-weight: 600; cursor: pointer; margin-top: 10px; }
        .form-button-secondary { background-color: #f0f0f0; color: var(--text-primary); border: 1px solid var(--border-color); }
        #wallpaper-screen .form-container { align-items: center; }
        #wallpaper-preview { width: 180px; height: 320px; border: 2px dashed var(--border-color); background-color: #f0f2f5; margin-bottom: 20px; background-size: cover; background-position: center; border-radius: 10px; display: flex; justify-content: center; align-items: center; color: var(--text-secondary); }
        #wallpaper-upload-input { display: none; }
        #world-book-list {
            flex-grow: 1;
            overflow-y: auto;
            background-color: var(--secondary-bg);
            padding-top: 80px;
            margin-top: -80px;
        }
        #chat-list {
            flex-grow: 1;
            background-color: var(--secondary-bg);
            padding-top: 80px; 
            padding-bottom: 90px; 
            box-sizing: border-box;
        }
        .list-item { display: flex; flex-direction: column; padding: 12px 20px; cursor: pointer; border-bottom: 1px solid var(--border-color); }
        .list-item:hover { background-color: #f5f5f5; }
        .list-item .item-title { font-weight: 500; font-size: 16px; margin-bottom: 5px; }
        .list-item .item-content { font-size: 14px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .chat-list-item { display: flex; align-items: center; padding: 10px 15px; cursor: pointer; border-bottom: 1px solid var(--border-color); position: relative; }
        .chat-list-item:hover { background-color: #f5f5f5; }
        .chat-list-item .avatar { width: 45px; height: 45px; border-radius: 50%; margin-right: 12px; object-fit: cover; background-color: #ccc; }
        .chat-list-item .info { flex-grow: 1; overflow: hidden; }
        .chat-list-item .name-line { display: flex; align-items: center; gap: 6px; margin-bottom: 2px; }
        .chat-list-item .name { font-weight: 500; color: var(--text-primary); }
        .chat-list-item .group-tag { font-size: 10px; color: var(--accent-color); background-color: #e7f3ff; padding: 2px 6px; border-radius: 4px; font-weight: bold; flex-shrink: 0; }
        .chat-list-item .last-msg { font-size: 13px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
        #chat-interface-screen { background-size: cover; background-position: center; position: relative; }
        #selection-cancel-btn, #selection-delete-btn { font-size: 16px; color: var(--accent-color); cursor: pointer; padding: 5px; }
        #selection-delete-btn { color: #ff3b30; }
        #chat-messages {
            flex-grow: 1;
            overflow-y: auto;
            overflow-x: hidden; 
            padding: 10px 15px; 
            padding-top: 110px;
            margin-top: -80px;
            display: flex;
            flex-direction: column;
            gap: 20px;
            box-sizing: border-box; 
        }
        #load-more-btn { text-align: center; padding: 10px; color: var(--accent-color); font-size: 14px; cursor: pointer; background-color: transparent; border: none; width: 100%; }
        #load-more-btn:hover { text-decoration: underline; }
        .sender-name { font-size: 11px; color: #666; margin-bottom: 3px; }
        .message-wrapper.ai .sender-name {
            margin-left: 50px; 
            margin-bottom: 3px;
            position: absolute; 
            top: -16px;       
            left: 0;
        }
        .message-wrapper {
            display: flex;          
            gap: 8px;               
            align-items: flex-end;  
            position: relative;
            max-width: 90%;         
        }
        .message-wrapper.ai {
            align-self: flex-start;
            flex-direction: row; 
        }
        .message-wrapper.user {
            align-self: flex-end;
            flex-direction: row-reverse; 
        }
        .message-bubble {
            display: flex;
            align-items: flex-start;
            gap: 12px;
            max-width: 100%;
            min-width: 0; 
        }
        .timestamp {
            font-size: 11px;
            color: #999;
            text-shadow: 0 0 3px rgba(255,255,255,0.6);
            white-space: nowrap; 
            margin-bottom: 5px;  
            flex-shrink: 0;      
        }
        .message-bubble.selected::after { content: '✔'; position: absolute; left: -10px; top: 50%; transform: translateY(-50%); background-color: var(--accent-color); color: white; width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; }
        .message-bubble.user.selected::after { left: auto; right: -10px; }
        .message-bubble.user { flex-direction: row-reverse; }
        #typing-indicator { align-self: flex-start; display: none; margin: 0 10px 10px; color: var(--text-secondary); }
        #chat-list-bottom-nav {
            position: absolute;
            bottom: 0;
            left: 0;
            width: 100%;
            z-index: 15;
            display: flex;
            border-top: 1px solid var(--border-color);
            background-color: rgba(247, 247, 247, 0.9);
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            padding-bottom: env(safe-area-inset-bottom);
        }
        #chat-input-main-row { display: flex; align-items: flex-end; gap: 8px; width: 100%; }
#chat-input {
    flex-grow: 1;
    border: none;
    padding: 10px 15px;
    border-radius: 20px;
    background-color: var(--secondary-bg);
    font-size: 16px;
    height: 40px; 
    resize: none;
    overflow-y: auto; 
    box-sizing: border-box; 
}
        .action-button { border: none; color: white; border-radius: 20px; cursor: pointer; font-weight: 600; font-size: 14px; flex-shrink: 0; }
        #send-btn { background-color: var(--accent-color); height: 40px; padding: 0 15px;}
        .modal { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.4); display: none; justify-content: center; align-items: center; z-index: 100; }
        .modal.visible { display: flex; }
        .modal-content { width: 90%; max-height: 90%; background-color: white; border-radius: 15px; display: flex; flex-direction: column; }
        .modal-header { padding: 15px; font-weight: 600; border-bottom: 1px solid var(--border-color); text-align: center; display: flex; justify-content: space-between; align-items: center; }
        .modal-body { padding: 15px; overflow-y: auto; }
        .modal-footer { padding: 15px; border-top: 1px solid var(--border-color); display: flex; justify-content: space-around; }
        .modal-footer button { width: 45%; padding: 12px; border-radius: 8px; border: 1px solid var(--accent-color); cursor: pointer; font-size: 16px; }
        .modal-footer .save { background-color: var(--accent-color); color: white; }
        .modal-footer .cancel { background-color: white; color: var(--accent-color); }
        .avatar-upload { display: flex; align-items: center; gap: 15px; }
        .avatar-upload img { width: 60px; height: 60px; border-radius: 50%; object-fit: cover; background-color: #eee; }
        .avatar-upload button { padding: 8px 12px; border: 1px solid #ccc; background-color: #f0f0f0; border-radius: 5px; cursor: pointer; }
        #open-persona-library-btn { font-size: 14px; padding: 6px 10px; margin-left: 0; }
        .avatar-upload input[type="file"] { display: none; }
        .theme-selector label { display: inline-flex; align-items: center; margin-right: 15px; margin-bottom: 5px; cursor: pointer; }
        #reset-theme-btn { background: none; border: 1px solid #ccc; color: #555; font-size: 12px; padding: 2px 8px; border-radius: 5px; cursor: pointer; margin-left: 10px; }
        #group-members-settings { display: flex; overflow-x: auto; padding-bottom: 10px; gap: 15px; }
        .member-editor { text-align: center; cursor: pointer; }
        .member-editor img { width: 50px; height: 50px; border-radius: 50%; object-fit: cover; background-color: #eee; margin-bottom: 5px; }
        .member-editor .member-name { font-size: 12px; }
        #notification-bar { position: absolute; top: 40px; left: 50%; width: 90%; z-index: 500; background-color: rgba(250, 250, 250, 0.9); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-radius: 16px; padding: 10px; box-shadow: 0 4px 12px rgba(0,0,0,0.15); display: flex; align-items: center; gap: 12px; cursor: pointer;     transform: translateX(-50%) translateY(-150%); 
            transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
            visibility: hidden;
        }
        #notification-bar.visible {
            transform: translateX(-50%) translateY(0);
            visibility: visible;
        }
        #notification-avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }
        #notification-content .name { font-weight: 600; font-size: 15px; color: #000; }
        #notification-content .message { font-size: 14px; color: #555; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }
        .sticker-image { max-width: 100px; max-height: 100px; display: block; object-fit: contain; }
        #chat-input-actions-top { display: flex; gap: 8px; padding: 0 5px; }
        .chat-action-icon-btn { font-size: 24px; padding: 0; width: 38px; height: 38px; line-height: 38px; text-align: center; border-radius: 50%; background-color: rgba(255, 255, 255, 0.5); color: var(--text-primary); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); border: 1px solid rgba(0,0,0,0.05); cursor: pointer; display:flex; justify-content:center; align-items:center; }
        #sticker-panel { position: absolute; bottom: 0; left: 0; width: 100%; height: 50%; background-color: rgba(242, 242, 247, 0.85); backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px); border-top: 1px solid var(--border-color); border-radius: 20px 20px 0 0; z-index: 200; display: flex; flex-direction: column; transform: translateY(100%); transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); visibility: hidden; }
        #sticker-panel.visible { transform: translateY(0); visibility: visible; }
        #sticker-panel-header { padding: 10px 20px; display: flex; justify-content: space-between; align-items: center; flex-shrink: 0; border-bottom: 1px solid var(--border-color); }
        #sticker-panel-header .title { font-weight: 600; }
        #sticker-panel-header .panel-btn { font-size: 16px; padding: 5px 10px; cursor: pointer; color: var(--accent-color); }
        #sticker-grid { flex-grow: 1; overflow-y: auto; padding: 15px; display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 15px; }
.sticker-item {
    position: relative;
    display: flex;
    flex-direction: column; 
    align-items: center;    
    gap: 6px;               
    cursor: pointer;
}
.sticker-image-container {
    width: 100%;
    aspect-ratio: 1 / 1;    
    background-color: white;
    border-radius: 10px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.sticker-name {
    font-size: 12px;           
    color: var(--text-secondary); 
    width: 100%;               
    text-align: center;        
    white-space: nowrap;       
    overflow: hidden;          
    text-overflow: ellipsis;   
}
        .sticker-item .delete-btn { display: none; position: absolute; top: -5px; right: -5px; width: 20px; height: 20px; background-color: #ff3b30; color: white; border-radius: 50%; text-align: center; line-height: 20px; font-size: 14px; cursor: pointer; border: 2px solid white; }
        #input-actions-wrapper { position: static; display: flex; align-items: flex-end; gap: 8px; flex-shrink: 0; }
        #wait-reply-btn { position: static; bottom: auto; right: auto; width: auto; height: 40px; padding: 0 10px; border-radius: 20px; display: flex; align-items: center; justify-content: center; background-color: rgba(255, 255, 255, 0.6); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); border: 1px solid rgba(0,0,0,0.08); box-shadow: 0 2px 5px rgba(0,0,0,0.1); transition: opacity 0.2s, transform 0.1s; cursor: pointer;}
        #wait-reply-btn:hover { opacity: 0.8; }
        #wait-reply-btn:active { transform: scale(0.9); }
        #wait-reply-btn img { height: 22px; display: block; margin: auto; }
        .chat-image { max-width: 100%; border-radius: 10px; display: block; }
        .message-bubble.has-image .content { padding: 5px; }
        #custom-modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.5); display: none; align-items: center; justify-content: center; z-index: 1000; opacity: 0; transition: opacity 0.2s ease-in-out; }
        #custom-modal-overlay.visible { display: flex; opacity: 1; }
        #custom-modal { background-color: var(--secondary-bg); width: 280px; border-radius: 14px; box-shadow: 0 4px 20px rgba(0,0,0,0.2); display: flex; flex-direction: column; transform: scale(0.95); transition: transform 0.2s ease-in-out; }
        #custom-modal-overlay.visible #custom-modal { transform: scale(1); }
        .custom-modal-header { padding: 16px; font-size: 17px; font-weight: 600; text-align: center; }
        .custom-modal-body { padding: 0 16px 16px; text-align: center; font-size: 14px; color: #333; line-height: 1.5; }
        .custom-modal-body p { margin: 0; margin-bottom: 12px; }
        .custom-modal-body input {
            width: 100%;
            padding: 8px 12px; 
            border-radius: 6px;
            border: 1px solid #ccc;
            font-size: 16px; 
            box-sizing: border-box;
        }
        .custom-modal-footer { border-top: 1px solid #dbdbdb; display: flex; }
        .custom-modal-footer button { flex: 1; background: none; border: none; padding: 12px; font-size: 17px; cursor: pointer; color: var(--accent-color); }
        .custom-modal-footer button:first-child { border-right: 1px solid #dbdbdb; }
        .custom-modal-footer .confirm-btn { font-weight: 600; }
        .custom-modal-footer .confirm-btn.btn-danger { color: #ff3b30; }
        #preset-actions-modal .custom-modal-footer { flex-direction: column; }
        #preset-actions-modal .custom-modal-footer button { width: 100%; border: none; border-bottom: 1px solid #dbdbdb; padding: 14px; font-size: 18px; }
        #preset-actions-modal .custom-modal-footer button:last-child { border-bottom: none; }
        .custom-multiselect {
            position: relative;
            -webkit-user-select: none; 
            user-select: none;
        }
        .select-box { display: flex; align-items: center; width: 100%; padding: 12px; border: 1px solid var(--border-color); border-radius: 8px; font-size: 16px; box-sizing: border-box; background-color: var(--secondary-bg); cursor: pointer; }
        .select-box .selected-options-text { flex-grow: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-primary); }
        .select-box .arrow-down { margin-left: auto; font-size: 10px; color: var(--text-secondary); transition: transform 0.2s; }
        .select-box.expanded .arrow-down { transform: rotate(180deg); }
       .checkboxes-container {
    display: none;
    position: absolute;
    top: 100%; 
    margin-top: 5px; 
    left: 0;
    right: 0;
    max-height: 150px;
    overflow-y: auto;
    background-color: var(--secondary-bg); /* <-- 修改后 */
    border: 1px solid var(--border-color);
    border-radius: 8px;
    z-index: 101;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
        .checkboxes-container.visible { display: block; }
        .checkboxes-container label { display: block; padding: 10px 12px; cursor: pointer; font-weight: normal; color: var(--text-primary); }
        .checkboxes-container label {
            display: block;
            padding: 12px 15px; 
            cursor: pointer;
            font-weight: normal;
            color: var(--text-primary);
            font-size: 15px; 
        }
        .checkboxes-container input { margin-right: 10px; vertical-align: middle; }
        .bg-upload-container { display: flex; align-items: center; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
        .bg-preview-img { max-width: 120px; max-height: 80px; border-radius: 8px; border: 1px solid var(--border-color); object-fit: cover; display: none; }
        #remove-bg-btn { padding: 8px 12px; border: 1px solid #ff3b30; color: #ff3b30; background-color: var(--secondary-bg); border-radius: 5px; cursor: pointer; font-size: 14px; display: none; }
        .ai-generated-image { max-width: 180px; border-radius: 12px; display: block; cursor: pointer; transition: transform 0.2s, box-shadow 0.2s; }
        .ai-generated-image:hover { transform: scale(1.05); box-shadow: 0 4px 15px rgba(0,0,0,0.2); }
        
        /* RealImag/NovelAI图片在私聊/群聊消息气泡里的样式 */
        .realimag-image {
            max-width: 250px;
            max-height: 250px;
            width: auto;
            height: auto;
            display: block;
            border-radius: 10px;
            object-fit: cover;
            background-color: #f8f8f8;
            min-width: 100px;
            min-height: 100px;
            cursor: pointer;
            transition: transform 0.2s;
        }
        .realimag-image:hover {
            transform: scale(1.02);
        }
        
        .message-bubble.is-realimag .content {
            padding: 5px;
            background: transparent;
            box-shadow: none;
            border: none;
            backdrop-filter: none;
            -webkit-backdrop-filter: none;
        }
        
        .voice-message-body { display: flex; align-items: center; cursor: pointer; padding: 8px 12px; min-width: 80px; max-width: 200px; }
        .message-bubble.user .voice-message-body { color: #1a3d00; flex-direction: row-reverse; }
        .message-bubble.ai .voice-message-body { color: var(--text-primary); }
        .voice-waveform { display: flex; align-items: center; height: 20px; gap: 2px; flex-grow: 1; margin: 0 10px; }
        .voice-waveform div { width: 3px; background-color: currentColor; border-radius: 2px; animation: wave-quiet 1.5s ease-in-out infinite; }
        @keyframes wave-quiet { 0%, 100% { height: 2px; } 50% { height: 10px; } }
        .voice-waveform div:nth-child(2) { animation-delay: 0.2s; } .voice-waveform div:nth-child(3) { animation-delay: 0.4s; } .voice-waveform div:nth-child(4) { animation-delay: 0.6s; } .voice-waveform div:nth-child(5) { animation-delay: 0.8s; }
        .voice-duration {
            font-size: var(--chat-font-size, 13px);
            font-weight: 500;
            color: var(--text-secondary);
        }
        .message-bubble.user .voice-duration { color: #3e6224; }
        .message-bubble .content {
            position: relative;
            font-size: var(--chat-font-size, 16px);
            padding: 8px 12px;
            line-height: 1.5;
            word-break: break-word; 
        }
        .message-bubble.user .content { background-color: rgba(255, 255, 255, 0.75); color: #585858; border-radius: 8px 2px 8px 8px; }
        .message-bubble.ai .content { background-color: rgba(255, 255, 255, 0.7); color: #585858; border-radius: 2px 8px 8px 8px; }
        .message-bubble::after {
            content: "";
            position: absolute;
            width: 20px;  
            height: 20px; 
            background-size: contain;
            background-repeat: no-repeat;
            opacity: 1; 
            z-index: 1;
        }
        #chat-messages[data-theme="pink_blue"] .message-bubble.user .content { background-color: #fff0f6; color: #432531; }
        #chat-messages[data-theme="pink_blue"] .message-bubble.ai .content { background-color: #eff7ff; color: #263a4e; }
        #chat-messages[data-theme="blue_white"] .message-bubble.user .content { background-color: #eff7ff; color: #263a4e; }
        #chat-messages[data-theme="blue_white"] .message-bubble.ai .content { background-color: #f8f9fa; color: #383d41; }
        #chat-messages[data-theme="purple_yellow"] .message-bubble.user .content { background-color: #faf7ff; color: #827693; }
        #chat-messages[data-theme="purple_yellow"] .message-bubble.ai .content { background-color: #fffde4; color: #5C4033; }
        #chat-messages[data-theme="black_white"] .message-bubble.user .content { background-color: #343a40; color: #f8f9fa; }
        #chat-messages[data-theme="black_white"] .message-bubble.ai .content { background-color: #f8f9fa; color: #343a40; }
        #chat-messages[data-theme="yellow_white"] .message-bubble.user .content { background-color: #FFEB3B; color: #5D4037; }
        #chat-messages[data-theme="yellow_white"] .message-bubble.ai .content { background-color: #f8f9fa; color: #383d41; }
        #chat-messages[data-theme="red_black"] .message-bubble.user .content { background-color: #C62828; color: #FFFFFF; }
        #chat-messages[data-theme="red_black"] .message-bubble.ai .content { background-color: #212121; color: #FFFFFF; }
        #chat-messages[data-theme="blue_yellow"] .message-bubble.user .content { background-color: #A0D2EB; color: #153243; }
        #chat-messages[data-theme="blue_yellow"] .message-bubble.ai .content { background-color: #FEF9E7; color: #5D4037; }
        #chat-messages[data-theme="pink_yellow"] .message-bubble.user .content { background-color: #fff0f6; color: #432531; }
        #chat-messages[data-theme="pink_yellow"] .message-bubble.ai .content { background-color: #FEF9E7; color: #5D4037; }
        #chat-messages[data-theme="pink_purple"] .message-bubble.user .content { background-color: #fff0f6; color: #a78396; }
        #chat-messages[data-theme="pink_purple"] .message-bubble.ai .content { background-color: #faf7ff; color: #827693; }
        #chat-messages[data-theme="gray_white"] .message-bubble.user .content { background-color: #e9ecef; color: #495057; }
        #chat-messages[data-theme="gray_white"] .message-bubble.ai .content { background-color: #f8f9fa; color: #383d41; }
        #chat-messages[data-theme="blue_green"] .message-bubble.user .content { background-color: #d1ecf1; color: #0c5460; }
        #chat-messages[data-theme="blue_green"] .message-bubble.ai .content { background-color: #d4edda; color: #155724; }
        #chat-messages[data-theme="pink_white"] .message-bubble.user .content { background-color: #fff0f6; color: #a78396; }
        #chat-messages[data-theme="pink_white"] .message-bubble.ai .content { background-color: #f8f9fa; color: #383d41; }
        #chat-messages[data-theme="pink_black"] .message-bubble.user .content { background-color: #F8BBD0; color: #5B2C6F; }
        #chat-messages[data-theme="pink_black"] .message-bubble.ai .content { background-color: #343a40; color: #f8f9fa; }
        #chat-messages[data-theme="pink_green"] .message-bubble.user .content { background-color: #F8BBD0; color: #5B2C6F; }
        #chat-messages[data-theme="pink_green"] .message-bubble.ai .content { background-color: #C8E6C9; color: #1B5E20; }
        #chat-messages[data-theme="green_black"] .message-bubble.user .content { background-color: #d4edda; color: #155724; }
        #chat-messages[data-theme="green_black"] .message-bubble.ai .content { background-color: #343a40; color: #f8f9fa; }
        #transfer-btn { font-weight: bold; }
        #transfer-modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.5); display: none; align-items: center; justify-content: center; z-index: 1001; }
        #transfer-modal.visible { display: flex; }
        .transfer-content { background-color: #fff0f5; border-radius: 20px; width: 290px; padding: 20px; box-shadow: 0 5px 25px rgba(255, 105, 180, 0.3); text-align: center; background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100" opacity="0.05"><path d="M50,4 C35,4 28,15 28,24 C28,33 35,32 35,40 C35,48 28,49 28,57 C28,65 35,66 35,74 C35,82 28,83 28,91 C28,99 35,100 50,100 C65,100 72,99 72,91 C72,83 65,82 65,74 C65,66 72,65 72,57 C72,49 65,48 65,40 C65,32 72,33 72,24 C72,15 65,4 50,4 Z" fill="%23FF69B4"/></svg>'); background-repeat: no-repeat; background-position: top right; background-size: 80px; }
        .transfer-header { font-size: 20px; font-weight: bold; color: #a35c7b; margin-bottom: 20px; }
        .transfer-input-group { margin-bottom: 15px; text-align: left; }
        .transfer-input-group label { display: block; font-size: 14px; color: #ff85b3; margin-bottom: 5px; font-weight: 500; }
        .transfer-input-group input { width: 100%; padding: 12px; border-radius: 10px; border: 2px solid #ffcce0; background-color: var(--secondary-bg); font-size: 16px; box-sizing: border-box; }
        .transfer-input-group input:focus { border-color: #ff85b3; outline: none; }
        .transfer-actions { display: flex; justify-content: space-between; gap: 10px; }
        .transfer-actions button { flex: 1; padding: 12px; border: none; border-radius: 10px; font-size: 16px; font-weight: bold; cursor: pointer; transition: transform 0.2s; }
        .transfer-actions button:active { transform: scale(0.95); }
        #transfer-cancel-btn { background-color: #ffdde9; color: #a35c7b; }
        #transfer-confirm-btn { background-color: #ff85b3; color: white; }
        .transfer-card { width: 200px; border-radius: 12px; padding: 12px; color: white; position: relative; overflow: hidden; }
        .transfer-card::before { content: '🐾'; position: absolute; right: 10px; top: 5px; font-size: 30px; opacity: 0.2; transform: rotate(15deg); }
        .message-bubble.user .transfer-card { background: radial-gradient(circle at top left, #ffc5d5, #ff85b3); }
        .message-bubble.ai .transfer-card { background: radial-gradient(circle at top left, #a1c4fd, #c2e9fb); }
        .transfer-title { font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
        .transfer-amount { font-size: 28px; font-weight: bold; margin-bottom: 4px; }
        .transfer-note { font-size: 13px; opacity: 0.9; border-top: 1px solid rgba(255,255,255,0.3); padding-top: 8px; margin-top: 8px; word-break: break-all; }
        @keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
        #listen-together-btn img.rotating { animation: spin 2s linear infinite; }
        #listen-together-btn img.paused { animation-play-state: paused; }
        #music-player-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 50; display: none; justify-content: center; align-items: center; background-color: rgba(0,0,0,0.3); }
        #music-player-overlay.visible { display: flex; }
        .music-player-window { width: 90%; background-color: rgba(255, 255, 255, 0.6); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-radius: 20px; box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37); border: 1px solid rgba(255, 255, 255, 0.18); padding: 25px; display: flex; flex-direction: column; align-items: center; color: #1f1f1f; position: relative; }
        #music-playlist-btn { position: absolute; top: 15px; right: 15px; font-size: 24px; cursor: pointer; color: #333; }
        #music-time-counter { font-size: 12px; color: #555; margin-bottom: 20px; }
        #music-player-song-title { font-size: 20px; font-weight: 600; margin-bottom: 5px; text-align: center; }
        #music-player-artist { font-size: 14px; color: #666; margin-bottom: 25px; }
        .music-controls { display: flex; align-items: center; justify-content: center; gap: 20px; width: 100%; margin-bottom: 30px; }
        .music-controls button { background: none; border: none; font-size: 16px; font-weight: bold; cursor: pointer; color: #333; width: 44px; height: 44px; display: flex; justify-content: center; align-items: center; transition: transform 0.2s; }
        .music-controls button:active { transform: scale(0.9); }
        .music-controls .play-pause-btn { font-size: 24px; width: 60px; height: 60px; border-radius: 50%; background-color: rgba(0,0,0,0.05); }
        .music-bottom-actions { display: flex; justify-content: space-between; width: 100%; }
        .music-bottom-actions button { flex: 1; padding: 12px 0; border: none; border-radius: 10px; font-size: 15px; font-weight: 500; cursor: pointer; }
        #music-exit-btn { background-color: rgba(255, 100, 100, 0.7); color: white; margin-right: 5px; }
        #music-return-btn { background-color: rgba(0, 123, 255, 0.7); color: white; margin-left: 5px; }
        #music-playlist-panel { position: absolute; bottom: 0; left: 0; width: 100%; height: 70%; background-color: rgba(242, 242, 247, 0.9); backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px); border-top: 1px solid var(--border-color); border-radius: 20px 20px 0 0; z-index: 210; display: flex; flex-direction: column; transform: translateY(100%); transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); visibility: hidden; }
        #music-playlist-panel.visible { transform: translateY(0); visibility: visible; }
        .playlist-header { padding: 15px 20px; display: flex; justify-content: space-between; align-items: center; flex-shrink: 0; border-bottom: 1px solid var(--border-color); font-weight: 600; }
        .playlist-header .panel-btn { font-size: 16px; cursor: pointer; color: var(--accent-color); }
       .playlist-body {
    flex-grow: 1;
    overflow-y: auto;
    padding: 10px 0 80px 0;
    box-sizing: border-box;
}
        .playlist-item { padding: 10px 20px; display: flex; justify-content: space-between; align-items: center; cursor: pointer; border-bottom: 1px solid #eee; }
        .playlist-item.playing { background-color: rgba(0, 123, 255, 0.1); }
        .playlist-item-info .title { font-weight: 500; font-size: 15px; }
        .playlist-item-info .artist { font-size: 12px; color: #666; }
        .playlist-item .delete-track-btn { color: #ff3b30; font-size: 20px; padding: 5px; }
        #persona-library-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; padding: 10px; }
        .persona-preset-item { aspect-ratio: 1 / 1; border-radius: 12px; background-size: cover; background-position: center; cursor: pointer; transition: transform 0.2s, box-shadow 0.2s; border: 1px solid rgba(0,0,0,0.1); }
        .persona-preset-item:hover { transform: scale(1.08); box-shadow: 0 4px 10px rgba(0,0,0,0.2); }
        .modal-header .action-button { font-size: 16px; color: var(--accent-color); font-weight: 600; cursor: pointer; background: none; border: none; padding: 5px; }
        #battery-alert-modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.4); display: none; justify-content: center; align-items: center; z-index: 2000; opacity: 0; transition: opacity 0.3s ease; }
        #battery-alert-modal.visible { display: flex; opacity: 1; }
        .battery-alert-content { background-color: rgba(255, 255, 255, 0.9); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); width: 280px; border-radius: 15px; box-shadow: 0 5px 20px rgba(0,0,0,0.2); text-align: center; padding: 20px; cursor: pointer; transform: scale(0.9); transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); }
        #battery-alert-modal.visible .battery-alert-content { transform: scale(1); }
        #battery-alert-image { max-width: 100px; max-height: 100px; margin-bottom: 15px; }
        #battery-alert-text { font-size: 16px; font-weight: 500; color: #333; margin: 0; line-height: 1.4; }
        #font-preview {
            transition: font-family 0.3s ease;}
        #chat-list-screen {
        }
        .chat-list-view {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            display: flex;
            flex-direction: column;
            opacity: 0;
            visibility: hidden;
            transition: opacity 0.2s, visibility 0.2s;
            z-index: 1; 
        }
        .chat-list-view.active {
            opacity: 1;
            visibility: visible;
            z-index: 2; 
        }
        #messages-view {
            overflow-y: auto; 
        }
        .nav-item {
            flex: 1;
            text-align: center;
            padding: 12px 0;
            font-size: 14px;
            color: var(--text-secondary);
            cursor: pointer;
            transition: color 0.2s;
        }
        .nav-item.active {
            color: var(--accent-color);
            font-weight: 600;
        }
        #qzone-screen {
            background-color: #f0f2f5;
        }
        .qzone-header {
            position: relative;
            z-index: 10; 
            flex-shrink: 0; 
            padding: 15px 20px;
            padding-top: 45px;
            background-color: rgba(247, 247, 247, 0.7); 
            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;
            text-align: center;
        }
        .qzone-header .back-btn {
            font-size: 24px;
            cursor: pointer;
            color: var(--accent-color);
        }
        .qzone-header span:nth-child(2) { 
            position: absolute;
            left: 50%;
            transform: translateX(-50%);
        }
        .qzone-content {
            flex-grow: 1;
            overflow-y: auto;
        }
        .qzone-profile-header {
            position: relative;
            margin-bottom: 20px;
        }
        .qzone-banner-container {
            width: 100%;
            height: 180px; 
            position: relative;
        }
        #qzone-banner-img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
        .qzone-user-info {
            position: absolute;
            bottom: -30px; 
            left: 20px;
            display: flex;
            align-items: flex-end; 
            gap: 10px;
        }
        .qzone-avatar-container {
            position: relative;
        }
        #qzone-avatar-img {
            width: 70px;
            height: 70px;
            border-radius: 50%;
            border: 3px solid white;
            box-shadow: 0 2px 5px rgba(0,0,0,0.2);
            object-fit: cover;
        }
        #qzone-nickname {
            font-size: 18px;
            font-weight: 600;
            color: #fff;
            text-shadow: 0 1px 3px rgba(0,0,0,0.5);
            padding-bottom: 5px; 
        }
        .qzone-edit-btn {
            position: absolute;
            background-color: rgba(0,0,0,0.4);
            color: white;
            border: none;
            border-radius: 10px;
            padding: 4px 8px;
            font-size: 12px;
            cursor: pointer;
            backdrop-filter: blur(5px);
            -webkit-backdrop-filter: blur(5px);
        }
        #change-qzone-banner-btn {
            bottom: 10px;
            right: 10px;
        }
        #change-qzone-avatar-btn {
            bottom: 5px;
            right: 5px;
        }
        #change-qzone-nickname-btn {
            font-size: 14px;
            padding: 2px 6px;
            margin-left: 5px; 
            color: var(--text-primary);
            background-color: rgba(255,255,255,0.7);
            border-radius: 5px;
            position: relative; 
            bottom: 5px; 
        }
        #qzone-banner-container,
        #qzone-avatar-container,
        #qzone-nickname {
            cursor: pointer; 
            transition: opacity 0.2s;
        }
        #qzone-banner-container:hover,
        #qzone-avatar-container:hover,
        #qzone-nickname:hover {
            opacity: 0.85; 
        }
        .qzone-edit-btn {
            display: none;
        }
        #qzone-screen .qzone-header {
            display: none;
        }
        #qzone-screen.active .qzone-header {
            display: flex;
        }
        #chat-list-screen.in-qzone-view > .header,
        #chat-list-screen.in-qzone-view > #chat-list-bottom-nav {
            display: none;
        }
        .chat-list-item:first-child,
        .chat-group-container:first-child {
            margin-top: 10px; 
        }
        .qzone-actions-bar {
            display: flex;
            justify-content: space-around;
            padding: 10px 0;
            margin: 40px 15px 15px 15px; 
            background-color: var(--secondary-bg);
            border-radius: 12px;
            box-shadow: 0 2px 8px rgba(0,0,0,0.08);
        }
        .action-item {
            flex: 1;
            text-align: center;
            font-size: 15px;
            font-weight: 500;
            color: var(--text-primary);
            cursor: pointer;
            padding: 8px 0;
            position: relative;
        }
        .action-item:not(:last-child)::after {
            content: '';
            position: absolute;
            right: 0;
            top: 50%;
            transform: translateY(-50%);
            width: 1px;
            height: 20px;
            background-color: var(--border-color);
        }
        #qzone-posts-list {
            padding: 0 15px 20px 15px; 
            display: flex;
            flex-direction: column;
            gap: 20px; 
        }
        .qzone-post-item {
            background-color: var(--secondary-bg);
            border-radius: 12px;
            padding: 15px;
            box-shadow: 0 1px 4px rgba(0,0,0,0.06);
        }
        .post-header {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 12px;
        }
        .post-header .post-avatar {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            object-fit: cover;
        }
        .post-info {
            display: flex;
            flex-direction: column;
        }
        .post-info .post-nickname {
            font-weight: 600;
            font-size: 15px;
            color: var(--text-primary);
        }
        .post-info .post-timestamp {
            font-size: 12px;
            color: var(--text-secondary);
        }
        .post-content {
            font-size: 14px;
            line-height: 1.6;
            color: #333;
            white-space: pre-wrap; 
            word-break: break-word; 
        }
        #post-public-text {
            min-height: 80px; 
            resize: vertical;
        }
        .post-image-preview-container {
            position: relative;
            width: 100%;
            aspect-ratio: 16 / 9; 
            background-color: #f0f2f5;
            border: 2px dashed var(--border-color);
            border-radius: 8px;
            margin-bottom: 15px;
            display: none; 
            justify-content: center;
            align-items: center;
        }
        .post-image-preview-container.visible {
            display: flex; 
        }
        #post-image-preview {
            max-width: 100%;
            max-height: 100%;
            object-fit: contain;
            border-radius: 6px;
        }
        #post-remove-image-btn {
            position: absolute;
            top: -10px;
            right: -10px;
            width: 24px;
            height: 24px;
            border-radius: 50%;
            background-color: #ff3b30;
            color: white;
            border: 2px solid white;
            font-size: 16px;
            line-height: 20px;
            text-align: center;
            cursor: pointer;
            box-shadow: 0 1px 4px rgba(0,0,0,0.3);
        }
        .post-image-upload-options {
            display: flex;
            gap: 10px;
        }
        .post-image-upload-options button {
            flex: 1;
            margin-top: 0;
        }
        .post-mode-switcher {
            display: flex;
            margin-bottom: 20px;
            background-color: #e9ecef;
            border-radius: 8px;
            padding: 4px;
        }
        .mode-btn {
            flex: 1;
            padding: 8px;
            border: none;
            background-color: transparent;
            border-radius: 6px;
            font-size: 14px;
            font-weight: 500;
            color: var(--text-secondary);
            cursor: pointer;
            transition: all 0.2s ease-in-out;
        }
        .mode-btn.active {
            background-color: var(--secondary-bg);
            color: var(--text-primary);
            box-shadow: 0 1px 3px rgba(0,0,0,0.1);
        }
        .post-mode-content {
            display: none; 
        }
        .post-mode-content.active {
            display: block; 
        }
        #album-screen {
            background-color: #f0f2f5; 
        }
        #album-grid-page {
            padding: 15px;
            display: grid;
            grid-template-columns: repeat(2, 1fr); 
            gap: 15px;
        }
        .album-item {
            display: flex;
            flex-direction: column;
            cursor: pointer;
            transition: transform 0.2s ease, box-shadow 0.2s ease;
            border-radius: 8px; 
        }
        .album-item:hover {
            transform: translateY(-5px);
            box-shadow: 0 8px 15px rgba(0,0,0,0.1);
        }
        .album-cover {
            aspect-ratio: 1 / 1; 
            background-size: cover;
            background-position: center;
            border-radius: 8px;
            margin-bottom: 8px;
            background-color: #f0f2f5; 
        }
        .album-info {
            text-align: center;
        }
        .album-name {
            font-weight: 500;
            margin: 0 0 4px 0;
            color: var(--text-primary);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis; 
        }
        .album-count {
            font-size: 12px;
            color: var(--text-secondary);
            margin: 0;
        }
        #album-photos-screen {
            background-color: #f0f2f5;
        }
        #photos-grid-page {
            padding: 15px;
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 10px;
        }
        .photo-item {
            position: relative; 
            aspect-ratio: 1 / 1; 
            border-radius: 6px;
            overflow: hidden; 
            background-color: #e9ecef; 
        }
        .photo-item .photo-thumb {
            width: 100%;
            height: 100%;
            object-fit: cover; 
            cursor: pointer;
        }
        .photo-item .photo-delete-btn {
            position: absolute;
            top: 5px;
            right: 5px;
            width: 22px;
            height: 22px;
            background-color: rgba(0, 0, 0, 0.6);
            color: white;
            border: none;
            border-radius: 50%;
            font-size: 16px;
            line-height: 22px;
            text-align: center;
            cursor: pointer;
            opacity: 0; 
            transition: opacity 0.2s ease;
        }
        .photo-item:hover .photo-delete-btn {
            opacity: 1;
        }
        #photo-viewer-modal {
            background-color: rgba(0, 0, 0, 0.85);
            z-index: 1002;
            -webkit-backdrop-filter: blur(5px);
            backdrop-filter: blur(5px);
        }
        .photo-viewer-content {
            display: flex;
            justify-content: center;
            align-items: center;
            width: 100%;
            height: 100%;
        }
        #photo-viewer-image {
            max-width: 90vw;  
            max-height: 85vh; 
            object-fit: contain;
            border-radius: 8px;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
            transition: opacity 0.2s ease-in-out;
        }
        #photo-viewer-close-btn {
            position: absolute;
            top: 20px;
            right: 20px;
            background: none;
            border: none;
            color: white;
            font-size: 40px;
            font-weight: 200;
            cursor: pointer;
            line-height: 1;
            text-shadow: 0 0 5px black;
        }
        #photo-viewer-modal .nav-arrow {
            position: absolute; 
            top: 50%;
            transform: translateY(-50%);
            background: none;
            border: none;
            color: rgba(255, 255, 255, 0.7);
            font-size: 50px; 
            font-weight: 100;
            cursor: pointer;
            padding: 10px; 
        -webkit-user-select: none; 
            user-select: none;
            transition: color 0.2s;
            z-index: 1003; 
        }
        #photo-viewer-prev-btn {
            left: 5px; 
        }
        #photo-viewer-next-btn {
            right: 5px; 
        }
        #photo-viewer-modal .nav-arrow:hover {
            color: white;
        }
        #photo-viewer-modal .nav-arrow:disabled {
            color: rgba(255, 255, 255, 0.2);
            cursor: default;
        }
        .post-main-content {
        }
        .post-feedback-icons {
            display: flex;
            justify-content: flex-end; 
            align-items: center;
            gap: 12px;
            padding: 8px 0; 
        }
        .action-icon {
            cursor: pointer;
            color: var(--text-secondary); 
            transition: all 0.2s ease-in-out;
        }
        .action-icon svg {
            width: 22px;
            height: 22px;
            fill: none;
            stroke: currentColor;
            stroke-width: 2;
            stroke-linecap: round;
            stroke-linejoin: round;
        }
        .action-icon.active {
            color: #ff5252; 
            transform: scale(1.1); 
        }
        .action-icon.active.favorite {
            color: #ffc107; 
        }
        .action-icon.active svg {
            fill: currentColor; 
        }
        .animate-like {
            animation: like-bounce 0.4s ease-in-out;
        }
        @keyframes like-bounce {
            0%   { transform: scale(1); }
            25%  { transform: scale(0.8); }
            50%  { transform: scale(1.2); }
            75%  { transform: scale(1.05); }
            100% { transform: scale(1.1); }
        }
        .post-footer {
            margin-top: 15px;
            padding-top: 10px;
            border-top: 1px solid #f0f0f0; 
            display: flex;
            align-items: center;
            gap: 8px; 
        }
        .comment-section {
            flex-grow: 1; 
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .comment-section .comment-avatar {
            width: 28px;
            height: 28px;
            border-radius: 50%;
            object-fit: cover;
            flex-shrink: 0;
        }
        .comment-section {
            position: relative; 
        }
        .comment-section .comment-input {
            width: 100%;
            padding: 8px 12px;
            border: none;
            background-color: #f0f2f5;
            border-radius: 14px;
            font-size: 16px; 
            outline: none;
        }
        .comment-send-btn {
            flex-shrink: 0; 
            padding: 8px 15px;
            border: none;
            background-color: var(--accent-color);
            color: white;
            border-radius: 14px;
            font-size: 16px; 
            font-weight: 500;
            cursor: pointer;
        }
        .unread-indicator {
            position: absolute;
            top: -8px;      
            right: -15px;    
            min-width: 18px;
            height: 18px;
            padding: 0 5px;
            background-color: #ff3b30;
            color: white;
            font-size: 11px;
            font-weight: bold;
            line-height: 18px;
            text-align: center;
            border-radius: 9px;
            box-shadow: 0 1px 2px rgba(0,0,0,0.2);
            display: none;
            z-index: 1;
        }
        .back-btn-indicator {
            top: 0;
            right: -8px; 
            width: 10px;
            height: 10px;
            min-width: 10px;
            padding: 0;
            border-radius: 50%;
        }
        .post-comments-container {
            padding: 10px 0; 
            display: flex;
            flex-direction: column;
            gap: 8px; 
            font-size: 13px; 
        }
        .comment-item {
            line-height: 1.5;
        }
        .comment-item .commenter-name {
            font-weight: 600;
            color: var(--accent-color);
            cursor: pointer;
            margin-right: 5px; 
        }
        .comment-item .comment-text {
            color: var(--text-primary);
            word-break: break-word;
        }
        .post-likes-section {
            display: flex;
            align-items: center;
            gap: 6px; 
            padding: 8px 10px; 
            font-size: 13px;
            color: var(--accent-color); 
            background-color: #f0f5fa; 
            border-top: 1px solid #e9eef3;
            border-bottom: 1px solid #e9eef3;
            margin-top: 5px; 
        }
        .post-likes-section .like-icon {
            width: 16px;
            height: 16px;
            fill: currentColor; 
            flex-shrink: 0; 
        }
        .at-mention-popup {
            position: absolute; 
            bottom: 100%; 
            left: 40px; 
            width: calc(100% - 40px); 
            max-height: 120px;
            overflow-y: auto;
            background-color: var(--secondary-bg);
            border: 1px solid var(--border-color);
            border-radius: 8px;
            box-shadow: 0 -4px 12px rgba(0,0,0,0.1);
            z-index: 10;
            display: none; 
        }
        .at-mention-item {
            padding: 8px 12px;
            font-size: 14px;
            cursor: pointer;
            color: var(--text-primary);
            border-bottom: 1px solid #f0f0f0;
        }
        .at-mention-item:last-child {
            border-bottom: none;
        }
        .at-mention-item:hover {
            background-color: #f5f5f5;
        }
        #favorites-view {
            display: flex;
            flex-direction: column;
        }
        #favorites-view > .header {
            flex-shrink: 0;
        }
        #favorites-list {
            flex-grow: 1; 
            overflow-y: auto; 
            overflow-x: hidden; 
            padding: 15px; 
            display: flex;
            flex-direction: column;
            gap: 15px; 
        }
        .favorite-item-card {
            background-color: var(--secondary-bg);
            border-radius: 12px;
            padding: 15px;
            box-shadow: 0 1px 4px rgba(0,0,0,0.06);
            position: relative; 
        }
        .fav-card-header {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 12px;
        }
        .fav-card-header .avatar {
            width: 36px;
            height: 36px;
            border-radius: 50%;
            object-fit: cover;
        }
        .fav-card-header .info {
            flex-grow: 1;
        }
        .fav-card-header .name {
            font-weight: 600;
            font-size: 15px;
        }
        .fav-card-header .source {
            font-size: 12px;
            color: var(--text-secondary);
        }
        .fav-card-content {
            font-size: 14px;
            line-height: 1.6;
            color: #333;
            white-space: pre-wrap;
            word-break: break-word;
        }
        .fav-card-content .chat-image {
            margin-top: 8px; 
        }
        .fav-delete-btn {
            position: absolute;
            top: 10px;
            right: 10px;
            width: 28px;
            height: 28px;
            background: #f0f2f5;
            border: none;
            border-radius: 50%;
            cursor: pointer;
            font-size: 18px;
            color: var(--text-secondary);
            line-height: 28px;
            text-align: center;
        }
        .fav-delete-btn:hover {
            background-color: #e9ecef;
            color: #ff3b30;
        }
        .search-bar-container {
            padding: 10px 15px;
            background-color: #f9f9f9; 
            position: relative; 
            flex-shrink: 0;
        }
        #favorites-search-input {
            width: 100%;
            padding: 10px 30px 10px 15px; 
            font-size: 16px;
            border: 1px solid var(--border-color);
            border-radius: 18px; 
            background-color: var(--secondary-bg);
            box-sizing: border-box;
            outline: none;
        }
        #favorites-search-input:focus {
            border-color: var(--accent-color);
        }
        .search-clear-btn {
            position: absolute;
            right: 25px;
            top: 50%;
            transform: translateY(-50%);
            background: #ccc;
            color: white;
            border: none;
            border-radius: 50%;
            width: 20px;
            height: 20px;
            line-height: 20px;
            text-align: center;
            font-size: 16px;
            cursor: pointer;
        }
        #chat-interface-screen .header .selection-controls {
            display: flex;
            justify-content: space-between;
            align-items: center;
            width: 100%;
        }
        #chat-interface-screen .selection-controls .action-btn {
            font-size: 16px;
            font-weight: 600;
            cursor: pointer;
            padding: 5px;
        }
        #favorites-view.selection-mode .favorite-item-card {
            transition: transform 0.2s ease, box-shadow 0.2s ease;
        }
        .favorite-item-card::before {
            content: '';
            position: absolute;
            left: -25px; 
            top: 50%;
            transform: translateY(-50%);
            width: 20px;
            height: 20px;
            border: 2px solid #ccc;
            border-radius: 50%;
            background-color: white;
            transition: all 0.2s ease;
            opacity: 0; 
        }
        #favorites-view.selection-mode .favorite-item-card {
            transform: translateX(35px);
        }
        #favorites-view.selection-mode .favorite-item-card::before {
            opacity: 1;
        }
        #favorites-view.selection-mode .favorite-item-card.selected::before {
            background-color: var(--accent-color);
            border-color: var(--accent-color);
            content: '✔';
            color: white;
            font-size: 14px;
            text-align: center;
            line-height: 20px;
        }
        #favorites-action-bar {
            position: absolute; 
            bottom: 0;
            left: 0;
            right: 0;           
            width: auto;        
            padding: 10px 15px;
            padding-bottom: calc(10px + env(safe-area-inset-bottom)); 
            background-color: rgba(247, 247, 247, 0.9);
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            border-top: 1px solid var(--border-color);
            box-sizing: border-box;
            z-index: 5;
            display: none;
        }
        #favorites-action-bar .action-bar-btn {
            width: 100%;
            padding: 12px;
            border-radius: 8px;
            border: none;
            font-size: 16px;
            font-weight: 600;
            cursor: pointer;
            background-color: #ff3b30;
            color: white;
        }
        #chat-interface-screen .header .selection-controls {
            display: none;
        }
        #chat-interface-screen .header .default-controls {
            display: flex;
            justify-content: space-between;
            align-items: center;
            width: 100%;
        }
        #chat-interface-screen.selection-mode .header .default-controls {
            display: none;
        }
        #chat-interface-screen.selection-mode .header .selection-controls {
            display: flex;
            justify-content: space-between;
            align-items: center;
            width: 100%;
        }
        #add-chat-btn,
        #add-world-book-btn,
        #create-album-btn-page {
            font-size: 28px;   
            font-weight: 300;  
            position: relative;
            top: -1px;         
        }
        #settings-preview-area {
            width: 100%;
            height: 180px; 
            background-color: #f0f2f5;
            border-radius: 8px;
            padding: 15px;
            box-sizing: border-box;
            overflow: hidden; 
            display: flex;
            flex-direction: column;
            gap: 10px; 
            border: 1px solid var(--border-color);
            position: relative; 
        }
        #settings-preview-area::before {
            content: '';
            position: absolute;
            top: 0; left: 0;
            width: 100%; height: 100%;
            background-size: cover;
            background-position: center;
            z-index: 1;
            opacity: 0.8;
        }
        #settings-preview-area .message-wrapper {
            position: relative;
            z-index: 2;
        }
        #settings-preview-area .message-bubble .avatar {
            width: 30px;
            height: 30px;
        }
        #settings-preview-area .message-bubble .timestamp {
            display: none; 
        }
        .existing-group-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 12px;
            background-color: #f9f9f9;
            border-radius: 8px;
            border: 1px solid var(--border-color);
        }
        .existing-group-item .group-name {
            font-weight: 500;
        }
        .existing-group-item .delete-group-btn {
            color: #ff3b30;
            font-size: 20px;
            cursor: pointer;
            padding: 5px;
        }
        .chat-group-container {
            border-bottom: 1px solid var(--border-color);
        }
        .chat-group-container:first-child {
            border-top: 1px solid var(--border-color);
        }
        .chat-group-header {
            display: flex;
            align-items: center;
            padding: 12px 15px;
            cursor: pointer;
            background-color: #f7f7f7;
        }
        .chat-group-header .arrow {
            font-size: 14px;
            margin-right: 8px;
            transition: transform 0.2s ease;
        }
        .chat-group-header.collapsed .arrow {
            transform: rotate(-90deg);
        }
        .chat-group-header .group-name {
            font-weight: 600;
            font-size: 15px;
        }
        .chat-group-content {
            max-height: 1000px; 
            overflow: hidden;
            transition: max-height 0.3s ease-in-out;
        }
        .chat-group-content.collapsed {
            max-height: 0;
        }
        .format-helpers {
            display: flex;
            gap: 10px;
            margin-bottom: 15px; 
            flex-wrap: wrap; 
        }
        .format-btn {
            background-color: #e9ecef;
            color: var(--text-primary);
            border: none;
            padding: 6px 12px;
            border-radius: 16px; 
            font-size: 13px;
            font-weight: 500;
            cursor: pointer;
            transition: background-color 0.2s;
        }
        .format-btn:hover {
            background-color: #dcdfe3;
        }
        .post-actions-btn {
            margin-left: auto; 
            padding: 5px 10px;
            font-size: 20px;
            font-weight: bold;
            color: var(--text-secondary);
            cursor: pointer;
            border-radius: 50%;
            line-height: 1;
        }
        .post-actions-btn:hover {
            background-color: #f0f0f0;
        }
        #post-actions-modal .custom-modal-footer button {
            width: 100%;
            border: none;
            border-bottom: 1px solid #dbdbdb;
            padding: 14px;
            font-size: 18px;
        }
        #post-actions-modal .custom-modal-footer button:last-child {
            border-bottom: none;
        }
        #post-actions-modal #cancel-post-action-btn {
            margin-top: 8px;
            border-radius: 8px;
            background-color: #f0f0f0;
        }
        #chat-messages .transfer-card .transfer-title,
        #chat-messages .transfer-card .transfer-amount,
        #chat-messages .transfer-card .transfer-note {
            text-shadow: none !important; 
            color: white !important;      
        }
        #chat-messages .transfer-card .transfer-title {
            font-size: 16px !important;
            font-weight: 600 !important;
        }
        #chat-messages .transfer-card .transfer-amount {
            font-size: 28px !important;
            font-weight: bold !important;
        }
        #chat-messages .transfer-card .transfer-note {
            font-size: 13px !important;
            opacity: 0.9 !important;
        }
        .header > span:nth-child(2),
        #chat-header-title {
            position: absolute;
            left: 50%;
            transform: translateX(calc(-50% - 2px)); 
            max-width: 60%;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        #message-editor-container {
            display: flex;
            flex-direction: column;
            gap: 15px;
        }
        .message-editor-block {
            background-color: #f9f9f9;
            border: 1px solid var(--border-color);
            border-radius: 8px;
            padding: 12px;
        }
        .message-editor-block textarea {
            width: 100%;
            min-height: 60px;
            resize: vertical;
            border: 1px solid #ccc;
            border-radius: 6px;
            padding: 8px;
            font-size: 16px;
            box-sizing: border-box;
        }
        .message-editor-block .format-helpers {
            margin-top: 8px;
            margin-bottom: 0; 
        }
        .message-editor-block .delete-block-btn {
            float: right;
            margin-top: -5px;
            background: none;
            border: none;
            color: #ff3b30;
            font-size: 20px;
            cursor: pointer;
        }
        .contact-picker-item {
            display: flex;
            align-items: center;
            padding: 10px 15px;
            cursor: pointer;
            border-bottom: 1px solid var(--border-color);
        }
        .contact-picker-item .checkbox {
            width: 20px;
            height: 20px;
            border: 2px solid #ccc;
            border-radius: 50%;
            margin-right: 15px;
            transition: all 0.2s ease;
        }
        .contact-picker-item.selected .checkbox {
            background-color: var(--accent-color);
            border-color: var(--accent-color);
            content: '✔';
            color: white;
            font-size: 14px;
            text-align: center;
            line-height: 20px;
        }
        .contact-picker-item .avatar {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            margin-right: 12px;
        }
        .contact-picker-item .name {
            font-weight: 500;
        }
        #member-management-list {
            padding: 0; 
        }
        .member-management-item {
            display: flex;
            align-items: center;
            padding: 12px 15px;
            border-bottom: 1px solid var(--border-color);
        }
        .member-management-item .avatar {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            margin-right: 12px;
        }
        .member-management-item .name {
            flex-grow: 1;
            font-weight: 500;
        }
        .member-management-item .remove-member-btn {
            background-color: #ff3b30;
            color: white;
            border: none;
            width: 28px;
            height: 28px;
            border-radius: 50%;
            font-size: 20px;
            line-height: 28px;
            text-align: center;
            cursor: pointer;
            flex-shrink: 0;
        }
        #member-management-actions {
            flex-shrink: 0;
            padding: 15px;
            border-top: 1px solid var(--border-color);
            background-color: #f7f7f7;
            display: flex;
            flex-direction: column;
            gap: 10px;
        }
        #member-management-actions button {
            width: 100%;
            padding: 15px;
            background-color: var(--accent-color);
            color: white;
            border: none;
            border-radius: 8px;
            font-size: 16px;
            font-weight: 600;
            cursor: pointer;
        }
        #member-management-actions #create-new-member-btn {
            background-color: #4cd964; 
        }
        .waimai-card {
            width: 240px;
            border-radius: 12px;
            overflow: hidden;
            background-color: var(--secondary-bg);
            box-shadow: 0 4px 12px rgba(0,0,0,0.1);
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
        }
        .waimai-header {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 10px 12px;
            border-bottom: 1px solid #f0f0f0;
        }
        .waimai-header .icon {
            width: 20px;
            height: 20px;
        }
        .waimai-header .title-group {
            display: flex;
            align-items: baseline;
            font-size: 14px;
            color: #8a8a8a;
        }
        .waimai-header .title-group .brand {
            font-weight: 600;
            color: #555;
            margin-right: 5px;
        }
        .waimai-header .title-group .separator {
            margin: 0 5px;
        }
        .waimai-catchphrase {
            font-size: 13px;
            color: #1f1f1f;
            padding: 12px;
        }
        .waimai-main {
            background-color: #FFD66B; 
            padding: 12px;
            text-align: center;
        }
        .waimai-main .request-title {
            font-size: 12px;
            color: #856404;
            margin-bottom: 8px;
        }
        .waimai-main .payment-box {
            background-color: var(--secondary-bg);
            border-radius: 8px;
            padding: 15px 10px;
        }
        .waimai-main .payment-label {
            font-size: 13px;
            color: #8a8a8a;
        }
        .waimai-main .amount {
            font-size: 32px;
            font-weight: 700;
            color: #1f1f1f;
            margin: 4px 0 12px 0;
        }
        .waimai-main .countdown-label {
            font-size: 13px;
            color: #8a8a8a;
        }
        .waimai-main .countdown-timer {
            display: inline-flex;
            align-items: center;
            gap: 2px;
            margin-left: 5px;
        }
        .waimai-main .countdown-timer span {
            background-color: #333;
            color: white;
            padding: 2px 4px;
            border-radius: 2px;
            font-weight: bold;
            font-size: 12px;
        }
        .waimai-details-btn {
            width: 100%;
            padding: 10px 0;
            margin-top: 15px;
            border: none;
            border-radius: 6px;
            background-color: #FFC33A;
            color: #49380a;
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
        }
        .message-bubble.status-paid .waimai-card {
            border: 2px solid #28a745; 
        }
        .message-bubble.status-paid .waimai-main .request-title::before {
            content: '✅  ';
        }
        .message-bubble.status-paid .waimai-main .request-title {
            color: #155724;
            font-weight: 600;
            content: "我已为您买单，请尽情享用吧～" !important;
            display: block;
            margin-bottom: 15px;
        }
        .message-bubble.status-paid .payment-box {
            display: none; 
        }
        .message-bubble.status-paid .waimai-details-btn {
            background-color: #28a745;
            color: white;
        }
        .message-bubble.status-rejected .waimai-card {
            border: 2px solid #dc3545; 
            opacity: 0.8;
        }
        .message-bubble.status-rejected .waimai-main {
            background-color: #e9ecef;
        }
        .message-bubble.status-rejected .waimai-main .request-title::before {
            content: '❌ ';
        }
        .message-bubble.status-rejected .waimai-main .request-title {
            color: #721c24;
            font-weight: 600;
            content: "我拒绝了您的代付请求" !important;
            display: block;
            margin-bottom: 15px;
        }
        .message-bubble.status-rejected .payment-box {
            display: none; 
        }
         .message-bubble.status-rejected .waimai-details-btn {
            background-color: #6c757d;
            color: white;
        }
        .message-bubble[class*="status-"] .request-title {
            font-size: 0; 
        }
        .message-bubble[class*="status-"] .request-title::after {
            font-size: 14px; 
        }
        .message-bubble.status-paid .request-title::after {
            content: "我已为您买单，请尽情享用吧～";
        }
        .message-bubble.status-rejected .request-title::after {
            content: "我拒绝了您的代付请求";
        }
        .waimai-user-actions {
            display: flex;
            gap: 10px;
            padding: 0 12px 12px 12px; 
            background-color: var(--secondary-bg);
        }
        .waimai-user-actions button {
            flex: 1;
            padding: 10px;
            border-radius: 8px;
            border: 1.5px solid;
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s ease;
        }
        .waimai-pay-btn {
            background-color: #28a745;
            border-color: #1f7a33;
            color: white;
        }
        .waimai-pay-btn:hover {
            background-color: #218838;
        }
        .waimai-decline-btn {
            background-color: #f8f9fa;
            border-color: #ced4da;
            color: #495057;
        }
        .waimai-decline-btn:hover {
            background-color: #e2e6ea;
        }
        #api-settings-screen,
        #font-settings-screen,
        #wallpaper-screen,
        #memories-view,
        #contact-picker-screen,
        #member-management-screen,
        #world-book-editor-screen {  
            background-color: var(--secondary-bg);
        }
        #api-settings-screen .form-container,
        #font-settings-screen .form-container,
        #wallpaper-screen .form-container {
            padding-top: 100px;
            margin-top: -80px;
            background-color: var(--secondary-bg);
        }
        #wallpaper-screen .form-container {
            align-items: center; 
        }
        #incoming-call-modal .incoming-call-content {
            background-color: rgba(40, 40, 40, 0.85);
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            border-radius: 20px;
            width: 280px;
            padding: 30px 20px;
            text-align: center;
            color: white;
            box-shadow: 0 10px 30px rgba(0,0,0,0.3);
        }
        .caller-avatar {
            width: 80px;
            height: 80px;
            border-radius: 50%;
            object-fit: cover;
            margin-bottom: 12px;
            border: 3px solid rgba(255,255,255,0.5);
        }
        .caller-name {
            font-size: 20px;
            font-weight: 600;
            margin-bottom: 5px;
        }
        .caller-text {
            font-size: 14px;
            color: #ccc;
            margin-bottom: 30px;
        }
        .incoming-call-actions {
            display: flex;
            justify-content: space-around;
            align-items: center;
        }
        .action-button-wrapper {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 8px;
            font-size: 13px;
            color: #e0e0e0;
        }
        .call-action-btn {
            width: 60px;
            height: 60px;
            border-radius: 50%;
            border: none;
            cursor: pointer;
            background-size: 50%;
            background-repeat: no-repeat;
            background-position: center;
            transition: transform 0.2s, box-shadow 0.2s;
            box-shadow: 0 4px 10px rgba(0,0,0,0.2);
        }
        .call-action-btn:active {
            transform: scale(0.9);
        }
        .call-action-btn.decline {
            background-color: #ff3b30;
            background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M13.5 16.5L3 6m18 6l-5.6-5.6a1.2 1.2 0 0 0-1.7 0L3 18.2a1.2 1.2 0 0 0-.3 1.2l1.2 3.6a1.2 1.2 0 0 0 1.2.9h15.6a1.2 1.2 0 0 0 1.2-1.2V7.7a1.2 1.2 0 0 0-.3-1.1z"/></svg>');
        }
        .call-action-btn.accept {
            background-color: #4cd964;
            background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z"/></svg>');
            animation: pulse 1.5s infinite;
        }
        @keyframes pulse {
            0% { box-shadow: 0 0 0 0 rgba(76, 217, 100, 0.7); }
            70% { box-shadow: 0 0 0 15px rgba(76, 217, 100, 0); }
            100% { box-shadow: 0 0 0 0 rgba(76, 217, 100, 0); }
        }
        #video-call-screen {
            background-color: #1c1c1e;
            color: white;
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }
        .video-call-top-bar {
            position: absolute;
            top: 0; left: 0; width: 100%;
            padding: 15px 20px;
            padding-top: 50px;
            background: linear-gradient(to bottom, rgba(0,0,0,0.5), transparent);
            z-index: 10;
            text-align: center;
            box-sizing: border-box;
            pointer-events: none;
        }
        #call-timer {
            font-size: 16px;
            font-weight: 500;
            letter-spacing: 1px;
        }
        .video-call-controls {
            position: absolute;
            bottom: 0; left: 0; width: 100%;
            display: flex;
            justify-content: space-around;
            align-items: center;
            padding: 20px;
            padding-bottom: 40px;
            background: linear-gradient(to top, rgba(0,0,0,0.5), transparent);
            z-index: 10;
            box-sizing: border-box;
        }
        .video-call-avatar-area {
            flex-grow: 1; 
            display: flex;
            justify-content: center;
            align-items: center;
            padding: 20px;
            padding-top: 80px; 
            box-sizing: border-box;
            overflow-y: auto; 
        }
        #participant-avatars-grid {
            display: flex;
            flex-wrap: wrap; 
            justify-content: center;
            align-items: center;
            gap: 15px; 
            max-width: 100%;
        }
        .participant-avatar-wrapper {
            position: relative;
            text-align: center;
            flex-shrink: 0;
        }
        .participant-avatar {
            width: 70px;   
            height: 70px;  
            border-radius: 50%;
            object-fit: cover;
            border: 3px solid rgba(255, 255, 255, 0.2);
            transition: all 0.3s ease;
        }
        .participant-name {
            margin-top: 8px;
            font-size: 12px;
            color: #ccc;
        }
        .participant-avatar.speaking {
            border-color: #4cd964;
            box-shadow: 0 0 20px rgba(76, 217, 100, 0.6);
            transform: scale(1.05);
        }
        #video-call-main {
            flex-shrink: 0; 
            height: 30%;   
            margin: 15px 15px 130px 15px; 
            overflow-y: auto;
            padding: 15px;
            background-color: rgba(255, 255, 255, 0.05);
            border-radius: 20px;
            display: flex;
            flex-direction: column;
            gap: 15px;
            box-sizing: border-box;
        }
        .control-btn {
            width: 70px;
            height: 70px;
            border-radius: 50%;
            border: none;
            cursor: pointer;
            background-repeat: no-repeat;
            background-position: center;
            transition: transform 0.2s, background-color 0.2s;
        }
        .control-btn:active {
            transform: scale(0.9);
        }
        .control-btn.speak-btn {
            background-color: rgba(255,255,255,0.2);
            background-size: 55%;
            background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="white" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z"/><path d="M19 10v2a7 7 0 0 1-14 0v-2"/><line x1="12" y1="19" x2="12" y2="23"/><line x1="8" y1="23" x2="16" y2="23"/></svg>');
        }
        .control-btn.hangup-btn {
            background-color: #ff3b30;
            background-size: 50%;
            background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M13.5 16.5L3 6m18 6l-5.6-5.6a1.2 1.2 0 0 0-1.7 0L3 18.2a1.2 1.2 0 0 0-.3 1.2l1.2 3.6a1.2 1.2 0 0 0 1.2.9h15.6a1.2 1.2 0 0 0 1.2-1.2V7.7a1.2 1.2 0 0 0-.3-1.1z"/></svg>');
        }
        .control-btn.join-btn {
            background-color: #007bff;
            background-size: 50%;
            background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M16 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"></path><circle cx="8.5" cy="7" r="4"></circle><line x1="20" y1="8" x2="20" y2="14"></line><line x1="17" y1="11" x2="23" y2="11"></line></svg>');
        }
        .call-message-bubble {
            padding: 10px 15px;
            border-radius: 12px;
            max-width: 85%;
            line-height: 1.6;
            word-break: break-word;
            white-space: pre-wrap;
        }
        .call-message-bubble.ai-speech {
            background-color: rgba(255, 255, 255, 0.15);
            align-self: flex-start; 
        }
        .call-message-bubble.user-speech {
            background-color: #4cd964; 
            align-self: flex-end;   
            text-align: left; 
        }
        #outgoing-call-screen {
            background-color: #1c1c1e;
            color: white;
            justify-content: center; 
            align-items: center;   
        }
        .outgoing-call-content {
            display: flex;
            flex-direction: column;
            align-items: center;
            text-align: center;
        }
        .outgoing-call-actions {
            margin-top: 50px; 
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 8px;
            font-size: 13px;
            color: #e0e0e0;
        }
        .qzone-post-container {
            position: relative; 
            overflow: hidden;   
            border-radius: 12px;
        }
        .qzone-post-item {
            transition: transform 0.3s ease;
            background-color: var(--secondary-bg); 
            position: relative; 
            z-index: 2;
        }
        .qzone-post-delete-action {
            position: absolute; 
            top: 0;
            right: 0;
            bottom: 0;
            width: 90px; 
            background-color: #ff3b30; 
            color: white;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 500;
            cursor: pointer;
            z-index: 1; 
        }
        .qzone-post-item.swiped {
            transform: translateX(-90px); 
        }
        @keyframes pat-shake {
            0%, 100% { transform: translateX(0); }
            10%, 30%, 50%, 70%, 90% { transform: translateX(-3px); }
            20%, 40%, 60%, 80% { transform: translateX(3px); }
        }
        .pat-animation {
            animation: pat-shake 0.4s ease-in-out;
        }
        .system-message {
            align-self: center; 
            padding: 4px 12px;
            margin: 5px 0;
            background-color: rgba(0, 0, 0, 0.1);
            color: var(--text-secondary);
            font-size: 12px;
            border-radius: 10px;
            text-align: center;
            max-width: 80%;
        }
        .message-wrapper.system-pat {
            justify-content: center;
            align-self: center;
            margin: 5px 0;
            max-width: 80%;
        }
        .message-bubble.system-bubble {
            background-color: rgba(0, 0, 0, 0.1);
            color: var(--text-secondary);
            font-size: 12px;
            padding: 4px 12px;
            border-radius: 10px;
        }
        #chat-input-actions-top {
            display: flex;
            gap: 8px;
            padding: 0 5px;
            overflow-x: auto;      
            flex-wrap: nowrap;     
            -webkit-overflow-scrolling: touch; 
            scrollbar-width: none; 
            -ms-overflow-style: none;  
        }
        #chat-input-actions-top::-webkit-scrollbar {
            display: none; 
        }
        #chat-header-title-wrapper {
            display: flex;
            flex-direction: column;
            align-items: center; 
            gap: 2px; 
            position: absolute;
            left: 50%;
            transform: translateX(-50%);
            max-width: 60%;
        }
        #chat-header-title {
            font-size: 16px; 
            font-weight: 600;
            position: static; 
            transform: none;  
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            max-width: 100%;
        }
        #chat-header-status {
            display: flex;
            align-items: center;
            gap: 5px;
            font-size: 11px;
            color: var(--text-secondary);
            transition: all 0.3s ease;
        }
        .status-dot {
            width: 7px;
            height: 7px;
            border-radius: 50%;
            background-color: #4cd964; 
            transition: background-color 0.3s ease;
        }
        #chat-header-status.busy .status-dot {
            background-color: #cccccc;
        }
        .status-text {
            font-weight: 500;
        }
        .memory-card {
            background-color: #fffaf0; 
            border-radius: 12px;
            padding: 15px; 
            box-shadow: 0 2px 6px rgba(0,0,0,0.07);
            border-left: 5px solid #ffb74d; 
            display: flex; 
            flex-direction: column; 
            gap: 8px; 
        }
        .memory-card .header {
            border-bottom: 1px solid rgba(217, 129, 0, 0.15); 
            padding-bottom: 8px; 
        }
        .memory-card .header .date {
            font-size: 11px;
            color: #a1887f;
            margin-bottom: 4px; 
        }
        .memory-card .header .author {
            font-weight: 600;
            color: #d98100;
            font-size: 15px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .memory-card .content {
            font-size: 14px;
            line-height: 1.7;
            color: #5d4037;
            white-space: pre-wrap;
        }
        .countdown-card {
            background: linear-gradient(135deg, #667eea, #764ba2);
            color: white;
            border-radius: 12px;
            padding: 20px;
            box-shadow: 0 4px 15px rgba(118, 75, 162, 0.4);
            text-align: center;
            position: relative;
            overflow: hidden;
            flex-shrink: 0;
        }
        .countdown-card::before {
            content: '✨';
            position: absolute;
            top: -10px;
            left: -10px;
            font-size: 50px;
            opacity: 0.1;
            transform: rotate(-15deg);
        }
        .countdown-card .title {
            font-size: 18px;
            font-weight: 600;
            margin-bottom: 15px;
        }
        .countdown-card .timer {
            font-size: 28px;
            font-weight: 300;
            letter-spacing: 2px;
            margin-bottom: 15px;
        }
        .countdown-card .target-date {
            font-size: 12px;
            opacity: 0.8;
            border-top: 1px solid rgba(255,255,255,0.2);
            padding-top: 10px;
        }
        #chat-lock-overlay {
            position: absolute;
            bottom: 0;
            left: 0;
            width: 100%;
            background-color: rgba(247, 247, 247, 0.9);
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            z-index: 150; 
            display: none; 
            align-items: center;
            justify-content: center;
            padding: 20px;
            box-sizing: border-box;
            border-top: 1px solid var(--border-color);
            text-align: center;
        }
        #chat-lock-content {
            display: flex;
            flex-direction: column;
            gap: 15px;
        }
        #chat-lock-content .lock-text {
            color: var(--text-secondary);
            font-size: 14px;
        }
        #chat-lock-content .lock-action-btn {
            padding: 10px 20px;
            border-radius: 20px;
            border: 1px solid var(--accent-color);
            background-color: var(--accent-color);
            color: white;
            cursor: pointer;
        }
        #chat-lock-content .lock-action-btn.secondary {
            background-color: transparent;
            color: var(--accent-color);
        }
        .red-packet-card {
            width: 220px;
            border-radius: 8px;
            background: linear-gradient(160deg, #F96259, #E44D44);
            color: #ffd700; 
            padding: 12px;
            cursor: pointer;
            box-shadow: 0 2px 5px rgba(0,0,0,0.1);
            position: relative;
            overflow: hidden;
        }
        .red-packet-card.opened {
            background: linear-gradient(160deg, #d3c4a0, #c4b693);
            cursor: default;
        }
        .red-packet-card::before {
            content: '🧧';
            position: absolute;
            top: -5px;
            left: -5px;
            font-size: 30px;
            opacity: 0.2;
            transform: rotate(-10deg);
        }
        .rp-header {
            display: flex;
            align-items: center;
            gap: 8px;
            margin-bottom: 8px;
        }
        .rp-icon {
            width: 20px;
            height: 20px;
        }
        .rp-greeting {
            font-size: 15px;
            font-weight: 500;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .rp-type {
            font-size: 11px;
            color: white;
            opacity: 0.8;
            border-top: 1px solid rgba(255, 255, 255, 0.2);
            padding-top: 8px;
            margin-top: 8px;
        }
        .rp-claimed-info {
            font-size: 13px;
            color: white;
            margin-top: 10px;
            padding-top: 10px;
            border-top: 1px solid rgba(255,255,255,0.3);
        }
        .rp-details-item {
            display: flex;
            align-items: center;
            padding: 8px 0;
            border-bottom: 1px solid #eee;
        }
        .rp-details-item:last-child {
            border-bottom: none;
        }
        .rp-details-item .name {
            flex-grow: 1;
            font-weight: 500;
            color: #333;
        }
        .rp-details-item .amount {
            font-weight: 500;
            color: #555;
        }
        .rp-details-item .lucky-king-tag {
            font-size: 10px;
            background-color: #ffd700;
            color: #a67c00;
            padding: 2px 5px;
            border-radius: 4px;
            margin-left: 8px;
            font-weight: bold;
        }
        .poll-card {
            width: 250px;
            background-color: #f9f9f9;
            border-radius: 10px;
            border: 1px solid #e0e0e0;
            padding: 12px;
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
        }
        .poll-card.closed {
            background-color: #e9ecef; 
        }
        .poll-question {
            font-weight: 600;
            font-size: 15px;
            margin-bottom: 12px;
            line-height: 1.4;
            word-break: break-word;
        }
        .poll-options-list {
            display: flex;
            flex-direction: column;
            gap: 8px;
        }
        .poll-option-item {
            background-color: white;
            border: 1px solid #dcdcdc;
            border-radius: 8px;
            padding: 10px;
            cursor: pointer;
            position: relative;
            overflow: hidden;
            transition: background-color 0.2s;
        }
        .poll-card:not(.closed) .poll-option-item:hover {
            background-color: #f0f8ff;
        }
        .poll-option-item.voted {
            border-color: var(--accent-color);
            background-color: #e7f3ff;
            font-weight: 500;
        }
        .poll-option-bar {
            position: absolute;
            top: 0;
            left: 0;
            height: 100%;
            background-color: rgba(0, 123, 255, 0.1);
            z-index: 1;
            transition: width 0.3s ease-in-out;
        }
        .poll-option-content {
            position: relative;
            z-index: 2;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        .poll-option-text {
            font-size: 14px;
        }
        .poll-option-votes {
            font-size: 13px;
            color: #8a8a8a;
            font-weight: 500;
        }
        .poll-footer {
            margin-top: 12px;
            padding-top: 8px;
            border-top: 1px solid #e9e9e9;
            display: flex;
            justify-content: space-between;
            align-items: center;
            font-size: 12px;
            color: var(--text-secondary);
        }
        .poll-total-votes {
            font-weight: 500;
        }
        .poll-action-btn {
            background: none;
            border: 1px solid var(--accent-color);
            color: var(--accent-color);
            padding: 4px 10px;
            border-radius: 15px;
            cursor: pointer;
            font-size: 12px;
        }
        .poll-card.closed .poll-action-btn {
            background-color: #6c757d;
            color: white;
            border-color: #6c757d;
        }
        .poll-option-input-wrapper {
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .poll-option-input-wrapper input {
            flex-grow: 1;
        }
        .poll-option-input-wrapper .remove-option-btn {
            width: 28px;
            height: 28px;
            border-radius: 50%;
            background-color: #f0f0f0;
            color: #ff3b30;
            border: none;
            cursor: pointer;
            font-size: 18px;
            line-height: 28px;
            text-align: center;
            flex-shrink: 0;
        }
        #chat-header-title.typing-status {
            color: var(--text-secondary);
            animation: typing-pulse 1.5s infinite;
            font-style: italic;
        }
        @keyframes typing-pulse {
            0%, 100% { opacity: 1; }
            50% { opacity: 0.6; }
        }
        #chat-header-title {
            transition: opacity 0.2s ease-in-out;
        }
        @keyframes message-pop-in {
          from {
            opacity: 0;
            transform: translateY(15px);
          }
          to {
            opacity: 1;
            transform: translateY(0);
          }
        }
        .message-wrapper.animate-in {
          animation: message-pop-in 0.3s cubic-bezier(0.25, 0.1, 0.25, 1) forwards;
          }
#icon-settings-grid,
#cphone-icon-settings-grid { 
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 20px;
    width: 100%;
    padding: 0 10px;
    box-sizing: border-box;
}
        .icon-setting-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 8px;
        }
        .icon-preview {
            width: 60px;
            height: 60px;
            border-radius: 15px;
            background-size: cover;
            background-position: center;
            box-shadow: 0 2px 5px rgba(0,0,0,0.1);
        }
        .change-icon-btn {
            padding: 4px 10px;
            font-size: 12px;
            border: 1px solid #ccc;
            background-color: #f0f0f0;
            border-radius: 5px;
            cursor: pointer;
        }
        #wallpaper-screen .form-container {
            min-height: 0; 
        }
        #wallpaper-preview {
            flex-shrink: 0; 
        }
        #browser-screen {
            background-color: #f8f9fa;
        }
        #browser-content {
            padding: 20px;
            font-size: 16px;
            line-height: 1.8;
            color: #333;
            overflow-y: auto;
            background-color: #f8f9fa;
        }
        #browser-content .article-title {
            font-size: 24px;
            font-weight: 700;
            margin-bottom: 10px;
        }
        #browser-content .article-meta {
            font-size: 13px;
            color: #8a8a8a;
            margin-bottom: 25px;
            padding-bottom: 15px;
            border-bottom: 1px solid #e0e0e0;
        }
        #browser-content .article-body {
            white-space: pre-wrap;
            word-break: break-word;
        }
        #browser-content .article-body p {
            margin-bottom: 1em;
        }
        .link-share-card {
            width: 210px; 
            background-color: var(--secondary-bg);
            border-radius: 10px;
            border: 1px solid #e0e0e0;
            padding: 12px;
            cursor: pointer;
            transition: background-color 0.2s;
            display: flex;
            flex-direction: column;
            gap: 8px;
        }
        .link-share-card:hover {
            background-color: #f9f9f9;
        }
        .link-share-card .title {
            font-weight: 600;
            font-size: 15px;
            line-height: 1.4;
            color: #1f1f1f;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .link-share-card .description {
            font-size: 13px;
            color: #8a8a8a;
            display: -webkit-box;
            -webkit-line-clamp: 3;
            -webkit-box-orient: vertical;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .link-share-card .footer {
            display: flex; 
            align-items: center;
            gap: 6px; 
            font-size: 12px;
            color: var(--text-secondary);
            margin-top: 4px; 
        }
        .link-share-card .footer-icon{
            width: 14px;
            height: 14px;
            flex-shrink: 0; 
        }
        .comment-item {
            position: relative;
            padding-right: 25px; 
        }
        .comment-delete-btn {
            position: absolute;
            top: 50%;
            right: 0;
            transform: translateY(-50%);
            width: 22px;
            height: 22px;
            line-height: 22px;
            text-align: center;
            border-radius: 50%;
            color: var(--text-secondary);
            font-size: 18px;
            cursor: pointer;
            transition: all 0.2s ease;
            opacity: 0; 
        }
        .comment-item:hover .comment-delete-btn {
            opacity: 1;
        }
        .comment-delete-btn:hover {
            background-color: #f0f0f0;
            color: #ff3b30;
        }
        #phone-screen.dark-mode {
            --secondary-bg: #1c1c1e; 
            --border-color: #38383a;  
            --text-primary: #ffffff;   
            --text-secondary: #8d8d92; 
        }
        #phone-screen.dark-mode #chat-list-screen,
        #phone-screen.dark-mode #qzone-screen .qzone-content,
        #phone-screen.dark-mode #memories-view {
            background-color: #000000;
        }
        #phone-screen.dark-mode #chat-list {
            background-color: #000000;
        }
        #phone-screen.dark-mode .chat-list-item {
            border-bottom-color: rgba(255, 255, 255, 0.15);
        }
        #phone-screen.dark-mode .chat-group-header {
            background-color: #1c1c1e; 
            border-bottom: 1px solid #38383a; 
        }
        #phone-screen.dark-mode .chat-list-item .name,
        #phone-screen.dark-mode .chat-group-header .group-name {
            color: #ffffff;
        }
        #phone-screen.dark-mode .chat-list-item:hover {
            background-color: #1c1c1e;
        }
        #phone-screen.dark-mode .header,
        #phone-screen.dark-mode .qzone-header {
            background-color: rgba(25, 25, 25, 0.9);
            backdrop-filter: blur(15px);
            -webkit-backdrop-filter: blur(15px);
            border-bottom-color: rgba(255, 255, 255, 0.15);
            color: #ffffff;
        }
        #phone-screen.dark-mode .header .back-btn,
        #phone-screen.dark-mode .header .action-btn,
        #phone-screen.dark-mode .header .save-btn {
            color: #ffffff;
        }
        #phone-screen.dark-mode #chat-list-bottom-nav {
            background-color: rgba(25, 25, 25, 0.9);
            border-top-color: rgba(255, 255, 255, 0.15);
        }
        #phone-screen.dark-mode .nav-item.active {
            color: #ffffff;
        }
        #phone-screen.dark-mode #chat-input-area {
            background-color: rgba(5, 5, 5, 0.8);
            border-top: none;
        }
        #phone-screen.dark-mode #chat-input {
            background-color: #3e3e42;
            color: #ffffff;
        }
        #phone-screen.dark-mode #chat-input::placeholder {
            color: #8d8d92;
        }
        #phone-screen.dark-mode .chat-action-icon-btn {
            color: #ffffff;
            background-color: rgba(255, 255, 255, 0.1);
            border: none;
        }
        #phone-screen.dark-mode #send-btn {
            background-color: var(--accent-color);
        }
        #phone-screen.dark-mode .qzone-actions-bar,
        #phone-screen.dark-mode .qzone-post-item {
            background-color: #1c1c1e;
            border: 1px solid #333;
            box-shadow: 0 2px 8px rgba(255, 255, 255, 0.05);
        }
        #phone-screen.dark-mode .action-item:not(:last-child)::after {
            background-color: #333;
        }
        #phone-screen.dark-mode .post-footer,
        #phone-screen.dark-mode .post-likes-section {
            border-top-color: #333;
        }
        #phone-screen.dark-mode .post-likes-section {
            background-color: rgba(0, 123, 255, 0.1);
        }
        #phone-screen.dark-mode .comment-input {
            background-color: #333;
            color: #ffffff;
        }
        #phone-screen.dark-mode .comment-input::placeholder {
            color: #8d8d92;
        }
        #phone-screen.dark-mode .post-actions-btn:hover {
            background-color: #333;
        }
        #phone-screen.dark-mode .at-mention-popup {
            background-color: #1c1c1e;
            border-color: #333;
        }
        #phone-screen.dark-mode .at-mention-item {
            border-bottom-color: #333;
        }
        #phone-screen.dark-mode .at-mention-item:hover {
            background-color: #333;
        }
        #phone-screen.dark-mode .memory-card {
            background-color: #1c1c1e;
            border-left-color: #e6a753;
            box-shadow: 0 4px 12px rgba(255, 255, 255, 0.08);
        }
        #phone-screen.dark-mode .memory-card .header {
            background-color: #2c2c2e;
            border-bottom-color: #38383a;
            margin: -15px -15px 8px -15px;
            padding: 12px 15px;
            border-radius: 12px 12px 0 0;
        }
        #phone-screen.dark-mode .memory-card .header .date,
        #phone-screen.dark-mode .memory-card .header .author,
        #phone-screen.dark-mode .memory-card .content {
            color: #e0e0e0;
        }
        #phone-screen.dark-mode #api-settings-screen,
        #phone-screen.dark-mode #font-settings-screen,
        #phone-screen.dark-mode #wallpaper-screen,
        #phone-screen.dark-mode #contact-picker-screen,
        #phone-screen.dark-mode #member-management-screen,
        #phone-screen.dark-mode #world-book-editor-screen,
        #phone-screen.dark-mode #world-book-list,
        #phone-screen.dark-mode .list-item:hover,
        #phone-screen.dark-mode .list-container,
        #phone-screen.dark-mode .form-container {
            background-color: #000000;
        }
        #phone-screen.dark-mode .form-group input, 
        #phone-screen.dark-mode .form-group select, 
        #phone-screen.dark-mode .form-group textarea {
            background-color: #1c1c1e;
            color: #ffffff;
            border-color: #38383a;
        }
        #phone-screen.dark-mode .form-button-secondary {
            background-color: #333;
            border-color: #555;
            color: #fff;
        }
        #phone-screen.dark-mode #font-preview {
            background-color: #1c1c1e;
            border-color: #38383a;
        }
        #phone-screen.dark-mode #font-preview p {
            color: #ffffff;
        }
        #phone-screen.dark-mode .qzone-post-item .post-nickname,
        #phone-screen.dark-mode .qzone-post-item .post-content {
            color: #f0f0f0; 
        }
        #phone-screen.dark-mode .favorite-item-card .fav-card-header .name,
        #phone-screen.dark-mode .favorite-item-card .fav-card-content {
            color: #f0f0f0; 
        }
        #phone-screen.dark-mode .favorite-item-card .fav-card-header .source {
            color: #8d8d92; 
        }
        #phone-screen.dark-mode .search-bar-container {
            background-color: #000000; 
        }
        #phone-screen.dark-mode #favorites-search-input {
            background-color: #1c1c1e; 
            border-color: #38383a;     
            color: #ffffff;            
        }
        #phone-screen.dark-mode #favorites-search-input::placeholder {
            color: #8d8d92; 
        }
        .toggle-switch {
            position: relative;
            display: inline-block;
            width: 51px;
            height: 31px;
        }
        .toggle-switch input {
            opacity: 0;
            width: 0;
            height: 0;
        }
        .slider {
            position: absolute;
            cursor: pointer;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-color: #e9e9eb; 
            transition: .4s;
            border-radius: 34px;
        }
        .slider:before {
            position: absolute;
            content: "";
            height: 27px;
            width: 27px;
            left: 2px;
            bottom: 2px;
            background-color: white;
            transition: .4s;
            border-radius: 50%;
            box-shadow: 0 1px 2px rgba(0,0,0,0.1);
        }
        input:checked + .slider {
            background-color: #34c759; 
        }
        input:checked + .slider:before {
            transform: translateX(20px); 
        }
        #reply-preview-bar {
            display: none; 
            padding: 8px 12px;
            margin: 0 8px 8px 8px; 
            background-color: rgba(0, 0, 0, 0.05);
            border-left: 3px solid var(--accent-color);
            border-radius: 6px;
            position: relative;
            font-size: 13px;
            color: var(--text-secondary);
        }
        #phone-screen.dark-mode #reply-preview-bar {
            background-color: rgba(255, 255, 255, 0.1);
        }
        .reply-preview-content .sender {
            font-weight: 600;
            color: var(--text-primary);
        }
        .reply-preview-content .text {
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            display: block; 
            max-width: 95%;
        }
        #cancel-reply-btn {
            position: absolute;
            top: 50%;
            right: 8px;
            transform: translateY(-50%);
            width: 20px;
            height: 20px;
            line-height: 20px;
            text-align: center;
            border-radius: 50%;
            background-color: rgba(0,0,0,0.1);
            cursor: pointer;
            font-size: 14px;
        }
        .quoted-message {
            padding: 6px 10px;
            margin-bottom: 6px;
            background-color: rgba(0, 0, 0, 0.04);
            border-left: 2px solid var(--accent-color);
            border-radius: 4px;
            font-size: 0.9em; 
            opacity: 0.8;
        }
        #phone-screen.dark-mode .quoted-message {
            background-color: rgba(255, 255, 255, 0.08);
            border-left-color: #a0cff1;
        }
        .quoted-message .quoted-sender {
            font-weight: 600;
            color: var(--accent-color);
        }
        #phone-screen.dark-mode .quoted-message .quoted-sender {
            color: #a0cff1;
        }
        .quoted-message .quoted-content {
            color: var(--text-secondary);
            white-space: normal;     
            word-break: break-word;  
            display: block;
        }
        #font-preview {
            padding: 20px;
            border: 1px solid var(--border-color);
            border-radius: 8px;
            background-color: #f9f9f9; 
            transition: background-color 0.3s, border-color 0.3s;
        }
        #font-preview p {
            color: var(--text-primary);
        }
        #phone-screen.dark-mode #font-preview {
            background-color: #1c1c1e; 
            border-color: #38383a;     
        }
        #phone-screen.dark-mode #font-preview p {
            color: #ffffff;
        }
        .transfer-actions-content {
            background-color: #fff0f5; 
            border-radius: 20px;
            width: 290px;
            padding: 20px;
            box-shadow: 0 5px 25px rgba(255, 105, 180, 0.3); 
            text-align: center;
            position: relative;
            border: 1px solid #ffcce0;
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
        }
        .transfer-actions-header {
            font-size: 20px;
            font-weight: bold;
            color: #a35c7b; 
            margin-bottom: 15px;
        }
        .transfer-actions-body p {
            font-size: 15px;
            color: #555;
            margin: 0 0 25px 0;
            line-height: 1.5;
        }
        .transfer-actions-footer {
            display: flex;
            justify-content: space-between;
            gap: 15px;
        }
        .transfer-actions-footer .action-btn {
            flex: 1;
            padding: 12px;
            border: none;
            border-radius: 12px;
            font-size: 16px;
            font-weight: 600;
            cursor: pointer;
            transition: transform 0.2s, box-shadow 0.2s;
            color: white;
        }
        .transfer-actions-footer .action-btn:active {
            transform: scale(0.95);
        }
        .transfer-actions-footer .action-btn.accept {
            background: linear-gradient(135deg, #ff85b3, #ff69b4);
            box-shadow: 0 4px 10px rgba(255, 105, 180, 0.4);
        }
        .transfer-actions-footer .action-btn.decline {
            background: linear-gradient(135deg, #c2c2c2, #a0a0a0);
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
        }
        .transfer-actions-content .cancel-btn {
            position: absolute;
            top: 10px;
            right: 10px;
            width: 28px;
            height: 28px;
            border-radius: 50%;
            border: none;
            background-color: rgba(0, 0, 0, 0.1);
            color: #a35c7b;
            font-size: 20px;
            line-height: 28px;
            cursor: pointer;
        }
        .unread-count-wrapper {
            flex-shrink: 0;
            width: 40px;
            display: flex;
            justify-content: center;
            align-items: flex-start;
            padding-top: 20px; 
        }
        .unread-count {
            min-width: 20px;
            height: 20px;
            padding: 0 6px;
            background-color: #ff3b30; 
            color: white;
            font-size: 13px;
            font-weight: 500;
            line-height: 20px;
            text-align: center;
            border-radius: 10px; 
            box-shadow: 0 1px 2px rgba(0,0,0,0.15);
            display: none; 
            justify-content: center;
            align-items: center;
        }
        #call-history-screen {
            background-color: #f0f2f5;
        }
        .call-record-card {
            background-color: var(--secondary-bg);
            border-radius: 12px;
            padding: 15px;
            box-shadow: 0 2px 8px rgba(0,0,0,0.08);
            cursor: pointer;
            transition: transform 0.2s ease, box-shadow 0.2s ease;
            border-left: 5px solid var(--accent-color);
        }
        .call-record-card:hover {
            transform: translateY(-3px);
            box-shadow: 0 6px 12px rgba(0,0,0,0.1);
        }
        .call-record-card .card-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            font-size: 13px;
            color: var(--text-secondary);
            margin-bottom: 12px;
            padding-bottom: 8px;
            border-bottom: 1px solid var(--border-color);
        }
        .call-record-card .card-header .duration {
            font-weight: 500;
            color: var(--text-primary);
        }
        .call-record-card .card-body {
            display: flex;
            align-items: center;
        }
        .call-record-card .participants-avatars {
            display: flex;
            align-items: center;
        }
        .call-record-card .participant-avatar {
            width: 36px;
            height: 36px;
            border-radius: 50%;
            object-fit: cover;
            border: 2px solid white;
            box-shadow: 0 1px 3px rgba(0,0,0,0.1);
        }
        .call-record-card .participant-avatar:not(:first-child) {
            margin-left: -12px;
        }
        .call-record-card .participants-names {
            margin-left: 12px;
            font-weight: 600;
            color: var(--text-primary);
            font-size: 15px;
        }
        #transcript-modal-body {
            display: flex;
            flex-direction: column;
            gap: 12px;
            padding: 15px;
        }
        .transcript-entry {
            padding: 8px 12px;
            border-radius: 10px;
            max-width: 85%;
            line-height: 1.5;
            word-break: break-word;
        }
        .transcript-entry.user {
            background-color: #dcf8c6; 
            align-self: flex-end;
        }
        .transcript-entry.assistant {
            background-color: #ffffff;
            align-self: flex-start;
        }
        #chat-list-title {
            cursor: pointer;
        }
        .call-record-card .card-body {
            display: flex;
            flex-direction: column;
            gap: 8px; 
        }
        .call-record-card .custom-title {
            font-size: 16px;
            font-weight: 600; 
            color: var(--text-primary);
            padding-bottom: 8px; 
            border-bottom: 1px solid var(--border-color); 
            margin-bottom: 4px; 
        }
        .call-record-card .participants-info {
            display: flex;
            align-items: center;
        }
        .call-record-card .participants-names {
            margin-left: 12px;
            font-weight: 500; 
            font-size: 14px; 
            color: var(--text-secondary); 
        }
        .voice-transcript {
            font-size: 14px;         
            line-height: 1.6;        
            color: var(--text-secondary); 
            padding: 8px 12px;       
            margin-top: 6px;         
            background-color: rgba(0, 0, 0, 0.04); 
            border-radius: 6px;      
            word-break: break-word;  
            display: none;           
        }
        #phone-screen.dark-mode .voice-transcript {
            background-color: rgba(255, 255, 255, 0.1); 
        }
        .loading-spinner {
            display: none; 
            width: 16px;
            height: 16px;
            border: 2px solid rgba(0, 0, 0, 0.2);
            border-top-color: var(--accent-color); 
            border-radius: 50%;
            animation: spin 1s linear infinite;
            margin: 0 8px; 
        }
        @keyframes spin {
            to {
        transform: rotate(360deg);
            }
        }
        #shared-history-viewer-content {
            display: flex;
            flex-direction: column; 
            gap: 20px; 
            padding: 15px; 
        }
        #music-player-overlay {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            z-index: 50;
            display: flex;
            justify-content: center;
            align-items: flex-start;
            padding-top: 60px;
            background-color: rgba(0,0,0,0.3);
            opacity: 0;
            visibility: hidden;
            transform: translateY(-50px);
            transition: opacity 0.4s ease-out, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
        }
        #music-player-overlay.visible {
            opacity: 1;
            visibility: visible;
            transform: translateY(0);
        }
        .music-player-window { 
            width: 70%; 
            min-height: 420px;
            background-color: rgba(255, 255, 255, 0.6); 
            backdrop-filter: blur(20px); 
            -webkit-backdrop-filter: blur(20px); 
            border-radius: 25px; 
            box-shadow: 0 8px 32px 0 rgba(25, 25, 25, 0.37); 
            border: 1px solid rgba(255, 255, 255, 0.18); 
            padding: 25px; 
            display: flex; 
            flex-direction: column; 
            align-items: center; 
            color: #1f1f1f; 
            position: relative;
            justify-content: space-between;
            padding-bottom: 15px;
        }
        .music-player-top-actions {
            position: absolute;
            top: 15px;
            left: 15px;
            right: 15px;
            width: calc(100% - 30px);
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        .top-left-cluster {
            display: flex;
            align-items: center;
            gap: 15px;
        }
        #music-return-btn, #music-exit-btn {
            background: none;
            border: none;
            font-size: 28px;
            font-weight: 300;
            cursor: pointer;
            color: #555;
            padding: 5px;
            line-height: 1;
        }
        #music-exit-btn {
            font-size: 24px;
            font-weight: 400;
        }
        .music-progress-bar-container {
            width: 100%;
            display: flex;
            align-items: center;
            gap: 10px;
            margin-top: 25px;
            margin-bottom: 10px;
        }
        .time-display {
            font-size: 11px;
            color: #888;
            width: 35px;
            text-align: center;
            flex-shrink: 0;
            font-family: 'SF Mono', 'Menlo', monospace;
        }
        .progress-bar {
            flex-grow: 1;
            height: 5px;
            background-color: #e5e5e5;
            border-radius: 2.5px;
            cursor: pointer;
        }
        .progress-bar-fill {
            width: 0%;
            height: 100%;
            background-color: #333;
            border-radius: 2.5px;
        }
        #music-lyrics-container {
            width: 100%;
            height: 192px;
            overflow: hidden;
            position: relative;
            -webkit-mask-image: linear-gradient(transparent, black 20%, black 80%, transparent);
            mask-image: linear-gradient(transparent, black 20%, black 80%, transparent);
        }
        #music-lyrics-list {
            display: flex;
            flex-direction: column;
            align-items: center;
            transition: transform 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);
        }
        .lyric-line {
            padding: 4px 0;
            font-size: 14px;
            color: #666;
            text-align: center;
            line-height: 1.5;
            transition: all 0.5s ease;
            opacity: 0.7;
            transform: scale(0.95);
        }
        .lyric-line.active {
            font-size: 16px;
            color: #000;
            opacity: 1;
            transform: scale(1);
        }
        .music-player-controls-wrapper {
            width: 100%;
            display: flex;
            flex-direction: column;
            gap: 10px;
        }
        .music-controls {
            margin-top: 0;
        }
        #music-return-btn, #music-exit-btn, #music-playlist-btn {
            position: relative;
        }
        #music-return-btn { top: -2px; }
        #music-playlist-btn { top: -3px; }
        .playlist-item-actions {
            display: flex;
            align-items: center;
            gap: 15px;
        }
        .playlist-action-btn {
            font-size: 18px;
            color: #888;
            cursor: pointer;
            transition: color 0.2s;
        }
        .playlist-action-btn:hover { color: #000; }
        .delete-track-btn { font-size: 24px; color: #ff3b30; }
        .delete-track-btn:hover { color: #c00; }
        .lyrics-btn { font-weight: 500; }
        .message-bubble .avatar {
            width: 34px;
            height: 34px;
            border-radius: 20%;
            object-fit: cover;
            flex-shrink: 0; 
        }
        .recalled-message-placeholder {
            align-self: center; 
            padding: 4px 12px;
            margin: 5px 0;
            background-color: rgba(0, 0, 0, 0.1);
            color: var(--text-secondary);
            font-size: 12px;
            border-radius: 10px;
            text-align: center;
            max-width: 80%;
            cursor: pointer; 
        }
        #phone-screen.dark-mode .recalled-message-placeholder {
            background-color: rgba(255, 255, 255, 0.15);
        }
        @keyframes recall-animation {
          from {
            opacity: 1;
            transform: scale(1);
          }
          to {
            opacity: 0;
            transform: scale(0.8);
          }
        }
        .message-wrapper.recalled-animation {
          animation: recall-animation 0.3s ease-out forwards;
        }
        .recalled-message-placeholder {
            white-space: nowrap; 
            display: inline-block; 
            padding: 4px 12px;
        }
        .world-book-group-container {
            border-bottom: 1px solid var(--border-color);
        }
        .world-book-group-container:first-child {
            border-top: 1px solid var(--border-color);
        }
        .world-book-group-header {
            display: flex;
            align-items: center;
            padding: 12px 15px;
            cursor: pointer;
            background-color: #f7f7f7;
        }
        .world-book-group-header .arrow {
            font-size: 14px;
            margin-right: 8px;
            transition: transform 0.2s ease;
        }
        .world-book-group-header.collapsed .arrow {
            transform: rotate(-90deg);
        }
        .world-book-group-header .group-name {
            font-weight: 600;
            font-size: 15px;
        }
        .world-book-group-content {
            max-height: 1000px;
            overflow: hidden;
            transition: max-height 0.3s ease-in-out;
        }
        .world-book-group-content.collapsed {
            max-height: 0;
        }
        #phone-screen.dark-mode .world-book-group-header {
            background-color: #1c1c1e;
        }
        .chat-list-item.pinned {
            background-color: #f0f2f5; 
        }
        #phone-screen.dark-mode .chat-list-item.pinned {
            background-color: #2c2c2e; 
        }
        #chat-input-area {
            display: flex;
            flex-direction: column;
            flex-shrink: 0; 
            background-color: var(--secondary-bg); 
        }
        #chat-input-actions-top {
            flex-shrink: 0; 
            padding-bottom: 8px; 
        }
        #chat-input-main-row {
            flex-shrink: 0; 
        }
        #chat-input-area {
            position: relative; 
            z-index: 20;      
            flex-shrink: 0;
            padding: 8px;
            background-color: rgba(247, 247, 247, 0.8);
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            border-top: 1px solid var(--border-color);
            display: flex;
            flex-direction: column;
            gap: 5px;
        }
        #chat-at-mention-popup {
            bottom: 100%; 
            left: 8px;    
            right: 8px;   
            width: auto;  
            margin-bottom: 5px; 
        }
        #announcement-board-modal .modal-content {
            height: 70%;
            background-color: #f0f2f5;
        }
        #announcement-board-content {
            padding: 15px;
            flex-grow: 1;
            overflow-y: auto;
            display: flex;
            flex-direction: column;
            gap: 15px; 
        }
        #announcement-board-content .message-wrapper {
            max-width: 100%; 
            align-self: center;
        }
        #announcement-board-content .timestamp {
            display: none; 
        }
        .announcement-item-wrapper {
            position: relative; 
            padding: 10px;
            background-color: white;
            border-radius: 12px;
            box-shadow: 0 1px 3px rgba(0,0,0,0.05);
        }
        .announcement-item-actions {
            position: absolute;
            top: 15px;
            right: 15px;
            font-size: 20px;
            font-weight: bold;
            color: var(--text-secondary);
            cursor: pointer;
            padding: 5px;
            line-height: 1;
            border-radius: 50%;
        }
        .announcement-item-actions:hover {
            background-color: #f0f0f0;
        }
        .pinned-indicator {
            position: absolute;
            top: -8px;
            left: -8px;
            width: 28px;
            height: 28px;
            background-color: #ffc107;
            color: white;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 16px;
            box-shadow: 0 2px 5px rgba(0,0,0,0.2);
            border: 2px solid white;
        }
        .reposted-content-wrapper {
            background-color: #f7f7f8;
            border: 1px solid var(--border-color);
            border-radius: 8px;
            padding: 10px;
            margin-top: 10px;
        }
        #phone-screen.dark-mode .reposted-content-wrapper {
            background-color: #2c2c2e;
            border-color: #38383a;
        }
        .reposted-content-wrapper .post-footer,
        .reposted-content-wrapper .post-feedback-icons,
        .reposted-content-wrapper .post-likes-section {
            display: none;
        }
        .reposted-content-wrapper .post-header {
            margin-bottom: 8px;
        }
        .reposted-content-wrapper .post-avatar {
            width: 32px;
            height: 32px;
        }
        .reposted-content-wrapper .post-nickname {
            font-size: 14px;
        }
        .location-share-card {
            width: 230px;
            border-radius: 10px;
            overflow: hidden; 
            background-color: var(--secondary-bg);
            border: 1px solid #f0f0f0;
            box-shadow: 0 1px 4px rgba(0,0,0,0.05);
            cursor: pointer; 
        }
        .card-text-area {
            padding: 12px;
            border-bottom: 1px solid #f0f0f0;
        }
        .card-text-primary {
            font-size: 16px;
            font-weight: 600;
            color: #222;
            margin-bottom: 4px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .card-text-secondary {
            font-size: 12px;
            color: #a0a0a0;
        }
        .card-map-area {
            height: 100px; 
            display: flex;
            justify-content: center;
            align-items: center;
            background-size: cover;
            background-position: center;
            background-color: #FFF0F5; 
        }
        .message-bubble.user .location-share-card .card-map-area {
            background-color: #F0FFF8;
        }
        .card-pin-icon {
            font-size: 40px;
            color: #FF6B6B; 
            text-shadow: 0 2px 5px rgba(0, 0, 0, 0.4); 
        }
        @keyframes breathing-light {
            0% {
        box-shadow: 0 0 6px rgba(0, 123, 255, 0.4);
            }
            50% {
        box-shadow: 0 0 18px 4px rgba(0, 123, 255, 0.8);
            }
            100% {
        box-shadow: 0 0 6px rgba(0, 123, 255, 0.4);
            }
        }
        .chat-list-item .avatar.is-acting {
            animation: breathing-light 2s ease-in-out infinite;
            border: 1.5px solid rgba(0, 123, 255, 0.7);
        }
        .comment-sticker-btn {
            background: none;
            border: none;
            padding: 5px; 
            cursor: pointer;
            color: var(--text-secondary);
            transition: all 0.2s ease-in-out;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .comment-sticker-btn:hover {
            color: var(--text-primary); 
        }
        .comment-sticker-btn svg {
            width: 22px;
            height: 22px;
            fill: none;
            stroke: currentColor;
            stroke-width: 2;
            stroke-linecap: round;
            stroke-linejoin: round;
        }
        #qzone-sticker-panel {
            position: absolute; 
            width: 280px;
            height: 200px;
            background-color: rgba(255, 255, 255, 0.95);
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            border: 1px solid var(--border-color);
            border-radius: 12px;
            box-shadow: 0 5px 15px rgba(0,0,0,0.15);
            z-index: 1010; 
            display: none; 
            flex-direction: column;
            overflow: hidden;
        }
        #qzone-sticker-grid {
            flex-grow: 1;
            overflow-y: auto;
            padding: 10px;
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
            gap: 10px;
        }
        #qzone-sticker-grid .sticker-item {
            position: relative;
            aspect-ratio: 1 / 1;
            background-color: white;
            border-radius: 8px;
            background-size: contain;
            background-repeat: no-repeat;
            background-position: center;
            cursor: pointer;
            box-shadow: 0 1px 3px rgba(0,0,0,0.08);
        }
        .comment-text .comment-sticker {
            max-width: 100px;  
            max-height: 100px; 
            display: block;
            background-color: transparent;
        }
        .comment-item .comment-text:has(.comment-sticker) {
            line-height: 1;
        }
        .change-frame-btn {
            padding: 6px 10px;
            border: 1px solid #ccc;
            background-color: #f0f0f0;
            border-radius: 5px;
            cursor: pointer;
            font-size: 13px;
            margin-left: 10px;
        }
        #avatar-frame-modal .modal-content {
            height: 70%;
        }
        #avatar-frame-modal .modal-body {
            padding: 0;
            display: flex;
            flex-direction: column;
        }
        .frame-tabs {
            display: flex;
            border-bottom: 1px solid var(--border-color);
            flex-shrink: 0;
        }
        .frame-tab {
            flex: 1;
            padding: 12px;
            text-align: center;
            font-weight: 500;
            cursor: pointer;
            color: var(--text-secondary);
            border-bottom: 2px solid transparent;
        }
        .frame-tab.active {
            color: var(--accent-color);
            border-bottom-color: var(--accent-color);
        }
        .frame-content {
            flex-grow: 1;
            overflow-y: auto;
            padding: 15px;
        }
        .frame-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
            gap: 15px;
        }
        .frame-item {
            aspect-ratio: 1 / 1;
            border: 2px solid transparent;
            border-radius: 10px;
            cursor: pointer;
            background-color: #f0f0f0;
            background-size: cover;
            background-position: center;
            padding: 5px;
            transition: all 0.2s ease;
            position: relative;
        }
        .frame-item.selected {
            border-color: var(--accent-color);
            transform: scale(1.05);
        }
        .frame-item .preview-avatar {
            width: 100%;
            height: 100%;
            border-radius: 50%;
            object-fit: cover;
        }
        .frame-item .preview-frame {
            position: absolute;
            top: -7px;
            left: 0;
            width: 100%;
            height: 100%;
        }
        .avatar-group {
            width: 34px;
            flex-shrink: 0; 
            position: relative;
            transition: width 0.2s ease;
        }
        .avatar-group.has-frame {
            width: 34px; 
        }
        .message-bubble .avatar {
            width: 34px;
            height: 34px;
            border-radius: 20%; 
            object-fit: cover;
        }
        .avatar-with-frame {
            position: relative; 
            width: 38px;
            height: 38px;
            margin: 0 auto;
            transition: all 0.2s ease;
        }
        .avatar-group.has-frame .avatar-with-frame {
            width: 43px;
            height: 43px;
        }
        .avatar-with-frame .avatar-img {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%; 
            height: 100%;
            border-radius: 50%; 
            object-fit: cover;
            z-index: 1; 
        }
        .avatar-with-frame .avatar-frame {
            position: absolute;
            width: 120%;  
            height: 120%; 
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            z-index: 2; 
            pointer-events: none; 
        }
.message-bubble {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    max-width: 100%;
}
.message-bubble.user { 
    flex-direction: row-reverse; 
}
.message-bubble .content {
    flex: 1;
    min-width: 0;
    overflow-wrap: break-word; 
    word-wrap: break-word;     
    position: relative;
    font-size: var(--chat-font-size, 16px);
    padding: 8px 12px;
    line-height: 1.5;
}
.message-bubble .avatar-group {
    flex-shrink: 0 !important;
}
        #chat-interface-screen .message-bubble .avatar-group.has-frame .avatar-with-frame {
            width: 34px !important;
            height: 34px !important;
        }
        #chat-interface-screen .message-bubble .avatar-with-frame .avatar-img {
            width: 100% !important;
            height: 100% !important;
        }
        .message-bubble.is-link-share .content,
        .message-bubble.is-transfer .content,
        .message-bubble.is-waimai-request .content,
        .message-bubble.is-red-packet .content,
        .message-bubble.is-poll .content,
        .message-bubble.is-location-share .content,
        .message-bubble.is-sticker .content,
        .message-bubble.is-ai-image .content {
            display: flex;
            justify-content: center;
            align-items: center;
        }
        #chat-list-screen .avatar-frame {
            display: none;
        }
        #chat-list-screen .avatar-group {
            width: 45px;
            height: 45px;
        }
        #chat-list-screen .avatar-group.has-frame .avatar-with-frame,
        #chat-list-screen .avatar-group.has-frame .avatar-img {
            width: 45px;
            height: 45px;
        }
        #chat-list-screen .avatar-img,
        #chat-list-screen .avatar {
            border-radius: 50%;
        }
        #chat-list .chat-list-item .avatar-group {
            margin-right: 15px !important; 
        }
        #chat-list .chat-list-item .avatar {
            margin-right: 0; 
        }
        .comment-item {
            cursor: pointer;
            transition: background-color 0.2s;
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            gap: 8px; 
            padding: 4px 6px; 
            margin: 0 -6px; 
            border-radius: 4px;
        }
        .comment-item:hover {
            background-color: #f0f2f5;
        }
        #phone-screen.dark-mode .comment-item:hover {
            background-color: #2c2c2e;
        }
        .comment-item .comment-text {
            flex-grow: 1; 
            word-break: break-word; 
        }
        .legacy-comment-item {
            line-height: 1.5;
            padding: 4px 6px; 
            color: var(--text-secondary); 
        }
        .message-bubble.is-link-share .content,
        .message-bubble.is-transfer .content,
        .message-bubble.is-waimai-request .content,
        .message-bubble.is-red-packet .content,
        .message-bubble.is-poll .content,
        .message-bubble.is-location-share .content,
        .message-bubble.is-sticker .content,
        .message-bubble.is-ai-image .content {
            display: flex;
            justify-content: center;
            align-items: center;
        }
        #chat-interface-screen .message-bubble .avatar-group.has-frame .avatar-with-frame {
            width: 34px !important;
            height: 34px !important;
        }
        #chat-interface-screen .message-bubble .avatar-with-frame .avatar-img {
            width: 100% !important;
            height: 100% !important;
        }
        .message-bubble.is-sticker,
        .message-bubble.is-voice-message,
        .message-bubble.is-transfer,
        .message-bubble.is-ai-image,
        .message-bubble.is-waimai-request,
        .message-bubble.is-red-packet,
        .message-bubble.is-poll,
        .message-bubble.is-link-share,
        .message-bubble.is-location-share {
            flex: initial; 
            min-width: auto; 
        }
        .message-bubble.is-sticker .content,
        .message-bubble.is-voice-message .content,
        .message-bubble.is-transfer .content,
        .message-bubble.is-ai-image .content,
        .message-bubble.is-waimai-request .content,
        .message-bubble.is-red-packet .content,
        .message-bubble.is-poll .content,
        .message-bubble.is-link-share .content,
        .message-bubble.is-location-share .content {
            flex: initial; 
            padding: 0;
            background: transparent;
            box-shadow: none;
            border: none;
            backdrop-filter: none;
            -webkit-backdrop-filter: none;
        }
        #announcement-board-content .message-wrapper {
            align-self: flex-start !important;
        }
        #announcement-board-content .message-bubble.user {
            flex-direction: row !important;
        }
        #announcement-board-content .message-wrapper.user {
            flex-direction: row !important;
        }
        #chat-interface-screen > .header {
            position: absolute !important; 
            top: 0;
            left: 0;
            width: 100%;
            z-index: 100 !important; 
        }
        #chat-interface-screen #chat-messages {
            margin-top: 0 !important; 
        }
        #music-player-overlay {
            z-index: 200 !important;
        }
        #chat-interface-screen {
            position: relative !important;
            height: 100%;
            width: 100%;
            overflow: hidden; 
        }
        #chat-interface-screen > .header {
            position: absolute !important;
            top: 0;
            left: 0;
            right: 0; 
            width: auto !important; 
            z-index: 100 !important; 
        }
        #chat-interface-screen #chat-input-area {
            position: absolute !important;
            bottom: 0;
            left: 0;
            right: 0;
            width: auto !important;
            z-index: 100 !important;
            padding-bottom: calc(8px + env(safe-area-inset-bottom)); 
        }
        #chat-interface-screen #chat-messages {
            height: 100% !important; 
            width: 100% !important;
            overflow-y: auto !important; 
            box-sizing: border-box !important; 
            margin-top: 0 !important; 
            padding-top: calc(120px + env(safe-area-inset-top)) !important; 
            padding-bottom: calc(120px + env(safe-area-inset-bottom)) !important;
        }
        .post-deleted-placeholder {
            align-self: center;
            padding: 4px 12px;
            margin: 5px 0;
            background-color: rgba(0, 0, 0, 0.1);
            color: var(--text-secondary);
            font-size: 12px;
            border-radius: 10px;
            text-align: center;
            max-width: 80%;
            cursor: pointer; 
        }
        #phone-screen.dark-mode .post-deleted-placeholder {
            background-color: rgba(255, 255, 255, 0.15);
        }
        .spoiler {
            background-color: #333; 
            color: #333;           
            padding: 0 4px;         
            border-radius: 4px;     
            cursor: pointer;        
            transition: all 0.2s ease-in-out; 
        }
        .spoiler:hover, .spoiler:active {
            background-color: #e0e0e0; 
            color: inherit;           
        }
        .memory-action-btn {
            background: none;
            border: none;
            cursor: pointer;
            padding: 5px; 
            border-radius: 50%; 
            display: flex;
            align-items: center;
            justify-content: center;
            transition: background-color 0.2s;
        }
        .memory-action-btn svg {
            width: 18px;  
            height: 18px;
            stroke: var(--text-secondary); 
            transition: stroke 0.2s;
        }
        .memory-action-btn:hover {
            background-color: #e9ecef; 
        }
        #phone-screen.dark-mode .memory-action-btn:hover {
            background-color: #38383a;
        }
        .memory-action-btn.edit-memory-btn:hover svg {
            stroke: var(--accent-color);
        }
        .memory-action-btn.delete-memory-btn:hover svg {
            stroke: #ff3b30;
        }
        #sticker-grid.management-mode .sticker-item::after {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            border: 3px solid transparent;
            border-radius: 10px;
            box-sizing: border-box;
            transition: border-color 0.2s;
        }
        #sticker-grid.management-mode .sticker-item.selected::after {
            border-color: var(--accent-color);
        }
        #sticker-grid.management-mode .sticker-item .delete-btn {
            display: block;
            background-color: rgba(0, 0, 0, 0.5);
            color: white;
            border: 1px solid white;
        }
        #sticker-action-bar {
            display: none; 
            padding: 10px 15px;
            padding-bottom: calc(10px + env(safe-area-inset-bottom));
            background-color: rgba(247, 247, 247, 0.9);
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            border-top: 1px solid var(--border-color);
        }
        #sticker-action-bar button {
            width: 100%;
            padding: 12px;
            border-radius: 8px;
            border: none;
            font-size: 16px;
            font-weight: 600;
            cursor: pointer;
            background-color: #ff3b30;
            color: white;
        }
        #ai-response-editor-container {
            display: flex;
            flex-direction: column;
            gap: 15px;
        }
        .ai-response-editor-block {
            background-color: #f9f9f9;
            border: 1px solid var(--border-color);
            border-radius: 8px;
            padding: 12px;
        }
        .ai-response-editor-block textarea {
            width: 100%;
            min-height: 80px; 
            resize: vertical;
            border: 1px solid #ccc;
            border-radius: 6px;
            padding: 8px;
            font-size: 14px; 
            font-family: monospace; 
            box-sizing: border-box;
        }
        .ai-response-editor-block .format-helpers {
            margin-top: 8px;
            margin-bottom: 0; 
        }
        .ai-response-editor-block .delete-block-btn {
            float: right;
            margin-top: -5px;
            background: none;
            border: none;
            color: #ff3b30;
            font-size: 20px;
            cursor: pointer;
        }
        #phone-screen.dark-mode .ai-response-editor-block {
            background-color: #2c2c2e;
            border-color: #38383a;
        }
        #phone-screen.dark-mode .ai-response-editor-block textarea {
            background-color: #1c1c1e;
            color: #f0f0f0;
            border-color: #4a4a4e;
        }
.offline-dialogue {
    font-weight: 500;
}
.offline-description {
    display: block; 
    color: inherit; 
    font-style: normal; 
    margin-top: 4px; 
    white-space: pre-wrap; 
    line-height: 1.6;
}
.offline-description em {
    color: var(--text-secondary); 
}
#phone-screen.dark-mode .offline-description {
    color: inherit; 
}
        .message-bubble .content {
            transition: background-color 0.5s ease-out;
        }
        .message-bubble.highlighted .content {
            background-color: rgba(0, 123, 255, 0.2) !important;
        }
        #gomoku-overlay {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 350px;
            z-index: 50;
            pointer-events: none; 
            overflow: hidden;     
            display: none;        
        }
        #gomoku-content-wrapper {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: transparent !important;
            backdrop-filter: none !important;
            box-shadow: none !important;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            gap: 15px;
            padding: 15px 0;
            box-sizing: border-box;
            transition: transform 0.3s ease-out;
            transform: translateY(-100%);
            pointer-events: auto;
        }
        #phone-screen.dark-mode #gomoku-content-wrapper {
            background-color: rgba(28, 28, 30, 0.9);
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
        }
        #gomoku-overlay.visible #gomoku-content-wrapper {
            transform: translateY(0);
        }
        #chat-messages {
            transition: padding-top 0.3s ease-out;
        }
        #gomoku-board {
            background-color: #e4b591;
            border-radius: 8px;
            box-shadow: 0 4px 15px rgba(0,0,0,0.15);
            cursor: pointer;
        }
        #gomoku-controls {
            width: 100%;
            text-align: center;
            flex-shrink: 0;
        }
        #close-gomoku-btn {
            padding: 6px 15px;
            border-radius: 15px;
            border: 1px solid var(--text-secondary);
            background-color: rgba(255,255,255,0.5);
            color: var(--text-secondary);
            cursor: pointer;
            font-size: 13px;
        }
        #phone-screen.dark-mode #close-gomoku-btn {
            background-color: rgba(0,0,0,0.2);
            border-color: var(--text-secondary);
        }
        #gomoku-overlay {
            pointer-events: none;
        }
        #gomoku-board,
        #gomoku-controls {
            pointer-events: auto;
        }
        #product-grid {
            flex-grow: 1; 
            overflow-y: auto; 
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 10px;
            padding: 10px;
            padding-bottom: 80px;
        }
        .product-item {
            background-color: white;
            border-radius: 8px;
            box-shadow: 0 2px 4px rgba(0,0,0,0.04);
            display: flex;         
            flex-direction: column;
            cursor: pointer;
            position: relative;
        }
        .product-image {
            width: 100%;
            aspect-ratio: 1 / 1;
            object-fit: cover;
        }
        .product-info {
            padding: 12px 10px;
            flex-grow: 1;      
            display: flex;
            flex-direction: column;
        }
        .product-name {
            font-size: 13px;
            color: #333;
            line-height: 1.4;
            min-height: 36px;
        }
        .product-footer {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-top: 8px;      
        }
        .product-price {
            font-size: 16px;
            font-weight: 700;
            color: #ff5722;
        }
        .product-price::before { content: '¥'; font-size: 12px; }
        .add-to-cart-btn {
            padding: 6px 12px;
            border: none;
            border-radius: 15px;
            background: linear-gradient(90deg, #ff9800, #ff5722);
            color: white;
            font-size: 12px;
            font-weight: 500;
            cursor: pointer;
        }
        .product-management-overlay {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0,0,0,0.5);
            display: none;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            gap: 15px;
            z-index: 7;
        }
        .product-management-overlay button {
            padding: 8px 20px;
            border: 1px solid white;
            background-color: rgba(255,255,255,0.2);
            color: white;
            border-radius: 15px;
            cursor: pointer;
        }
        .product-management-overlay .delete-product-btn {
            border-color: #ff8a80;
            color: #ff8a80;
        }
        #shopping-screen.management-mode .product-footer {
            display: none;
        }
        #cart-title {
            position: static;
            transform: none;
        }
        #cart-items-list { padding: 10px; display: flex; flex-direction: column; gap: 10px; }
        .cart-item {
            display: flex; align-items: flex-start; gap: 12px; background-color: white;
            padding: 12px; border-radius: 12px;
        }
        .cart-item-checkbox { margin-top: 28px; }
        .cart-item-image { width: 80px; height: 80px; object-fit: cover; border-radius: 8px; flex-shrink: 0; }
        .cart-item-info { flex-grow: 1; display: flex; flex-direction: column; }
        .cart-item-name { font-weight: 500; font-size: 14px; line-height: 1.4; }
        .cart-item-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 10px;}
        .cart-item-price { color: #ff5722; font-weight: bold; font-size: 16px; }
        .quantity-control { display: flex; align-items: center; gap: 4px; }
        .quantity-btn {
            width: 26px; height: 26px; border: none; background-color: #f7f8fa;
            border-radius: 4px; font-weight: 500; cursor: pointer; color: #666;
        }
        .quantity-display { font-weight: 500; min-width: 30px; text-align: center; }
        #cart-footer {
            position: absolute; bottom: 0; left: 0; width: 100%; display: flex;
            justify-content: space-between; align-items: center; padding: 10px 15px;
            padding-bottom: calc(10px + env(safe-area-inset-bottom));
            background-color: white; border-top: 1px solid var(--border-color); box-sizing: border-box;
        }
        #cart-footer .select-all-label { display: flex; align-items: center; gap: 5px; }
        #cart-footer .cart-summary { text-align: right; }
        #cart-footer .cart-subtext { font-size: 11px; color: #999; }
        #checkout-btn {
            padding: 10px 25px; border: none; border-radius: 20px;
            background: linear-gradient(90deg, #ff9800, #ff5722);
            color: white; font-size: 15px; font-weight: 500; cursor: pointer;
        }
        .gift-card {
            width: 220px; 
            box-sizing: border-box; 
            border-radius: 12px; 
            background-color: var(--secondary-bg); 
            border: 1px solid #eee; 
            padding: 12px;
            cursor: pointer; 
            box-shadow: 0 2px 8px rgba(0,0,0,0.07);
        }
        .gift-header { display: flex; align-items: center; gap: 8px; padding-bottom: 8px; border-bottom: 1px solid #f0f0f0; }
        .gift-header-icon { width: 20px; height: 20px; color: #ff9800; }
        .gift-header-text { font-size: 15px; font-weight: 600; color: var(--text-primary); }
        .gift-items-preview { padding: 12px 0; display: flex; flex-direction: column; gap: 8px; }
        .gift-preview-item { display: flex; align-items: center; gap: 8px; }
        .gift-preview-img { width: 32px; height: 32px; object-fit: cover; border-radius: 4px; flex-shrink: 0; }
        .gift-preview-name { flex-grow: 1; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .gift-preview-quantity { font-size: 12px; color: var(--text-secondary); }
        .gift-footer { font-size: 12px; color: var(--text-secondary); text-align: right; }
        #gift-receipt-body { font-family: 'Helvetica Neue', Arial, sans-serif; padding: 15px; background-color: #f7f8fa; }
        .receipt-header { text-align: center; padding-bottom: 15px; border-bottom: 1px solid #ddd; }
        .receipt-header h3 { margin: 0 0 5px 0; font-size: 20px; }
        .receipt-header p { margin: 0; font-size: 12px; color: #888; }
        .receipt-items-table { width: 100%; border-collapse: collapse; margin: 15px 0; }
        .receipt-items-table th, .receipt-items-table td { padding: 10px 5px; font-size: 13px; }
        .receipt-items-table thead th { border-bottom: 1px solid #333; text-align: left; }
        .receipt-items-table .item-name { width: 50%; }
        .receipt-items-table .item-qty { text-align: center; }
        .receipt-items-table .item-price, .receipt-items-table .item-subtotal { text-align: right; }
        .receipt-total { padding-top: 15px; border-top: 1px solid #333; text-align: right; font-size: 16px; font-weight: bold; }
        .receipt-footer { text-align: center; margin-top: 25px; font-size: 12px; color: #888; }
        .product-item {
            position: relative; 
        }
.product-management-overlay {
    position: absolute;
    bottom: 0; 
    left: 0;
    width: 100%;
    background-color: rgba(0,0,0,0.6); 
    display: none; 
    justify-content: center; 
    align-items: center;
    gap: 15px; 
    padding: 10px 0; 
    border-radius: 0 0 8px 8px; 
    z-index: 5; 
    transition: opacity 0.2s;
}
        #shopping-screen.management-mode .product-management-overlay {
            display: flex; 
        }
        .product-management-overlay button {
            padding: 8px 20px;
            border: 1px solid white;
            background-color: rgba(255,255,255,0.2);
            color: white;
            border-radius: 15px;
            cursor: pointer;
        }
        .product-management-overlay .delete-product-btn {
            border-color: #ff8a80;
            color: #ff8a80;
        }
        #shopping-screen.management-mode .add-to-cart-btn {
            display: none;
        }
        .message-bubble.is-card-like {
            flex: initial; 
            min-width: auto; 
        }
        .message-bubble.is-card-like .content {
            flex: initial; 
            padding: 0;
            background: transparent;
        }
        #go-to-cart-btn {
            display: flex;
            align-items: center; 
            gap: 4px; 
        }
        #gift-recipient-list .contact-picker-item {
            display: flex;
            align-items: center;
            padding: 10px 15px;
            cursor: pointer;
            border-bottom: 1px solid var(--border-color);
        }
        #gift-recipient-list .contact-picker-item:last-child {
            border-bottom: none;
        }
        #gift-recipient-list .contact-picker-item .checkbox {
            width: 20px;
            height: 20px;
            border: 2px solid #ccc;
            border-radius: 50%;
            margin-right: 15px;
            transition: all 0.2s ease;
        }
        #gift-recipient-list .contact-picker-item.selected .checkbox {
            background-color: var(--accent-color);
            border-color: var(--accent-color);
        }
        #gift-recipient-list .contact-picker-item .avatar {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            margin-right: 12px;
        }
        #gift-recipient-list .contact-picker-item .name {
            font-weight: 500;
        }
        #ai-heart-rate-display {
            display: none !important;
        }
        #global-lyrics-bar {
            position: absolute;
            z-index: 20;
            display: flex;
            align-items: center;
            font-size: 13px;
            font-weight: 500;
            color: var(--text-secondary);
            background-color: rgba(0, 0, 0, 0.05);
            padding: 4px 12px;
            border-radius: 12px;
            opacity: 0;
            visibility: hidden;
            transition: opacity 0.4s ease, visibility 0.4s ease, top 0.3s ease, bottom 0.3s ease, left 0.3s ease, right 0.3s ease, transform 0.3s ease;
            pointer-events: none;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            max-width: 65%;
        }
        #phone-screen.dark-mode #global-lyrics-bar {
            color: #a0a0a0;
            background-color: rgba(255, 255, 255, 0.1);
        }
        #global-lyrics-bar.visible {
            opacity: 1;
            visibility: visible;
        }
        #phone-screen.dark-mode #global-lyrics-bar {
            color: #a0a0a0;
            background-color: rgba(255, 255, 255, 0.1);
        }
        #world-book-screen {
            background-color: #f0f2f5;
            display: flex; 
            flex-direction: column;
        }
        #phone-screen.dark-mode #world-book-screen {
            background-color: #000000;
        }
        #world-book-tabs {
            display: flex;
            overflow-x: auto; 
            padding: 10px 15px 0 15px;
            flex-shrink: 0; 
            border-bottom: 1px solid var(--border-color);
            background-color: var(--secondary-bg);
            -ms-overflow-style: none;  
            scrollbar-width: none;  
        }
        #world-book-tabs::-webkit-scrollbar {
            display: none; 
        }
        .world-book-tab {
            padding: 8px 16px;
            cursor: pointer;
            border: none;
            background-color: transparent;
            font-size: 15px;
            font-weight: 500;
            color: var(--text-secondary);
            border-bottom: 2px solid transparent;
            margin-bottom: -1px; 
            transition: all 0.2s ease-in-out;
            white-space: nowrap; 
        }
        .world-book-tab.active {
            color: var(--accent-color);
            border-bottom-color: var(--accent-color);
            font-weight: 600;
        }
        #phone-screen.dark-mode .world-book-tab.active {
            color: #ffffff;
        }
        #world-book-content-container {
            flex-grow: 1;
            overflow-y: auto;
        }
        .world-book-category-pane {
            display: none; 
            grid-template-columns: repeat(2, 1fr); 
            gap: 15px;
            padding: 15px;
        }
        .world-book-category-pane.active {
            display: grid;
        }
.world-book-card {
    background-color: var(--secondary-bg);
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    word-break: break-all;
}
        .world-book-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 6px 12px rgba(0,0,0,0.12);
        }
        #phone-screen.dark-mode .world-book-card {
            box-shadow: 0 2px 8px rgba(255,255,255,0.05);
        }
        .world-book-card .card-title {
            font-weight: 600;
            font-size: 15px;
            color: var(--text-primary);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis; 
        }
        .world-book-card .card-content-preview {
            font-size: 13px;
            color: var(--text-secondary);
            line-height: 1.5;
            display: -webkit-box;
            -webkit-line-clamp: 3; 
            -webkit-box-orient: vertical;
            overflow: hidden;
        }
        #rendering-rules-screen {
            background-color: #f0f2f5;
            display: flex; 
            flex-direction: column;
        }
        #phone-screen.dark-mode #rendering-rules-screen {
            background-color: #000000;
        }
        #rules-tabs {
            display: flex;
            overflow-x: auto;
            padding: 10px 15px 0 15px;
            flex-shrink: 0;
            border-bottom: 1px solid var(--border-color);
            background-color: var(--secondary-bg);
            -ms-overflow-style: none;
            scrollbar-width: none;
        }
        #rules-tabs::-webkit-scrollbar {
            display: none;
        }
        .rules-tab {
            padding: 8px 16px;
            cursor: pointer;
            border: none;
            background-color: transparent;
            font-size: 15px;
            font-weight: 500;
            color: var(--text-secondary);
            border-bottom: 2px solid transparent;
            margin-bottom: -1px;
            transition: all 0.2s ease-in-out;
            white-space: nowrap;
        }
        .rules-tab.active {
            color: var(--accent-color);
            border-bottom-color: var(--accent-color);
            font-weight: 600;
        }
        #phone-screen.dark-mode .rules-tab.active {
            color: #ffffff;
        }
        #rules-content-container {
            flex-grow: 1;
            overflow-y: auto;
        }
        .rules-category-pane {
            display: none; 
            grid-template-columns: repeat(2, 1fr); 
            gap: 15px;
            padding: 15px;
        }
        .rules-category-pane.active {
            display: grid;
        }
        .rule-card {
            background-color: var(--secondary-bg);
            border-radius: 12px;
            padding: 15px;
            box-shadow: 0 2px 8px rgba(0,0,0,0.08);
            cursor: pointer;
            transition: transform 0.2s ease, box-shadow 0.2s ease;
            display: flex;
            flex-direction: column;
            gap: 8px; 
            border-left: 5px solid #6c757d; 
        }
        .rule-card.enabled {
            border-left-color: #28a745; 
        }
        .rule-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 6px 12px rgba(0,0,0,0.12);
        }
        #phone-screen.dark-mode .rule-card {
            box-shadow: 0 2px 8px rgba(255,255,255,0.05);
        }
        .rule-card .card-title {
            font-weight: 600;
            font-size: 15px;
            color: var(--text-primary);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .rule-card .card-content-preview {
            font-size: 12px;
            font-family: monospace; 
            color: var(--text-secondary);
            background-color: #f0f2f5;
            padding: 5px 8px;
            border-radius: 4px;
            word-break: break-all;
        }
        #phone-screen.dark-mode .rule-card .card-content-preview {
            background-color: #2c2c2e;
        }
        .control-btn.regenerate-btn {
            background-color: rgba(255, 255, 255, 0.2);
            background-size: 55%; 
            background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M20 11A8.1 8.1 0 0 0 4.5 9M4 5v4h4"/><path d="M4 13a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4"/></svg>');
        }
        .control-btn.propel-btn {
            background-color: rgba(255, 255, 255, 0.2);
            background-size: 55%;
            background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polygon points="13 19 22 12 13 5 13 19"></polygon><polygon points="2 19 11 12 2 5 2 19"></polygon></svg>');
        }
.message-bubble.is-raw-html .content {
    padding: 0 !important; 
    background: transparent !important; 
    border: none !important; 
    box-shadow: none !important; 
}
#phone-screen {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    -webkit-touch-callout: none;
}
#home-screen #clock-container,
#home-screen #app-grid,
#home-screen #home-widgets-container {
    display: none !important;
}
#home-screen {
    background: linear-gradient(135deg, #6DD5FA, #2980B9);
    background-size: cover;
    background-position: center;
    padding: 20px;
    padding-top: calc(20px + env(safe-area-inset-top));
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: space-between; 
    align-items: center;
    height: 100%;
}
#main-content-area {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 30px; 
    align-items: center;
    margin-top: 20px; 
}
#profile-widget {
    position: relative; 
    width: 100%;
    max-width: 380px;
    flex-shrink: 0;
}
#profile-banner-img {
    display: block; 
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 24px 24px 0 0; 
    position: relative;
    z-index: 1; 
}
#profile-widget .profile-avatar-container {
    position: absolute;
    top: 80px; 
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: white; 
    padding: 4px; 
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 3; 
}
#profile-avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}
#profile-widget .profile-info {
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 24px;
    margin-top: -24px; 
    padding-top: 44px; 
    min-height: 120px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-left: 15px;
    padding-right: 15px;
    padding-bottom: 15px;
    text-align: center;
    color: #1c1c1e;
    position: relative;
    z-index: 2; 
}
#profile-widget::before {
    display: none !important;
}
#profile-avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}
#profile-widget::before {
    display: none !important;
}
#profile-avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}
#profile-username { font-size: 18px; font-weight: 600; margin: 0 0 2px 0; }
#profile-sub-username { font-size: 13px; color: #8a8a8a; margin: 0 0 10px 0; }
#profile-bio { font-size: 14px; margin: 0 0 12px 0; color: #333; }
#profile-location {
    font-size: 12px; color: #8a8a8a; margin: 0 auto; display: inline-flex;
    align-items: center; gap: 4px; background-color: rgba(0,0,0,0.05);
    padding: 3px 9px; border-radius: 10px;
}
#desktop-layout {
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    gap: 20px;
    width: 100%;
    align-items: start;
}
#desktop-widget-column {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.widget-header {
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    margin: 0 0 5px 5px;
}
.desktop-widget {
    background-color: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 18px;
    padding: 12px 15px;
    color: #1f1f1f; 
    font-weight: 500;
    font-size: 13px;
    display: flex;
    align-items: center;
}
.desktop-widget.text-only {
    background-color: transparent; 
    border: none;                  
    padding: 0;                    
    box-shadow: none;              
}
.desktop-widget.icon-left { justify-content: flex-start; gap: 10px; }
.desktop-widget.icon-right {
    justify-content: flex-end; 
    gap: 10px;                 
}
.desktop-widget img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.desktop-widget p, .desktop-widget span { margin: 0; }
#desktop-app-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    align-content: start;
}
#desktop-dock {
    background-color: rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    padding: 15px 25px;
    display: flex;
    justify-content: center;
    gap: 30px;
    width: fit-content;
    flex-shrink: 0;
    margin-bottom: calc(20px + env(safe-area-inset-bottom));
}
.desktop-app-icon {
    display: flex; flex-direction: column; align-items: center; gap: 8px; cursor: pointer; text-align: center;
}
.icon-bg-desktop {
    width: 55px; height: 55px; border-radius: 14px; background-color: #f0f2f5; justify-content: center; box-shadow: 0 4px 10px rgba(0,0,0,0.1); transition: transform 0.2s ease; overflow: hidden;
}
.icon-bg-desktop img {
    width: 100%; height: 100%; object-fit: cover; border-radius: 0;
}
.desktop-app-icon .label {
    color: #333; font-size: 13px; font-weight: 500;
}
.desktop-app-icon:active .icon-bg-desktop {
    transform: scale(0.9);
}
.editable-text:hover, .editable-image:hover {
    outline: 2px dashed rgba(255, 255, 255, 0.8);
    cursor: pointer;
    opacity: 0.9;
}
.editable-text, .editable-image {
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}
.editable-text:hover, .editable-image:hover {
    outline: 2px dashed rgba(255, 255, 255, 0.8);
    opacity: 0.9;
    border-radius: 4px; 
}
#profile-widget .profile-info {
    background: transparent !important;
    position: relative;
    z-index: 1; 
}
#profile-widget .profile-info::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 24px;
    mask-image: linear-gradient(to bottom, black 50%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 50%, transparent 100%);
    z-index: -1;
}
#chat-settings-screen {
    display: flex;
    flex-direction: column;
    background-color: #f0f2f5; 
}
#phone-screen.dark-mode #chat-settings-screen {
     background-color: #000000; 
}
#chat-settings-screen .form-container {
    flex-grow: 1;      
    overflow-y: auto;  
    padding-top: 100px;  
    margin-top: -80px;   
}
.search-result-item {
    display: flex;
    flex-direction: column;
    padding: 12px 18px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background-color 0.2s;
}
.search-result-item:hover {
    background-color: rgba(0, 0, 0, 0.1);
}
#phone-screen.dark-mode .search-result-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
}
.search-result-item .title {
    font-weight: 500;
    font-size: 15px;
    color: var(--text-primary);
}
.search-result-item .artist {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}
.search-result-item .source {
    font-size: 10px;
    color: var(--accent-color);
    background-color: rgba(0, 123, 255, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
    margin-left: 8px;
}
#music-player-cover {
    width: 180px;
    height: 180px;
    border-radius: 15px;
    object-fit: cover;
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
    margin-bottom: 25px; 
    transition: opacity 0.5s ease-in-out; 
}
#music-visual-container {
    position: relative;
    width: 220px;
    height: 220px;
    margin-bottom: 25px;
    cursor: pointer;
}
#vinyl-view, #inline-lyrics-view {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease, transform 0.5s ease;
}
#vinyl-view {
    background-color: #222;
    border-radius: 50%;
    padding: 18px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.3), 
                inset 0 0 0 2px rgba(255, 255, 255, 0.05);
    background-image: repeating-radial-gradient(circle, #333, #333 1px, #222 1px, #222 2px);
    box-sizing: border-box;
}
#vinyl-view #music-player-cover {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
    margin: 0; 
}
#inline-lyrics-view {
    opacity: 0;
    transform: scale(1.1);
    pointer-events: none;
    padding: 10px;
    box-sizing: border-box;
}
#music-visual-container.lyrics-active #vinyl-view {
    opacity: 0;
    transform: scale(0.9);
}
#music-visual-container.lyrics-active #inline-lyrics-view {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}
#inline-lyrics-view #music-lyrics-container {
    width: 100%;
    height: 100%;
}
#music-info-top {
    text-align: center; 
    flex-shrink: 0;
    margin-bottom: 20px; 
}
#music-player-song-title,
#music-player-artist,
#music-time-counter {
    margin-bottom: 5px; 
}
#music-visual-container {
    margin-bottom: 15px; 
}
@keyframes spin-vinyl {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}
#vinyl-view.spinning {
  animation: spin-vinyl 12s linear infinite;
}
#single-lyric-display {
    height: 40px;          
    line-height: 40px;     
    width: 100%;           
    margin-top: 15px;      
    text-align: center;    
    font-size: 14px;       
    color: #333;           
    font-weight: 500;      
    transition: opacity 0.3s ease; 
    white-space: nowrap;           
    overflow: hidden;              
    text-overflow: ellipsis;       
}
#music-visual-container.lyrics-active + #single-lyric-display {
    display: none;
}
#character-profile-modal {
    background-color: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.character-profile-content {
    width: 320px;
    height: 75vh;
    max-height: 580px;
    background-color: #f0f2f5;
    border-radius: 20px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    display: flex;
    flex-direction: column;
    position: relative;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
     overflow: visible; 
    padding-top: 40px; 
}
#profile-history-icon-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 36px;
    height: 36px;
    background: none;
    border: none;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
    padding: 0;
    z-index: 10;
}
#profile-history-icon-btn:hover { background-color: rgba(0,0,0,0.05); }
#profile-history-icon-btn svg { width: 20px; height: 20px; stroke: #b0b0b0; stroke-width: 2; }
#profile-main-content, #profile-thoughts-history-view {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
}
#profile-main-content {
    padding: 0 25px 25px 25px; 
    gap: 20px; 
    flex-grow: 1;
    overflow-y: auto;
}
.profile-header {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
    margin-bottom: 10px; 
}
#profile-avatar { width: 60px; height: 60px; border-radius: 12px; object-fit: cover; }
.profile-info { display: flex; flex-direction: column; }
#profile-name { font-size: 20px; font-weight: 600; color: #1f1f1f; }
#profile-id { font-size: 14px; color: #8a8a8a; }
.profile-section {
    background-color: #ffffff; 
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06); 
    display: flex;
    flex-direction: column;
    gap: 12px; 
    flex-shrink: 0;
}
.profile-section-header {
    display: flex;
    align-items: center;
    gap: 10px; 
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f0f0; 
}
.profile-section-icon {
    font-size: 20px;
    opacity: 0.5;
}
.profile-section label {
    font-size: 15px;
    font-weight: 600;
    color: #555; 
    margin: 0; 
}
.profile-section p {
    font-size: 15px;
    color: #333;
    line-height: 1.7;
    margin: 0;
    white-space: pre-wrap;
}
#profile-thoughts-history-view { display: none; padding: 0 25px 25px 25px; }
#profile-thoughts-history-view .profile-header { justify-content: space-between; padding-bottom: 15px; }
#profile-thoughts-history-view .profile-header span { font-size: 18px; font-weight: 600; }
#history-back-btn { width: 36px; height: 36px; background: none; border: none; cursor: pointer; border-radius: 50%; display: flex; align-items: center; justify-content: center; transition: background-color 0.2s; padding: 0; }
#history-back-btn:hover { background-color: rgba(0,0,0,0.05); }
#history-back-btn svg { width: 22px; height: 22px; stroke: #a0a0a0; stroke-width: 2.5; }
#thoughts-history-list {
    flex-grow: 1;
    overflow-y: auto;
    padding-right: 5px;
    margin-right: -10px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.thought-card { background-color: #ffffff; border-radius: 16px; padding: 15px 20px; border: 1px solid #eee; }
.thought-header { font-size: 12px; color: #b0b0b0; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid #f0f0f0; }
.thought-content .label { display: flex; align-items: center; gap: 6px; font-weight: 600; color: #a0a0a0; font-size: 13px; margin-bottom: 6px; }
.thought-content .label svg { width: 16px; height: 16px; }
.thought-content .text { font-size: 14px; color: #555; line-height: 1.7; white-space: pre-wrap; padding-left: 22px; }
.thought-content .jottings { margin-top: 15px; }
#profile-main-content::-webkit-scrollbar,
#thoughts-history-list::-webkit-scrollbar { display: none; }
#profile-main-content, #thoughts-history-list { -ms-overflow-style: none; scrollbar-width: none; }
.character-profile-content {
    background-color: #ffffff !important;
}
#character-profile-modal .jottings .label {
    display: none;
}
#character-profile-modal .thought-content .text {
    padding-left: 0;
}
#qzone-more-actions-btn {
    font-size: 24px;      
    font-weight: bold;    
    padding: 0 10px;      
    border-radius: 50%;   
    line-height: 1;       
    position: relative;
    top: -2px;            
    transition: background-color 0.2s;
}
#qzone-more-actions-btn:hover {
    background-color: rgba(0,0,0,0.05); 
}
#phone-screen.dark-mode #qzone-more-actions-btn:hover {
    background-color: rgba(255,255,255,0.1);
}
#clear-posts-list {
    overflow-y: auto; 
    flex-grow: 1;
}
.clear-posts-item {
    display: flex;
    align-items: center;
    padding: 12px 18px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s;
}
.clear-posts-item:hover {
    background-color: #f5f5f5;
}
.clear-posts-item .checkbox {
    width: 22px;
    height: 22px;
    border: 2px solid #ccc;
    border-radius: 50%;
    margin-right: 15px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}
.clear-posts-item.selected .checkbox {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
}
.clear-posts-item.selected .checkbox::after {
    content: '✔';
    font-size: 14px;
    font-weight: bold;
}
.clear-posts-item .name {
    font-weight: 500;
}
.clear-posts-item.danger-option .name {
    color: #ff3b30;
    font-weight: 600;
}
.thought-card {
    position: relative; 
}
.thought-delete-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: none;
    background-color: rgba(0,0,0,0.05);
    color: var(--text-secondary);
    font-size: 20px;
    line-height: 26px;
    text-align: center;
    cursor: pointer;
    opacity: 0; 
    transition: all 0.2s ease-in-out;
}
.thought-card:hover .thought-delete-btn {
    opacity: 1;
}
.thought-delete-btn:hover {
    background-color: #ff3b30;
    color: white;
}
.search-result-item {
    display: flex;       
    align-items: center; 
    padding: 12px 18px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background-color 0.2s;
}
.search-result-item:hover {
    background-color: rgba(0, 0, 0, 0.05);
}
#phone-screen.dark-mode .search-result-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
}
.search-result-item .search-result-info {
    flex-grow: 1;
    pointer-events: none; 
}
.search-result-item .music-search-checkbox {
    width: 20px;
    height: 20px;
    margin-right: 15px;
    flex-shrink: 0;
}
#music-search-results-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
#music-search-results-modal .modal-footer {
    display: flex;
    justify-content: space-around;
}
#music-search-results-modal .modal-footer button {
    width: 45%; 
}
.bg-upload-container {
    width: 100%;
    justify-content: center;
    gap: 15px; 
}
.bg-upload-container .form-button-secondary {
    flex-grow: 1; 
    flex-basis: 0; 
    max-width: 180px; 
    margin-top: 0;
    padding: 12px; 
    font-size: 15px;
    font-weight: 600; 
    border-radius: 8px; 
    border: none; 
    background-color: #e9e9eb; 
    color: #1c1c1e; 
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
}
.bg-upload-container .form-button-secondary:active {
    transform: scale(0.98); 
}
#remove-global-bg-btn {
    background-color: #ffebee;
    color: #c62828;
}
#character-profile-modal .character-profile-content {
    position: relative; 
    overflow: visible;  
    padding-bottom: 35px; 
}
#character-profile-modal .character-profile-content::before {
    content: '';
    position: absolute;
    top: -10px; 
    left: 0;
    right: 0;
    height: 20px; 
    background-image: radial-gradient(circle at 50% 0, transparent 8px, #f0f2f5 8px);
    background-size: 25px 20px; 
    background-repeat: repeat-x;
}
#character-profile-modal .character-profile-content::after {
    content: '';
    position: absolute;
    bottom: -10px; 
    left: 0;
    right: 0;
    height: 20px; 
    background-image: radial-gradient(circle at 50% 100%, transparent 8px, #f0f2f5 8px);
    background-size: 25px 20px; 
    background-repeat: repeat-x;
}
#character-profile-modal .character-profile-content {
    border-radius: 0;         
    background-color: #ffffff; 
}
#character-profile-modal .character-profile-content::before {
    background-image: radial-gradient(circle at 50% 0, transparent 8px, #ffffff 8px);
}
#character-profile-modal .character-profile-content::after {
    background-image: radial-gradient(circle at 50% 100%, transparent 8px, #ffffff 8px);
}
#character-profile-modal .thought-header {
    position: relative;
    width: 100%;
    padding-bottom: 15px; 
    margin-bottom: 25px; 
    border-bottom: 2px dashed #e0e0e0; 
}
#character-profile-modal .thought-header::before {
    content: '';
    position: absolute;
    bottom: -11px;
    left: -35px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color:  rgba(0, 0, 0, 0.3);
}
#character-profile-modal .thought-header::after {
    content: '';
    position: absolute;
    bottom: -11px;
    right: -35px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color:  rgba(0, 0, 0, 0.3);
}
#character-profile-modal .thought-header {
    height: 140px;         
    flex-shrink: 0;
    padding: 10px;         
    padding-bottom: 25px;  
    box-sizing: border-box;
    border-bottom: 2px dashed #e0e0e0; 
    margin-bottom: 25px;
    position: relative;     
    background-image: url('https://s3plus.meituan.net/opapisdk/op_ticket_885190757_1758340625111_qdqqd_zqr2cl.jpeg'); 
    background-size: cover;
    background-position: center top;
    border-radius: 0;      
}
#profile-photo-slot {
    display: none; 
}
#character-profile-modal #profile-main-content .thought-header {
    box-sizing: border-box;
    background-image: url('https://s3plus.meituan.net/opapisdk/op_ticket_885190757_1758340625111_qdqqd_zqr2cl.jpeg');
    background-size: cover;
    background-position: center top;
    border-bottom: 2px dashed #e0e0e0;
    margin-bottom: 15px;
    background-clip: content-box; 
    -webkit-background-clip: content-box; 
}
#character-profile-modal #profile-main-content .thought-header::before,
#character-profile-modal #profile-main-content .thought-header::after {
    content: '';
    position: absolute;
    bottom: -11px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.3);
}
#character-profile-modal #profile-main-content .thought-header::before {
    left: -35px;
}
#character-profile-modal #profile-main-content .thought-header::after {
    right: -35px;
}
#character-profile-modal #thoughts-history-list .thought-card .thought-header {
    height: auto;
    padding: 0;
    padding-bottom: 8px; 
    margin-bottom: 12px;
    background-image: none; 
    border: none; 
    border-bottom: 1px solid #f0f0f0; 
}
#character-profile-modal #thoughts-history-list .thought-card .thought-header::before,
#character-profile-modal #thoughts-history-list .thought-card .thought-header::after {
    display: none !important; 
}
#character-profile-modal #profile-main-content .label {
    display: flex !important;
}
#character-profile-modal #profile-main-content .text {
    font-family: "SimSun", "Songti SC", serif; 
    font-size: 16px; 
}
#character-profile-modal .thought-content .label {
    color: #000000 !important;
}
#character-profile-modal .thought-content .text {
    color: #000000 !important;
}
#character-profile-modal #profile-main-content {
    overflow-x: hidden;
}
        #sticker-category-tabs {
            display: flex;
            overflow-x: auto;
            padding: 0 15px; 
            flex-shrink: 0;
            border-bottom: 1px solid var(--border-color);
            background-color: var(--secondary-bg);
            -ms-overflow-style: none;
            scrollbar-width: none;
        }
        #sticker-category-tabs::-webkit-scrollbar {
            display: none;
        }
        .sticker-category-tab {
            padding: 10px 16px; 
            cursor: pointer;
            border: none;
            background-color: transparent;
            font-size: 14px;
            font-weight: 500;
            color: var(--text-secondary);
            border-bottom: 2px solid transparent;
            margin-bottom: -1px; 
            transition: all 0.2s ease-in-out;
            white-space: nowrap; 
        }
        .sticker-category-tab.active {
            color: var(--accent-color);
            border-bottom-color: var(--accent-color);
            font-weight: 600;
        }
        #phone-screen.dark-mode .sticker-category-tab.active {
            color: #ffffff;
        }
        #sticker-grid.management-mode .sticker-item::after {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            border: 3px solid transparent;
            border-radius: 10px;
            box-sizing: border-box;
            transition: border-color 0.2s;
            pointer-events: none; 
        }
        #sticker-grid.management-mode .sticker-item.selected::after {
            border-color: var(--accent-color);
        }
        #sticker-grid.management-mode .sticker-item .delete-btn {
            display: block;
            background-color: rgba(0, 0, 0, 0.5);
            color: white;
            border: 1px solid white;
        }
        #sticker-action-bar {
            display: none; 
            flex-shrink: 0;
            padding: 10px 15px;
            padding-bottom: calc(10px + env(safe-area-inset-bottom));
            background-color: rgba(247, 247, 247, 0.9);
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            border-top: 1px solid var(--border-color);
            justify-content: space-between; 
            align-items: center;
        }
        #sticker-action-bar .select-all-label {
            font-size: 16px;
            color: var(--text-primary);
            cursor: pointer;
        }
        #sticker-action-bar button {
            padding: 10px 25px;
            border-radius: 20px;
            border: none;
            font-size: 15px;
            font-weight: 600;
            cursor: pointer;
            background-color: #ff3b30;
            color: white;
        }
#character-selection-screen { background-color: #f0f2f5; }
#phone-screen.dark-mode #character-selection-screen { background-color: #000; }
#character-grid {
    padding: 0; 
    overflow-y: auto; 
    flex-grow: 1;
}
.character-select-item {
    display: flex;
    flex-direction: row;     
    align-items: center;     
    cursor: pointer;
    padding: 12px 20px;      
    border-bottom: 1px solid var(--border-color); 
    gap: 15px;               
    transition: background-color 0.2s; 
}
.character-select-item:hover {
    background-color: #f5f5f5; 
}
.character-select-item .avatar {
    width: 45px;             
    height: 45px;
    border-radius: 50%;      
    object-fit: cover;
    margin-bottom: 0;        
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
    flex-shrink: 0;          
}
.character-select-item .name {
    font-weight: 500;
    font-size: 16px;         
    color: var(--text-primary);
}
#character-phone-screen { background-size: cover; background-position: center; }
.char-screen { width: 100%; height: 100%; position: absolute; top: 0; left: 0; display: flex; flex-direction: column; overflow: hidden; opacity: 0; visibility: hidden; transition: opacity 0.3s, visibility 0.3s; }
.char-screen.active { opacity: 1; visibility: visible; z-index: 2; }
#char-home-screen { justify-content: flex-start; align-items: center; box-sizing: border-box; padding: 0 20px; }
#char-clock-container { text-align: center; color: white; text-shadow: 0 3px 8px rgba(0,0,0,0.4); margin-top: calc(60px + env(safe-area-inset-top)); flex-shrink: 0; margin-bottom: 100px; }
#char-main-time { font-size: 88px; font-weight: 600; letter-spacing: -2px; font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif; }
#char-main-date { font-size: 22px; font-weight: normal; }
#char-app-grid { display: flex; flex-direction: column; align-items: center; gap: 20px; width: 100%; }
#char-qq-screen, #char-memo-screen, #char-diary-screen, #char-usage-screen, 
#char-album-screen, #char-browser-screen, #char-taobao-screen {
     background-color: var(--secondary-bg);
}
.memo-item, .diary-item, .usage-item { padding: 15px 20px; border-bottom: 1px solid var(--border-color); cursor: pointer; }
.memo-item .content, .diary-item .content { font-size: 16px; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.diary-item .date, .usage-item .timestamp { font-size: 12px; color: var(--text-secondary); margin-bottom: 5px; }
.usage-item .action { font-size: 15px; color: var(--text-primary); }
#char-album-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); 
    gap: 5px;
    padding: 5px;
}
.char-photo-item {
    aspect-ratio: 1 / 1; 
    background-size: cover;
    background-position: center;
    background-color: #e9ecef;
}
.char-browser-item {
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-color);
}
.char-browser-item .title {
    font-weight: 500;
    font-size: 15px;
    color: var(--text-primary);
    margin-bottom: 4px;
}
.char-browser-item .url {
    font-size: 12px;
    color: var(--accent-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
#char-product-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 10px;
}
.char-product-item {
    background-color: var(--secondary-bg);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.04);
    display: flex;
    flex-direction: column;
}
.char-product-item .product-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 8px 8px 0 0;
}
.char-product-item .product-info {
    padding: 12px 10px;
    flex-grow: 1;
}
.char-product-item .product-name {
    font-size: 13px;
    color: #333;
    line-height: 1.4;
    min-height: 36px;
}
.char-product-item .product-price {
    font-size: 16px;
    font-weight: 700;
    color: #ff5722;
    margin-top: 8px;
}
.char-product-item .product-price::before { content: '¥'; font-size: 12px; }
#char-qq-screen .list-container {
    padding: 0; 
}
#transcript-modal-body {
    display: flex;
    flex-direction: column;
    gap: 20px; 
    padding: 15px; 
    background-color: #f0f2f5;
}
#phone-screen.dark-mode #transcript-modal-body {
    background-color: #000000;
}
#chat-list .chat-list-item,
#char-chat-list .chat-list-item {
    display: flex;
    align-items: center;
    gap: 15px; 
}
#chat-list .chat-list-item .avatar-group,
#char-chat-list .chat-list-item .avatar-group {
    flex-shrink: 0;
}
#chat-list .chat-list-item .info,
#char-chat-list .chat-list-item .info {
    flex-grow: 1;
    min-width: 0; 
}
#char-qq-conversation-screen .list-container {
    display: flex;
    flex-direction: column;
    gap: 20px; 
    padding: 15px; 
    background-color: #f0f2f5;
}
#phone-screen.dark-mode #char-qq-conversation-screen .list-container {
    background-color: #000000;
}
#char-qq-screen, 
#char-memo-screen, 
#char-diary-screen, 
#char-usage-screen, 
#char-album-screen, 
#char-browser-screen, 
#char-taobao-screen,
#char-browser-article-screen,
#char-wallet-screen {
     background-color: var(--secondary-bg);
}
#char-memo-detail-content {
    width: 100%;
    height: 100%;
    border: none;
    background-color: transparent;
    font-size: 16px;
    line-height: 1.7; 
    padding: 15px 20px; 
    box-sizing: border-box;
    resize: none; 
    outline: none; 
    font-family: inherit; 
    color: var(--text-primary); 
}
#char-memo-detail-screen {
    background-color: var(--secondary-bg);
}
#char-memo-detail-screen .header {
    background-color: var(--secondary-bg); 
    border-bottom: 1px solid var(--border-color); 
    padding-bottom: 10px;
}
#char-memo-detail-title {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-weight: 600; 
}
#char-memo-detail-screen .form-container {
    padding: 0;
}
#char-memo-detail-content {
    background-color: var(--secondary-bg); 
    padding: 15px 20px; 
    font-size: 17px; 
    line-height: 1.7; 
    color: var(--text-primary);
}
#char-diary-detail-screen {
    background-color: #FDFBF5; 
}
#phone-screen.dark-mode #char-diary-detail-screen {
    background-color: #2c2c2e; 
}
#char-diary-detail-content-wrapper {
    padding: 0;
    overflow-y: auto; 
}
#char-diary-detail-content {
    padding: 25px 20px; 
    font-family: Georgia, 'Times New Roman', Times, serif; 
    font-size: 16px;
    line-height: 1.8; 
    color: #383838; 
}
#phone-screen.dark-mode #char-diary-detail-content {
    color: #e0e0e0;
}
#char-diary-detail-content > p:first-of-type {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    text-align: center;
}
#char-diary-detail-content strong {
    font-weight: 600; 
}
#char-diary-detail-content .spoiler {
    background-color: #333;
    color: #333;
    padding: 0 4px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}
#char-diary-detail-content .spoiler:hover {
    background-color: #e0e0e0;
    color: inherit;
}
@import url('https://fonts.googleapis.com/css2?family=Zhi+Mang+Xing&display=swap');
#char-diary-detail-content .diary-highlight {
    background-color: #FFFACD; 
    padding: 1px 4px;
    border-radius: 3px;
    margin: 0 2px;
}
#char-diary-detail-content .diary-underline {
    border-bottom: 2px dotted #FFB6C1; 
    text-decoration: none; 
    padding-bottom: 1px;
}
#char-diary-detail-content .diary-emphasis {
    color: #DB7093; 
    font-weight: bold;
}
#char-diary-detail-content .diary-handwritten {
    font-family: 'Zhi Mang Xing', cursive; 
    font-size: 1.1em; 
    color: #1a1a1a; 
}
#char-diary-detail-content .diary-messy {
    font-family: 'Zhi Mang Xing', cursive;
    font-size: 1.1em;
    color: #1a1a1a;
    transform: rotate(-2deg); 
    display: inline-block; 
    margin: 0 2px;
}
#char-diary-detail-content .diary-censored {
    background-color: #222;
    color: #222; 
    user-select: none; 
    padding: 0 3px;
    border-radius: 2px;
}
.diary-censored:hover, .diary-censored:active {
  background-color: #E0E0E0; 
  color: inherit; 
  cursor: pointer; 
}
#char-amap-screen {
    background-color: #f0f2f5;
}
#phone-screen.dark-mode #char-amap-screen {
    background-color: #000000;
}
#char-amap-list {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 18px; 
}
.char-amap-item {
    background-color: var(--secondary-bg);
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    display: flex;
    flex-direction: column; 
}
.amap-item-header {
    display: flex;
    align-items: flex-start; 
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
    margin-bottom: 12px;
}
.amap-item-icon {
    font-size: 24px;
    color: var(--accent-color);
    margin-top: 2px;
}
.amap-item-info {
    flex-grow: 1;
}
.amap-item-title {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 4px;
}
.amap-item-address {
    font-size: 13px;
    color: var(--text-secondary);
}
.amap-item-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.amap-item-comment {
    font-size: 14px;
    line-height: 1.6;
    white-space: pre-wrap; 
}
.amap-item-photo {
    width: 100%;
    height: 150px;
    border-radius: 8px;
    background-size: cover;
    background-position: center;
    cursor: pointer;
}
.amap-item-footer {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 10px;
    text-align: right;
}
#char-usage-list {
    padding: 10px 0; 
}
.char-usage-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px 20px;
    transition: background-color 0.2s;
}
.char-usage-item:hover {
    background-color: rgba(0,0,0,0.03);
}
.usage-item-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px; 
    object-fit: cover;
    flex-shrink: 0;
    background-color: #e9ecef;
}
.usage-item-info {
    flex-grow: 1; 
}
.usage-item-name {
    font-weight: 500;
    font-size: 16px;
}
.usage-item-category {
    font-size: 12px;
    color: var(--text-secondary);
}
.usage-item-time {
    font-size: 15px;
    color: var(--text-secondary);
    font-weight: 500;
    flex-shrink: 0;
}
#char-music-screen {
    background-color: #f0f2f5;
}
#phone-screen.dark-mode #char-music-screen {
    background-color: #000000;
}
#char-music-list {
    padding: 0;
}
.char-music-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
}
.char-music-item:hover {
    background-color: rgba(0,0,0,0.03);
}
.music-item-cover {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}
.music-item-info {
    flex-grow: 1;
    overflow: hidden; 
}
.music-item-name {
    font-weight: 500;
    font-size: 16px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.music-item-artist {
    font-size: 12px;
    color: var(--text-secondary);
}
#char-music-player-modal .modal-content {
    width: 400px !important; 
    height: auto !important; 
    max-height: 90vh;
    background-color: #f7f8fa !important; 
    border-radius: 12px !important;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1) !important;
    color: #333 !important;
    display: flex;
    flex-direction: column;
}
#char-music-player-modal .char-player-header {
    flex-shrink: 0;
    padding: 12px 15px;
    border-bottom: 1px solid #e5e5e5;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}
#char-music-player-modal .char-player-close-btn {
    background: none;
    border: none;
    font-size: 20px;
    color: #aaa;
    cursor: pointer;
}
#char-music-player-modal .char-player-close-btn:hover {
    color: #333;
}
#char-music-player-modal .char-player-body {
    padding: 30px 35px 20px 35px;
    text-align: center;
}
#char-music-player-modal #char-music-cover {
    width: 220px;
    height: 220px;
    border-radius: 10px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    margin-bottom: 20px;
    object-fit: cover;
}
#char-music-player-modal .char-player-progress-bar-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}
#char-music-player-modal .char-player-progress-bar {
    flex-grow: 1;
    height: 4px;
    background-color: #e0e0e0;
    border-radius: 2px;
    cursor: pointer;
}
#char-music-player-modal #char-music-progress-fill {
    width: 0%;
    height: 100%;
    background-color: #555;
    border-radius: 2px;
}
#char-music-player-modal .char-player-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}
#char-music-player-modal .char-player-controls .control-btn {
    background: none;
    border: none;
    color: #555;
    cursor: pointer;
    transition: color 0.2s;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
}
#char-music-player-modal .char-player-controls .control-btn:hover {
    color: #000;
}
#char-music-player-modal .char-player-controls .control-btn.play {
    width: 50px;
    height: 50px;
    background-color: #f0f1f3;
    border-radius: 50%;
    color: #333;
}
#char-music-player-modal .char-player-controls .control-btn.mode {
    font-size: 14px;
    font-weight: 500;
    width: 50px;
}
#char-music-player-modal #char-music-lyrics {
    flex-grow: 1;
    overflow-y: auto;
    padding: 0 35px 25px 35px;
    font-size: 14px;
    line-height: 2;
    color: #888;
    text-align: center;
}
#char-music-player-modal #char-music-lyrics p.active {
    color: #000;
    font-weight: 600;
}
#char-music-player-modal #char-music-lyrics::-webkit-scrollbar {
    display: none;
}
#char-music-player-modal #char-music-lyrics {
    -ms-overflow-style: none;
    scrollbar-width: none;
}
@keyframes spin-vinyl {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
#char-music-player-modal .modal-content {
    width: 340px !important; 
    height: auto !important;
    background-color: #f0f1f3 !important; 
    border-radius: 12px !important;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1) !important;
    color: #333 !important;
    display: flex;
    flex-direction: column;
    padding: 20px; 
    position: relative;
}
#char-music-player-modal .modal-header {
    display: none !important;
}
#char-music-player-modal .char-player-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    font-weight: 300;
    color: #aaa;
    cursor: pointer;
    line-height: 1;
    z-index: 10;
}
#char-music-player-modal .char-player-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-grow: 1;
}
#char-music-player-modal .char-player-song-info {
    text-align: center;
    margin-bottom: 25px;
}
#char-music-player-modal #char-music-player-title {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 5px 0;
}
#char-music-player-modal #char-music-artist {
    font-size: 14px;
    color: #888;
    margin: 0;
}
#char-music-player-modal #char-vinyl-container {
    width: 210px;
    height: 210px;
    border-radius: 50%;
    background-color: #222;
    padding: 15px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.2), 
                inset 0 0 0 2px rgba(255, 255, 255, 0.05);
    background-image: repeating-radial-gradient(circle, #333, #333 1px, #222 1px, #222 2px);
    box-sizing: border-box;
    margin-bottom: 25px;
}
#char-music-player-modal #char-vinyl-container.spinning {
    animation: spin-vinyl 12s linear infinite;
}
#char-music-player-modal #char-music-cover {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}
#char-music-player-modal #char-lyric-placeholder {
    color: #aaa;
    font-size: 18px;
    letter-spacing: 5px;
    margin-bottom: 25px;
}
#char-music-player-modal .char-player-footer {
    width: 100%;
    margin-top: auto; 
}
#char-music-player-modal .char-player-progress-bar-container {
    display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
}
#char-music-player-modal .char-player-progress-bar {
    flex-grow: 1; height: 4px; background-color: #e0e0e0; border-radius: 2px; cursor: pointer;
}
#char-music-player-modal #char-music-progress-fill {
    width: 0%; height: 100%; background-color: #555; border-radius: 2px;
}
#char-music-player-modal .char-player-controls {
    display: flex; align-items: center; justify-content: center; gap: 20px;
}
#char-music-player-modal .char-player-controls .control-btn {
    background: none; border: none; color: #555; cursor: pointer; transition: color 0.2s; padding: 5px;
    display: flex; align-items: center; justify-content: center;
}
#char-music-player-modal .char-player-controls .control-btn:hover { color: #000; }
#char-music-player-modal .char-player-controls .control-btn.play {
    width: 50px; height: 50px; background-color: #e0e1e3; border-radius: 50%; color: #333;
}
#char-music-player-modal .char-player-controls .control-btn.mode {
    font-size: 14px; font-weight: 500; width: 50px;
}
#char-music-player-modal #char-music-lyrics {
    display: none; 
}
@keyframes spin-vinyl {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
#char-music-player-modal .modal-content {
    width: 340px !important; 
    height: auto !important;
    background-color: #f0f1f3 !important; 
    border-radius: 12px !important;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1) !important;
    color: #333 !important;
    display: flex;
    flex-direction: column;
    padding: 20px; 
    position: relative;
}
#char-music-player-modal .modal-header {
    display: none !important;
}
#char-music-player-modal .char-player-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    font-weight: 300;
    color: #aaa;
    cursor: pointer;
    line-height: 1;
    z-index: 10;
}
#char-music-player-modal .char-player-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-grow: 1;
}
#char-music-player-modal .char-player-song-info {
    text-align: center;
    margin-bottom: 25px;
}
#char-music-player-modal #char-music-player-title {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 5px 0;
}
#char-music-player-modal #char-music-artist {
    font-size: 14px;
    color: #888;
    margin: 0;
}
#char-music-player-modal #char-vinyl-container {
    width: 210px;
    height: 210px;
    border-radius: 50%;
    background-color: #222;
    padding: 15px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.2), 
                inset 0 0 0 2px rgba(255, 255, 255, 0.05);
    background-image: repeating-radial-gradient(circle, #333, #333 1px, #222 1px, #222 2px);
    box-sizing: border-box;
    margin-bottom: 25px;
}
#char-music-player-modal #char-vinyl-container.spinning {
    animation: spin-vinyl 12s linear infinite;
}
#char-music-player-modal #char-music-cover {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}
#char-music-player-modal #char-music-lyrics {
    width: 100%;
    height: 50px; 
    overflow: hidden; 
    position: relative;
    margin-bottom: 25px;
    font-size: 14px;
    line-height: 25px; 
    color: #888;
    text-align: center;
    transition: all 0.3s ease;
}
#char-music-player-modal #char-music-lyrics p {
    margin: 0;
    transition: all 0.3s ease;
}
#char-music-player-modal #char-music-lyrics p.active {
    color: #000;
    font-weight: 600;
    font-size: 16px; 
}
#char-music-player-modal .char-player-footer {
    width: 100%;
    margin-top: auto; 
}
#char-music-player-modal .char-player-progress-bar-container {
    display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
}
#char-music-player-modal .char-player-progress-bar {
    flex-grow: 1; height: 4px; background-color: #e0e0e0; border-radius: 2px; cursor: pointer;
}
#char-music-player-modal #char-music-progress-fill {
    width: 0%; height: 100%; background-color: #555; border-radius: 2px;
}
#char-music-player-modal .char-player-controls {
    display: flex; align-items: center; justify-content: center; gap: 20px;
}
#char-music-player-modal .char-player-controls .control-btn {
    background: none; border: none; color: #555; cursor: pointer; transition: color 0.2s; padding: 5px;
    display: flex; align-items: center; justify-content: center;
}
#char-music-player-modal .char-player-controls .control-btn:hover { color: #000; }
#char-music-player-modal .char-player-controls .control-btn.play {
    width: 50px; height: 50px; background-color: #e0e1e3; border-radius: 50%; color: #333;
}
#char-music-player-modal .char-player-controls .control-btn.mode {
    font-size: 14px; font-weight: 500; width: 50px;
}
#chat-list .chat-list-item {
    gap: 15px !important;
    justify-content: flex-start !important;
}
#chat-list .chat-list-item .avatar-group {
    margin-right: 0 !important;
}
#douban-screen {
    background-color: #F6F6F1; 
}
#phone-screen.dark-mode #douban-screen {
    background-color: #1a1a1a;
}
#douban-posts-list {
    padding: 0; 
    display: flex;
    flex-direction: column;
}
.douban-post-item {
    background-color: var(--secondary-bg);
    padding: 12px 15px;
    border: none;
    box-shadow: none;
    border-bottom: 1px solid var(--border-color); 
    cursor: pointer;
    transition: background-color 0.2s;
}
.douban-post-item:hover {
    background-color: #f9f9f9;
}
#phone-screen.dark-mode .douban-post-item:hover {
    background-color: #2c2c2e;
}
.douban-post-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}
.douban-post-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}
.douban-author-info {
    flex-grow: 1;
}
.douban-author-name {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 14px;
}
.douban-group-name {
    font-size: 12px;
    color: #007722; 
    font-weight: 500;
}
.douban-post-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}
.douban-post-content {
    font-size: 14px;
    color: #555;
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
#phone-screen.dark-mode .douban-post-content {
    color: #dcdcdc;
}
.douban-post-footer {
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--text-secondary);
}
.douban-post-actions {
    display: flex;
    gap: 20px;
}
.douban-post-actions span {
    display: flex;
    align-items: center;
    gap: 6px; 
    color: var(--text-secondary); 
}
.douban-post-actions svg {
    width: 18px;
    height: 18px;
    fill: currentColor; 
    position: relative;
    top: -1px; 
}
.douban-feather-btn {
    font-size: 24px;
    padding: 0;
    width: 38px;
    height: 38px;
    line-height: 38px;
    text-align: center;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0; 
    margin-right: 8px; 
    background-color: #f0f2f5;
    color: #555;
    transition: background-color 0.2s;
}
.douban-feather-btn:hover {
    background-color: #e2e6ea;
}
.douban-feather-btn svg {
    width: 20px;
    height: 20px;
}
#douban-post-detail-screen {
    background-color: #F6F6F1; 
}
#phone-screen.dark-mode #douban-post-detail-screen {
    background-color: #1a1a1a;
}
#douban-detail-content-wrapper {
    background-color: var(--secondary-bg);
    padding: 0; 
    padding-bottom: 80px; 
}
#douban-post-detail-body {
    padding: 20px 18px 25px 18px; 
    border-bottom: 1px solid #f0f0f0;
}
#phone-screen.dark-mode #douban-post-detail-body {
    border-bottom-color: #38383a;
}
.douban-post-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    line-height: 1.5;
}
.douban-detail-content {
    white-space: pre-wrap;
    line-height: 1.8;
    font-size: 15px;
    color: #333;
}
#phone-screen.dark-mode .douban-detail-content {
    color: #dcdcdc;
}
.douban-comments-section {
    margin-top: 0;
    padding: 15px 18px;
}
.douban-comments-section h4 {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    margin: 0 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}
#phone-screen.dark-mode .douban-comments-section h4 {
    border-bottom-color: #38383a;
}
.douban-comment-item {
    display: flex;
    gap: 12px;
    padding: 15px 0;
    border-bottom: 1px solid #f0f0f0;
}
.douban-comment-item:last-child {
    border-bottom: none;
}
#phone-screen.dark-mode .douban-comment-item {
    border-bottom-color: #38383a;
}
.douban-comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
}
.douban-comment-body {
    flex-grow: 1;
}
.douban-comment-author {
    font-weight: 500;
    font-size: 14px;
    color: var(--text-primary);
}
.douban-comment-text {
    font-size: 14px;
    color: #555;
    margin-top: 6px;
    line-height: 1.7;
    word-break: break-word;
}
#phone-screen.dark-mode .douban-comment-text {
    color: #b0b0b0;
}
#douban-comment-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 10px 18px; 
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
    box-sizing: border-box; 
    background-color: rgba(247, 247, 247, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid var(--border-color); 
}
#douban-send-comment-btn {
    background-color: #007722; 
}
#douban-screen .header .header-actions {
    flex-shrink: 0;
    display: flex;       
    align-items: center; 
}
.header .action-btn svg {
    width: 24px;   
    height: 24px;
    display: block; 
}
.header .action-btn {
    min-width: 30px; 
    display: flex;
    align-items: center;
    justify-content: center;
}
.header .header-left-actions {
    display: flex;
    align-items: center;
    gap: 15px; 
}
        .char-photo-item {
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 8px; 
            box-sizing: border-box;
        }
        .char-photo-description {
            font-size: 13px;
            color: var(--text-secondary); 
            text-align: center;
            line-height: 1.5;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 5; 
            overflow: hidden;
            word-break: break-all; 
        }
        .char-product-description-overlay {
            width: 100%;
            aspect-ratio: 1 / 1; 
            background-color: #f7f8fa; 
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 15px; 
            box-sizing: border-box;
            border-bottom: 1px solid #eee; 
            border-radius: 8px 8px 0 0; 
        }
        .char-product-description-overlay .char-photo-description,
        .char-browser-image-description { 
            font-size: 14px; 
            color: var(--text-secondary);
            text-align: center;
            line-height: 1.6;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 6; 
            overflow: hidden;
            word-break: break-all;
        }
        .char-browser-image-description {
            padding: 40px 20px; 
        }
.char-product-status {
    font-size: 12px;
    color: #8a8a8a; 
    background-color: #f0f2f5; 
    padding: 3px 8px;
    border-radius: 10px;
}
#search-history-screen {
    background-color: #f0f2f5;
}
#phone-screen.dark-mode #search-history-screen {
    background-color: #000000;
}
#search-results-list {
    flex-grow: 1;
    overflow-y: auto;
}
.date-separator {
    text-align: center;
    color: var(--text-secondary);
    font-size: 12px;
    padding: 10px 0;
    font-weight: 500;
}
#phone-screen.dark-mode #search-bar input {
    background-color: #1c1c1e;
    color: #ffffff;
    border-color: #38383a;
}
        #home-screen {
            flex-direction: column;
            padding: 0; 
        }
        #home-screen-pages-container {
            flex-grow: 1; 
            width: 100%;
            overflow: hidden; 
            position: relative;
        }
        #home-screen-pages {
            display: flex;
            width: 200%; 
            height: 100%;
            transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1); 
        }
        .home-screen-page {
            width: 50%; 
            height: 100%;
            padding: 20px;
            padding-top: calc(20px + env(safe-area-inset-top));
            padding-bottom: 0; 
            box-sizing: border-box;
            display: flex;
            flex-direction: column;
            align-items: center;
        }
        #home-screen-pagination {
            display: flex;
            justify-content: center;
            gap: 8px;
            padding: 10px 0;
            padding-bottom: calc(10px + env(safe-area-inset-bottom) / 2);
            flex-shrink: 0;
        }
        .pagination-dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background-color: rgba(255, 255, 255, 0.4);
            transition: all 0.3s ease;
        }
        .pagination-dot.active {
            background-color: white;
            transform: scale(1.1);
        }
.draggable-button-item {
    padding: 8px 12px;
    background-color: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    cursor: grab;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s, box-shadow 0.2s;
    user-select: none;
}
.draggable-button-item:active {
    cursor: grabbing;
}
.draggable-button-item svg {
    width: 18px;
    height: 18px;
    stroke-width: 2;
}
.draggable-button-item.dragging {
    opacity: 0.5;
    background-color: #e0e0e0;
}
.draggable-button-item.drag-over {
    background-color: #d0eaff;
    box-shadow: 0 0 0 2px var(--accent-color);
}
.draggable-button-item.dragging {
    opacity: 0.5;
    background-color: #e0e0e0;
    position: relative; 
    z-index: 10;
}
#button-order-editor {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}
.scrollable-content-preview {
    max-height: 35vh;
    overflow-y: auto;
    background-color: #f0f2f5;
    padding: 10px 15px;
    border-radius: 8px;
    text-align: left;
    white-space: pre-wrap; 
    border: 1px solid var(--border-color);
}
.wizard-step {
    display: none; 
    flex-direction: column;
    width: 100%;
    height: 100%;
}
.wizard-step.active {
    display: flex; 
}
#data-clear-char-list .clear-posts-item,
#data-clear-type-list .clear-posts-item {
    padding: 12px 18px;
}
#data-clear-wizard-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
#data-clear-wizard-modal .modal-header label {
    font-size: 14px;
    font-weight: normal;
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}
#tutorial-screen {
    background-color: #f0f2f5;
}
#phone-screen.dark-mode #tutorial-screen {
    background-color: #000000;
}
.entry-content-container {
    display: none; 
    margin-top: 8px; 
}
.toggle-content-btn {
    background: none;
    border: 1px solid #ccc;
    color: var(--text-secondary);
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 5px;
    cursor: pointer;
}
#update-notice-modal {
    position: fixed; 
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    display: none; 
    align-items: center;
    justify-content: center;
    z-index: 2000; 
    opacity: 0;
    transition: opacity 0.3s ease;
}
#update-notice-modal.visible {
    display: flex;
    opacity: 1;
}
.update-notice-content {
    background-color: var(--secondary-bg);
    width: 300px;
    border-radius: 14px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}
#update-notice-modal.visible .update-notice-content {
    transform: scale(1);
}
.update-notice-body {
    padding: 20px;
    font-size: 15px;
    line-height: 1.6;
    color: #333;
    max-height: 60vh; 
    overflow-y: auto; 
}
.update-notice-footer {
    border-top: 1px solid #dbdbdb;
    display: flex;
}
.update-notice-footer button {
    flex: 1;
    background: none;
    border: none;
    padding: 14px;
    font-size: 17px;
    cursor: pointer;
    color: var(--accent-color);
}
.update-notice-footer button:first-child {
    border-right: 1px solid #dbdbdb;
    font-weight: 600;
}
#message-actions-modal .custom-modal-footer {
    flex-wrap: wrap; 
    padding: 10px;   
    gap: 10px;       
    justify-content: flex-start; 
}
#message-actions-modal .custom-modal-footer button:not(#cancel-message-action-btn) {
    flex-grow: 1;
    flex-basis: 75px; 
    border: none;
    background-color: #f0f2f5;
    border-radius: 8px;
    padding: 12px 5px; 
    font-size: 16px;
    font-weight: 500;
}
#message-actions-modal #cancel-message-action-btn {
    width: 100%; 
    flex-basis: 100%; 
    margin-top: 8px;
    border-radius: 8px;
    background-color: #f0f2f5;
    font-weight: 600;
}
input, textarea, select {
    font-size: 16px !important;
}
#favorite-diary-btn.active svg {
    fill: #ffc107; 
    color: #ffc107;
}
.favorite-item-card .diary-title {
    font-weight: 600;
    display: block;
    margin-bottom: 8px;
    font-size: 15px;
}
.favorite-item-card .diary-content-preview {
    font-size: 13px;
    opacity: 0.8;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3; 
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.favorite-item-card .diary-content-preview {
    font-size: 13px;
    opacity: 0.8;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3; 
    -webkit-box-orient: vertical;
    overflow: hidden;
}
#npc-list-view {
    background-color: #f0f2f5;
}
#phone-screen.dark-mode #npc-list-view {
    background-color: #000;
}
#chat-lock-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px; 
}
.spectator-actions-container {
    display: flex;
    gap: 12px; 
    align-items: center;
}
#chat-lock-content .lock-action-btn.secondary {
    background-color: transparent; 
    color: var(--accent-color);   
    border: 1px solid var(--accent-color); 
    padding: 8px 18px; 
    font-size: 14px;
}
.spectator-actions-container .lock-action-btn.secondary svg {
    width: 20px;  
    height: 20px; 
    stroke: currentColor; 
}
.music-player-window {
    position: relative;
    background-color: rgba(255, 255, 255, 0.75);
}
.music-player-window::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: var(--music-bg-image);
    background-size: cover;
    background-position: center;
    filter: blur(15px) brightness(0.8);
    z-index: -1;
    border-radius: inherit; 
    transition: background-image 0.5s ease-in-out;
}
.music-player-window.bg-clear::before {
    filter: none;
}
#toggle-blur-btn {
    background: none;
    border: none;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    color: #333;
    width: 44px;
    height: 44px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s ease;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.05);
}
#toggle-blur-btn.active {
    background-color: var(--accent-color); 
    color: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.music-player-window.fullscreen {
    width: 100%;
    height: 100%;
    max-height: 100%; 
    border-radius: 0; 
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1); 
}
#music-player-overlay.fullscreen-active {
    padding-top: 0;
    align-items: stretch; 
}
#toggle-fullscreen-btn {
    background: none;
    border: none;
    font-size: 22px; 
    cursor: pointer;
    color: #555;
    padding: 5px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}
#toggle-fullscreen-btn:hover {
    color: #000;
}
#toggle-fullscreen-btn .icon-minimize {
    display: none;
}
.music-player-window.fullscreen #toggle-fullscreen-btn .icon-maximize {
    display: none;
}
.music-player-window.fullscreen #toggle-fullscreen-btn .icon-minimize {
    display: block;
}
#music-player-avatar-display {
    display: none; 
    width: 100%;
    padding: 15px 20px;
    box-sizing: border-box;
    justify-content: space-between; 
    align-items: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1); 
    margin-bottom: 10px;
}
.music-player-window.fullscreen #music-player-avatar-display.visible {
    display: flex;
}
.participant-display-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
#show-avatars-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    display: none; 
    align-items: center;
    justify-content: center;
    opacity: 0.6;
    transition: opacity 0.2s;
}
.music-player-window.fullscreen #show-avatars-btn {
    display: flex;
}
#show-avatars-btn:hover {
    opacity: 1;
}
#show-avatars-btn.active {
    opacity: 1;
}
.douban-settings-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.douban-settings-item label {
    margin-bottom: 0;
    flex-grow: 1; 
}
.douban-settings-controls {
    display: flex;
    align-items: center;
    gap: 8px; 
    flex-shrink: 0; 
}
.douban-settings-controls input {
    width: 60px;
    text-align: center;
}
#time-zone-search-input {
    width: 100%;
    padding: 10px 12px;
    margin-bottom: 8px; 
    border: 1px solid var(--border-color);
    border-radius: 6px;
    box-sizing: border-box;
    font-size: 16px; 
}
#phone-screen.dark-mode #time-zone-search-input {
    background-color: #1c1c1e;
    color: #ffffff;
    border-color: #38383a;
}
#werewolf-game-screen {
    background-color: #2c2c2e; 
    color: white;
}
#werewolf-player-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 15px;
    padding: 15px;
    flex-shrink: 0;
    border-bottom: 1px solid #444;
}
.werewolf-player-avatar {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    position: relative;
}
.werewolf-player-avatar img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 2px solid #888;
    transition: all 0.3s;
}
.werewolf-player-avatar .player-name {
    font-size: 12px;
    font-weight: 500;
    text-shadow: 0 1px 2px black;
}
.werewolf-player-avatar.dead img {
    filter: grayscale(100%);
    border-color: #ff3b30;
}
.werewolf-player-avatar.dead .player-name {
    color: #ff3b30;
    text-decoration: line-through;
}
#werewolf-log {
    padding: 15px;
    background: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.werewolf-log-entry {
    background-color: rgba(255, 255, 255, 0.08);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.6;
}
.werewolf-log-entry.system {
    text-align: center;
    color: #ffc107;
    font-style: italic;
    background-color: rgba(255, 193, 7, 0.1);
}
.werewolf-log-entry .speaker {
    font-weight: bold;
}
#werewolf-action-bar {
    padding: 10px 15px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
    background-color: rgba(0,0,0,0.3);
    flex-shrink: 0;
    text-align: center;
}
#werewolf-next-step-btn {
    width: 100%;
}
#werewolf-role-card {
    background: linear-gradient(135deg, #4a4a4a, #2a2a2a);
    border: 1px solid #666;
    border-radius: 12px;
    padding: 20px;
    color: white;
}
#werewolf-role-name {
    font-size: 22px;
    font-weight: bold;
    color: #ffc107;
    margin-bottom: 10px;
}
#werewolf-role-description {
    font-size: 14px;
    line-height: 1.6;
}
.werewolf-selection-item {
    display: flex;
    align-items: center;
    padding: 12px 18px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
}
.werewolf-selection-item.selected {
    background-color: var(--accent-color);
    color: white;
}
.werewolf-selection-item img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 15px;
}
.werewolf-selection-item .name {
    font-weight: 500;
}
        #werewolf-game-screen #werewolf-action-bar {
            background-color: rgba(0, 0, 0, 0.3); 
            border-top: 1px solid rgba(255, 255, 255, 0.1); 
            padding: 10px 15px; 
            padding-bottom: calc(10px + env(safe-area-inset-bottom)); 
        }
        #werewolf-game-screen #werewolf-user-input {
            flex-grow: 1; 
            border: none;
            padding: 10px 15px;
            border-radius: 20px; 
            background-color: rgba(255, 255, 255, 0.1); 
            color: #f0f0f0; 
            font-size: 16px; 
            resize: none; 
            height: 40px; 
            box-sizing: border-box;
        }
        #werewolf-game-screen #werewolf-user-input::placeholder {
            color: #8d8d92; 
        }
        #werewolf-game-screen #input-actions-wrapper button {
            height: 40px;
            padding: 0 15px;
            border-radius: 20px;
            border: none;
            color: white;
            font-weight: 600;
            cursor: pointer;
            flex-shrink: 0; 
        }
        #werewolf-game-screen #werewolf-wait-reply-btn {
            background-color: #555; 
        }
        #werewolf-game-screen #werewolf-finish-speech-btn {
            background-color: #c62828; 
        }
#sticker-search-container {
    padding: 10px 15px; 
    flex-shrink: 0; 
    border-bottom: 1px solid var(--border-color); 
    background-color: var(--secondary-bg); 
}
#sticker-search-input {
    width: 100%;
    padding: 10px 15px;
    font-size: 16px; 
    border: 1px solid var(--border-color);
    border-radius: 18px; 
    background-color: #f0f2f5; 
    box-sizing: border-box;
    outline: none; 
    -webkit-appearance: none; 
}
#sticker-search-input:focus {
    border-color: var(--accent-color); 
    background-color: var(--secondary-bg); 
}
#phone-screen.dark-mode #sticker-search-input {
    background-color: #2c2c2e;
    color: #f0f0f0;
    border-color: #38383a;
}
#phone-screen.dark-mode #sticker-search-input:focus {
    background-color: #38383a;
}
.message-bubble .content {
    transition: background-color 0.5s ease-out;
}
.message-bubble.highlighted .content {
    background-color: rgba(0, 123, 255, 0.2) !important;
}
.loader-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px 0;
    width: 100%;
    height: 44px; 
    box-sizing: border-box;
}
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(0, 0, 0, 0.1); 
    border-top-color: var(--accent-color); 
    border-radius: 50%;
    animation: spin 1s linear infinite; 
}
#phone-screen.dark-mode .spinner {
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: #fff; 
}
#reading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 150; 
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none; 
    display: none; 
}
#reading-window {
    width: 90%;
    max-width: 340px;
    height: 60vh;
    max-height: 480px;
    background-color: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 18px;
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.18);
    display: flex;
    flex-direction: column;
    pointer-events: auto; 
    position: absolute; 
    transition: transform 0.3s ease, opacity 0.3s ease, visibility 0s 0.3s; 
}
#phone-screen.dark-mode #reading-window {
    background-color: rgba(40, 40, 42, 0.7);
}
.reading-header {
    cursor: move;
    user-select: none;
    -webkit-user-select: none;
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
    gap: 10px;
    flex-wrap: nowrap;
}
#reading-title {
    font-weight: 600;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.reading-controls {
    flex-shrink: 0;
}
.reading-controls button {
    background: none; border: none; color: var(--text-secondary); padding: 4px 8px;
    border-radius: 4px; cursor: pointer; font-size: 14px; transition: background-color 0.2s;
}
.reading-controls button:hover {
    background-color: rgba(0,0,0,0.1);
}
#minimize-reading-btn {
    font-weight: bold; font-size: 16px; line-height: 1;
}
#reading-window.minimized {
    transform: scale(0.8); 
    opacity: 0;           
    pointer-events: none; 
    visibility: hidden;   
}
#reading-restore-btn {
    position: absolute;
    top: 50%;
    right: 15px; 
    transform: translateY(-50%); 
    width: 50px; 
    height: 50px;
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px; 
    cursor: move; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    pointer-events: auto; 
    z-index: 160; 
    transition: transform 0.2s; 
}
#reading-restore-btn:active {
    transform: translateY(-50%) scale(0.95);
}
#phone-screen.dark-mode #reading-restore-btn {
    background-color: rgba(50, 50, 52, 0.8);
}
#reading-content {
    flex-grow: 1; 
    overflow-y: auto; 
    padding: 15px;
    font-size: 15px; 
    line-height: 1.8;
    white-space: pre-wrap; 
    word-break: break-word;  
}
.reading-footer {
    flex-shrink: 0; display: flex; justify-content: space-between; align-items: center;
    padding: 12px 15px; border-top: 1px solid var(--border-color);
}
#page-indicator {
    font-size: 14px; 
    color: var(--text-secondary);
    cursor: pointer; 
    transition: color 0.2s;
}
#page-indicator:hover {
    color: var(--accent-color); 
}
.reading-footer button {
    padding: 6px 15px; border-radius: 15px; border: none;
    background-color: var(--accent-color); color: white; cursor: pointer;
}
.reading-footer button:disabled {
    background-color: #ccc;
}
#phone-screen.dark-mode .reading-footer button:disabled {
    background-color: #555;
}
#reading-library-search-container {
    padding: 10px 15px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0; 
}
#reading-library-search-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 16px; 
    -webkit-appearance: none; 
}
#phone-screen.dark-mode #reading-library-search-input {
    background-color: #2c2c2e;
    color: #f0f0f0;
    border-color: #38383a;
}
.voice-message-body {
    display: flex;
    align-items: center;
    cursor: pointer;
    min-width: 80px;
    max-width: 220px;
    padding: 8px 12px;
}
.message-bubble.user .voice-message-body {
    color: #1a3d00;
    flex-direction: row-reverse;
}
.message-bubble.ai .voice-message-body {
    color: var(--text-primary);
}
.voice-play-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background-color: rgba(0, 0, 0, 0.1);
    color: currentColor;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background-color 0.2s;
}
.voice-play-btn:hover {
    background-color: rgba(0, 0, 0, 0.2);
}
.voice-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(0, 0, 0, 0.2);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: none; 
    margin: 4px;
}
.voice-duration {
    font-size: 14px;
    font-weight: 500;
    margin: 0 10px;
    flex-shrink: 0;
}
.message-bubble.user .voice-duration {
    color: #3e6224;
}
#product-category-tabs {
    display: flex;
    overflow-x: auto; 
    padding: 10px 15px 0 15px;
    flex-shrink: 0;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--secondary-bg);
    -ms-overflow-style: none;  
    scrollbar-width: none;  
}
#product-category-tabs::-webkit-scrollbar {
    display: none; 
}
.product-category-tab {
    padding: 8px 16px;
    cursor: pointer;
    border: none;
    background-color: transparent;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent; 
    margin-bottom: -1px; 
    transition: all 0.2s ease-in-out;
    white-space: nowrap; 
    flex-shrink: 0; 
}
.product-category-tab.active {
    color: #FF5722; 
    border-bottom-color: #FF5722; 
    font-weight: 600; 
}
#phone-screen.dark-mode .product-category-tab.active {
    color: #FF8A65; 
    border-bottom-color: #FF8A65;
}
#product-category-tabs {
    overflow-x: auto;      
    white-space: nowrap;   
    -webkit-overflow-scrolling: touch; 
    scrollbar-width: none;             
    -ms-overflow-style: none;          
}
#product-category-tabs::-webkit-scrollbar {
    display: none; 
}
.product-category-tab {
    flex-shrink: 0;
}
        #shopping-screen.management-mode .product-item {
            cursor: pointer;
        }
        #shopping-screen.management-mode .product-management-overlay {
            display: none;
        }
        #shopping-screen.management-mode .product-item::before {
            content: '';
            position: absolute;
            top: 10px;
            right: 10px;
            width: 22px;
            height: 22px;
            border: 2px solid #ccc;
            border-radius: 50%;
            background-color: rgba(255, 255, 255, 0.7);
            transition: all 0.2s ease;
            z-index: 6; 
        }
        #shopping-screen.management-mode .product-item.selected::before {
            background-color: var(--accent-color);
            border-color: var(--accent-color);
            content: '✔';
            color: white;
            font-size: 14px;
            text-align: center;
            line-height: 22px;
        }
        #shopping-screen.management-mode .product-item:not(.selected) {
            opacity: 0.8;
        }
        #shopping-action-bar {
            position: absolute;
            bottom: 0;
            left: 0;
            right: 0;
            width: auto;
            padding: 10px 15px;
            padding-bottom: calc(10px + env(safe-area-inset-bottom));
            background-color: rgba(247, 247, 247, 0.9);
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            border-top: 1px solid var(--border-color);
            box-sizing: border-box;
            z-index: 5;
            display: none; 
            justify-content: space-between;
            align-items: center;
        }
        #shopping-action-bar .select-all-label {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 16px;
            color: var(--text-primary);
            cursor: pointer;
        }
        #shopping-action-bar .action-bar-btn {
            padding: 10px 25px;
            border-radius: 20px;
            border: none;
            font-size: 15px;
            font-weight: 600;
            cursor: pointer;
            background-color: #ff3b30;
            color: white;
        }
.polaroid-widget-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 30px; 
    flex-shrink: 0;
    margin-top: 20px; 
}
.polaroid-photos {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px; 
}
.polaroid-photo {
    background-color: white;
    padding: 8px 8px 15px 8px; 
    border-radius: 4px;
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.2); 
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s;
    width: 80px; 
    flex-shrink: 0;
}
.polaroid-photo:hover {
    transform: scale(1.1) rotate(0deg) !important; 
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
    z-index: 10; 
}
.polaroid-photo img {
    width: 100%;
    display: block;
    aspect-ratio: 1 / 1; 
    object-fit: cover;
}
.polaroid-widget-title {
    margin-top: 15px;
    font-size: 13px;
    font-weight: 500;
    color: white; 
    text-shadow: 0 1px 3px rgba(0,0,0,0.4); 
}
#page-2-app-container {
    display: grid;
    grid-template-columns: 155px 1fr; 
    gap: 15px;
    width: 100%;
    padding-top: 20px;
    align-items: start;
}
.app-subgrid {
    display: grid;
    grid-template-columns: 1fr 1fr; 
    gap: 15px; 
}
.large-widget {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px; 
}
.large-widget-img {
    width: 100%;
    aspect-ratio: 1 / 1; 
    border-radius: 22px; 
    object-fit: cover;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}
.large-widget-label {
    color: white;
    font-size: 13px;
    font-weight: 500;
    text-shadow: 0 1px 3px rgba(0,0,0,0.4);
}
.small-widget {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.small-widget-icon-wrapper {
    width: 55px;
    height: 55px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.small-widget-img {
    width: 100%;     
    height: 100%;    
    object-fit: cover; 
    border-radius: 14px; 
}
.small-widget-label {
    color: white;
    font-size: 13px;
    font-weight: 500;
    text-shadow: 0 1px 3px rgba(0,0,0,0.4);
}
#page-2-app-container .small-widget-label {
    color: #000 !important;       
    text-shadow: none !important; 
}
#phone-screen.dark-mode #char-diary-list .list-item .item-title,
#phone-screen.dark-mode #char-diary-list .list-item .item-content,
#phone-screen.dark-mode #char-memo-list .list-item .item-title,
#phone-screen.dark-mode #char-memo-list .list-item .item-content,
#phone-screen.dark-mode #char-browser-history .char-browser-item .title,
#phone-screen.dark-mode #char-usage-list .usage-item-name,
#phone-screen.dark-mode #char-music-list .music-item-name {
    color: #f0f0f0; 
}
#phone-screen.dark-mode #char-diary-list .list-item .item-content,
#phone-screen.dark-mode #char-browser-history .char-browser-item .url,
#phone-screen.dark-mode #char-usage-list .usage-item-category,
#phone-screen.dark-mode #char-music-list .music-item-artist {
    color: #a0a0a0; 
}
#phone-screen.dark-mode #char-diary-detail-content .diary-highlight {
    background-color: rgba(255, 223, 100, 0.2); 
    color: #FFD700; 
}
#phone-screen.dark-mode #char-diary-detail-content .diary-underline {
    border-bottom-color: #FF85B3; 
}
#phone-screen.dark-mode #char-diary-detail-content .diary-emphasis {
    color: #FF85B3; 
}
#phone-screen.dark-mode #char-diary-detail-content .diary-handwritten,
#phone-screen.dark-mode #char-diary-detail-content .diary-messy {
    color: #dcdcdc; 
}
#phone-screen.dark-mode .spoiler {
    background-color: #444; 
    color: #444;           
}
#phone-screen.dark-mode .spoiler:hover, 
#phone-screen.dark-mode .spoiler:active {
    background-color: #555; 
    color: #fff;           
}
#avatar-frame-modal .frame-grid.management-mode .frame-item {
    cursor: pointer;
}
#avatar-frame-modal .frame-grid.management-mode .frame-item:has(.delete-btn)::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    width: calc(100% + 4px);
    height: calc(100% + 4px);
    border: 3px solid transparent;
    border-radius: 12px;
    box-sizing: border-box;
    transition: border-color 0.2s;
    pointer-events: none; 
}
#avatar-frame-modal .frame-grid.management-mode .frame-item.selected::after {
    border-color: var(--accent-color);
}
#frame-action-bar {
    display: none; 
    flex-shrink: 0;
    padding: 10px 15px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
    background-color: rgba(247, 247, 247, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid var(--border-color);
    justify-content: space-between;
    align-items: center;
}
#frame-action-bar .select-all-label {
    font-size: 16px;
    color: var(--text-primary);
    cursor: pointer;
}
#frame-action-bar .action-bar-btn {
    padding: 10px 25px;
    border-radius: 20px;
    border: none;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    background-color: #ff3b30;
    color: white;
}
#favorite-memo-btn.active svg {
    fill: #ffc107; 
    color: #ffc107;
}
.favorite-item-card .memo-title {
    font-weight: 600;
    display: block;
    margin-bottom: 8px;
    font-size: 15px;
}
#chat-interface-screen .back-btn {
    position: relative; 
}
.back-btn .unread-indicator {
    position: absolute;
    top: -2px;
    right: -10px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background-color: #ff3b30;
    color: white;
    font-size: 11px;
    font-weight: bold;
    line-height: 18px;
    text-align: center;
    border-radius: 9px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
    display: none;
    z-index: 20; 
    transform: scale(0.8);
}
#phone-screen.dark-mode .back-btn .unread-indicator {
    border: 1px solid #333;
}
#favorite-article-btn.active svg {
    fill: #ffc107; 
    color: #ffc107;
}
.modal,
#custom-modal-overlay,
#transfer-modal,
#battery-alert-modal,
#photo-viewer-modal,
#character-profile-modal,
#update-notice-modal {
    background-color: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}
#character-profile-modal .jottings .label {
    display: flex !important;
}
#total-image-size-display,
#token-count-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 15px;
    padding: 8px 12px;
    background-color: #f0f2f5;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

#phone-screen.dark-mode #total-image-size-display,
#phone-screen.dark-mode #token-count-display {
    background-color: #2c2c2e; 
    border-color: #38383a;
}

#total-image-size-display #image-size-label,
#token-count-display #token-count-label {
    font-weight: 500;
}

#total-image-size-display #image-size-value,
#token-count-display #token-count-value {
    font-weight: 600;
    color: var(--text-primary);
}

/* ▼▼▼ RealImag多图布局样式 ▼▼▼ */
/* 多图容器 */
.post-images-grid {
    display: grid;
    gap: 8px;  /* 图片之间的固定间距 */
    margin-top: 10px;
}

/* 单张图片 - 大图，等比例缩放 */
.post-images-grid.grid-1 {
    grid-template-columns: 1fr;
    justify-items: start;
}
.post-images-grid.grid-1 .realimag-image,
.post-images-grid.grid-1 .naiimag-image {
    max-width: 280px;
    max-height: 280px;
    width: auto;
    height: auto;
}

/* 2张图片 - 横向并排，等比例缩放 */
.post-images-grid.grid-2 {
    grid-template-columns: auto auto;
    gap: 5px;
    justify-content: start;
}
.post-images-grid.grid-2 .realimag-image,
.post-images-grid.grid-2 .naiimag-image {
    max-width: 135px;
    max-height: 135px;
    width: auto;
    height: auto;
}

/* 3张图片 - 横向排列，等比例缩放 */
.post-images-grid.grid-3 {
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
}
.post-images-grid.grid-3 .realimag-image {
    max-width: 130px;
    max-height: 130px;
    width: auto;
    height: auto;
}

/* 4张图片 - 2x2方格，等比例缩放 */
.post-images-grid.grid-4 {
    grid-template-columns: repeat(2, 1fr);
    gap: 5px;
}
.post-images-grid.grid-4 .realimag-image {
    max-width: 195px;
    max-height: 195px;
    width: auto;
    height: auto;
}

/* 5张图片 - 上2下3，等比例缩放 */
.post-images-grid.grid-5 {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 5px;
}
.post-images-grid.grid-5 .realimag-image:nth-child(1),
.post-images-grid.grid-5 .realimag-image:nth-child(2) {
    grid-column: span 3;
    max-width: 195px;
    max-height: 195px;
    width: auto;
    height: auto;
}
.post-images-grid.grid-5 .realimag-image:nth-child(n+3) {
    grid-column: span 2;
    max-width: 130px;
    max-height: 130px;
    width: auto;
    height: auto;
}

/* 6张图片 - 3x2网格，等比例缩放 */
.post-images-grid.grid-6 {
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
}
.post-images-grid.grid-6 .realimag-image {
    max-width: 130px;
    max-height: 130px;
    width: auto;
    height: auto;
}

/* 7-9张图片 - 3x3九宫格，等比例缩放 */
.post-images-grid.grid-7,
.post-images-grid.grid-8,
.post-images-grid.grid-9 {
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
}
.post-images-grid.grid-7 .realimag-image,
.post-images-grid.grid-8 .realimag-image,
.post-images-grid.grid-9 .realimag-image {
    max-width: 130px;
    max-height: 130px;
    width: auto;
    height: auto;
}

/* 图片基础样式 - 完整显示，等比例缩放，不裁剪 */
.post-images-grid .realimag-image,
.post-images-grid .naiimag-image {
    object-fit: contain;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s;
}
.post-images-grid .realimag-image:hover,
.post-images-grid .naiimag-image:hover {
    transform: scale(1.05);
}
/* ▲▲▲ RealImag多图布局样式结束 ▲▲▲ */
/* 【修复】解决夜间模式下浏览器和足迹页面文字颜色不正确的问题 */
#phone-screen.dark-mode #browser-content {
    color: #dcdcdc; /* 浏览器文章正文颜色 */
}
#phone-screen.dark-mode #browser-content .article-title {
    color: #ffffff; /* 浏览器文章标题颜色 */
}
#phone-screen.dark-mode #browser-content .article-meta {
    color: #8d8d92; /* 浏览器文章元数据（来源）颜色 */
    border-bottom-color: #38383a;
}
#phone-screen.dark-mode .amap-item-title {
    color: #f0f0f0; /* 足迹 - 地点标题颜色 */
}
#phone-screen.dark-mode .amap-item-comment {
    color: #dcdcdc; /* 足迹 - 评论内容颜色 */
}
/* 【修复】CPhone 浏览器详情页在夜间模式下的文字颜色 */
#phone-screen.dark-mode #char-article-content {
    color: #dcdcdc; /* 设置为浅灰色，使其在深色背景上可见 */
}
#char-article-content {
    color: #333; /* CPhone 浏览器文章正文 - 白天模式默认颜色 */
}

#open-nai-gallery-btn svg path {
    fill: currentColor;
    stroke: none;
}

#nai-gallery-panel {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 65%; /* 画廊面板高度 */
    background-color: rgba(242, 242, 247, 0.85);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-top: 1px solid var(--border-color);
    border-radius: 20px 20px 0 0;
    z-index: 200;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    visibility: hidden;
}

#nai-gallery-panel.visible {
    transform: translateY(0);
    visibility: visible;
}

#nai-gallery-panel-header {
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    border-bottom: 1px solid var(--border-color);
}
#nai-gallery-panel-header .title {
    font-weight: 600;
}
#nai-gallery-panel-header .panel-btn {
    font-size: 16px;
    padding: 5px 10px;
    cursor: pointer;
    color: var(--accent-color);
}

#nai-gallery-grid {
    flex-grow: 1;
    overflow-y: auto;
    padding: 15px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 15px;
}

.nai-gallery-item {
    position: relative;
    display: flex;
    flex-direction: column; 
    align-items: center;    
    gap: 6px;               
    cursor: pointer;
    /* 移除了背景、阴影等属性，因为它们将移到子元素上 */
}
/* 新增：NAI的图片容器，样式模仿 .sticker-image-container */
.nai-image-container {
    position: relative; /* 用于定位内部的 controls */
    width: 100%;
    aspect-ratio: 1 / 1;
    background-color: white;
    border-radius: 10px;
    background-size: contain; /* 核心修改：保持图片完整 */
    background-repeat: no-repeat;
    background-position: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    overflow: hidden; /* 隐藏溢出的 controls */
}

/* 新增：NAI的文字标签，样式模仿 .sticker-name */
.nai-gallery-name {
    font-size: 12px;
    color: var(--text-secondary);
    width: 100%;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.nai-image-container .nai-gallery-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 4px;
    background: rgba(0,0,0,0.4);
    display: none; /* 仅在管理模式下显示 */
    justify-content: space-around;
    align-items: center;
}

.nai-gallery-controls button {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 2px;
}
.nai-gallery-controls svg {
    width: 16px;
    height: 16px;
}

#nai-gallery-grid.management-mode .nai-gallery-controls {
    display: flex;
}

#nai-gallery-grid.management-mode .nai-gallery-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 4px solid transparent;
    border-radius: 10px;
    box-sizing: border-box;
    transition: border-color 0.2s;
    pointer-events: none; 
}

#nai-gallery-grid.management-mode .nai-gallery-item.selected::after {
    border-color: var(--accent-color);
}

#nai-gallery-action-bar {
    display: none; 
    flex-shrink: 0;
    padding: 10px 15px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
    background-color: rgba(247, 247, 247, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid var(--border-color);
    justify-content: space-between; 
    align-items: center;
    gap: 10px; /* <-- 新增了间距 */
}

#nai-gallery-action-bar .select-all-label {
    font-size: 16px;
    color: var(--text-primary);
    cursor: pointer;
    flex-grow: 1; /* <-- 新增，让“全选”占据剩余空间 */
}
#nai-gallery-action-bar .action-bar-btn {
    padding: 10px 15px; /* <-- 修改了内边距 */
    border-radius: 20px;
    border: none;
    font-size: 14px; /* <-- 修改了字号 */
    font-weight: 600;
    cursor: pointer;
    background-color: #ff3b30;
    color: white;
    flex-shrink: 0; /* <-- 新增，防止按钮被压缩 */
}

/* 适配暗黑模式 */
#phone-screen.dark-mode #nai-gallery-panel {
    background-color: rgba(28, 28, 30, 0.85);
    border-top-color: #38383a;
}
#phone-screen.dark-mode #nai-gallery-panel-header {
    border-bottom-color: #38383a;
}
#phone-screen.dark-mode #nai-gallery-grid {
    background-color: #000;
}
#phone-screen.dark-mode #nai-gallery-action-bar {
    background-color: rgba(28, 28, 30, 0.9);
    border-top-color: #38383a;
}
#phone-screen.dark-mode #nai-gallery-action-bar .select-all-label {
    color: #f0f0f0;
}
/* --- NAI 图片重新生成按钮 (V3 - 悬停显示修复版) --- */
.nai-image-wrapper {
    position: relative; /* 关键：必须有这行，用于按钮定位！ */
    display: inline-block;
    line-height: 0;
}

.nai-regenerate-btn {
    position: absolute;
    bottom: 10px; /* 从底部偏移 10px */
    right: 10px;  /* 从右侧偏移 10px */
    width: 32px;
    height: 32px;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    
    /* 核心修复：默认设置为透明，即隐藏 */
    opacity: 0; 
    
    transition: opacity 0.2s ease-in-out;
    z-index: 5;
}

/* 核心修复：当鼠标悬停在 *图片包裹层* 上时，才显示按钮 */
.nai-image-wrapper:hover .nai-regenerate-btn {
    opacity: 0.85; /* 悬停时显示 */
}

/* 按钮本身的悬停效果（变亮） */
.nai-regenerate-btn:hover {
    opacity: 1 !important; /* 确保悬停在按钮上时更亮 */
    background-color: rgba(0, 0, 0, 0.8);
}

.nai-regenerate-btn svg {
    width: 16px;
    height: 16px;
}

/* 加载中状态 */
.nai-regenerate-btn.loading {
    pointer-events: none;
    opacity: 1; /* 加载时强制显示 */
}
.nai-regenerate-btn.loading svg {
    animation: spin 1s linear infinite;
}

/* 修复暗黑模式下的样式 */
#phone-screen.dark-mode .nai-regenerate-btn {
    background-color: rgba(30, 30, 30, 0.7);
    border-color: rgba(255, 255, 255, 0.2);
}
/* --- NAI 图片重新生成按钮 结束 --- */
/* ▼▼▼ 【新功能】手机外框样式 (374x674px 精确版) ▼▼▼ */

/* 1. 手机外框的背景 (你想要的白色) */
body.frame-mode-active {
    background-color: #f0f2f5; /* 保持白色背景 */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    overflow: hidden; 
}

/* 在暗黑模式下，背景则为浅灰色 */
body.dark-mode.frame-mode-active {
    background-color: #f0f2f5;
}

/* 2. 手机外框本身 (使用你计算的精确尺寸) */
body.frame-mode-active #phone-screen {
    /* 总宽度: 374px
      总高度: 674px
      (这会使内部内容区域精确为 350x650px)
    */
    width: 374px;
    height: 700px;
    
    /* 12px 的黑色边框 */
    border: 12px solid #ffffff;
    
    /* 适配的圆角 */
    border-radius: 54px; 
    
    /* 移除内边距 (padding) 来匹配你的计算 */
    /* padding: 0; (移除) */

    /* 覆盖全屏样式 */
    min-height: auto; 
    max-width: 100%;
    max-height: 95vh; /* 最大高度，防止溢出 */
    box-shadow: inset 0 0 0 1px #000,   
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.1);
    box-sizing: border-box; 
    position: relative; 
    overflow: hidden; 
}

/* 3. 屏幕内部的圆角遮罩 */
body.frame-mode-active #phone-screen::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    
    /* 内部圆角 (比 54px 小 12px) */
    border-radius: 42px; 
    
    /* 移除内边框，因为它不再需要 */
    /* border: 0; (移除) */
    
    pointer-events: none;
    z-index: 1000; 
    
    /* 添加一个非常细微的内阴影，模拟屏幕玻璃感 */
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.1);
}

/* 4. 模拟灵动岛 (Dynamic Island) */
body.frame-mode-active #phone-screen::after {
    content: '';
    position: absolute;
    top: 22px; 
    left: 50%;
    transform: translateX(-50%);
    /* 调整为更协调的灵动岛尺寸 (已缩小) */
    width: 100px;  /* <-- 已从 120px 减小 */
    height: 25px;  /* <-- 已从 28px 减小 */
    background-color: #000; 
    border-radius: 12.5px; /* <-- 调整圆角以保持形状 */
    z-index: 1002; 
}

/* [新增] 当手机外框激活时，等比缩小主屏幕和CPhone内容以适应屏幕 (V3 - 最终布局修复版) */
body.frame-mode-active #home-screen-pages-container,
body.frame-mode-active #char-clock-container,
body.frame-mode-active #char-app-grid {
    transform: scale(0.9);
    transform-origin: top center;
    transition: transform 0.3s ease, margin-top 0.3s ease, margin-bottom 0.3s ease; /* 添加过渡效果 */
}

/* EPhone 主屏幕的布局修正 */
body.frame-mode-active #home-screen-pages-container {
    margin-bottom: -55px;
}
body.frame-mode-active #home-screen-pagination {
    transform: scale(0.9);
}
body.frame-mode-active #desktop-dock {
    transform: scale(0.9);
    margin-bottom: -5px;
}

/* ▼▼▼ CPhone 布局的核心修正 ▼▼▼ */
body.frame-mode-active #char-clock-container {
    /* 替换默认的大间距，给一个适合框内视图的上边距 */
    margin-top: 60px;
    /* 大幅减小下边距，把下面的App图标拉上来 */
    margin-bottom: 50px;
}

body.frame-mode-active #char-app-grid {
    /* 移除之前过于激进的负边距，让它自然排列在时钟下方 */
    margin-top: 0;
}
/* ▲▲▲ 修正结束 ▲▲▲ */
#dynamic-island-content {
    position: absolute;
    top: 22px; /* 与手机外框的刘海伪元素位置完全重合 */
    left: 50%;
    transform: translateX(-50%);
    width: 120px; /* 默认宽度，与刘海一致 */
    height: 28px; /* 默认高度，与刘海一致 */
    background-color: #000;
    border-radius: 14px;
    z-index: 1003; /* 确保在刘海伪元素之上 */
    
    display: flex;
    align-items: center;
    padding: 3px;
    box-sizing: border-box;
    
    /* 核心动画：宽度、透明度的变化都带过渡效果 */
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* 默认状态：完全透明，不可见，不响应点击 */
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    overflow: hidden; /* 隐藏内部溢出的内容 */
}

/* 2. 当音乐播放时，灵动岛“展开” */
/* 规则 1: 在有框模式下，调整回刘海的位置并展开 */
body.frame-mode-active #phone-screen.dynamic-island-active #dynamic-island-content {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    width: 190px;
    top: 22px; /* 覆盖默认值，对齐刘海 */
}

/* 规则 2: 在无框模式下，在顶部展开 */
body:not(.frame-mode-active) #phone-screen.dynamic-island-active #dynamic-island-content {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    width: 190px;
    /* (这里会使用我们在第6303行设置的新top值) */
}

/* 3. 同时，隐藏掉原来的刘海伪元素，防止重叠 */
body.frame-mode-active #phone-screen.dynamic-island-active::after {
    opacity: 0;
}

/* 4. 岛内的专辑封面 */
#island-album-art {
    width: 22px; /* 高度28px - 上下各3px内边距 = 22px */
    height: 22px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 8px;
    flex-shrink: 0; /* 防止被压缩 */
}

/* 5. 歌词的容器，用于裁剪滚动文字 */
#island-lyric-container {
    flex-grow: 1; /* 占据剩余所有空间 */
    overflow: hidden; /* 【关键】裁剪掉超出部分的歌词 */
    white-space: nowrap; /* 【关键】强制歌词不换行 */
}
#island-lyric-container.center-content {
    display: flex;
    justify-content: center;
}
/* 6. 歌词文字本身 */
#island-lyric-text {
    color: #aeaeae; /* 柔和的灰色 */
    font-size: 13px;
    font-weight: 500;
    display: inline-block; /* 动画需要 */
    transition: opacity 0.2s ease-in-out;
}
/* 您可以在 L2910 附近找到 .frame-mode-active 的相关样式
   然后在这附近添加下面的新规则
*/

body.frame-mode-active #main-content-area {
    /* * 在这里修改您想要的距离。
     * 原本是 30px，您可以改成 40px 或 50px 来增大间距。
     * * 请注意：在有框模式下，整个主页被 transform: scale(0.9) 缩小了，
     * 所以您设置 50px，视觉上看起来会是 45px。
     */
    gap:10px; 
}
/* 仅在有框模式下，修改组件距离顶部的间距 */
body.frame-mode-active #main-content-area {
    /* * 原本是 20px。
     * 您可以改成 0px 来让它更靠上，
     * 或者改成 40px 来让它更靠下。
     */
    margin-top: 0px; 
}
/* 仅在有框模式下，调整【第二页】的间距 */
body.frame-mode-active .home-screen-page:nth-child(2) .polaroid-widget-container {
    
    /* 1. 修改这个来调整 [拍立得] 与 [屏幕顶部] 的距离 (原为 20px) */
    /* 您可以改成 0px 或 10px 来让它更靠上 */
    margin-top: 0px;

    /* 2. 修改这个来调整 [拍立得] 与 [下方应用/小组件] 的距离 (原为 30px) */
    /* 您可以改成 40px 或 50px 来增大它们之间的间距 */
    margin-bottom: 10px;
}
/* 【修复】在有框模式下，增加聊天页面头部的顶部内边距，以避开灵动岛 */
body.frame-mode-active #chat-interface-screen > .header {
    /* * 灵动岛区域大约在 22px + 25px = 47px 结束。
     * 我们可以设置 55px 或 60px 来给它留出一些呼吸空间。
     */
    padding-top: 48px !important; 
}
body:not(.frame-mode-active) #phone-screen.dynamic-island-active #chat-interface-screen > .header {
    padding-top: 48px !important;
}
/* --- 歌词循环滚动 (Marquee) 动画 --- */

/* 1. 默认状态：居中 (用于短歌词) */
#island-lyric-container.center-content {
    display: flex;
    justify-content: center;
}
#island-lyric-container.center-content #island-lyric-text.scrolling {
    animation: none; /* 短歌词不需要滚动 */
}
#island-lyric-container.center-content #island-lyric-text span + span {
    display: none; /* 短歌词只显示一个 */
}

/* 2. 滚动容器：内部有两个span */
#island-lyric-text.scrolling {
    /* 使用 --marquee-duration 变量作为动画时长，从JS传入 */
    animation: marquee var(--marquee-duration, 10s) linear infinite;
    display: block; /* 必须是 block 才能应用 transform */
    width: fit-content; /* 确保宽度由内容撑开 */
}

/* 3. 两个span并排 */
#island-lyric-text.scrolling span {
    display: inline-block;
    padding-right: 50px; /* 两个歌词之间的间距 */
    white-space: nowrap;
}

/* 4. 定义动画 */
@keyframes marquee {
    0% {
        transform: translateX(0%);
    }
    100% {
        /* * 滚动 50% 的宽度。
         * 因为我们的总宽度是两个 <span>，所以滚动 50% 
         * 意味着第一个 <span> 刚好完全移出，第二个 <span> 完美接上。
         */
        transform: translateX(-50%); 
    }
}

/* 【新功能】分离状态栏 / 真·全屏模式 v2.0 */

/* 当 body 标签拥有 detach-mode-active 类时，应用以下样式 */
body.detach-mode-active #phone-screen {
    /* 核心修改1：保持固定定位，但只定义三边 */
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;

    /* 核心修改2：这是最关键的一步！
       让元素的顶部从“安全区域的底部”开始，而不是屏幕的绝对顶部。
       env(safe-area-inset-top) 会自动获取刘海或状态栏的高度。*/
    top: env(safe-area-inset-top);

    /* 核心修改3：移除固定的 height 属性，让 top 和 bottom 自动决定高度 */
    height: auto;
    width: auto; /* 同样移除固定的 width */

    /* 移除手机外框样式，实现真正的全屏感 */
    border-radius: 0;
    border: none;
    box-shadow: none;

    /* 其他布局属性保持不变 */
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background-color: var(--secondary-bg);
}

/* 在此模式下，隐藏模拟的刘海和屏幕圆角遮罩，因为我们要显示物理的 */
body.detach-mode-active #phone-screen::after,
body.detach-mode-active #phone-screen::before {
    display: none;
}
/* 【全局修复】将Dock栏和分页点的位置固定在更低的位置，忽略底部安全区 */
#home-screen-pagination {
    /* 移除 calc 和 env() */
    padding-bottom: 10px;
}

#desktop-dock {
    /* 移除 calc 和 env() */
    margin-bottom: 20px;
}
/* ======================================= */
/* ▼▼▼ 【新功能】简洁聊天界面 (Minimal Chat UI) ▼▼▼ */
/* ======================================= */

/* 1. 默认隐藏“+”号展开按钮 */
#chat-expand-btn {
    display: none;
    flex-shrink: 0;
    width: 40px; /* 与发送按钮同高 */
    height: 40px;
    font-size: 28px;
    font-weight: 300;
    line-height: 38px; /* 垂直居中 */
    padding: 0;
    background-color: var(--secondary-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease, background-color 0.2s, color 0.2s;
}

/* 2. 当简洁模式开启时 (body上会有这个class) */
body.minimal-chat-ui-active #chat-input-actions-top {
    /* 默认隐藏工具栏 */
    display: none;
}
body.minimal-chat-ui-active #chat-input-main-row {
    /* 确保“+”按钮和输入框底对齐 */
    align-items: flex-end;
}
body.minimal-chat-ui-active #chat-expand-btn {
    /* 显示“+”按钮 */
    display: flex;
    justify-content: center;
    align-items: center;
}
body.minimal-chat-ui-active #chat-input {
    /* 修复“+”按钮出现后，输入框没有自动适应宽度的问题 */
    flex-grow: 1;
}

/* 3. 当用户点击“+”号，工具栏展开时 (body上会临时添加这个class) */
body.minimal-chat-ui-active.chat-actions-expanded #chat-input-actions-top {
    /* 重新显示工具栏 */
    display: flex;
}
body.minimal-chat-ui-active.chat-actions-expanded #chat-expand-btn {
    /* “+”号旋转45度变成“x”号 */
    transform: rotate(45deg);
    background-color: #f0f2f5;
    color: #8a8a8a;
}
#phone-screen.dark-mode body.minimal-chat-ui-active.chat-actions-expanded #chat-expand-btn {
    background-color: #3e3e42;
    color: #8d8d92;
}

/* 4. 暗黑模式下的“+”按钮 */
#phone-screen.dark-mode #chat-expand-btn {
    background-color: #3e3e42;
    color: #f0f0f0;
    border: 1px solid #38383a;
}
/* ▲▲▲ 简洁聊天界面样式结束 ▲▲▲ */


/* 1. 当简洁模式开启 (且工具栏折叠时)，减小聊天列表的底部内边距 */
body.minimal-chat-ui-active #chat-interface-screen #chat-messages {
    /* 原本是 150px，我们把它缩小到 80px，刚好容纳单行输入框 */
    padding-bottom: calc(80px + env(safe-area-inset-bottom)) !important;
    /* 确保过渡平滑 */
    transition: padding-bottom 0.3s ease;
}

/* 2. 当简洁模式开启 (且工具栏展开时)，恢复原来的内边距 */
body.minimal-chat-ui-active.chat-actions-expanded #chat-interface-screen #chat-messages {
    /* 恢复 150px，为展开的图标行腾出空间 */
    padding-bottom: calc(120px + env(safe-area-inset-bottom)) !important;
}