        :root {
            --black: #111111;
            --white: #fcfcfc;
            --gray-light: rgba(0, 0, 0, 0.04);
            --gray-dark: rgba(0, 0, 0, 0.4);
            --bg-color: var(--white);
            --text-color: var(--black);
            --text-secondary: var(--gray-dark);
            --border-color: rgba(0, 0, 0, 0.08);
            --card-bg: var(--white);
            --glass-bg: rgba(252, 252, 252, 0.8);
            --font-serif: 'Cormorant Garamond', serif;
            --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
            --main-font: var(--font-sans);
            --font-size: 14px;
            --bubble-padding: 8px 12px;
            --avatar-size: 32px;
            --avatar-radius: 50%;
            --status-bar-height: 44px;
            --transition-smooth: 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
            --transition-fast: 0.2s ease;
        }

        [data-theme="dark"] {
            --bg-color: #0a0a0a;
            --text-color: #f0f0f0;
            --text-secondary: rgba(255, 255, 255, 0.4);
            --border-color: rgba(255, 255, 255, 0.08);
            --card-bg: #111111;
            --glass-bg: rgba(10, 10, 10, 0.8);
            --gray-light: rgba(255, 255, 255, 0.04);
        }


        * { box-sizing: border-box; margin: 0; padding: 0; font-family: var(--main-font); -webkit-tap-highlight-color: transparent; user-select: none; }
        input, textarea { user-select: auto; }
        html, body {
    width: 100%;
    /* 核心适配：使用动态计算的高度变量 */
    height: var(--app-height, 100vh);
    height: 100dvh;
    min-height: var(--app-height, 100vh);
    margin: 0;
    padding: 0;
    overflow: hidden;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overscroll-behavior: none;
    -webkit-overflow-scrolling: touch;
    background-color: var(--bg-color);
}

/* iOS 全屏模式安全区适配 (添加到主屏幕后生效) */
body.ios-standalone #status-bar { padding-top: env(safe-area-inset-top); height: calc(var(--status-bar-height) + env(safe-area-inset-top)); }
body.ios-standalone .view-header { padding-top: calc(10px + env(safe-area-inset-top)) !important; }
body.ios-standalone #chat-header { padding-top: calc(10px + env(safe-area-inset-top)) !important; }
body.ios-standalone .input-area-floating { bottom: calc(8px + env(safe-area-inset-bottom)) !important; }
body.ios-standalone #desktop-dock { bottom: calc(20px + env(safe-area-inset-bottom)) !important; }
body.ios-standalone #selection-action-bar { padding-bottom: calc(10px + env(safe-area-inset-bottom)) !important; height: calc(70px + env(safe-area-inset-bottom)) !important; }
body.ios-standalone #music-nav-bar { padding-bottom: env(safe-area-inset-bottom) !important; height: calc(50px + env(safe-area-inset-bottom)) !important; }
body.ios-standalone #music-mini-player { bottom: calc(50px + env(safe-area-inset-bottom)) !important; }

body {
    background-color: var(--bg-color);
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
}

        #phone-shell {
    width: 390px;
    height: 844px;
    background-color: var(--bg-color);
    border-radius: 50px;
    border: 10px solid #333;
    box-shadow: 0 30px 60px rgba(0,0,0,0.4);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    overflow: hidden;
    transition: background-color var(--transition-smooth);
    display: flex;
    flex-direction: column;
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
}

#phone-shell.fullscreen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100dvh !important;
    min-height: -webkit-fill-available !important;
    transform: none !important;
    border-radius: 0 !important;
    border: none !important;
    box-shadow: none !important;
    margin: 0 !important;
}
        #status-bar {
            height: var(--status-bar-height);
            display: flex;
            justify-content: space-between;
            padding: 0 25px;
            align-items: center;
            font-size: 12px;
            font-weight: 600;
            letter-spacing: 1px;
            color: var(--text-color);
            z-index: 1000;
            position: relative;
            flex-shrink: 0;
            font-family: var(--font-sans);
        }
        .status-icons {
            display: flex;
            align-items: center;
            gap: 6px;
        }
        .css-signal {
            display: flex;
            align-items: flex-end;
            gap: 1.5px;
            height: 10px;
        }
        .signal-bar {
            width: 2.5px;
            background-color: currentColor;
            border-radius: 1px;
        }
        .signal-bar:nth-child(1) { height: 3px; }
        .signal-bar:nth-child(2) { height: 5px; }
        .signal-bar:nth-child(3) { height: 7px; }
        .signal-bar:nth-child(4) { height: 10px; }
        .css-wifi {
            position: relative;
            width: 14px;
            height: 10px;
            display: flex;
            justify-content: center;
            align-items: flex-end;
            overflow: hidden;
        }
        .wifi-arc {
            position: absolute;
            border: 2px solid currentColor;
            border-radius: 50%;
            border-bottom-color: transparent;
            border-left-color: transparent;
            border-right-color: transparent;
        }
        .arc-3 { width: 18px; height: 18px; bottom: -6px; }
        .arc-2 { width: 10px; height: 10px; bottom: -2px; }
        .arc-1 { width: 4px; height: 4px; bottom: 0; background-color: currentColor; border: none; }
        .css-battery {
            display: flex;
            align-items: center;
            margin-left: 2px;
        }
        .battery-body {
            width: 22px;
            height: 11px;
            border: 1px solid currentColor;
            border-radius: 3px;
            padding: 1px;
            display: flex;
            align-items: center;
        }
        .battery-fill {
            height: 100%;
            width: 80%;
            background-color: currentColor;
            border-radius: 1px;
        }
        .battery-cap {
            width: 2px;
            height: 4px;
            background-color: currentColor;
            border-radius: 0 2px 2px 0;
            margin-left: 1px;
        }
        #main-content-area {
    position: relative;
    flex: 1;
    overflow: hidden; /* 彻底锁死主容器，禁止上下滑动白屏 */
    overscroll-behavior: none;
}

        .title-serif { font-family: var(--font-serif); font-size: 34px; font-weight: 300; color: var(--text-color); line-height: 1.2; letter-spacing: 1px; display: flex; flex-direction: column; align-items: center; }
        .title-sub { font-family: var(--font-sans); font-size: 9px; letter-spacing: 2px; color: var(--text-secondary); text-transform: uppercase; margin-top: 2px; }
        .text-btn { font-family: var(--font-sans); font-size: 7px; font-weight: 600; letter-spacing: 2px; text-transform: uppercase; color: var(--text-color); cursor: pointer; background: none; border: none; outline: none; padding: 8px 0; display: flex; flex-direction: column; align-items: center; }
        .text-btn span { font-size: calc(var(--font-size) * 0.55); color: var(--text-secondary); letter-spacing: 1px; margin-top: 2px; }
        .text-btn:active { opacity: 0.4; }
        .text-btn:disabled { opacity: 0.3; cursor: not-allowed; }
        .action-btn { background: var(--bg-color); border: 1px solid var(--border-color); color: var(--text-color); padding: 8px; border-radius: 0; cursor: pointer; text-align: center; margin-bottom: 8px; font-family: var(--font-sans); font-size: 8px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; display: flex; justify-content: center; align-items: center; gap: 5px; }
        .action-btn:active { background: var(--text-color); color: var(--bg-color); }
        .action-btn.primary { background: var(--text-color); color: var(--bg-color); }
        .action-btn.primary:active { opacity: 0.8; }
        .action-btn:disabled { background: var(--gray-light); color: var(--text-secondary); border-color: var(--gray-light); cursor: not-allowed; }

/* --- 奢侈风 Activation View --- */
#view-login {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #050505;
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 1.2s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.8s ease;
}
#view-login.hidden {
    display: none;
}
#view-login.fade-out {
    transform: scale(1.15);
    opacity: 0;
    pointer-events: none;
}

.login-luxury-wrapper {
    width: 100%; max-width: 320px;
    padding: 40px 30px;
    display: flex; flex-direction: column; align-items: center;
}

/* 动画序列定义 */
.login-anim-logo { animation: luxBlurIn 1.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards; }
.login-anim-title { opacity: 0; animation: luxFadeUp 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) 0.6s forwards; }
.login-anim-interactive { width: 100%; opacity: 0; animation: luxFadeUp 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) 1.2s forwards; }

@keyframes luxBlurIn {
    0% { opacity: 0; filter: blur(20px); transform: scale(0.9); }
    100% { opacity: 1; filter: blur(0); transform: scale(1); }
}
@keyframes luxFadeUp {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* 极简 Logo */
.login-logo-circle {
    width: 8px; height: 8px; border-radius: 50%;
    background: #ffffff; margin: 0 auto 15px auto;
    box-shadow: 0 0 15px rgba(255,255,255,0.8);
}
.login-logo-line {
    width: 1px; height: 40px; background: linear-gradient(to bottom, rgba(255,255,255,0.5), transparent);
    margin: 0 auto 30px auto;
}

/* 标题排版 */
.login-title-serif {
    font-family: var(--font-serif); font-size: 36px; font-weight: 300;
    color: #ffffff; letter-spacing: 4px; text-align: center; margin-bottom: 8px;
}
.login-title-sub {
    font-family: var(--font-sans); font-size: 9px; font-weight: 400;
    color: rgba(255,255,255,0.4); letter-spacing: 6px; text-transform: uppercase;
    text-align: center; margin-bottom: 50px;
}

/* 极简输入框 */
.login-input-group { position: relative; width: 100%; margin-bottom: 15px; }
#login-code {
    width: 100%; background: transparent; border: none; outline: none;
    color: #ffffff; font-family: var(--font-sans); font-size: 12px;
    letter-spacing: 4px; text-align: center; padding: 10px 0;
}
#login-code::placeholder { color: rgba(255,255,255,0.2); letter-spacing: 2px; font-size: 9px; }
.login-input-line {
    position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
    width: 40%; height: 1px; background: rgba(255,255,255,0.2);
    transition: width 0.4s ease, background 0.4s ease;
}
#login-code:focus + .login-input-line { width: 100%; background: rgba(255,255,255,0.8); }

/* 设备信息 */
.login-device-info {
    font-family: var(--font-sans); font-size: 8px; color: rgba(255,255,255,0.3);
    letter-spacing: 2px; text-align: center; margin-bottom: 40px;
}
#display-device-id { color: rgba(255,255,255,0.6); user-select: all; }

/* 奢侈风按钮 */
.login-btn-luxury {
    position: relative; width: 100%; padding: 14px; background: transparent;
    border: 1px solid rgba(255,255,255,0.3); color: #ffffff; cursor: pointer;
    overflow: hidden; transition: all 0.4s ease; margin-bottom: 25px;
}
.login-btn-luxury .btn-text {
    position: relative; z-index: 2; font-family: var(--font-sans); font-size: 10px;
    font-weight: 500; letter-spacing: 4px; text-transform: uppercase;
}
.login-btn-luxury .btn-shine {
    position: absolute; top: 0; left: -100%; width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transform: skewX(-20deg); z-index: 1; transition: left 0.6s ease;
}
.login-btn-luxury:hover { border-color: #ffffff; background: rgba(255,255,255,0.05); }
.login-btn-luxury:hover .btn-shine { left: 150%; }
.login-btn-luxury:active { transform: scale(0.98); }

/* 分割线 */
.login-divider {
    display: flex; align-items: center; gap: 15px; margin-bottom: 25px; width: 100%;
}
.login-divider .divider-line { flex: 1; height: 1px; background: rgba(255,255,255,0.1); }
.login-divider span { font-family: var(--font-sans); font-size: 8px; color: rgba(255,255,255,0.3); letter-spacing: 2px; }

/* Discord 按钮 */
.login-btn-discord {
    width: 100%; padding: 12px; background: transparent; border: 1px solid rgba(88, 101, 242, 0.5);
    color: #5865F2; font-family: var(--font-sans); font-size: 9px; font-weight: 500;
    letter-spacing: 2px; display: flex; align-items: center; justify-content: center; gap: 10px;
    cursor: pointer; transition: all 0.3s ease;
}
.login-btn-discord:hover { background: rgba(88, 101, 242, 0.1); border-color: #5865F2; }
.login-btn-discord:active { transform: scale(0.98); }

/* 状态提示 */
.login-status-msg { font-size: 8px; color: rgba(255,255,255,0.5); text-align: center; margin-top: 15px; letter-spacing: 1px; height: 12px; }
.login-error-msg { font-size: 9px; color: #ff4d4d; text-align: center; margin-top: 10px; letter-spacing: 1px; height: 12px; }

        /* 新增：聊天顶部头像样式 */
#chat-header-avatar-container {
    width: 100%;
    display: none;
    justify-content: center;
    margin-bottom: 8px; /* 使用 margin-bottom 替代 padding-top，确保与下方元素的间距 */
}
        #chat-header-avatar {
            width: 42px;
            height: 42px;
            border-radius: 50%;
            border: 1px solid var(--border-color);
            object-fit: cover;
            background: var(--gray-light);
        }

        /* --- 修改后的桌面容器与分页样式 --- */
    #view-desktop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100;
    transition: opacity var(--transition-smooth);
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 100px;
    overscroll-behavior: contain;
}
        #view-desktop::-webkit-scrollbar { display: none; }
        .desktop-page { min-width: 100%; height: 100%; scroll-snap-align: start; padding: 30px 25px; display: flex; flex-direction: column; position: relative; }
        .desktop-app-grid { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 85px; gap: 15px 10px; align-content: flex-start; width: 100%; height: 100%; } .empty-slot { opacity: 0; pointer-events: auto; } .empty-slot.drag-over { opacity: 1; background: rgba(255,255,255,0.1); border: 1px dashed var(--text-color); border-radius: 16px; } .app-icon.drag-over { opacity: 0.5; transform: scale(0.9); border: 1px dashed var(--text-color); border-radius: 16px; } .drag-clone { position: fixed !important; top: 0 !important; left: 0 !important; pointer-events: none; z-index: 9999; opacity: 0.9; margin: 0; will-change: transform; }
        
        /* Dock 栏样式 */
        #desktop-dock { position: absolute; bottom: 20px; left: 20px; right: 20px; height: 85px; background: var(--glass-bg); backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px); border-radius: 24px; display: flex; justify-content: space-around; align-items: center; padding: 0 10px; z-index: 105; transition: opacity var(--transition-smooth); box-shadow: 0 10px 30px rgba(0,0,0,0.1); }
        #desktop-dock .app-icon { margin-bottom: 0; }
                #desktop-dock .app-icon .sub-name { display: none; }
        
        /* 分页指示器 */
        .desktop-pagination { position: absolute; bottom: 115px; left: 0; width: 100%; display: flex; justify-content: center; gap: 8px; z-index: 105; pointer-events: none; transition: opacity var(--transition-smooth); }
        .desktop-dot { width: 6px; height: 6px; border-radius: 50%; background: rgba(150,150,150,0.4); transition: background 0.3s; }
        .desktop-dot.active { background: var(--text-color); }

        /* 小组件样式 */
        .widget-4x4 { width: 100%; aspect-ratio: 1 / 1; background: transparent; border-radius: 24px; padding: 20px; display: flex; flex-direction: column; align-items: center; justify-content: space-between; position: relative; margin-top: 20px; }
        .avatars-section { display: flex; justify-content: center; gap: 40px; margin-top: 20px; position: relative; z-index: 2; }
        .avatar-wrapper { display: flex; flex-direction: column; align-items: center; position: relative; }
        .widget-bubble { background: var(--glass-bg); border: none; border-radius: 12px; padding: 4px 10px; font-size: 12px; box-shadow: 0 4px 10px rgba(0,0,0,0.05); position: absolute; top: -30px; display: flex; align-items: center; justify-content: center; cursor: text; outline: none; min-width: 30px; white-space: nowrap; color: var(--text-color); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
        .widget-bubble::after { content: ''; position: absolute; bottom: -4px; left: 50%; transform: translateX(-50%) rotate(45deg); width: 8px; height: 8px; background: var(--glass-bg); border: none; }
        #view-role-edit .setting-group > label { display: block; margin-bottom: 8px; font-size: 9px; letter-spacing: 1px; text-transform: uppercase; color: var(--text-secondary); }
        .widget-avatar-circle { width: 70px; height: 70px; border-radius: 50%; border: none; background-color: var(--gray-light); background-size: cover; background-position: center; cursor: pointer; box-shadow: 0 4px 15px rgba(0,0,0,0.1); transition: transform 0.2s; }
        #view-role-edit .widget-avatar-circle { width: 80px; height: 80px; border: 1px solid var(--border-color); }
        #view-role-edit .widget-avatar-circle:last-of-type { border: 2px dashed var(--text-color); }
        .widget-avatar-circle:active { transform: scale(0.95); }
        .widget-avatar-name { margin-top: 10px; font-size: 14px; font-weight: 600; color: var(--text-color); cursor: text; outline: none; padding: 2px 6px; border-radius: 4px; }
        .widget-svg-lines { position: absolute; top: 100px; left: 0; width: 100%; height: 150px; z-index: 1; pointer-events: none; }
        .widget-stats-text { font-size: 11px; color: var(--text-secondary); z-index: 2; padding: 2px 10px; margin-top: 10px; border-radius: 10px; background: var(--glass-bg); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); cursor: text; outline: none; }
        .widget-player-section { width: 100%; background: rgba(245, 245, 245, 0.85); backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px); border-radius: 16px; padding: 15px; z-index: 2; border: none; box-shadow: 0 8px 20px rgba(0,0,0,0.05); }
        [data-theme="dark"] .widget-player-section { background: rgba(40, 40, 40, 0.85); }
        .widget-song-info { text-align: center; margin-bottom: 12px; }
        .widget-song-title { font-size: 13px; font-weight: 600; color: var(--text-color); margin-bottom: 4px; cursor: text; outline: none; }
        .widget-song-artist { font-size: 10px; color: var(--text-secondary); cursor: text; outline: none; }
        .widget-progress-container { display: flex; align-items: center; gap: 8px; font-size: 9px; color: var(--text-secondary); margin-bottom: 12px; }
        .widget-progress-track { flex: 1; height: 4px; background: var(--gray-light); border-radius: 2px; position: relative; }
        .widget-progress-fill { position: absolute; left: 0; top: 0; height: 100%; width: 35%; background: var(--text-secondary); border-radius: 2px; }
        .widget-controls { display: flex; justify-content: space-between; align-items: center; padding: 0 10px; }
        .widget-ctrl-btn { font-size: 16px; color: var(--text-secondary); cursor: pointer; }
        .widget-ctrl-play { font-size: 20px; font-weight: bold; color: var(--text-color); }
        .app-icon { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; cursor: pointer; text-align: center; user-select: none; -webkit-user-drag: element; }
        .app-icon.dragging { opacity: 0.4; transform: scale(0.9); }
        .app-icon.drag-over { border: 1px dashed var(--text-color); border-radius: 10px; }
        .app-icon .icon { width: 52px; height: 52px; border-radius: 0; border: 1px solid var(--border-color); background-color: transparent; display: flex; align-items: center; justify-content: center; font-size: 20px; margin-bottom: 6px; background-size: cover; background-position: center; color: var(--text-color); pointer-events: none; }
        .app-icon:active .icon { transform: scale(0.95); }
.app-icon span { font-family: var(--font-sans); font-size: 8px; font-weight: 600; letter-spacing: 1px; color: var(--app-text-color, var(--text-color)); text-transform: uppercase; pointer-events: none; }
        .app-icon .sub-name { font-size: 7px; color: var(--text-secondary); margin-top: 2px; pointer-events: none; }

        .view-container { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-color: var(--bg-color); z-index: 950; display: flex; flex-direction: column; transform: translateX(100%); opacity: 0; transition: transform var(--transition-smooth), opacity var(--transition-smooth); pointer-events: none; }
        .view-container.active { transform: translateX(0); opacity: 1; pointer-events: auto; }
                .view-header { padding: 10px 20px 12px 20px; display: flex; align-items: center; justify-content: space-between; z-index: 10; flex-shrink: 0; background: var(--glass-bg); backdrop-filter: blur(25px); -webkit-backdrop-filter: blur(25px); border-bottom: none; }
        .view-content { flex: 1; overflow-y: auto; padding: 15px 20px; overscroll-behavior: contain; }
        .view-content::-webkit-scrollbar { display: none; }
.list-item { display: flex; align-items: center; padding: 16px 0; background: transparent; border-bottom: 1px solid var(--border-color); cursor: pointer; transition: opacity var(--transition-fast); }
        .list-item:active { transform: scale(0.98); }
        .avatar { width: 36px; height: 36px; border-radius: 0; border: 1px solid var(--border-color); object-fit: cover; margin-right: 12px; background: var(--gray-light); flex-shrink: 0; }
        .item-info { flex: 1; overflow: hidden; }
        .item-name { font-family: var(--font-serif); font-size: 16px; font-weight: 600; color: var(--text-color); margin-bottom: 2px; display: flex; align-items: baseline; gap: 8px; }
        .item-name span { font-family: var(--font-sans); font-size: 9px; color: var(--text-secondary); font-weight: 400; letter-spacing: 1px; text-transform: uppercase; }
        .item-desc { font-family: var(--font-sans); font-size: 10px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 300; }
        .item-actions { display: flex; align-items: center; gap: 6px; }
        .btn-edit, .btn-delete { font-family: var(--font-sans); font-size: 7px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; padding: 6px; border: 1px solid var(--border-color); background: transparent; color: var(--text-color); cursor: pointer; display: flex; flex-direction: column; align-items: center; }
        .btn-delete { color: var(--bg-color); background: var(--text-color); }

        #chat-view { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-color: var(--bg-color); background-size: cover; background-repeat: no-repeat; background-position: center; z-index: 960; display: flex; flex-direction: column; transform: translateX(100%); opacity: 0; transition: transform var(--transition-smooth), opacity var(--transition-smooth); pointer-events: none; }
        #chat-view.active { transform: translateX(0); opacity: 1; pointer-events: auto; }
       #chat-header {
    padding: 10px 15px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    border-bottom: none;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    z-index: 110;
    flex-shrink: 0;
    transition: all 0.3s ease;
}
        .chat-header-top { display: flex; justify-content: space-between; align-items: center; width: 100%; }
        .chat-title-glass { padding: 4px 12px 4px 14px !important; border-radius: 20px !important; }
        #chat-title { font-family: var(--font-serif); font-size: 13px !important; font-weight: 600; font-style: normal !important; color: var(--role-accent-color, var(--text-color)); letter-spacing: 0.5px; }
        .chat-title-arrow { width: 14px; height: 14px; color: var(--text-secondary); opacity: 0.8; stroke-width: 2.5; transform: translateY(1px); }
        #chat-mode-switcher { display: flex; justify-content: center; gap: 20px; margin-top: 8px; }
        .mode-btn { font-family: var(--font-sans); font-size: 7px; font-weight: 500; letter-spacing: 2px; text-transform: uppercase; color: var(--text-secondary); cursor: pointer; background: none; border: none; padding-bottom: 4px; border-bottom: 1px solid transparent; }
        .mode-btn.active { color: var(--text-color); font-weight: 600; border-bottom: 1px solid var(--text-color); }
                #chat-messages { flex: 1; overflow-y: auto; padding: 15px 12px 140px 12px; display: flex; flex-direction: column; gap: 4px; position: relative; overscroll-behavior: contain; }
        .msg-row { display: flex; width: 100%; align-items: center; position: relative; }
        .msg-row.me { justify-content: flex-end; }
        .msg-row.ai { justify-content: flex-start; }
        .msg-avatar { width: var(--avatar-size); height: var(--avatar-size); border-radius: var(--avatar-radius); border: 1px solid var(--border-color); object-fit: cover; cursor: pointer; flex-shrink: 0; margin-top: 0; align-self: center; transform: translateY(-7px); }
        .msg-row.me .msg-avatar { margin-left: 6px; cursor: default; }
        .msg-row.ai .msg-avatar { margin-right: 6px; }
        .msg-wrapper { display: flex; flex-direction: column; max-width: 78%; }
        .msg-row.me .msg-wrapper { align-items: flex-end; }
        .msg-row.ai .msg-wrapper { align-items: flex-start; }
        .msg-bubble { padding: var(--bubble-padding); font-size: var(--font-size); line-height: 1.5; font-weight: 400; letter-spacing: 0.2px; border-radius: 14px; word-wrap: break-word; cursor: pointer; margin-top: 0; position: relative; }
        .msg-bubble:active { opacity: 1; }
        .msg-row.me .msg-bubble { background-color: var(--text-color); color: var(--bg-color); border: none; border-bottom-right-radius: 4px; margin-right: 4px; }
        .msg-row.ai .msg-bubble { background-color: #333333; color: #ffffff; border: none; border-bottom-left-radius: 4px; margin-left: 4px; }
        .msg-row.me .msg-bubble::before { content: ''; position: absolute; bottom: 0; right: -6px; width: 12px; height: 16px; background: var(--text-color); border-bottom-left-radius: 10px; }
        .msg-row.me .msg-bubble::after { content: ''; position: absolute; bottom: 0; right: -12px; width: 12px; height: 16px; background: var(--bg-color); border-bottom-left-radius: 12px; }
        .msg-row.ai .msg-bubble::before { content: ''; position: absolute; bottom: 0; left: -6px; width: 12px; height: 16px; background: #333333; border-bottom-right-radius: 10px; }
        .msg-row.ai .msg-bubble::after { content: ''; position: absolute; bottom: 0; left: -12px; width: 12px; height: 16px; background: var(--bg-color); border-bottom-right-radius: 12px; }
        .msg-row.me .msg-bubble::before { background-color: inherit; } 
        .msg-row.ai .msg-bubble::before { background-color: inherit; }
        .msg-status { font-family: var(--font-sans); font-size: 7px; color: var(--text-secondary); margin-top: 4px; letter-spacing: 1px; text-transform: uppercase; }
        html.single-timestamp-mode .msg-row:not(:last-child) .msg-status { display: none !important; }
        .msg-row.me .msg-bubble { border-bottom-right-radius: 18px; }
        .msg-row.me .msg-bubble::before, .msg-row.me .msg-bubble::after { display: none; }
        .msg-row.me:last-child .msg-bubble, .msg-row.me:has(+ .msg-row.ai) .msg-bubble, .msg-row.me:has(+ .msg-row[style]) .msg-bubble { border-bottom-right-radius: 4px; }
        .msg-row.me:last-child .msg-bubble::before, .msg-row.me:last-child .msg-bubble::after, .msg-row.me:has(+ .msg-row.ai) .msg-bubble::before, .msg-row.me:has(+ .msg-row.ai) .msg-bubble::after, .msg-row.me:has(+ .msg-row[style]) .msg-bubble::before, .msg-row.me:has(+ .msg-row[style]) .msg-bubble::after { display: block; }
        .msg-row.ai .msg-bubble { border-bottom-left-radius: 18px; }
        .msg-row.ai .msg-bubble::before, .msg-row.ai .msg-bubble::after { display: none; }
        .msg-row.ai:last-child .msg-bubble, .msg-row.ai:has(+ .msg-row.me) .msg-bubble, .msg-row.ai:has(+ .msg-row[style]) .msg-bubble { border-bottom-left-radius: 4px; }
        .msg-row.ai:last-child .msg-bubble::before, .msg-row.ai:last-child .msg-bubble::after, .msg-row.ai:has(+ .msg-row.me) .msg-bubble::before, .msg-row.ai:has(+ .msg-row.me) .msg-bubble::after, .msg-row.ai:has(+ .msg-row[style]) .msg-bubble::before, .msg-row.ai:has(+ .msg-row[style]) .msg-bubble::after { display: block; }
        .msg-bubble.offline-mode { border-style: dashed; }
        .bubble-heart { position: absolute; bottom: -4px; right: 4px; font-size: 8px; line-height: 1; background: var(--bg-color); color: var(--text-color); border: 1px solid var(--border-color); width: 14px; height: 14px; display: flex; align-items: center; justify-content: center; z-index: 5; border-radius: 50%; }
        .msg-row.me .bubble-heart { background: var(--text-color); color: var(--bg-color); right: 4px; }
        .msg-bubble img.chat-inline-img { max-width: 90px; max-height: 90px; object-fit: contain; border-radius: 4px; border: 1px solid currentColor; margin-top: 5px; display: block; }
        .virtual-img-box { width: 120px; height: 120px; background-color: var(--gray-light); color: var(--text-secondary); border: 1px dashed currentColor; display: flex; align-items: center; justify-content: center; text-align: center; font-size: 9px; cursor: pointer; margin-top: 5px; font-family: var(--font-sans); font-weight: 500; padding: 10px; word-break: break-all; }
        [data-theme="dark"] .virtual-img-box { background-color: #222; }
        .virtual-img-box.revealed { background-color: var(--text-color); color: var(--bg-color); border-style: solid; font-weight: 600; }
        .msg-translation-divider { border-top: 1px dashed currentColor; margin: 8px 0; opacity: 0.3; }
        .msg-translation-text { font-size: 0.95em; opacity: 0.85; }
        .msg-checkbox { width: 14px; height: 14px; border: 1px solid var(--border-color); border-radius: 50%; margin-top: 6px; margin-right: 8px; flex-shrink: 0; display: none; }
        .msg-row.me .msg-checkbox { margin-right: 0; margin-left: 8px; order: 3; }
        .selection-mode .msg-checkbox { display: block; }
        .msg-checkbox.checked { background-color: var(--text-color); border-color: var(--text-color); }
        .input-area-floating { position: absolute; bottom: 8px; left: 15px; right: 15px; display: flex; flex-direction: column; gap: 6px; z-index: 100; }
        #sticker-suggestions { display: none; background: var(--glass-bg); backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px); border: 1px solid var(--border-color); border-radius: 16px; padding: 10px; overflow-x: auto; white-space: nowrap; box-shadow: 0 -5px 15px rgba(0,0,0,0.05); gap: 10px; margin-bottom: 4px; }
        #sticker-suggestions::-webkit-scrollbar { display: none; }
        .suggestion-item { display: inline-block; width: 50px; height: 50px; border-radius: 8px; border: 1px solid var(--border-color); background-color: var(--bg-color); background-size: cover; background-position: center; cursor: pointer; flex-shrink: 0; }
        .suggestion-item:active { transform: scale(0.95); }
        #quote-preview-bar { display: none; background: var(--bg-color); border: 1px solid var(--border-color); padding: 6px 10px; font-size: 9px; color: var(--text-secondary); justify-content: space-between; align-items: center; box-shadow: 0 5px 15px rgba(0,0,0,0.05); }
        #quote-preview-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; margin-right: 10px; }
        .input-controls { display: flex; gap: 6px; align-items: flex-end; position: relative; }
        .standalone-icon-btn { width: 32px; height: 32px; border-radius: 16px; background: var(--bg-color); border: 1px solid var(--border-color); color: var(--text-color); font-size: 14px; display: flex; justify-content: center; align-items: center; cursor: pointer; flex-shrink: 0; box-shadow: 0 5px 15px rgba(0,0,0,0.05); padding: 0; overflow: hidden; }
        .standalone-icon-btn:active { transform: scale(0.9); }
        #chat-input { flex: 1; min-height: 32px; max-height: 80px; background-color: rgba(255, 255, 255, 0.02) !important; backdrop-filter: blur(10px) saturate(180%) !important; -webkit-backdrop-filter: blur(10px) saturate(180%) !important; border: 0.5px solid rgba(255, 255, 255, 0.2) !important; box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.4), inset 0 -1px 4px 0 rgba(255, 255, 255, 0.3), 0 2px 6px rgba(0, 0, 0, 0.05) !important; border-radius: 16px; padding: 8px 14px; font-family: var(--font-sans); font-size: 11px; color: var(--text-color); outline: none; resize: none; line-height: 1.4; transition: all 0.3s ease; }
        [data-theme="dark"] #chat-input { background-color: rgba(50, 50, 50, 0.3) !important; border: 0.5px solid rgba(255, 255, 255, 0.1) !important; box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.1), inset 0 -2px 6px 0 rgba(255, 255, 255, 0.05), 0 5px 15px -3px rgba(0, 0, 0, 0.3) !important; }
        #chat-input::placeholder { color: var(--text-secondary); letter-spacing: 1px; font-size: 8px; text-transform: uppercase; }
        .standalone-send-btn { height: 32px; padding: 0 10px; background-color: var(--text-color); color: var(--bg-color); border: none; border-radius: 16px; font-family: var(--font-sans); font-size: 7px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; cursor: pointer; box-shadow: 0 5px 15px rgba(0,0,0,0.1); flex-shrink: 0; display: flex; flex-direction: column; justify-content: center; align-items: center; }
        .standalone-send-btn:active { transform: scale(0.95); }
        .standalone-send-btn span { font-size: 5px; opacity: 0.7; margin-top: 1px; }
        .standalone-send-btn.outline { background-color: var(--bg-color); color: var(--text-color); border: 1px solid var(--border-color); }
        #attachment-popup { 
            display: none; 
            position: absolute; 
            bottom: 50px !important; 
            left: 0; 
            background: transparent !important; 
            backdrop-filter: blur(35px) saturate(200%) !important;
            -webkit-backdrop-filter: blur(35px) saturate(200%) !important;
            border: 0.5px solid rgba(255, 255, 255, 0.3) !important;
            box-shadow: 0 10px 30px rgba(0,0,0,0.15) !important; 
            flex-direction: column !important; 
            z-index: 1000; 
            width: 160px !important; 
            border-radius: 14px !important;
            padding: 6px 0 !important;
            max-height: 60vh !important;
            overflow-y: auto !important;
        }
        #attachment-popup::-webkit-scrollbar { display: none; }
        [data-theme="dark"] #attachment-popup {
            background: transparent !important;
            border: 0.5px solid rgba(255, 255, 255, 0.1) !important;
        }
        /* 附件按钮激活状态 */
.attach-btn.active {
    background: rgba(255, 255, 255, 0.2) !important;
    font-weight: 700 !important;
}
/* 暗色模式下的激活状态适配 */
[data-theme="dark"] .attach-btn.active {
    background: rgba(150, 150, 150, 0.2) !important;
}
[data-theme="dark"] .attach-btn.active {
    background: rgba(255, 255, 255, 0.1) !important;
}
        .attach-btn { padding: 12px 14px; background: none; border: none; border-bottom: none; font-family: var(--font-sans); font-size: 9px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--text-color); cursor: pointer; text-align: left; display: flex; align-items: center; gap: 6px; }
        .attach-btn:last-child { border-bottom: none; }
        .attach-btn:active { background: var(--gray-light); }
        .attach-btn span { font-size: 9px; color: var(--text-secondary); font-weight: 500; }
        .attach-btn svg { flex-shrink: 0; opacity: 0.8; }
        #selection-action-bar { display: none; position: absolute; bottom: 0; left: 0; width: 100%; height: 70px; background: var(--bg-color); border-top: 1px solid var(--border-color); z-index: 105; justify-content: space-around; align-items: center; padding-bottom: 10px; }
        #context-menu-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: transparent; z-index: 9999; display: none; }
        #context-menu { position: absolute; background: var(--glass-bg); backdrop-filter: blur(25px); -webkit-backdrop-filter: blur(25px); border: 0.5px solid rgba(128,128,128,0.2); width: 110px; display: flex; flex-direction: column; box-shadow: 0 10px 30px rgba(0,0,0,0.15); border-radius: 12px; overflow: hidden; transform: scale(0.9); opacity: 0; transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1); transform-origin: top left; }
        #context-menu.active { transform: scale(1); opacity: 1; }
        .ctx-btn { padding: 10px 12px; background: none; border: none; border-bottom: 1px solid rgba(128,128,128,0.1); font-family: var(--font-sans); font-size: 12px; font-weight: 500; letter-spacing: 1px; color: var(--text-color); cursor: pointer; text-align: center; display: flex; flex-direction: row; align-items: center; justify-content: center; }
        .ctx-btn:active { background: rgba(128,128,128,0.1); }
        .ctx-btn:last-child { border-bottom: none; }
        .ctx-btn.danger { color: #ff4d4d; background: transparent; }
        .ctx-btn.danger:active { background: rgba(255,77,77,0.1); }
        
        /* 底部导航栏样式 */
        .view-content.has-bottom-nav { padding-bottom: 80px !important; }
        .app-bottom-nav { position: absolute; bottom: 0; left: 0; right: 0; height: calc(65px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: var(--glass-bg); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-top: 1px solid var(--border-color); display: flex; justify-content: space-around; align-items: flex-start; padding-top: 8px; z-index: 50; }
        .app-bottom-nav .nav-item { display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; color: var(--text-secondary); width: 60px; }
        .app-bottom-nav .nav-item.active { color: var(--text-color); }
        .app-bottom-nav .nav-item:active svg { transform: scale(0.85); }
        .app-bottom-nav .nav-item span { font-size: 9px; font-weight: 600; }
        .ctx-btn.danger { color: var(--bg-color); background: var(--text-color); }
        .ctx-btn.danger:active { opacity: 0.8; }
        .modal-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.8); z-index: 10005 !important; display: none; justify-content: center; align-items: center; }
        .modal { background: var(--bg-color); width: 90%; max-width: 350px; max-height: 85vh; border-radius: 0; border: 1px solid var(--border-color); padding: 25px 20px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; }
        .modal h3 { font-family: var(--font-serif); font-size: 22px; color: var(--text-color); text-align: center; font-weight: 600; margin-bottom: 5px; display: flex; flex-direction: column; }
        .modal h3 span { font-family: var(--font-sans); font-size: 9px; letter-spacing: 2px; color: var(--text-secondary); text-transform: uppercase; margin-top: 4px; }
        .modal input, .modal textarea, .modal select { width: 100%; padding: 10px 12px; border-radius: 0; border: 1px solid var(--border-color); background: transparent; color: var(--text-color); font-family: var(--font-sans); font-size: 11px; outline: none; }
        .modal input::placeholder, .modal textarea::placeholder { color: var(--text-secondary); text-transform: uppercase; font-size: 8px; letter-spacing: 1px; }
        .modal textarea { height: 100px; resize: vertical; }
        .modal-btns { display: flex; gap: 10px; justify-content: flex-end; margin-top: 5px; }
        .modal-btns button { flex: 1; padding: 6px; border-radius: 0; border: 1px solid var(--border-color); font-family: var(--font-sans); font-size: 7px; font-weight: 600; letter-spacing: 2px; text-transform: uppercase; cursor: pointer; display: flex; flex-direction: column; align-items: center; }
        .modal-btns button span { font-size: 6px; opacity: 0.7; margin-top: 2px; }
        .btn-cancel { background: var(--bg-color); color: var(--text-color); }
        .btn-cancel:active { background: var(--gray-light); }
        .btn-confirm { background: var(--text-color); color: var(--bg-color); }
        .btn-confirm:active { opacity: 0.8; }
        .setting-group { margin-bottom: 12px; }
.setting-group label { display: block; color: var(--text-secondary); margin-bottom: 4px; font-size: 8px; text-transform: uppercase; letter-spacing: 1px; font-weight: 600; }
        .file-upload-btn { display: block; padding: 10px; border: 1px dashed var(--border-color); color: var(--text-color); cursor: pointer; font-size: 8px; text-transform: uppercase; letter-spacing: 1px; text-align: center; font-weight: 600; }
        .album-group { margin-bottom: 25px; }
        .album-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; border-bottom: 1px solid var(--border-color); padding-bottom: 5px; cursor: pointer; }
        .album-header span { font-family: var(--font-serif); font-size: 18px; font-weight: 600; }
        .photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 10px; overflow: hidden; }
        .photo-grid.collapsed { display: none; }
        .photo-thumb { width: 100%; padding-bottom: 100%; position: relative; background: var(--gray-light); border: 1px solid var(--border-color); cursor: pointer; overflow: hidden; }
        .photo-thumb img { position: absolute; width: 100%; height: 100%; object-fit: cover; }
        .virtual-thumb { position: absolute; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; padding: 5px; font-size: 9px; text-align: center; background: var(--text-color); color: var(--bg-color); word-break: break-all; font-family: var(--font-sans); font-weight: 600; }
        #modal-photo-viewer img { width: auto; max-width: 100%; max-height: 50vh; object-fit: contain; border: 1px solid var(--border-color); margin: 0 auto; display: block; }
        ::-webkit-scrollbar { width: 0px; background: transparent; }
        /* =========================================
   气泡内“正在输入”动画
   ========================================= */
.bubble-typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 0; /* 给小点一些垂直空间 */
}
.bubble-typing-indicator div {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: currentColor; /* 颜色跟随气泡文字颜色 */
    opacity: 0.6;
    animation: bubble-bounce 1.2s infinite ease-in-out;
}
.bubble-typing-indicator div:nth-child(2) {
    animation-delay: 0.15s;
}
.bubble-typing-indicator div:nth-child(3) {
    animation-delay: 0.3s;
}
@keyframes bubble-bounce {
    0%, 80%, 100% {
        transform: translateY(0);
        opacity: 0.6;
    }
    40% {
        transform: translateY(-4px);
        opacity: 1;
    }
}

        /* --- Music App Styles --- */
        #view-music .view-content { padding: 0; display: flex; flex-direction: column; }
        .music-main-area { flex: 1; overflow-y: auto; padding-bottom: 120px; /* Space for mini player and nav */ }
        .music-tab-content { display: none; }
        .music-tab-content.active { display: block; }
        #music-search-page { padding: 15px 20px; }
        #music-search-page input { width: 100%; padding: 10px; border: 1px solid var(--border-color); background: transparent; color: var(--text-color); outline: none; font-size: 11px; margin-bottom: 10px; }
        #music-menu-page { padding: 15px 20px; }
        #music-menu-page input { width: 100%; padding: 10px; border: 1px solid var(--border-color); background: transparent; color: var(--text-color); outline: none; font-size: 11px; margin-bottom: 10px; }
        #music-playlist-page { padding: 15px 20px; }
        #music-playlist-page .list-item.playing { background-color: var(--gray-light); }
        #music-playlist-page .item-name { font-family: var(--font-sans); }
        #music-listen-together-page { padding: 15px 20px; }
        
        #music-mini-player { display: none; position: absolute; bottom: 50px; left: 0; right: 0; height: 60px; background: var(--glass-bg); backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px); border-top: 1px solid var(--border-color); padding: 10px 20px; align-items: center; gap: 15px; cursor: pointer; z-index: 10; }
        #music-mini-player.visible { display: flex; }
        #music-mini-cover { width: 40px; height: 40px; border: 1px solid var(--border-color); background: var(--gray-light); flex-shrink: 0; }
        #music-mini-details { flex: 1; overflow: hidden; }
        #music-mini-title { font-size: 12px; font-weight: 600; color: var(--text-color); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        #music-mini-artist { font-size: 9px; color: var(--text-secondary); }
        #music-mini-controls button { font-size: 18px; background: none; border: none; color: var(--text-color); cursor: pointer; margin-left: 10px; }

        #music-nav-bar { position: absolute; bottom: 0; left: 0; right: 0; height: 60px; background: var(--bg-color); border-top: 1px solid var(--border-color); display: flex; justify-content: space-around; align-items: center; z-index: 10; padding-bottom: 5px; }
        .music-nav-btn { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 9px; letter-spacing: 1px; color: var(--text-secondary); cursor: pointer; }
        .music-nav-btn svg { opacity: 0.6; transition: opacity 0.2s; }
        .music-nav-btn.active { color: var(--text-color); font-weight: 600; }
        .music-nav-btn.active svg { opacity: 1; }

        #music-fullscreen-player {
    position: absolute;
    inset: 0;
    background-color: var(--bg-color);
    z-index: 970;
    display: flex;
    flex-direction: column;
    padding: var(--status-bar-height) 20px 20px 20px;
    transform: translateY(100%);
    opacity: 0;
    pointer-events: none;
    transition: transform var(--transition-smooth), opacity var(--transition-smooth);
}

#music-fullscreen-player.visible {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}
        #music-fullscreen-header { display: flex; justify-content: space-between; align-items: center; flex-shrink: 0; margin-bottom: 20px; }
        #music-fullscreen-header .text-btn { font-size: 12px; }
        #music-fullscreen-cover { width: 80%; max-width: 280px; padding-bottom: 80%; position: relative; margin: 0 auto 20px auto; background-size: cover; background-position: center; border: 1px solid var(--border-color); box-shadow: 0 10px 30px rgba(0,0,0,0.2); }
        #music-fullscreen-details { text-align: center; margin-bottom: 20px; }
        #music-fullscreen-title { font-family: var(--font-serif); font-size: 22px; font-weight: 600; }
        #music-fullscreen-artist { font-size: 12px; color: var(--text-secondary); margin-top: 5px; }
        #music-lyrics-container { flex: 1; overflow-y: auto; text-align: center; font-size: 14px; line-height: 2.2; color: var(--text-secondary); scroll-behavior: smooth; }
        #music-lyrics-container p { transition: color 0.3s, font-weight 0.3s, font-size 0.3s; }
        #music-lyrics-container p.active { color: var(--text-color); font-weight: 600; font-size: 1.1em; }
        #music-fullscreen-controls { flex-shrink: 0; padding-top: 20px; }
        #music-progress-container { width: 100%; height: 4px; background: var(--gray-light); cursor: pointer; margin-bottom: 8px; }
        #music-progress-bar { width: 0%; height: 100%; background: var(--text-color); }
        #music-time-display { display: flex; justify-content: space-between; font-size: 9px; color: var(--text-secondary); margin-bottom: 15px; }
                #music-main-controls { display: flex; justify-content: center; align-items: center; gap: 40px; }
        #music-main-controls button { font-size: 20px; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; background: none; border: none; color: var(--text-color); cursor: pointer; padding: 0; }
        #music-main-controls #music-play-pause-btn-fs { font-size: 28px; width: 32px; height: 32px; }

        /* 音乐/亲属卡/转账 分享卡片 (尖角 + 黑白灰极简风) */
        .music-card { 
            border: 1px solid var(--border-color); 
            padding: 10px; 
            display: flex; 
            align-items: center; 
            gap: 10px; 
            cursor: pointer; 
            background: var(--glass-bg); 
            backdrop-filter: blur(15px); 
            -webkit-backdrop-filter: blur(15px); 
            border-radius: 0; /* 尖角 */
        }
        .music-card-cover { width: 50px; height: 50px; background-size: cover; background-position: center; flex-shrink: 0; border: 1px solid var(--border-color); border-radius: 0 !important; /* 尖角头像 */ }
        .music-card-info { flex: 1; overflow: hidden; }
        .music-card-title { font-weight: 600; font-size: 1.1em; color: var(--text-color); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .music-card-artist { font-size: 0.9em; color: var(--text-secondary); }
        .music-card-tag { font-size: 8px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-secondary); margin-top: 5px; }
        
                /* 代付卡片样式 */
        .daifu-card { border: 1px solid var(--border-color); padding: 16px; display: flex; align-items: center; gap: 16px; background: var(--glass-bg); backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px); border-radius: 12px; cursor: pointer; box-shadow: 0 4px 15px rgba(0,0,0,0.05); }
        .daifu-icon { width: 48px; height: 48px; border-radius: 50%; background: var(--gray-light); display: flex; align-items: center; justify-content: center; font-size: 24px; flex-shrink: 0; border: 1px solid var(--border-color); }
        .daifu-info { flex: 1; overflow: hidden; }
        .daifu-title { font-weight: 600; font-size: 14px; color: var(--text-color); margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .daifu-desc { font-size: 11px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .daifu-bottom { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; flex-wrap: wrap; gap: 8px; }
        .daifu-price { font-size: 18px; font-weight: 700; color: #ff3b30; font-family: var(--font-serif); }
        .daifu-tag { font-size: 9px; background: var(--text-color); color: var(--bg-color); padding: 4px 8px; border-radius: 6px; text-transform: uppercase; letter-spacing: 1px; font-weight: 600; white-space: nowrap; }
        .share-card {
    border: 1px solid var(--border-color);
    padding: 12px;
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 0;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.share-card-badge {
    display: inline-block;
    font-size: 7px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--bg-color);
    background: var(--text-color);
    padding: 3px 6px;
    margin-bottom: 8px;
}

.share-card-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-color);
    line-height: 1.4;
    margin-bottom: 4px;
    word-break: break-word;
}

.share-card-desc {
    font-size: 9px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    letter-spacing: 0.5px;
}

.share-card-preview {
    font-size: 11px;
    color: var(--text-color);
    line-height: 1.5;
    opacity: 0.9;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

        /* 详情弹窗 (纯色背景 + 尖角) */
        .music-invite-modal { 
            width: 92%; max-width: 380px; border-radius: 0; padding: 0; gap: 0; overflow: hidden; 
            background: var(--bg-color); /* 恢复纯色背景 */
            border: 1px solid var(--border-color); 
        }
        .music-invite-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--border-color); }
        .music-invite-header h3 { margin: 0; font-family: var(--font-sans); font-size: 16px; font-weight: 700; letter-spacing: 0; text-align: left; display: block; color: var(--text-color); }
        .music-invite-close { width: 34px; height: 34px; border: 1px solid var(--border-color); border-radius: 50%; background: transparent; color: var(--text-color); font-size: 22px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; }
        .music-invite-body { padding: 18px 20px 20px; }
        .music-invite-track { display: flex; gap: 14px; align-items: center; margin-bottom: 18px; }
        .music-invite-cover { width: 68px; height: 68px; border-radius: 14px; border: 1px solid var(--border-color); object-fit: cover; background: transparent; flex-shrink: 0; }
        .music-invite-track-info { min-width: 0; }
        .music-invite-track-title { font-size: 14px; font-weight: 700; color: var(--text-color); /* 黑字 */ line-height: 1.4; word-break: break-word; }
        .music-invite-track-artist { font-size: 11px; color: var(--text-secondary); /* 灰字 */ margin-top: 4px; word-break: break-word; }
        .music-invite-meta { display: flex; flex-direction: column; gap: 8px; font-size: 11px; }
        .music-invite-meta-row { color: var(--text-secondary); /* 灰字 */ line-height: 1.5; word-break: break-all; }
        .music-invite-meta-row strong { color: var(--text-color); /* 黑字 */ }
        .music-invite-actions { display: flex; gap: 10px; margin-top: 18px; }
        .music-invite-actions button { flex: 1; margin: 0; }
    @keyframes bannerSlideIn {
    from { opacity: 0; transform: translateY(-10px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ==================== 日历 App ==================== */
#view-calendar .view-content { padding: 0; display: flex; flex-direction: column; }
.cal-month-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px 8px 20px; }
.cal-month-title { font-family: var(--font-serif); font-size: 24px; font-weight: 600; color: var(--text-color); }
.cal-nav-btn { background: none; border: none; color: var(--text-color); font-size: 18px; cursor: pointer; padding: 4px 10px; }
.cal-nav-btn:active { opacity: 0.4; }
.cal-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); padding: 0 12px; }
.cal-weekday { text-align: center; font-size: 8px; font-weight: 600; letter-spacing: 1px; color: var(--text-secondary); padding: 6px 0; text-transform: uppercase; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); padding: 0 12px; gap: 2px; }
.cal-cell { aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; border-radius: 50%; position: relative; font-size: 12px; color: var(--text-color); font-family: var(--font-sans); }
.cal-cell:active { opacity: 0.6; }
.cal-cell.other-month { color: var(--text-secondary); opacity: 0.35; }
.cal-cell.today { background: var(--text-color); color: var(--bg-color); border-radius: 50%; font-weight: 700; }
.cal-cell.has-event::after { content: ''; position: absolute; bottom: 3px; width: 4px; height: 4px; border-radius: 50%; background: currentColor; opacity: 0.6; }
.cal-cell.today.has-event::after { background: var(--bg-color); }
.cal-cell.festival { color: #e05a8a; font-weight: 600; }
.cal-cell.today.festival { color: var(--bg-color); }
.cal-divider { border: none; border-top: 1px solid var(--gray-light); margin: 10px 20px; }
.cal-events-section { flex: 1; overflow-y: auto; padding: 0 20px 20px 20px; }
.cal-events-section::-webkit-scrollbar { display: none; }
.cal-section-label { font-size: 8px; font-weight: 600; letter-spacing: 2px; text-transform: uppercase; color: var(--text-secondary); margin-bottom: 10px; margin-top: 14px; }
.cal-event-item { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--gray-light); }
.cal-event-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 4px; }
.cal-event-dot.type-anniversary { background: #e05a8a; }
.cal-event-dot.type-festival { background: #f59e0b; }
.cal-event-dot.type-custom { background: var(--text-color); }
.cal-event-info { flex: 1; }
.cal-event-name { font-size: 13px; color: var(--text-color); font-weight: 500; }
.cal-event-meta { font-size: 9px; color: var(--text-secondary); margin-top: 2px; letter-spacing: 0.5px; }
.cal-event-actions { display: flex; gap: 6px; }
.cal-countdown-banner { margin: 10px 20px 0 20px; background: var(--gray-light); padding: 10px 14px; display: flex; justify-content: space-between; align-items: center; }
.cal-countdown-name { font-size: 11px; color: var(--text-color); font-weight: 500; }
.cal-countdown-days { font-family: var(--font-serif); font-size: 20px; font-weight: 600; color: var(--text-color); }
.cal-countdown-label { font-size: 8px; color: var(--text-secondary); letter-spacing: 1px; text-align: right; }
.cal-settings-section { padding: 14px 20px; border-top: 1px solid var(--border-color); flex-shrink: 0; }
.cal-settings-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cal-settings-label { font-size: 9px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--text-secondary); }
html, body {
    min-height: 100dvh;
    overscroll-behavior: none;
}

/* 强制修复 iOS 底部黑块：已通过 100dvh 动态视口高度与背景色同步解决 */

/* ==================== 稳定版气泡与卡片分离 ==================== */
.msg-row.bubble-row.me .msg-bubble::before,
.msg-row.bubble-row.me .msg-bubble::after,
.msg-row.bubble-row.ai .msg-bubble::before,
.msg-row.bubble-row.ai .msg-bubble::after {
    display: none !important;
}

.msg-row.bubble-row.me .msg-bubble,
.msg-row.bubble-row.ai .msg-bubble {
    border-radius: 18px !important;
}

.msg-row.bubble-row.me .msg-bubble {
    border-bottom-right-radius: 8px !important;
}

.msg-row.bubble-row.ai .msg-bubble {
    border-bottom-left-radius: 8px !important;
}

.msg-row.bubble-row + .msg-row.bubble-row {
    margin-top: 1px !important;
}

.msg-row.card-row {
    margin-top: 10px !important;
    margin-bottom: 10px !important;
}

.msg-row.card-row + .msg-row.bubble-row,
.msg-row.bubble-row + .msg-row.card-row,
.msg-row.card-row + .msg-row.card-row {
    margin-top: 10px !important;
}

.msg-row.card-row .msg-avatar {
    visibility: visible !important;
}

.msg-row.card-row .msg-wrapper {
    max-width: 86% !important;
}

/* ==================== 毛玻璃输入框 ==================== */
.input-area-floating {
    background: transparent !important;
}

#chat-input {
    background-color: var(--glass-bg) !important;
    backdrop-filter: blur(15px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(15px) saturate(180%) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05) !important;
    border-radius: 20px !important;
    color: var(--text-color) !important;
    font-size: 14px !important;
    padding: 9px 16px !important;
    min-height: 38px !important;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}
[data-theme="dark"] #chat-input {
    background-color: rgba(30, 30, 30, 0.6) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

#chat-input:focus {
    border-color: rgba(255, 255, 255, 0.9) !important;
}

#chat-input::placeholder {
    color: #bbbbbb !important;
    font-size: 14px !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
}

[data-theme="dark"] #chat-input {
    background-color: transparent !important;
    border: 0.5px solid rgba(255, 255, 255, 0.1) !important;
    color: var(--text-color) !important;
}

[data-theme="dark"] #chat-input::placeholder {
    color: #666 !important;
}

.standalone-icon-btn {
    background: rgba(255, 255, 255, 0.45) !important;
    backdrop-filter: blur(20px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
    border: 1px solid rgba(255, 255, 255, 0.6) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08) !important;
    border-radius: 50% !important;
}

[data-theme="dark"] .standalone-icon-btn {
    background: rgba(50, 50, 50, 0.6) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
}

.standalone-send-btn {
    border-radius: 50% !important;
    width: 36px !important;
    height: 36px !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1) !important;
}

.standalone-send-btn span {
    display: none !important;
}

.standalone-send-btn.outline {
    background: rgba(255, 255, 255, 0.45) !important;
    backdrop-filter: blur(20px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
    border: 1px solid rgba(255, 255, 255, 0.6) !important;
    color: var(--text-color) !important;
}

[data-theme="dark"] .standalone-send-btn.outline {
    background: rgba(50, 50, 50, 0.6) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
}

/* ==================== 时间戳在气泡外部 + 纯文字消息状态 ==================== */
.msg-wrapper { position: relative; }
.msg-status { position: relative !important; bottom: auto !important; font-size: 10px !important; font-weight: 400 !important; margin-top: 4px !important; margin-bottom: 4px !important; display: inline-flex !important; align-items: center !important; gap: 6px !important; white-space: nowrap !important; letter-spacing: 0 !important; text-transform: none !important; color: var(--timestamp-color, var(--text-secondary)) !important; padding: 0 4px !important; }
.msg-row.me .msg-status { color: var(--timestamp-color, var(--text-secondary)) !important; justify-content: center !important; }
.msg-row.ai .msg-status { color: var(--timestamp-color, var(--text-secondary)) !important; justify-content: center !important; padding: 0 12px !important; }
.msg-row.me .msg-status::after { display: none !important; }
.msg-delivery-text { font-size: 10px; font-weight: 400; letter-spacing: 0.3px; }
.msg-delivery-text.status-delivered { color: var(--timestamp-color, var(--text-secondary)); }
.msg-delivery-text.status-read { color: var(--timestamp-color, var(--text-secondary)); }
.msg-delivery-text.status-failed { color: #ef4444; }

/* =========================================
   统一的高级内发光玻璃拟态按钮样式
   ========================================= */
.standalone-icon-btn,
.standalone-send-btn,
.glass-icon-btn,
.chat-title-glass {
    background-color: rgba(255, 255, 255, 0.02) !important;
    backdrop-filter: blur(5px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(5px) saturate(180%) !important;
    border: 0.5px solid rgba(255, 255, 255, 0.25) !important;
    box-shadow:
      inset 0 1px 0 0 rgba(255, 255, 255, 0.5),
      inset 0 -2px 6px 0 rgba(255, 255, 255, 0.45),
      0 5px 15px -3px rgba(0, 0, 0, 0.15) !important;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

.standalone-icon-btn:active,
.standalone-send-btn:active,
.glass-icon-btn:active,
.chat-title-glass:active {
    transform: scale(0.9) !important;
    background-color: rgba(255, 255, 255, 0.06) !important;
    box-shadow:
      inset 0 1px 0 0 rgba(255, 255, 255, 0.8),
      inset 0 -3px 8px 0 rgba(255, 255, 255, 0.6),
      0 8px 25px -5px rgba(255, 255, 255, 0.4) !important;
}

/* 暗色模式适配 */
[data-theme="dark"] .standalone-icon-btn,
[data-theme="dark"] .standalone-send-btn,
[data-theme="dark"] .glass-icon-btn,
[data-theme="dark"] .chat-title-glass {
    background-color: rgba(50, 50, 50, 0.2) !important;
    border: 0.5px solid rgba(255, 255, 255, 0.15) !important;
    box-shadow:
      inset 0 1px 0 0 rgba(255, 255, 255, 0.1),
      inset 0 -2px 6px 0 rgba(255, 255, 255, 0.05),
      0 5px 15px -3px rgba(0, 0, 0, 0.3) !important;
}

[data-theme="dark"] .standalone-icon-btn:active,
[data-theme="dark"] .standalone-send-btn:active,
[data-theme="dark"] .glass-icon-btn:active,
[data-theme="dark"] .chat-title-glass:active {
    background-color: rgba(50, 50, 50, 0.4) !important;
    box-shadow:
      inset 0 1px 0 0 rgba(255, 255, 255, 0.2),
      inset 0 -3px 8px 0 rgba(255, 255, 255, 0.1),
      0 8px 25px -5px rgba(0, 0, 0, 0.4) !important;
}
/* =========================================
   奢侈感重构版：精致附件按钮与高定工具栏
   ========================================= */
.standalone-icon-btn,
.glass-icon-btn,
.chat-title-glass {
    background-color: rgba(255, 255, 255, 0.02) !important;
    backdrop-filter: blur(10px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(10px) saturate(180%) !important;
    border: 0.5px solid rgba(255, 255, 255, 0.2) !important;
    box-shadow:
      inset 0 1px 0 0 rgba(255, 255, 255, 0.4),
      inset 0 -1px 4px 0 rgba(255, 255, 255, 0.3),
      0 2px 6px rgba(0, 0, 0, 0.05) !important;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

.standalone-icon-btn:active,
.glass-icon-btn:active,
.chat-title-glass:active {
    transform: scale(0.92) !important;
    background-color: rgba(255, 255, 255, 0.08) !important;
}

/* 暗色模式适配 */
[data-theme="dark"] .standalone-icon-btn,
[data-theme="dark"] .glass-icon-btn,
[data-theme="dark"] .chat-title-glass {
    background-color: rgba(50, 50, 50, 0.3) !important;
    border: 0.5px solid rgba(255, 255, 255, 0.1) !important;
}

/* 输入区域整体布局 */
.input-controls {
    display: flex !important;
    gap: 10px !important;
    align-items: center !important;
    position: relative !important;
}

/* 附件按钮：精致小圆 */
.standalone-icon-btn {
    width: 38px !important; 
    height: 38px !important;
    min-width: 38px !important;
    min-height: 38px !important;
    flex-shrink: 0 !important;
    border-radius: 50% !important;
    overflow: hidden !important;
    color: var(--role-accent-color, var(--text-color)) !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    padding: 0 !important;
}
.standalone-icon-btn::after {
    content: '' !important;
    display: block !important;
    width: 18px !important;
    height: 18px !important;
    background-color: currentColor !important;
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21.44 11.05l-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48'/%3E%3C/svg%3E") !important;
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21.44 11.05l-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48'/%3E%3C/svg%3E") !important;
    background-size: contain !important;
    background-repeat: no-repeat;
}

/* 附件工具栏：高定窄版长条 */
#attachment-popup {
    width: 160px !important;
    padding: 6px 0 !important;
    display: none;
    flex-direction: column !important;
    background: rgba(255, 255, 255, 1) !important;
    backdrop-filter: blur(35px) saturate(200%) !important;
    -webkit-backdrop-filter: blur(35px) saturate(200%) !important;
    border-radius: 14px !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15) !important;
    border: 0.5px solid rgba(255, 255, 255, 0.3) !important;
    bottom: 50px !important;
    left: 0 !important;
}
[data-theme="dark"] #attachment-popup {
    background: #1c1c1e !important; /* 纯色不透明深灰/黑色 */
    border: 0.5px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.8) !important;
}
.attach-btn {
    display: flex !important;
    flex-direction: row !important; /* 横向排列 */
    align-items: center !important;
    justify-content: flex-start !important;
    padding: 10px 16px !important;
    border: none !important;
    background: none !important;
    gap: 12px !important;
    color: var(--role-accent-color, var(--text-color)) !important;
    width: 100% !important;
    transition: background 0.2s;
}
.attach-btn:active { background: rgba(255,255,255,0.1); }
.attach-btn svg {
    width: 16px !important;
    height: 16px !important;
    stroke: var(--attachment-color, var(--text-color)) !important;
    opacity: 0.8;
}
.attach-btn span {
    margin: 0 !important;
    font-size: 9px !important;
    font-weight: 600 !important;
    letter-spacing: 1px !important;
    text-transform: uppercase !important; /* 全大写奢侈感 */
    color: var(--attachment-color, var(--text-color)) !important;
    opacity: 0.9;
}

/* 输入框容器：瘦身 */
.input-wrapper-fusion {
    flex: 1 !important;
    position: relative !important;
    display: flex !important;
    align-items: center !important;
}

#chat-input {
    width: 100% !important;
    height: 38px !important; /* 进一步瘦身 */
    min-height: 38px !important;
    padding: 8px 38px 8px 16px !important;
    border-radius: 19px !important;
    font-size: 13px !important;
    line-height: 22px !important;
}

/* 修复提示词颜色显示 */
#chat-input::placeholder {
    color: var(--placeholder-color, #bbbbbb) !important;
    opacity: 1 !important; /* 必须设置 opacity 为 1，否则颜色会发灰 */
}

/* 发送按钮：极致透明化，严禁任何背景 */
.standalone-send-btn {
    position: absolute !important;
    right: 6px !important;
    width: 30px !important;
    height: 30px !important;
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    color: var(--placeholder-color, #bbbbbb) !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 5 !important;
    padding: 0 !important;
    -webkit-tap-highlight-color: transparent !important;
}

.standalone-send-btn::before {
    content: '' !important;
    width: 18px !important;
    height: 18px !important;
    /* 使用变量控制发送按钮图标颜色 */
    background-color: var(--send-btn-color, currentColor) !important;
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z'/%3E%3Cpath d='M19 10v2a7 7 0 0 1-14 0v-2'/%3E%3Cline x1='12' y1='19' x2='12' y2='23'/%3E%3Cline x1='8' y1='23' x2='16' y2='23'/%3E%3C/svg%3E") !important;
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z'/%3E%3Cpath d='M19 10v2a7 7 0 0 1-14 0v-2'/%3E%3Cline x1='12' y1='19' x2='12' y2='23'/%3E%3Cline x1='8' y1='23' x2='16' y2='23'/%3E%3C/svg%3E") !important;
    background-size: contain !important;
}

/* 聊天顶栏按钮与悬浮备注 */
.glass-icon-btn {
    width: 34px; height: 34px; border-radius: 50%;
    display: flex; justify-content: center; align-items: center;
    cursor: pointer; color: var(--role-accent-color, var(--text-color)); padding: 0;
}
.glass-icon-btn svg { stroke: currentColor !important; }
.chat-title-glass {
    display: flex; align-items: center; gap: 6px;
    padding: 4px 10px 4px 14px;
    border-radius: 16px;
    cursor: pointer;
}
.chat-title-arrow { color: var(--text-secondary); opacity: 0.6; }
#chat-title { 
    font-family: var(--font-serif); 
    font-size: 13px !important; 
    font-weight: 600; 
    font-style: normal !important; 
    color: var(--role-accent-color, var(--text-color)); 
    letter-spacing: 0.5px; 
}

/* 强制修复 iOS/移动端滑动白屏（橡皮筋回弹）问题 */
html, body, #phone-shell, .view-container { overscroll-behavior: none !important; }
.view-content, #chat-messages, #reinc-chat-messages, .reinc-page { overscroll-behavior: contain !important; -webkit-overflow-scrolling: touch; }

/* 针对 APK/PWA 安装包的全屏与防遮挡优化 (完美适配刘海屏与底部小白条) */
body.is-app #status-bar { padding-top: env(safe-area-inset-top); height: calc(var(--status-bar-height) + env(safe-area-inset-top)); }
body.is-app .view-header { padding-top: calc(10px + env(safe-area-inset-top)) !important; }
body.is-app #chat-header { padding-top: calc(10px + env(safe-area-inset-top)) !important; }
body.is-app .input-area-floating { bottom: calc(8px + env(safe-area-inset-bottom)) !important; }
body.is-app #desktop-dock { bottom: calc(20px + env(safe-area-inset-bottom)) !important; }
body.is-app #selection-action-bar { padding-bottom: calc(10px + env(safe-area-inset-bottom)) !important; height: calc(70px + env(safe-area-inset-bottom)) !important; }
body.is-app .to-bottom-nav { padding-bottom: env(safe-area-inset-bottom) !important; height: calc(70px + env(safe-area-inset-bottom)) !important; }
body.is-app #music-nav-bar { padding-bottom: env(safe-area-inset-bottom) !important; height: calc(50px + env(safe-area-inset-bottom)) !important; }
body.is-app #music-mini-player { bottom: calc(50px + env(safe-area-inset-bottom)) !important; }
body.is-app .os-bottom-nav { padding-bottom: env(safe-area-inset-bottom) !important; height: calc(60px + env(safe-area-inset-bottom)) !important; }
body.is-app #chat-messages { padding-bottom: calc(140px + env(safe-area-inset-bottom)) !important; }
body.is-app .to-cart-float { bottom: calc(15px + env(safe-area-inset-bottom)) !important; }
body.is-app .to-page { padding-bottom: calc(70px + env(safe-area-inset-bottom)) !important; }

/* ==================== 票根卡片样式 ==================== */
.ticket-card-wrapper {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 5px;
}
.ticket-card {
    width: 100%;
    display: flex;
    position: relative;
    border-radius: 12px;
    overflow: visible;
    cursor: pointer;
    transition: transform 0.2s ease;
}
.ticket-card:active { transform: scale(0.98); }
.tc-main {
    flex: 1;
    padding: 14px 16px;
    position: relative;
    overflow: hidden;
    border-radius: 12px 0 0 12px;
}
.tc-main::after {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: linear-gradient(45deg, transparent 40%, rgba(255,255,255,0.04) 50%, transparent 60%);
    animation: tcShine 4s ease-in-out infinite;
    pointer-events: none;
}
@keyframes tcShine {
    0%, 100% { transform: translateX(-100%) rotate(25deg); }
    50% { transform: translateX(100%) rotate(25deg); }
}
.tc-stub {
    width: 70px;
    padding: 10px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 0 12px 12px 0;
    position: relative;
}
.tc-divider {
    position: absolute;
    right: 70px;
    top: 0; bottom: 0;
    width: 2px;
    z-index: 10;
}
.tc-divider::before {
    content: '';
    position: absolute;
    top: 8px; bottom: 8px; left: 0;
    width: 2px;
    border-left: 2px dashed rgba(255,255,255,0.25);
}
/* 移除了票根的两个白点，保持极简 */
.ticket-card::before, .ticket-card::after {
    display: none !important;
}
.tc-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.tc-type {
    font-size: 7px; font-weight: 700; letter-spacing: 1.5px;
    text-transform: uppercase; padding: 2px 6px; border-radius: 3px;
    display: flex; align-items: center; gap: 4px;
}
.tc-type svg { width: 10px; height: 10px; flex-shrink: 0; }
.tc-serial { font-size: 7px; opacity: 0.5; letter-spacing: 1px; }
.tc-title { font-family: 'Cormorant Garamond', serif; font-size: 17px; font-weight: 600; line-height: 1.2; margin-bottom: 3px; }
.tc-subtitle { font-size: 9px; opacity: 0.6; margin-bottom: 12px; font-weight: 300; }
.tc-info-row { display: flex; gap: 12px; margin-bottom: 8px; }
.tc-info-item { display: flex; flex-direction: column; }
.tc-info-label { font-size: 6px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; opacity: 0.45; margin-bottom: 2px; }
.tc-info-value { font-size: 10px; font-weight: 600; }
.tc-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; padding-top: 8px; border-top: 1px solid rgba(255,255,255,0.08); }
.tc-footer-text { font-size: 7px; opacity: 0.35; letter-spacing: 1px; }
.tc-owner { font-size: 7px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; padding: 2px 6px; border-radius: 3px; background: rgba(255,255,255,0.1); }
.tc-stub-date { font-family: 'Cormorant Garamond', serif; font-size: 22px; font-weight: 600; line-height: 1; }
.tc-stub-month { font-size: 8px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; margin-top: 3px; }
.tc-stub-year { font-size: 7px; opacity: 0.5; margin-top: 1px; }
.tc-barcode { display: flex; gap: 1px; margin-top: 8px; align-items: flex-end; height: 16px; }
.tc-bar { width: 2px; background: currentColor; opacity: 0.3; }
.tc-bar:nth-child(odd) { height: 60%; }
.tc-bar:nth-child(even) { height: 100%; }
.tc-bar:nth-child(3n) { height: 40%; }
.tc-bar:nth-child(5n) { height: 80%; }

/* 票根主题色 */
.tc-movie .tc-main { background: linear-gradient(135deg, #1a1a2e, #16213e); color: #e8d5b7; }
.tc-movie .tc-stub { background: linear-gradient(135deg, #16213e, #0f3460); color: #e8d5b7; }
.tc-movie .tc-type { background: rgba(232,213,183,0.15); color: #e8d5b7; }
.tc-concert .tc-main { background: linear-gradient(135deg, #2d1b69, #11001c); color: #e0c3fc; }
.tc-concert .tc-stub { background: linear-gradient(135deg, #11001c, #1a0533); color: #e0c3fc; }
.tc-concert .tc-type { background: rgba(224,64,251,0.15); color: #e040fb; }
.tc-travel .tc-main { background: linear-gradient(135deg, #1a1a1a, #2d2d2d); color: #f5f5f5; }
.tc-travel .tc-stub { background: linear-gradient(135deg, #ff6b35, #f7931e); color: #fff; }
.tc-travel .tc-type { background: rgba(255,107,53,0.15); color: #ff6b35; }
.tc-exhibit .tc-main { background: #fff; color: #1a1a1a; }
.tc-exhibit .tc-stub { background: #f5f5f5; color: #1a1a1a; }
.tc-exhibit .tc-type { background: #1a1a1a; color: #fff; }
.tc-exhibit .tc-footer { border-top-color: rgba(0,0,0,0.08); }
.tc-exhibit .tc-divider::before { border-left-color: rgba(0,0,0,0.15); }
.tc-exhibit::before, .tc-exhibit::after { background: var(--bg-color); }
.tc-love .tc-main { background: linear-gradient(135deg, #2d1f2f, #1a1520); color: #ffb6c1; }
.tc-love .tc-stub { background: linear-gradient(135deg, #1a1520, #2d1f2f); color: #ffb6c1; }
.tc-love .tc-type { background: rgba(255,182,193,0.15); color: #ff8da1; }
.tc-love .tc-title { color: #fff; }
.tc-radio .tc-main { background: linear-gradient(135deg, #0a192f, #172a45); color: #8892b0; }
.tc-radio .tc-stub { background: linear-gradient(135deg, #172a45, #1d3557); color: #64ffda; }
.tc-radio .tc-type { background: rgba(100,255,218,0.1); color: #64ffda; }
.tc-radio .tc-title { color: #ccd6f6; }
/* ==================== 全局尺寸精简优化 (适配 APK/移动端) ==================== */
/* 缩小标题 */
.title-serif { font-size: 26px !important; }
#chat-title { font-size: 18px !important; }
.modal h3 { font-size: 20px !important; }

/* 缩小桌面图标和间距 */
.desktop-app-grid { grid-auto-rows: 75px !important; gap: 10px 8px !important; }
#desktop-dock { height: 75px !important; bottom: 20px !important; } /* 调整Dock栏位置 */
.desktop-pagination { bottom: 110px !important; } /* 同步调整分页指示器位置 */
.app-icon .icon { width: 46px !important; height: 46px !important; margin-bottom: 4px !important; }
.app-icon span { font-size: 7.5px !important; }
.app-icon .sub-name { font-size: 6.5px !important; }

/* 缩小列表项和头像 */
.list-item { padding: 10px 0 !important; }
.avatar { width: 32px !important; height: 32px !important; margin-right: 10px !important; }
.item-name { font-size: 15px !important; }
.item-desc { font-size: 9px !important; }

/* 缩小底部输入区按钮 */
.standalone-icon-btn { width: 30px !important; height: 30px !important; }
.standalone-icon-btn::after { width: 16px !important; height: 16px !important; }
.standalone-send-btn { width: 30px !important; height: 30px !important; background-size: 15px 15px !important; }
#chat-input { min-height: 34px !important; padding: 7px 14px !important; font-size: 12px !important; }

/* 缩小弹窗内边距和输入框 */
.modal { padding: 20px 15px !important; gap: 6px !important; }
.modal input, .modal textarea, .modal select { padding: 8px 10px !important; font-size: 10px !important; }
.action-btn { padding: 8px !important; font-size: 8px !important; }

/* 缩小顶部 Header 内边距 */
.view-header { padding: 10px 15px 10px 15px !important; }
#chat-header { padding: 10px 15px 10px 15px !important; }

/* ==================== 灵动岛 Dynamic Island ==================== */
#dynamic-island { position: absolute; top: calc(env(safe-area-inset-top) + 10px); left: 50%; transform: translateX(-50%) translateY(-50px) scale(0.8); background: #000000; color: #ffffff; border-radius: 24px; padding: 6px 14px; display: flex; align-items: center; gap: 10px; z-index: 9999; opacity: 0; transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); box-shadow: 0 10px 30px rgba(0,0,0,0.4); pointer-events: none; max-width: 220px; cursor: pointer; }
#dynamic-island.active { transform: translateX(-50%) translateY(0) scale(1); opacity: 1; pointer-events: auto; }
.di-cover { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; animation: diSpin 4s linear infinite; }
.di-info { flex: 1; overflow: hidden; display: flex; flex-direction: column; }
.di-title { font-size: 11px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: var(--font-sans); }
.di-wave { display: flex; gap: 2px; align-items: flex-end; height: 14px; }
.di-bar { width: 2px; background: #22c55e; border-radius: 1px; animation: diWave 1s infinite ease-in-out; }
.di-bar:nth-child(1) { animation-delay: 0.0s; }
.di-bar:nth-child(2) { animation-delay: 0.2s; }
.di-bar:nth-child(3) { animation-delay: 0.4s; }
@keyframes diSpin { 100% { transform: rotate(360deg); } }
@keyframes diWave { 0%, 100% { height: 4px; } 50% { height: 14px; } }


@keyframes blink { 0% { opacity: .2; } 20% { opacity: 1; } 100% { opacity: .2; } }


            /* 美容院专属样式优化 */
            #view-beauty .setting-group {
                border: 1px solid var(--border-color);
                border-radius: 12px;
                padding: 15px;
                margin-bottom: 15px;
                background: var(--gray-light);
            }
            #view-beauty .setting-group > label {
                font-size: 10px;
                font-weight: 700;
                letter-spacing: 1px;
                text-transform: uppercase;
                color: var(--text-color);
                margin-bottom: 12px;
            }
            #view-beauty textarea {
                width: 100%;
                height: 160px; /* 增大输入框高度 */
                resize: vertical;
                padding: 10px;
                border: 1px solid var(--border-color);
                background: var(--bg-color);
                color: var(--text-color);
                font-family: monospace; /* 使用等宽字体，更适合写代码 */
                font-size: 11px;
                line-height: 1.6;
                border-radius: 8px;
                outline: none;
            }
            #view-beauty input[type="range"] {
                width: 100%;
                accent-color: var(--text-color);
            }
        


    /* 情绪密码专属样式 */
    #view-cipher .view-content { padding: 0; overflow: hidden; }
    .cipher-app { height: 100%; display: flex; flex-direction: column; overflow: hidden; }
    .cipher-page { display: none; flex-direction: column; flex: 1; overflow-y: auto; padding: 15px 20px; }
    .cipher-page.active { display: flex; }
    .cipher-stats-row { display: flex; gap: 1px; margin: 15px 0; background: var(--border-color); }
    .cipher-stat { flex: 1; background: var(--bg-color); padding: 12px 8px; text-align: center; }
    .cipher-stat-val { font-family: var(--font-serif); font-size: 22px; font-weight: 600; }
    .cipher-stat-label { font-size: 7px; letter-spacing: 2px; color: var(--text-secondary); text-transform: uppercase; margin-top: 3px; }
    .cipher-role-card { display: flex; align-items: center; gap: 14px; padding: 12px; border: 1px solid var(--gray-light); margin-bottom: 8px; cursor: pointer; }
    .cipher-role-card:active { opacity: 0.6; }
    .cipher-role-card.selected { border-color: var(--text-color); border-width: 2px; }
    .cipher-role-avatar { width: 36px; height: 36px; border: 1px solid var(--border-color); object-fit: cover; background: var(--gray-light); }
    .cipher-box { border: 1px solid var(--border-color); padding: 20px 14px; text-align: center; margin-bottom: 14px; min-height: 70px; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 4px; }
    .cipher-box.empty { border-style: dashed; }
    .cipher-sym { font-size: 26px; }
    .cipher-wrd { font-size: 12px; font-style: italic; color: var(--text-secondary); padding: 2px 6px; border: 1px dashed var(--text-secondary); }
    .cipher-pls { font-size: 13px; color: var(--text-secondary); margin: 0 2px; }
    .cipher-ph { font-size: 8px; color: var(--text-secondary); letter-spacing: 2px; text-transform: uppercase; }
    .cipher-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 10px; min-height: 22px; }
    .cipher-tag { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border: 1px solid var(--border-color); font-size: 11px; }
    .cipher-tag-rm { width: 13px; height: 13px; border: none; background: var(--text-color); color: var(--bg-color); font-size: 8px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
    .cipher-input-row { display: flex; gap: 6px; margin-bottom: 10px; }
    .cipher-text-input { flex: 1; padding: 8px 10px; border: 1px solid var(--border-color); background: transparent; color: var(--text-color); font-size: 11px; outline: none; font-family: var(--font-sans); }
    .cipher-text-input::placeholder { color: var(--text-secondary); font-size: 8px; letter-spacing: 1px; text-transform: uppercase; }
    .cipher-add-btn { width: 36px; border: 1px solid var(--border-color); background: var(--text-color); color: var(--bg-color); font-size: 16px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
    .cipher-kb { border: 1px solid var(--border-color); margin-bottom: 10px; }
    .cipher-kb-tabs { display: flex; border-bottom: 1px solid var(--border-color); overflow-x: auto; scrollbar-width: none; }
    .cipher-kb-tabs::-webkit-scrollbar { display: none; }
    .cipher-kb-tab { padding: 6px 10px; font-size: 7px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; white-space: nowrap; cursor: pointer; color: var(--text-secondary); border-right: 1px solid var(--gray-light); flex-shrink: 0; }
    .cipher-kb-tab.active { color: var(--text-color); background: var(--gray-light); }
    .cipher-sym-grid { display: grid; grid-template-columns: repeat(6, 1fr); }
    .cipher-sym-btn { aspect-ratio: 1; border: none; border-right: 1px solid var(--gray-light); border-bottom: 1px solid var(--gray-light); background: transparent; font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
    .cipher-sym-btn:active { background: var(--text-color); }
    .cipher-sym-btn:nth-child(6n) { border-right: none; }
    .cipher-target-box { border: 1px solid var(--text-secondary); padding: 6px 12px; text-align: center; margin-bottom: 12px; }
    .cipher-target-label { font-size: 7px; letter-spacing: 2px; color: var(--text-secondary); text-transform: uppercase; margin-bottom: 3px; }
    .cipher-target-text { font-size: 12px; font-style: italic; }
    .cipher-options { display: flex; flex-direction: column; gap: 7px; margin-bottom: 14px; }
    .cipher-opt { padding: 10px 12px; border: 1px solid var(--gray-light); cursor: pointer; font-size: 11px; line-height: 1.5; display: flex; align-items: flex-start; gap: 8px; }
    .cipher-opt:active { opacity: 0.7; }
    .cipher-opt.disabled { pointer-events: none; }
    .cipher-opt-letter { width: 18px; height: 18px; border: 1px solid var(--border-color); display: flex; align-items: center; justify-content: center; font-size: 8px; font-weight: 700; flex-shrink: 0; }
    .cipher-opt.correct { border-color: #22c55e; background: rgba(34,197,94,0.06); }
    .cipher-opt.correct .cipher-opt-letter { background: #22c55e; color: #fff; border-color: #22c55e; }
    .cipher-opt.wrong { border-color: #ef4444; background: rgba(239,68,68,0.06); }
    .cipher-opt.wrong .cipher-opt-letter { background: #ef4444; color: #fff; border-color: #ef4444; }
    .cipher-guess-card { border: 1px solid var(--border-color); padding: 16px; margin-bottom: 14px; }
    .cipher-guess-label { font-size: 7px; letter-spacing: 2px; color: var(--text-secondary); text-transform: uppercase; margin-bottom: 6px; }
    .cipher-thinking { display: flex; gap: 5px; align-items: center; justify-content: center; padding: 16px; }
    .cipher-thinking span { width: 5px; height: 5px; background: var(--text-color); animation: cipherBlink 1.4s infinite; }
    .cipher-thinking span:nth-child(2) { animation-delay: 0.2s; }
    .cipher-thinking span:nth-child(3) { animation-delay: 0.4s; }
    @keyframes cipherBlink { 0%,80%,100%{opacity:0.2} 40%{opacity:1} }
    .cipher-diff-row { display: flex; gap: 1px; margin-bottom: 14px; background: var(--border-color); }
    .cipher-diff-btn { flex: 1; padding: 7px; background: var(--bg-color); text-align: center; font-size: 7px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; cursor: pointer; color: var(--text-secondary); }
    .cipher-diff-btn.active { color: var(--text-color); background: var(--gray-light); }
    .cipher-collection-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--gray-light); }
    .cipher-collection-emoji { font-size: 20px; width: 36px; text-align: center; flex-shrink: 0; }
    .cipher-collection-info { flex: 1; overflow: hidden; }
    .cipher-collection-cipher { font-size: 9px; color: var(--text-secondary); margin-bottom: 2px; }
    .cipher-collection-meaning { font-size: 11px; font-weight: 500; }
    .cipher-collection-badge { font-size: 6px; padding: 2px 6px; border: 1px solid var(--border-color); letter-spacing: 1px; text-transform: uppercase; font-weight: 600; flex-shrink: 0; }
    .cipher-bank-item { display: flex; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--gray-light); }
    .cipher-bank-sym { font-size: 14px; flex-shrink: 0; min-width: 70px; }
    .cipher-bank-ans { flex: 1; font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .cipher-bank-del { width: 22px; height: 22px; border: 1px solid #ef4444; color: #ef4444; background: transparent; font-size: 11px; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
    .cipher-result-overlay { display: none; position: absolute; inset: 0; background: rgba(0,0,0,0.85); z-index: 9990; align-items: center; justify-content: center; flex-direction: column; padding: 30px; text-align: center; }
    .cipher-result-overlay.active { display: flex; }
    .cipher-result-icon { font-size: 42px; margin-bottom: 14px; }
    .cipher-result-title { font-family: var(--font-serif); font-size: 22px; color: #fff; margin-bottom: 6px; }
    .cipher-result-sub { font-size: 10px; color: #888; margin-bottom: 14px; }
    .cipher-result-answer { border: 1px solid #333; padding: 14px; margin-bottom: 16px; max-width: 260px; }
    .cipher-result-answer-label { font-size: 7px; letter-spacing: 2px; color: #666; margin-bottom: 5px; }
    .cipher-result-answer-text { font-size: 12px; color: #fff; line-height: 1.6; }
    .cipher-result-score { font-size: 16px; font-weight: 700; margin-bottom: 16px; }
    .cipher-result-score.pos { color: #22c55e; }
    .cipher-result-score.neg { color: #ef4444; }
    .cipher-action-row { display: flex; gap: 8px; margin-top: auto; padding-top: 10px; }
    .cipher-action-row .action-btn { flex: 1; }
    .cipher-textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--border-color); background: transparent; color: var(--text-color); font-size: 11px; outline: none; font-family: var(--font-sans); resize: vertical; min-height: 40px; }
    .cipher-textarea::placeholder { color: var(--text-secondary); }
    .cipher-section-label { font-size: 7px; letter-spacing: 2px; color: var(--text-secondary); text-transform: uppercase; margin-bottom: 5px; font-weight: 600; }
    /* ==================== 角色状态栏系统 ==================== */
.status-panel-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9990;
    display: none;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.status-panel-overlay.visible {
    display: flex;
}
.status-panel-content {
    width: 90%;
    max-width: 340px;
    max-height: 70vh;
    overflow-y: auto;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    padding: 20px;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: statusSlideIn 0.3s ease;
}
.status-panel-content::-webkit-scrollbar { display: none; }
@keyframes statusSlideIn {
    from { transform: translateY(20px) scale(0.95); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}
.status-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--gray-light);
}
.status-panel-title {
    font-family: var(--font-serif);
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
}
.close-status-panel {
    width: 28px; height: 28px;
    border: 1px solid var(--border-color);
    background: var(--bg-color);
    color: var(--text-color);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.close-status-panel:active {
    background: var(--text-color);
    color: var(--bg-color);
}
.status-history-item {
    background: var(--gray-light);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    position: relative;
}
.status-checkbox {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 16px;
    height: 16px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-color);
    display: none;
    cursor: pointer;
}
.status-manage-mode .status-checkbox {
    display: block;
}
.status-checkbox.checked {
    background: var(--text-color);
}
.status-checkbox.checked::after {
    content: '';
    position: absolute;
    top: 2px; left: 5px;
    width: 4px; height: 8px;
    border: solid var(--bg-color);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
/* ==================== 状态栏预设管理 ==================== */
.preset-card {
    border: 1px solid var(--border-color);
    padding: 12px;
    margin-bottom: 8px;
    position: relative;
    transition: background 0.2s;
}
.preset-card:active {
    background: var(--gray-light);
}
.preset-card-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 4px;
}
.preset-card-desc {
    font-size: 9px;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.preset-card-actions {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}
.preset-card-actions button {
    flex: 1;
    padding: 6px;
    font-size: 8px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    border: 1px solid var(--border-color);
    background: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-sans);
}
.preset-card-actions button:active {
    background: var(--text-color);
    color: var(--bg-color);
}
.preset-card-actions button.danger {
    border-color: #ff4d4d;
    color: #ff4d4d;
}
.preset-card-actions button.danger:active {
    background: #ff4d4d;
    color: #fff;
}
.preset-card-actions button.primary {
    background: var(--text-color);
    color: var(--bg-color);
}



    #view-reincarnation .view-content { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
    .reinc-page { display: none; flex-direction: column; flex: 1; overflow-y: auto; padding: 15px 20px; }
    .reinc-page.active { display: flex; }
    #reinc-chat-messages { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 15px; padding-bottom: 20px; }
    #reinc-chat-messages::-webkit-scrollbar { display: none; }
        /* 调整输入区域为相对定位，并为按钮留出右侧内边距 */
    .reinc-input-area { padding: 10px 20px; border-top: none; display: flex; align-items: center; background: var(--bg-color); position: relative; }
    .reinc-input { flex: 1; padding: 10px 45px 10px 15px; border: 1px solid var(--border-color); border-radius: 20px; background: transparent; color: var(--text-color); font-size: 11px; outline: none; }
    #reinc-send-btn { position: absolute; right: 26px; }
    #view-takeout .view-content { padding: 0; display: flex; flex-direction: column; overflow: hidden; position: relative; }
    .to-page { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: var(--bg-color); display: flex; flex-direction: column; transform: translateX(100%); opacity: 0; transition: transform var(--transition-smooth), opacity var(--transition-smooth); pointer-events: none; z-index: 10; padding-bottom: calc(70px + env(safe-area-inset-bottom)); }
    .to-page.active { transform: translateX(0); opacity: 1; pointer-events: auto; z-index: 20; }
    .to-page.base { transform: translateX(0); opacity: 1; pointer-events: auto; z-index: 5; }
    .to-page.slide-left { transform: translateX(-30%); opacity: 0.6; }
    .to-bottom-nav { z-index: 50; }
    @keyframes toBlink { 0%,100%{opacity:1} 50%{opacity:0.3} }
.to-scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; padding-bottom: 20px; }
    .to-scroll::-webkit-scrollbar { display: none; }
    .to-location { display: flex; align-items: center; gap: 4px; padding: 8px 20px; font-size: 11px; color: var(--text-secondary); cursor: pointer; }
    .to-location .loc-name { font-weight: 600; color: var(--text-color); }
    .to-search { margin: 8px 20px 10px; height: 36px; border-radius: 18px; border: 1px solid var(--border-color); background: var(--gray-light); padding: 0 16px; font-size: 12px; color: var(--text-color); outline: none; width: calc(100% - 40px); }
    .to-search::placeholder { color: var(--text-secondary); font-size: 11px; }
    .to-cat-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; padding: 8px 20px 15px; }
    .to-cat-item { display: flex; flex-direction: column; align-items: center; gap: 5px; cursor: pointer; padding: 6px 0; }
    .to-cat-item:active { transform: scale(0.92); }
    .to-cat-icon { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 20px; background: var(--gray-light); }
    .to-cat-name { font-size: 8px; font-weight: 600; color: var(--text-color); letter-spacing: 0.5px; }
    .to-banner-scroll { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 10px; padding: 0 20px 12px; scrollbar-width: none; }
    .to-banner-scroll::-webkit-scrollbar { display: none; }
    .to-banner { min-width: 85%; height: 100px; border-radius: 14px; scroll-snap-align: start; position: relative; overflow: hidden; background: linear-gradient(135deg, #1a1a1a, #333); flex-shrink: 0; display: flex; align-items: center; padding: 16px; cursor: pointer; }
    .to-banner:active { transform: scale(0.98); }
    .to-banner-text { color: #fff; z-index: 2; }
    .to-banner-title { font-family: var(--font-serif); font-size: 18px; font-weight: 600; margin-bottom: 3px; }
    .to-banner-sub { font-size: 9px; opacity: 0.7; letter-spacing: 1px; }
    .to-banner-tag { position: absolute; top: 10px; right: 10px; background: rgba(255,255,255,0.2); color: #fff; font-size: 7px; padding: 2px 7px; border-radius: 8px; font-weight: 600; letter-spacing: 1px; backdrop-filter: blur(10px); }
    .to-section-title { padding: 12px 20px 8px; display: flex; justify-content: space-between; align-items: baseline; }
    .to-section-title h3 { font-family: var(--font-serif); font-size: 16px; font-weight: 600; color: var(--text-color); }
    .to-section-title .more { font-size: 8px; color: var(--text-secondary); letter-spacing: 1px; text-transform: uppercase; cursor: pointer; font-weight: 600; }
    .to-shop-list { padding: 0 20px 90px; display: flex; flex-direction: column; gap: 10px; }
    .to-shop-card { display: flex; gap: 10px; padding: 10px; background: var(--card-bg); border: 1px solid var(--gray-light); border-radius: 12px; cursor: pointer; }
    .to-shop-card:active { transform: scale(0.98); }
    .to-shop-img { width: 70px; height: 70px; border-radius: 10px; background: var(--gray-light); flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 28px; }
    .to-shop-info { flex: 1; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; }
    .to-shop-name { font-size: 13px; font-weight: 600; color: var(--text-color); margin-bottom: 2px; }
    .to-shop-tags { display: flex; gap: 3px; flex-wrap: wrap; }
    .to-shop-tag { font-size: 7px; padding: 1px 5px; border-radius: 3px; background: var(--gray-light); color: var(--text-color); font-weight: 600; }
    .to-shop-tag.hot { background: #ff3b30; color: #fff; }
    .to-shop-meta { display: flex; align-items: center; gap: 6px; font-size: 9px; color: var(--text-secondary); }
    .to-shop-meta .rating { color: #ff9500; font-weight: 700; }
    .to-shop-price .yen { font-size: 9px; color: #ff3b30; font-weight: 700; }
    .to-shop-price .num { font-size: 13px; color: #ff3b30; font-weight: 700; }
    .to-shop-price .orig { font-size: 9px; color: var(--text-secondary); text-decoration: line-through; margin-left: 3px; }
    .to-detail-hero { height: 160px; background: linear-gradient(135deg, #2c2c2c, #1a1a1a); display: flex; align-items: flex-end; padding: 16px 20px; position: relative; flex-shrink: 0; }
    .to-detail-hero-name { font-family: var(--font-serif); font-size: 22px; font-weight: 600; color: #fff; }
    .to-detail-hero-meta { font-size: 9px; color: rgba(255,255,255,0.7); margin-top: 4px; display: flex; gap: 10px; }
    .to-detail-hero-badge { position: absolute; top: 12px; right: 12px; background: rgba(255,255,255,0.15); color: #fff; padding: 3px 8px; border-radius: 8px; font-size: 8px; font-weight: 600; letter-spacing: 1px; backdrop-filter: blur(10px); }
    .to-menu-tabs { display: flex; overflow-x: auto; padding: 10px 20px; gap: 6px; scrollbar-width: none; flex-shrink: 0; }
    .to-menu-tabs::-webkit-scrollbar { display: none; }
    .to-menu-tab { padding: 5px 12px; border-radius: 16px; font-size: 10px; font-weight: 600; white-space: nowrap; cursor: pointer; background: var(--gray-light); color: var(--text-secondary); border: none; }
    .to-menu-tab.active { background: var(--text-color); color: var(--bg-color); }
    .to-menu-tab:active { transform: scale(0.95); }
    .to-menu-list { padding: 8px 20px 110px; display: flex; flex-direction: column; gap: 10px; }
    .to-menu-item { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--gray-light); }
    .to-menu-item:last-child { border-bottom: none; }
    .to-menu-item-img { width: 64px; height: 64px; border-radius: 8px; background: var(--gray-light); flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 24px; }
    .to-menu-item-info { flex: 1; display: flex; flex-direction: column; justify-content: space-between; }
    .to-menu-item-name { font-size: 12px; font-weight: 600; color: var(--text-color); }
    .to-menu-item-desc { font-size: 9px; color: var(--text-secondary); line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
    .to-menu-item-sales { font-size: 8px; color: var(--text-secondary); }
    .to-menu-item-bottom { display: flex; justify-content: space-between; align-items: center; }
    .to-qty-control { display: flex; align-items: center; gap: 6px; }
    .to-qty-btn { width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--border-color); background: var(--bg-color); color: var(--text-color); font-size: 14px; display: flex; align-items: center; justify-content: center; cursor: pointer; }
    .to-qty-btn:active { background: var(--text-color); color: var(--bg-color); }
    .to-qty-btn.add { background: var(--text-color); color: var(--bg-color); border-color: var(--text-color); }
    .to-qty-num { font-size: 12px; font-weight: 700; min-width: 14px; text-align: center; }
    .to-cart-float { position: absolute; bottom: 15px; left: 15px; right: 15px; height: 50px; background: var(--text-color); border-radius: 25px; display: flex; align-items: center; padding: 0 6px 0 16px; box-shadow: 0 8px 25px rgba(0,0,0,0.3); z-index: 100; cursor: pointer; transform: translateY(80px); opacity: 0; transition: all var(--transition-smooth); }
    .to-cart-float.visible { transform: translateY(0); opacity: 1; }
    .to-cart-float:active { transform: scale(0.97); }
    .to-cart-badge { width: 16px; height: 16px; border-radius: 50%; background: #ff3b30; color: #fff; font-size: 8px; font-weight: 700; display: flex; align-items: center; justify-content: center; margin-right: 10px; }
    .to-cart-total { flex: 1; color: var(--bg-color); }
    .to-cart-total-price { font-size: 16px; font-weight: 700; }
    .to-cart-total-price .small { font-size: 10px; font-weight: 500; opacity: 0.7; }
    .to-cart-submit { height: 36px; padding: 0 16px; border-radius: 18px; background: var(--bg-color); color: var(--text-color); border: none; font-size: 10px; font-weight: 700; letter-spacing: 1px; cursor: pointer; }
    .to-cart-submit:active { opacity: 0.7; }
    .to-order-section { padding: 12px 20px; border-bottom: 6px solid var(--gray-light); }
    .to-order-section-title { font-size: 8px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--text-secondary); margin-bottom: 10px; }
    .to-order-address { display: flex; gap: 10px; align-items: center; cursor: pointer; }
    .to-order-address:active { opacity: 0.6; }
    .to-order-address-icon { width: 32px; height: 32px; border-radius: 50%; background: var(--gray-light); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
    .to-order-address-name { font-size: 12px; font-weight: 600; }
    .to-order-address-detail { font-size: 9px; color: var(--text-secondary); margin-top: 2px; }
    .to-time-chips { display: flex; gap: 6px; flex-wrap: wrap; }
    .to-time-chip { padding: 6px 12px; border-radius: 16px; font-size: 10px; font-weight: 600; border: 1px solid var(--border-color); background: var(--bg-color); color: var(--text-color); cursor: pointer; }
    .to-time-chip.active { background: var(--text-color); color: var(--bg-color); border-color: var(--text-color); }
    .to-time-chip:active { transform: scale(0.95); }
    .to-order-note { width: 100%; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--border-color); background: var(--gray-light); font-size: 11px; color: var(--text-color); outline: none; resize: none; height: 50px; }
    .to-order-note::placeholder { color: var(--text-secondary); }
    .to-summary-row { display: flex; justify-content: space-between; align-items: center; padding: 5px 0; font-size: 11px; color: var(--text-secondary); }
    .to-summary-row.total { font-size: 14px; font-weight: 700; color: var(--text-color); border-top: 1px solid var(--border-color); padding-top: 10px; margin-top: 5px; }
    .to-summary-row.total .price { color: #ff3b30; }
    .to-pay-btn { margin: 10px auto 0 auto; height: 40px; border-radius: 20px; background: var(--text-color); color: var(--bg-color); border: none; font-size: 11px; font-weight: 600; letter-spacing: 2px; cursor: pointer; width: 85%; display: flex; align-items: center; justify-content: center; gap: 6px; box-shadow: 0 4px 15px rgba(0,0,0,0.15); transition: transform 0.2s; }
    .to-pay-btn:active { transform: scale(0.96); opacity: 0.9; }
    .to-success-page { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 30px; text-align: center; height: 100%; }
    .to-success-icon { width: 70px; height: 70px; border-radius: 50%; background: var(--text-color); color: var(--bg-color); display: flex; align-items: center; justify-content: center; font-size: 30px; margin-bottom: 16px; animation: successPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1); }
    @keyframes successPop { 0% { transform: scale(0); } 100% { transform: scale(1); } }
    .to-success-title { font-family: var(--font-serif); font-size: 22px; font-weight: 600; margin-bottom: 6px; }
    .to-success-sub { font-size: 10px; color: var(--text-secondary); margin-bottom: 20px; line-height: 1.5; }
    .to-timeline { width: 100%; text-align: left; margin-bottom: 20px; }
    .to-timeline-item { display: flex; gap: 10px; padding: 8px 0; position: relative; }
    .to-timeline-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gray-mid); flex-shrink: 0; margin-top: 3px; position: relative; z-index: 2; }
    .to-timeline-dot.active { background: var(--text-color); }
    .to-timeline-item:not(:last-child)::before { content: ''; position: absolute; left: 3px; top: 19px; width: 2px; height: calc(100% - 11px); background: var(--gray-mid); }
    .to-timeline-text { font-size: 11px; font-weight: 500; }
    .to-timeline-time { font-size: 8px; color: var(--text-secondary); margin-top: 2px; }
    .to-bottom-nav { position: absolute; bottom: 0; left: 0; right: 0; height: 70px; background: var(--glass-bg); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-top: 1px solid var(--border-color); display: flex; justify-content: space-around; align-items: flex-start; padding-top: 8px; z-index: 50; }
    .to-nav-item { display: flex; flex-direction: column; align-items: center; gap: 3px; cursor: pointer; color: var(--text-secondary); width: 50px; position: relative; }
    .to-nav-item.active { color: var(--text-color); }
    .to-nav-item:active svg { transform: scale(0.85); }
    .to-nav-label { font-size: 8px; font-weight: 600; }
    .to-nav-badge { position: absolute; top: -2px; right: 6px; width: 14px; height: 14px; border-radius: 50%; background: #ff3b30; color: #fff; font-size: 7px; font-weight: 700; display: none; align-items: center; justify-content: center; }
    .to-orders-list { padding: 15px 20px 90px; }
    .to-order-card { border: 1px solid var(--gray-light); border-radius: 12px; padding: 12px; margin-bottom: 10px; cursor: pointer; }
    .to-order-card:active { transform: scale(0.98); }
    .to-order-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
    .to-order-card-shop { font-size: 13px; font-weight: 600; }
    .to-order-card-status { font-size: 9px; font-weight: 600; padding: 2px 8px; border-radius: 8px; }
    .to-order-card-status.pending { background: #fff3cd; color: #856404; }
    .to-order-card-status.done { background: #d4edda; color: #155724; }
    .to-order-card-items { font-size: 10px; color: var(--text-secondary); margin-bottom: 6px; }
    .to-order-card-bottom { display: flex; justify-content: space-between; align-items: center; font-size: 10px; }
    .to-order-card-total { font-weight: 700; color: var(--text-color); }
    .to-order-card-time { color: var(--text-secondary); }
    .to-order-card-btn { padding: 5px 12px; border-radius: 12px; border: 1px solid var(--border-color); background: var(--bg-color); font-size: 9px; font-weight: 600; cursor: pointer; }
    .to-order-card-btn:active { background: var(--text-color); color: var(--bg-color); }
    .to-profile-section { padding: 20px; }
    .to-profile-card { display: flex; align-items: center; gap: 15px; padding: 20px; background: var(--gray-light); border-radius: 14px; margin-bottom: 15px; }
    .to-profile-avatar { width: 50px; height: 50px; border-radius: 50%; background: var(--text-color); color: var(--bg-color); display: flex; align-items: center; justify-content: center; font-size: 20px; }
    .to-profile-name { font-size: 16px; font-weight: 600; }
    .to-profile-sub { font-size: 9px; color: var(--text-secondary); margin-top: 2px; }
    .to-profile-menu-item { display: flex; justify-content: space-between; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--gray-light); cursor: pointer; }
    .to-profile-menu-item:active { opacity: 0.6; }
    .to-profile-menu-label { font-size: 12px; font-weight: 500; }
    .to-profile-menu-arrow { font-size: 14px; color: var(--text-secondary); }
    .to-addr-list { padding: 15px 20px 90px; }
    .to-addr-card { border: 1px solid var(--gray-light); border-radius: 12px; padding: 12px; margin-bottom: 10px; display: flex; align-items: center; gap: 10px; cursor: pointer; }
    .to-addr-card:active { transform: scale(0.98); }
    .to-addr-card.selected { border-color: var(--text-color); border-width: 2px; }
    .to-addr-icon { width: 32px; height: 32px; border-radius: 50%; background: var(--gray-light); display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 14px; }
    .to-addr-info { flex: 1; }
    .to-addr-tag { font-size: 12px; font-weight: 600; }
    .to-addr-detail { font-size: 9px; color: var(--text-secondary); margin-top: 2px; }
    .to-addr-actions { display: flex; gap: 6px; }
    .to-addr-actions button { font-size: 8px; padding: 3px 8px; border: 1px solid var(--border-color); background: var(--bg-color); color: var(--text-color); cursor: pointer; font-weight: 600; letter-spacing: 0.5px; }
    .to-addr-actions button:active { background: var(--text-color); color: var(--bg-color); }
    .to-addr-actions button.del { border-color: #ff3b30; color: #ff3b30; }

    /* ==================== 命之书 Grimoire App ==================== */
    #view-grimoire-detail { background-color: var(--bg-color); color: var(--text-color); }
    .grim-header { padding: 20px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border-color); background: var(--glass-bg); backdrop-filter: blur(25px); -webkit-backdrop-filter: blur(25px); z-index: 10; }
    .grim-title { font-family: var(--font-serif); font-size: 24px; color: var(--text-color); text-align: center; font-weight: 600; letter-spacing: 1px; }
    .grim-sub { font-family: var(--font-sans); font-size: 9px; color: var(--text-secondary); letter-spacing: 3px; text-transform: uppercase; display: block; margin-top: 2px; }
    .grim-card { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 16px; padding: 20px; text-align: center; position: relative; box-shadow: 0 10px 30px rgba(0,0,0,0.05); margin-bottom: 20px; }
    .grim-avatar { width: 80px; height: 80px; border-radius: 50%; border: 1px solid var(--border-color); object-fit: cover; margin: 0 auto 10px; padding: 2px; background: var(--gray-light); }
    .grim-name { font-family: var(--font-serif); font-size: 22px; font-weight: 600; color: var(--text-color); }
    .grim-bond-header { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-secondary); margin-bottom: 5px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; }
    .grim-bond-bg { width: 100%; height: 6px; background: var(--gray-light); border-radius: 3px; overflow: hidden; }
    .grim-bond-fill { height: 100%; background: var(--text-color); border-radius: 3px; transition: width 0.5s; }
    .grim-tabs { display: flex; gap: 10px; margin-bottom: 20px; }
    .grim-tab-btn { flex: 1; background: transparent; border: 1px solid var(--border-color); color: var(--text-secondary); padding: 10px 0; border-radius: 8px; font-size: 11px; font-weight: 600; letter-spacing: 1px; cursor: pointer; transition: all 0.3s; text-transform: uppercase; }
    .grim-tab-btn.active { background: var(--text-color); border-color: var(--text-color); color: var(--bg-color); }
    .grim-tab-content { display: none; animation: fadeIn 0.4s ease; }
    .grim-tab-content.active { display: block; }
    .grim-timeline { position: relative; padding-left: 20px; }
    .grim-timeline::before { content: ''; position: absolute; left: 4px; top: 0; bottom: 0; width: 1px; background: var(--border-color); }
    .grim-tl-item { position: relative; margin-bottom: 20px; }
    .grim-tl-dot { position: absolute; left: -20px; top: 4px; width: 9px; height: 9px; border-radius: 50%; background: var(--bg-color); border: 2px solid var(--text-color); }
    .grim-tl-date { font-size: 9px; color: var(--text-secondary); letter-spacing: 1px; margin-bottom: 4px; display: flex; justify-content: space-between; text-transform: uppercase; font-weight: 600; }
    .grim-tl-text { font-size: 12px; line-height: 1.6; color: var(--text-color); background: var(--gray-light); padding: 10px; border-radius: 8px; border: 1px solid var(--border-color); }
    .grim-parchment { background: var(--gray-light); border-radius: 8px; padding: 20px; border: 1px solid var(--border-color); position: relative; }
    .grim-parchment::before { content: 'PAGE OF FATE'; position: absolute; top: 10px; left: 0; width: 100%; text-align: center; font-family: var(--font-serif); font-size: 12px; color: var(--text-secondary); letter-spacing: 4px; }
    .grim-textarea { width: 100%; height: 200px; background: transparent; border: none; outline: none; resize: none; font-family: var(--font-sans); font-size: 12px; line-height: 1.8; color: var(--text-color); margin-top: 15px; }
    .grim-btn-seal { width: 100%; padding: 12px; margin-top: 15px; background: var(--text-color); border: none; border-radius: 8px; color: var(--bg-color); font-weight: 600; letter-spacing: 2px; cursor: pointer; text-transform: uppercase; }
    .grim-btn-seal:active { opacity: 0.8; }



    #btn-sticker-picker::after {
        content: '' !important;
        display: block !important;
        width: 20px !important;
        height: 20px !important;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23555555' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M8 14s1.5 2 4 2 4-2 4-2'/%3E%3Cline x1='9' y1='9' x2='9.01' y2='9'/%3E%3Cline x1='15' y1='9' x2='15.01' y2='9'/%3E%3C/svg%3E") !important;
        background-size: contain !important;
        background-repeat: no-repeat !important;
        background-position: center !important;
    }
    [data-theme="dark"] #btn-sticker-picker::after {
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23aaaaaa' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M8 14s1.5 2 4 2 4-2 4-2'/%3E%3Cline x1='9' y1='9' x2='9.01' y2='9'/%3E%3Cline x1='15' y1='9' x2='15.01' y2='9'/%3E%3C/svg%3E") !important;
    }



    #view-wallet .view-content { padding: 0; display: flex; flex-direction: column; background: var(--bg-color); }
    .wallet-card { border: 1px solid var(--border-color); border-radius: 16px; padding: 20px; margin-bottom: 20px; background-size: cover; background-position: center; position: relative; overflow: hidden; background-color: var(--gray-light); }
    .wallet-card::before { content: ''; position: absolute; top:0; left:0; right:0; bottom:0; background: rgba(0,0,0,0.5); z-index: 1; }
    .wallet-card > * { position: relative; z-index: 2; color: #fff; }
    .wallet-card-title { font-size: 10px; font-weight: 600; letter-spacing: 1px; color: #ccc; text-transform: uppercase; margin-bottom: 15px; display: flex; justify-content: space-between; align-items: center; }
    .wallet-btn-bg { background: rgba(255,255,255,0.15); border: none; color: #fff; padding: 6px; border-radius: 50%; cursor: pointer; backdrop-filter: blur(5px); display: flex; align-items: center; justify-content: center; transition: background 0.2s; }
    .wallet-btn-bg:active { background: rgba(255,255,255,0.3); }
    .wallet-balance { font-family: var(--font-serif); font-size: 36px; font-weight: 600; margin-bottom: 20px; color: #fff; }
    .wallet-sub-assets { display: flex; justify-content: space-between; border-top: 1px solid rgba(255,255,255,0.15); padding-top: 15px; }
    .wallet-sub-item { text-align: center; flex: 1; }
    .wallet-sub-label { font-size: 9px; color: #aaa; margin-bottom: 4px; letter-spacing: 1px; }
    .wallet-sub-val { font-size: 13px; font-weight: 600; color: #fff; }
    .wallet-val-neg { color: #ff4d4d; }
    .wallet-val-pos { color: #22c55e; }
    .wallet-section-title { font-size: 11px; font-weight: 600; letter-spacing: 1px; color: var(--text-secondary); margin: 25px 0 10px 0; text-transform: uppercase; display: flex; justify-content: space-between; align-items: center; }
    .wallet-bank-card { height: 100px; border-radius: 12px; padding: 15px; margin-bottom: 10px; background: linear-gradient(135deg, #2c3e50, #000000); position: relative; overflow: hidden; border: 1px solid var(--border-color); background-size: cover; background-position: center; }
    .wallet-bank-card::before { content: ''; position: absolute; top:0; left:0; right:0; bottom:0; background: rgba(0,0,0,0.4); z-index: 1; }
    .wallet-bank-card > * { position: relative; z-index: 2; color: #fff; }
    .wallet-list-item { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--gray-light); }
    .wallet-btn-row { display: flex; gap: 10px; margin-bottom: 20px; }
    .wallet-action-btn { flex: 1; padding: 10px; background: var(--bg-color); border: 1px solid var(--border-color); color: var(--text-color); font-size: 9px; font-weight: 600; letter-spacing: 1px; border-radius: 8px; cursor: pointer; text-align: center; }
    .wallet-action-btn:active { opacity: 0.7; }



    #view-ourspace { background-color: var(--bg-color); background-image: linear-gradient(to bottom, var(--bg-color), #ffffff); }
    #view-ourspace .view-content { padding: 0; display: flex; flex-direction: column; height: 100%; overflow: hidden; position: relative; }
    .os-top-sync { padding: 15px 20px; display: flex; justify-content: space-between; align-items: center; font-size: 11px; color: var(--text-secondary); font-weight: 500; z-index: 10; }
    .os-content-area { flex: 1; overflow-y: auto; padding: 0 20px 20px; scrollbar-width: none; position: relative; }
    .os-content-area::-webkit-scrollbar { display: none; }
    .os-tab-page { display: none; animation: osFadeIn 0.3s ease; }
    .os-tab-page.active { display: block; }
    @keyframes osFadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
    .os-card { background: rgba(255,255,255,0.6); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-radius: 20px; padding: 20px; margin-bottom: 15px; box-shadow: 0 8px 24px rgba(0,0,0,0.05); border: 1px solid rgba(255,255,255,0.8); }
    .os-btn-action { padding: 12px; border-radius: 16px; border: none; background: #fff; color: var(--text-color); font-size: 13px; font-weight: bold; box-shadow: 0 4px 12px rgba(0,0,0,0.05); cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 6px; }
    .os-btn-action:active { transform: scale(0.95); }
    .os-btn-action.primary { background: var(--text-color); color: var(--bg-color); }
    .os-couple-avatars { display: flex; justify-content: center; align-items: center; gap: 15px; margin-top: 10px; }
    .os-avatar { width: 70px; height: 70px; border-radius: 50%; object-fit: cover; border: 3px solid #fff; box-shadow: 0 4px 10px rgba(0,0,0,0.05); }
    .os-heart-beat { cursor: pointer; display: flex; align-items: center; justify-content: center; }
    .ecg-line {
        stroke-dasharray: 150;
        stroke-dashoffset: 150;
        animation: ecgAnimation 2s linear infinite;
    }
    .ecg-glow {
        stroke: rgba(255, 77, 77, 0.4);
        stroke-width: 6;
        stroke-dasharray: 150;
        stroke-dashoffset: 150;
        animation: ecgAnimation 2s linear infinite;
        filter: blur(2px);
    }
    @keyframes ecgAnimation {
        0% { stroke-dashoffset: 150; }
        50% { stroke-dashoffset: 0; }
        100% { stroke-dashoffset: -150; }
    }
    .os-timer-box { text-align: center; margin: 20px 0; }
    .os-timer-days { font-size: 48px; font-weight: bold; color: var(--text-color); font-family: var(--font-serif); line-height: 1; }
    .os-list-item { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px dashed rgba(0,0,0,0.1); position: relative; }
    .os-list-item:last-child { border-bottom: none; padding-bottom: 0; }
    .os-app-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; margin-top: 10px; }
    .os-app-icon { background: #fff; border-radius: 18px; padding: 15px 10px; text-align: center; box-shadow: 0 4px 12px rgba(0,0,0,0.05); cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 8px; }
    .os-app-icon:active { transform: scale(0.95); }
    .os-bottom-nav { height: 60px; background: rgba(255,255,255,0.8); backdrop-filter: blur(20px); border-top: 1px solid rgba(0,0,0,0.05); display: flex; justify-content: space-around; align-items: center; padding-bottom: 5px; z-index: 10; transition: transform 0.3s ease; }
    .os-sub-view .os-sub-content input:focus ~ .os-bottom-nav,
    .keyboard-open .os-bottom-nav { transform: translateY(100%); }
    .keyboard-open .os-selection-bar { transform: translateY(100%); }
    .os-nav-item { display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--text-secondary); cursor: pointer; width: 60px; }
    .os-nav-item.active { color: var(--text-color); }
    .os-sub-view { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: var(--bg-color); z-index: 1000; display: none; flex-direction: column; transform: translateX(100%); transition: transform 0.3s ease; }
    .os-sub-view.active { display: flex; transform: translateX(0); }
    .os-sub-header { padding: 15px 20px; display: flex; align-items: center; justify-content: space-between; background: rgba(255,255,255,0.6); backdrop-filter: blur(10px); border-bottom: 1px solid rgba(0,0,0,0.05); z-index: 10; }
    .os-sub-content { flex: 1; overflow-y: auto; padding: 20px; position: relative; }
    .os-checkbox { position: absolute; top: 10px; right: 10px; width: 18px; height: 18px; border: 1px solid var(--border-color); border-radius: 50%; background: rgba(255,255,255,0.8); display: none; z-index: 10; }
    .os-checkbox.checked { background: var(--text-color); border-color: var(--text-color); }
    .os-checkbox.checked::after { content: ''; position: absolute; top: 3px; left: 6px; width: 4px; height: 8px; border: solid var(--bg-color); border-width: 0 2px 2px 0; transform: rotate(45deg); }
    .os-manage-mode .os-checkbox { display: block; }
    .os-selection-bar { display: none; position: absolute; bottom: 0; left: 0; width: 100%; height: 70px; background: var(--bg-color); border-top: 1px solid var(--border-color); z-index: 105; justify-content: space-around; align-items: center; padding-bottom: 10px; }
    .os-photo-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .os-photo-item { width: 100%; aspect-ratio: 1; border-radius: 12px; object-fit: cover; background: var(--gray-light); cursor: pointer; position: relative; }
/* --- 自动登录连星动画 --- */
#auto-login-overlay {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background-color: #050505;
    z-index: 10001;
    display: none;
    overflow: hidden;
    color: #ffffff;
    font-family: var(--font-sans);
    transition: transform 1.2s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.8s ease;
}
#auto-login-overlay.active { display: block; }
#auto-login-overlay.fade-out { transform: scale(1.15); opacity: 0; pointer-events: none; }

#skip-splash-btn {
    position: absolute; top: calc(env(safe-area-inset-top) + 20px); right: 20px;
    background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.6); padding: 6px 12px; border-radius: 20px;
    font-size: 9px; letter-spacing: 2px; cursor: pointer; z-index: 100;
    backdrop-filter: blur(10px); transition: all 0.3s;
}
#skip-splash-btn:active { background: rgba(255,255,255,0.3); color: #fff; }

#auto-login-overlay .noise {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: url('data:image/svg+xml;utf8,%3Csvg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"%3E%3Cfilter id="noiseFilter"%3E%3CfeTurbulence type="fractalNoise" baseFrequency="0.85" numOctaves="3" stitchTiles="stitch"/%3E%3C/filter%3E%3Crect width="100%25" height="100%25" filter="url(%23noiseFilter)" opacity="0.05"/%3E%3C/svg%3E');
    z-index: 0; pointer-events: none;
}

.deco-text {
    position: absolute; font-size: 9px; font-weight: 200; letter-spacing: 4px;
    color: rgba(255, 255, 255, 0.5); text-transform: uppercase;
    opacity: 0; animation: splashFadeIn 2s 0.5s ease-out forwards; z-index: 5;
}
.deco-text.tl { top: calc(env(safe-area-inset-top) + 40px); left: 20px; }
.deco-text.tr { top: calc(env(safe-area-inset-top) + 80px); right: 20px; text-align: right; }
.deco-text.bl { bottom: calc(env(safe-area-inset-bottom) + 40px); left: 20px; }

.editorial-block {
    position: absolute; bottom: calc(env(safe-area-inset-bottom) + 40px); right: 20px; width: 160px;
    font-size: 8px; line-height: 1.6; color: rgba(255, 255, 255, 0.3);
    text-align: justify; opacity: 0;
    animation: splashSlideUpFade 2s 1.5s cubic-bezier(0.2, 1, 0.3, 1) forwards; z-index: 5;
}

.watermark {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    font-family: var(--font-serif); font-size: 80vh; font-style: italic;
    color: rgba(255, 255, 255, 0.02); z-index: 1;
    opacity: 0; animation: splashFadeIn 4s 1s forwards; pointer-events: none;
}

.svg-layer { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; }
.grid { stroke: rgba(255, 255, 255, 0.06); stroke-width: 0.5; }
.orbit { fill: none; stroke: rgba(255, 255, 255, 0.15); stroke-width: 0.5; stroke-dasharray: 4 8; transform-origin: center; opacity: 0; }
.orbit-1 { animation: splashFadeInOrbit 3s 2s forwards, splashRotateSlow 40s linear infinite; }
.orbit-2 { animation: splashFadeInOrbit 3s 2.5s forwards, splashRotateSlowRev 60s linear infinite; }

.link-line { fill: none; stroke: rgba(255, 255, 255, 0.4); stroke-width: 0.5; stroke-dasharray: 1000; stroke-dashoffset: 1000; }
.ll-1 { animation: splashDrawLine 2s 4.0s cubic-bezier(0.7, 0, 0.3, 1) forwards; }
.ll-2 { animation: splashDrawLine 2s 4.5s cubic-bezier(0.7, 0, 0.3, 1) forwards; }
.ll-3 { animation: splashDrawLine 2s 5.0s cubic-bezier(0.7, 0, 0.3, 1) forwards; }
.ll-4 { animation: splashDrawLine 2s 5.5s cubic-bezier(0.7, 0, 0.3, 1) forwards; }

.star-core { fill: #fff; opacity: 0; }
.star-ring { fill: none; stroke: rgba(255,255,255,0.3); stroke-width: 0.5; opacity: 0; }
.star-label { font-family: var(--font-sans); font-size: 6px; fill: rgba(255,255,255,0.5); opacity: 0; }

.n1 .star-core { animation: splashPopStar 1s 3.8s forwards; }
.n1 .star-ring { animation: splashExpandRing 2s 3.8s ease-out forwards; }
.n1 .star-label { animation: splashFadeIn 1s 4.2s forwards; }
.n2 .star-core { animation: splashPopStar 1s 4.3s forwards; }
.n2 .star-ring { animation: splashExpandRing 2s 4.3s ease-out forwards; }
.n2 .star-label { animation: splashFadeIn 1s 4.7s forwards; }
.n3 .star-core { animation: splashPopStar 1s 4.8s forwards; }
.n3 .star-ring { animation: splashExpandRing 2s 4.8s ease-out forwards; }
.n3 .star-label { animation: splashFadeIn 1s 5.2s forwards; }
.n4 .star-core { animation: splashPopStar 1s 5.3s forwards; }
.n4 .star-ring { animation: splashExpandRing 2s 5.3s ease-out forwards; }
.n4 .star-label { animation: splashFadeIn 1s 5.7s forwards; }

.brand-container { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 10; text-align: center; pointer-events: none; }
.logo-box { overflow: hidden; padding: 10px; }
.logo-text { font-family: var(--font-serif); font-size: 42px; font-weight: 400; letter-spacing: 16px; margin-right: -16px; color: #fff; transform: translateY(120%); animation: splashRevealLogo 2.5s 8s cubic-bezier(0.8, 0, 0.1, 1) forwards; }
.tagline { font-size: 8px; letter-spacing: 8px; font-weight: 300; margin-top: 10px; color: rgba(255, 255, 255, 0.6); opacity: 0; animation: splashFadeIn 2s 9.5s forwards; }

.dim-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: radial-gradient(circle at center, transparent 20%, #050505 80%); opacity: 0; z-index: 3; pointer-events: none; animation: splashFadeIn 3s 8s forwards; }

@keyframes splashFadeIn { to { opacity: 1; } }
@keyframes splashSlideUpFade { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes splashFadeInOrbit { to { opacity: 1; } }
@keyframes splashRotateSlow { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes splashRotateSlowRev { from { transform: rotate(360deg); } to { transform: rotate(0deg); } }
@keyframes splashDrawLine { to { stroke-dashoffset: 0; } }
@keyframes splashPopStar { 0% { opacity: 0; transform: scale(0); } 50% { opacity: 1; transform: scale(1.5); } 100% { opacity: 1; transform: scale(1); } }
@keyframes splashExpandRing { 0% { opacity: 1; r: 0; } 100% { opacity: 0; r: 30; } }
@keyframes splashRevealLogo { to { transform: translateY(0); } }
/* =========================================
   气泡内“正在输入”动画
   ========================================= */
.bubble-typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 0;
    min-height: 16px;
}
.bubble-typing-indicator div {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: currentColor;
    opacity: 0.6;
    animation: bubble-bounce 1.2s infinite ease-in-out;
}
.bubble-typing-indicator div:nth-child(2) {
    animation-delay: 0.15s;
}
.bubble-typing-indicator div:nth-child(3) {
    animation-delay: 0.3s;
}
@keyframes bubble-bounce {
    0%, 80%, 100% {
        transform: translateY(0);
        opacity: 0.6;
    }
    40% {
        transform: translateY(-4px);
        opacity: 1;
    }
}
.css-signal { display: flex; align-items: flex-end; gap: 1px; height: 10px; }
.css-signal span { width: 2px; background: currentColor; border-radius: 1px; }
.css-signal span:nth-child(1) { height: 3px; }
.css-signal span:nth-child(2) { height: 5px; }
.css-signal span:nth-child(3) { height: 7px; }
.css-signal span:nth-child(4) { height: 10px; }
.css-wifi { position: relative; width: 14px; height: 10px; display: flex; justify-content: center; align-items: flex-end; overflow: hidden; }
.css-wifi span { position: absolute; border: 2px solid currentColor; border-radius: 50%; border-bottom-color: transparent; border-left-color: transparent; border-right-color: transparent; }
.css-wifi span:nth-child(1) { width: 18px; height: 18px; bottom: -6px; }
.css-wifi span:nth-child(2) { width: 10px; height: 10px; bottom: -2px; }
.css-wifi span:nth-child(3) { width: 4px; height: 4px; bottom: 0; background: currentColor; border: none; }
.css-battery { position: relative; width: 20px; height: 10px; border: 1px solid currentColor; border-radius: 3px; padding: 1px; display: flex; align-items: center; margin-left: 2px; }
.css-battery::after { content: ''; position: absolute; right: -3px; top: 2px; width: 2px; height: 4px; background: currentColor; border-radius: 0 2px 2px 0; }
/* 人设输入区域：不聚焦时模糊，聚焦时清晰 */
#role-persona:not(:focus) {
    filter: blur(5px);
    transition: filter 0.3s ease;
}
#role-persona:focus {
    filter: blur(0);
    transition: filter 0.3s ease;
}
/* ==================== 遗书卡片 (极简杂志风) ==================== */
.will-card {
    border: 1px solid rgba(0,0,0,0.1);
    padding: 25px 20px;
    background: #fcfcfc;
    border-radius: 2px;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(0,0,0,0.03);
    text-align: center;
    position: relative;
    overflow: hidden;
}
[data-theme="dark"] .will-card {
    background: #111;
    border-color: rgba(255,255,255,0.1);
}
.will-card::before {
    content: '';
    position: absolute;
    top: 0; left: 50%; transform: translateX(-50%);
    width: 40px; height: 1px;
    background: #111;
}
[data-theme="dark"] .will-card::before { background: #fff; }
.will-card-title {
    font-family: var(--font-serif);
    font-size: 20px;
    font-weight: 400;
    color: var(--text-color);
    letter-spacing: 2px;
    margin-bottom: 10px;
}
.will-card-desc {
    font-family: var(--font-sans);
    font-size: 9px;
    color: var(--text-secondary);
    letter-spacing: 1px;
    text-transform: uppercase;
}
/* ==================== 情绪岛 专属极简杂志风样式 ==================== */
#view-emotionisland {
    --bg: var(--bg-color);
    --text-main: var(--text-color);
    --text-sub: var(--text-secondary);
    --line: var(--border-color);
    --accent: #8CA89A;
    --bubble-bg: var(--gray-light);
    --transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: var(--font-serif);
}
[data-theme="dark"] #view-emotionisland {
    --accent: #D4A373;
}

.ei-theme-toggle { width: 16px; height: 16px; cursor: pointer; fill: none; stroke: var(--text-main); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: stroke var(--transition); }

#ei-app-container .ei-page { display: none; animation: eiFadeIn 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards; flex: 1; }
#ei-app-container .ei-page.active { display: flex; flex-direction: column; }
@keyframes eiFadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

.ei-char-list { display: flex; flex-direction: column; gap: 15px; margin: auto 0; }
.ei-char-card { padding: 15px 20px; border: 1px solid var(--line); border-radius: 4px; cursor: pointer; transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1); display: flex; justify-content: space-between; align-items: center; background: transparent; }
.ei-char-card:hover { transform: translateY(-4px); border-color: var(--accent); color: var(--accent); box-shadow: 0 10px 20px rgba(0,0,0,0.02); }
.ei-char-name { font-size: 16px; font-weight: 300; margin-bottom: 4px; font-family: var(--font-serif); display: flex; align-items: center; gap: 8px; }
.ei-char-desc { font-size: 10px; color: var(--text-sub); font-family: var(--font-serif); }
.ei-char-tag { font-size: 9px; padding: 2px 8px; border: 1px solid var(--line); border-radius: 12px; color: var(--text-sub); font-family: var(--font-serif); }
.ei-bond-marks { font-size: 10px; color: var(--accent); letter-spacing: 1px; }

.ei-space-header { text-align: center; margin-bottom: 30px; margin-top: 10px; }
.ei-space-title { font-size: 24px; font-weight: 300; margin-bottom: 8px; font-family: var(--font-serif); }
.ei-space-actions { display: flex; flex-direction: column; gap: 25px; align-items: center; margin: 20px 0; }
.ei-action-btn { font-size: 18px; font-weight: 300; position: relative; padding-bottom: 4px; cursor: pointer; font-family: var(--font-serif); transition: color 0.3s; }
.ei-action-btn::after { content: ''; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); width: 0; height: 1px; background: var(--text-main); transition: width 0.4s cubic-bezier(0.2, 0.8, 0.2, 1); }
.ei-action-btn:hover::after { width: 100%; }
.ei-action-sub { font-size: 9px; color: var(--text-sub); display: block; margin-top: 4px; font-family: var(--font-serif); }
.ei-current-name { font-family: var(--font-serif); font-weight: normal; }
.ei-write-letter { text-align: center; font-size: 11px; color: var(--text-sub); margin-top: 30px; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; font-family: var(--font-serif); transition: color 0.3s; }
.ei-write-letter:hover { color: var(--text-main); }
.ei-stay-awhile { text-align: center; font-size: 9px; color: var(--text-sub); margin-top: 15px; cursor: pointer; font-family: var(--font-serif); opacity: 0.7; transition: opacity 0.3s; }
.ei-stay-awhile:hover { opacity: 1; }

.ei-calendar-wrap { margin-top: 10px; display: flex; justify-content: center; align-items: center; }
.ei-calendar-svg { width: 100px; height: 20px; stroke: var(--line); fill: none; stroke-width: 1; }
.ei-calendar-dot { fill: var(--accent); }

.ei-chat-container { flex: 1; display: flex; flex-direction: column; overflow-y: auto; padding-bottom: 20px; gap: 12px; scrollbar-width: none; }
.ei-chat-container::-webkit-scrollbar { display: none; }
.ei-msg { max-width: 75%; padding: 10px 14px; border-radius: 4px; font-size: 12px; position: relative; transition: all 0.3s; line-height: 1.6; cursor: pointer; font-family: var(--font-serif); animation: eiBubblePop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; transform-origin: bottom left; }
@keyframes eiBubblePop { 0% { opacity: 0; transform: scale(0.9) translateY(10px); } 100% { opacity: 1; transform: scale(1) translateY(0); } }
.ei-msg:active { opacity: 0.7; }
.ei-msg.user { align-self: flex-end; background: var(--bubble-bg); color: var(--text-main); transform-origin: bottom right; }
.ei-msg.char { align-self: flex-start; background: none; padding-left: 12px; color: var(--text-main); }
.ei-msg.char::before { content: ''; position: absolute; left: 0; top: 14px; width: 3px; height: 3px; border-radius: 50%; background: var(--accent); }
.ei-msg.dissipate { filter: blur(8px); opacity: 0; transform: translateY(-30px) scale(1.1); pointer-events: none; transition: all 0.8s ease; }

.ei-input-area { margin-top: 10px; position: relative; flex-shrink: 0; }
.ei-chat-input { width: 100%; padding: 10px 30px 10px 0; border: none; border-bottom: 1px solid var(--line); background: transparent; color: var(--text-main); font-size: 12px; outline: none; transition: border-color 0.3s; border-radius: 0; font-family: var(--font-serif); }
.ei-chat-input:focus { border-bottom-color: var(--accent); }
.ei-send-btn { position: absolute; right: 0; top: 50%; transform: translateY(-50%); color: var(--text-sub); width: 16px; height: 16px; transition: color 0.3s, transform 0.2s; background: none; border: none; cursor: pointer; padding: 0; }
.ei-chat-input:focus + .ei-send-btn { color: var(--accent); }
.ei-send-btn:active { transform: translateY(-50%) scale(0.8); }
.ei-throw-away { font-size: 9px; color: var(--text-sub); text-align: right; margin-top: 8px; cursor: pointer; flex-shrink: 0; font-family: var(--font-serif); transition: color 0.3s; }
.ei-throw-away:hover { color: var(--text-main); }

.ei-grid-layout { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 15px; }
.ei-card { padding: 12px; border: 1px solid var(--line); border-radius: 2px; font-size: 10px; position: relative; transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1); background: transparent; font-family: var(--font-serif); }
.ei-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 5px 15px rgba(0,0,0,0.03); }
.ei-card-meta { font-size: 8px; color: var(--text-sub); margin-bottom: 6px; display: flex; justify-content: space-between; }
.ei-empty-state { text-align: center; color: var(--text-sub); margin-top: 40px; font-size: 10px; grid-column: 1 / -1; font-family: var(--font-serif); }

.ei-letter-paper { flex: 1; padding: 15px; border: 1px solid var(--line); background: transparent; margin-bottom: 10px; display: flex; transition: all 0.3s; }
.ei-letter-paper:focus-within { border-color: var(--accent); box-shadow: 0 0 10px rgba(140, 168, 154, 0.1); }
.ei-letter-input { width: 100%; height: 100%; line-height: 2; border: none; background: transparent; color: var(--text-main); font-size: 12px; outline: none; resize: none; font-family: var(--font-serif); }
.ei-letter-actions { display: flex; justify-content: space-between; font-size: 9px; color: var(--text-sub); flex-shrink: 0; font-family: var(--font-serif); }
.ei-letter-actions span { cursor: pointer; transition: color 0.3s; }
.ei-letter-actions span:hover { color: var(--text-main); }

.ei-char-switcher { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; font-size: 11px; color: var(--text-sub); margin-bottom: 10px; flex-shrink: 0; font-family: var(--font-serif); transition: color 0.3s; }
.ei-char-switcher:hover { color: var(--text-main); }
.ei-char-switcher svg { width: 8px; height: 8px; stroke: currentColor; }

/* 贴合气泡的菜单 */
.ei-context-menu { position: absolute; background: var(--glass-bg); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid var(--line); border-radius: 8px; padding: 4px 0; display: flex; flex-direction: column; box-shadow: 0 10px 30px rgba(0,0,0,0.1); transform: scale(0.8); opacity: 0; transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1); transform-origin: top left; z-index: 10000; min-width: 110px; }
.ei-context-menu.active { transform: scale(1); opacity: 1; }
.ei-ctx-btn { padding: 10px 14px; background: none; border: none; font-family: var(--font-serif); font-size: 11px; color: var(--text-main); cursor: pointer; text-align: left; transition: background 0.2s; }
.ei-ctx-btn:hover { background: var(--gray-light); }
.ei-ctx-btn.danger { color: #ff4d4d; }

/* 情绪天气动画 (增强版) */
.ei-weather-container { width: 50px; height: 50px; margin: 0 auto 15px auto; position: relative; display: flex; justify-content: center; align-items: center; transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1); }
.ei-weather-ring { width: 24px; height: 24px; border: 1px solid var(--line); border-radius: 50%; position: absolute; transition: all 0.8s ease; }
.ei-weather-sun { width: 4px; height: 4px; background: var(--accent); border-radius: 50%; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); box-shadow: 0 0 12px 2px var(--accent); opacity: 0; transition: opacity 0.8s ease; }
.ei-weather-cloud { width: 30px; height: 1.5px; background: var(--line); position: absolute; top: 60%; left: 50%; transform: translateX(-50%); opacity: 0; transition: all 0.8s ease; }
.ei-weather-rain { position: absolute; top: 75%; left: 50%; transform: translateX(-50%); display: flex; gap: 4px; opacity: 0; transition: opacity 0.8s ease; }
.ei-weather-rain span { width: 1.5px; height: 6px; background: var(--line); transform: rotate(15deg); animation: eiRainDrop 1s infinite linear; }
.ei-weather-rain span:nth-child(2) { animation-delay: 0.3s; }
.ei-weather-rain span:nth-child(3) { animation-delay: 0.6s; }
@keyframes eiRainDrop { 0% { transform: rotate(15deg) translateY(-2px); opacity: 0; } 50% { opacity: 1; } 100% { transform: rotate(15deg) translateY(6px); opacity: 0; } }
.ei-weather-fog { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 50%; position: absolute; opacity: 0; transition: opacity 0.8s ease; animation: eiFogPulse 3s infinite ease-in-out; }
@keyframes eiFogPulse { 0% { transform: scale(0.8); opacity: 0.8; } 100% { transform: scale(1.4); opacity: 0; } }

/* 情绪天气状态类 */
.ei-weather-container.sunny .ei-weather-sun { opacity: 1; transform: translate(-50%, -50%) scale(1.2); }
.ei-weather-container.cloudy .ei-weather-cloud { opacity: 1; transform: translateX(-50%) translateY(-2px); }
.ei-weather-container.rainy .ei-weather-rain { opacity: 1; }
.ei-weather-container.foggy .ei-weather-fog { opacity: 1; }
[data-theme="dark"] .ei-weather-container { filter: drop-shadow(0 0 8px rgba(212, 163, 115, 0.3)); }

/* 共处模式 */
.ei-stay-text { font-size: 12px; color: var(--text-sub); font-family: var(--font-serif); font-style: italic; transition: opacity 0.8s ease; opacity: 1; text-align: center; letter-spacing: 1px; }
.ei-stay-text.fade { opacity: 0; }

/* 情绪回响 */
.ei-echo-text { font-size: 10px; color: var(--text-sub); font-family: var(--font-serif); font-style: italic; text-align: center; margin-bottom: 15px; opacity: 0; transition: opacity 0.8s ease; cursor: pointer; }
.ei-echo-text.visible { opacity: 0.8; }
[data-theme="dark"] .ei-echo-text { color: var(--accent); opacity: 0.6; }

/* 沉默的礼物 */
.ei-gift-card { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 4px; font-size: 10px; color: var(--text-sub); cursor: pointer; margin-top: 8px; font-family: var(--font-serif); transition: all 0.3s; }
.ei-gift-card:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.ei-drawer-gift { background: var(--bg); border: 1px solid var(--line); }
[data-theme="dark"] .ei-drawer-gift { background: #2A2D32; color: var(--accent); border-color: var(--accent); }

/* 极简杂志风主题样式 */
/* 顶栏高透高斯模糊，去除黑线 */
#chat-view.theme-magazine #chat-header {
    background: var(--glass-bg) !important;
    backdrop-filter: blur(25px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(25px) saturate(180%) !important;
    border-bottom: none !important; 
}

#chat-view.theme-magazine .chat-title-glass {
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    color: var(--text-color) !important;
    padding-bottom: 2px !important;
}

#chat-view.theme-magazine .glass-icon-btn {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    color: var(--text-color) !important;
}

/* 底栏高透高斯模糊，去除黑线 */
#chat-view.theme-magazine .input-area-floating {
    background: var(--glass-bg) !important;
    border-top: none !important;
    padding: 15px 20px 30px 20px !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    border-radius: 0 !important;
    backdrop-filter: blur(25px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(25px) saturate(180%) !important;
}

#chat-view.theme-magazine #chat-input {
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    font-family: var(--font-serif) !important;
    font-size: 16px !important;
    padding: 10px 0 !important;
}

#chat-view.theme-magazine .standalone-icon-btn {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

#chat-view.theme-magazine .standalone-icon-btn::after {
    display: none !important;
}

#chat-view.theme-magazine .standalone-send-btn {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    width: auto !important;
    padding: 0 10px !important;
}

#chat-view.theme-magazine .standalone-send-btn::before {
    display: none !important;
}

#chat-view.theme-magazine .standalone-send-btn span {
    display: block !important;
}

#chat-view.theme-magazine .msg-row.ai .msg-wrapper {
    padding-left: 5px;
}

#chat-view.theme-magazine .msg-row.me .msg-wrapper {
    padding-right: 5px;
}
/* ========== 引用消息相关样式 (全局短信样式) ========== */
#chat-view .msg-row:has(.quote-block) .msg-bubble {
    position: relative !important;
    margin-top: 38px !important;
    margin-bottom: 0px !important; 
}

#chat-view .msg-row:has(.quote-block) .msg-bubble::before {
    content: '' !important;
    position: absolute !important;
    width: 24px !important;
    height: 24px !important;
    top: -16px !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1024 1024' width='128' height='128'%3E%3Cpath d='M896 208a48 48 0 0 1 48 48v448A240 240 0 0 1 704 944H256a48 48 0 0 1 0-96h448A144 144 0 0 0 848 704V256a48 48 0 0 1 48-48z' fill='%23d9d9d9'%3E%3C/path%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-size: contain !important;
    pointer-events: none !important;
    z-index: 10 !important;
    display: block !important;
    border: none !important;
    background-color: transparent !important;
}

#chat-view .msg-row.me:has(.quote-block) .msg-bubble::before {
    left: -20px !important;
    right: auto !important;
    transform: scaleX(-1) !important;
}

#chat-view .msg-row.ai:has(.quote-block) .msg-bubble::before {
    right: -20px !important;
    left: auto !important;
    transform: none !important;
}

#chat-view .msg-row.me .quote-block {
    left: auto !important;
    right: 0 !important;
}

#chat-view .msg-row.ai .quote-block {
    left: 0 !important;
    right: auto !important;
}

#chat-view .quote-block {
    position: absolute !important;
    top: -34px !important;
    left: 0 !important;
    z-index: 0;
    min-width: 60px;
    max-width: 180px;
    height: 26px !important;
    background-color: var(--gray-light) !important;
    backdrop-filter: blur(15px) !important;
    -webkit-backdrop-filter: blur(15px) !important;
    border-radius: 13px !important;
    border: 1px solid var(--border-color) !important;
    padding: 0 12px !important;
    margin: 0 !important;
    font-size: 11px !important;
    color: var(--text-secondary) !important;
    line-height: 24px !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    pointer-events: auto;
}

/* 移除前世今生界面的气泡小尾巴 */
#reinc-chat-messages .msg-bubble::before,
#reinc-chat-messages .msg-bubble::after {
    display: none !important;
}
#reinc-chat-messages .msg-bubble {
    border-radius: 18px !important;
}