
        * { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
        body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; width: 100%; margin: 0; padding: 0; background: #f2f2f2; height: 100svh; }
        
        @media (min-width: 768px) { body { max-width: 100%; margin: 0; padding: 0; } }
        @media (min-width: 1024px) { body { max-width: 100%; padding: 0; } }
        @media (max-width: 767px) { body { padding: 0; } }
        
        .container { background: white; display: flex; flex-direction: column; height: 100%; width: 100%; }
        
        @media (min-width: 768px) { .container { border-radius: 0; box-shadow: none; } }
        @media (min-width: 1024px) { .container { border-radius: 0; box-shadow: none; } }
        @media (max-width: 767px) { .container { border-radius: 0; box-shadow: none; } }
        
        #login-layer {
            position: fixed; top: 0; left: 0; width: 100%; height: 100%;
            background: #f6f8f5;
            display: flex; align-items: center; justify-content: center;
            z-index: 2000; padding: 20px;
            overflow: hidden;
        }

        .login-logo {
            width: 72px;
            height: 72px;
            margin-bottom: 14px;
            border-radius: 18px;
            object-fit: cover;
        }

        .login-card {
            background: transparent;
            width: 100%; max-width: 340px;
            padding: 10px;
            text-align: center;
            animation: slideUp 0.5s ease-out;
            position: relative;
            z-index: 1;
        }

        @keyframes slideUp {
            from { opacity: 0; transform: translateY(20px); }
            to { opacity: 1; transform: translateY(0); }
        }

        .login-header { margin-bottom: 38px; display: flex; flex-direction: column; align-items: center; }

        .login-header p { margin: 0; color: #2e3b2e; font-size: 18px; font-weight: 600; letter-spacing: 4px; text-indent: 4px; }

        .input-group { display: flex; flex-direction: column; gap: 15px; margin-bottom: 20px; }

        input.auth-input, select.auth-select {
            width: 100%; padding: 14px 18px;
            background: #f5faf5;
            border: 1px solid #c8e6c9;
            border-radius: 12px;
            font-size: 15px;
            color: #2e5a2e;
            outline: none;
            transition: all 0.25s ease;
        }
        
        input.auth-input::placeholder {
            color: rgba(76,175,80,0.45);
        }
        
        input.auth-input:focus, select.auth-select:focus {
            background: #fff;
            border-color: #81c784;
            box-shadow: 0 0 0 3px rgba(129,199,132,0.15);
        }

        select.auth-select {
            cursor: pointer;
            appearance: none;
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2366bb6a' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
            background-repeat: no-repeat;
            background-position: right 15px center;
            padding-right: 40px;
        }

        button.primary-btn {
            width: 100%; padding: 14px;
            background: #66bb6a;
            color: #fff; border: none; border-radius: 12px;
            font-size: 16px; font-weight: 600; cursor: pointer;
            transition: all 0.25s; box-shadow: 0 2px 8px rgba(102,187,106,0.3);
            letter-spacing: 1px;
        }
        button.primary-btn:hover { 
            transform: translateY(-1px); 
            background: #4caf50;
            box-shadow: 0 4px 12px rgba(76,175,80,0.35);
        }
        button.primary-btn:active { transform: translateY(1px); }

        button.secondary-btn {
            width: 100%;
            padding: 14px;
            background: transparent;
            color: #66bb6a;
            border: 1px solid #66bb6a;
            border-radius: 12px;
            font-size: 16px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.25s;
            letter-spacing: 1px;
        }
        button.secondary-btn:hover {
            background: rgba(102,187,106,0.1);
            transform: translateY(-1px);
        }
        button.secondary-btn:active {
            transform: translateY(1px);
        }

        .room-section {
            margin-top: 20px;
        }

        /* 登录页：极简下划线风格（不影响弹窗内的 auth-input） */
        #login-layer .input-group { gap: 18px; margin-bottom: 18px; }
        #login-layer .room-section { margin-top: 0; }
        #login-layer #room-password { margin-top: 18px; }
        #login-layer input.auth-input {
            background: transparent;
            border: none;
            border-bottom: 1px solid #d9ded7;
            border-radius: 0;
            padding: 12px 2px;
            color: #2e3b2e;
            font-size: 15px;
            transition: border-color 0.2s ease-out, box-shadow 0.2s ease-out;
        }
        #login-layer input.auth-input::placeholder {
            color: #98a296;
            letter-spacing: 1px;
        }
        #login-layer input.auth-input:focus {
            background: transparent;
            border-color: #3f8f5c;
            box-shadow: 0 1px 0 #3f8f5c;
        }
        #login-layer button.primary-btn {
            background: transparent;
            border: 1px solid #b9cec0;
            box-shadow: none;
            border-radius: 8px;
            padding: 11px;
            margin-top: 30px;
            color: #3f8f5c;
            font-size: 15px;
            font-weight: 500;
            letter-spacing: 2px;
            text-indent: 2px;
            transition: border-color 0.2s ease-out, background 0.2s ease-out, color 0.2s ease-out;
        }
        #login-layer button.primary-btn:hover {
            background: rgba(63,143,92,0.07);
            border-color: #3f8f5c;
            color: #2e6b44;
            transform: none;
            box-shadow: none;
        }
        #login-layer button.primary-btn:active {
            background: rgba(63,143,92,0.13);
        }
        #login-layer button.primary-btn:focus-visible {
            outline: 2px solid #3f8f5c;
            outline-offset: 3px;
        }
        @media (prefers-reduced-motion: reduce) {
            .login-card { animation: none; }
        }

        .checkbox-row {
            display: flex;
            align-items: center;
            gap: 8px;
            margin: 10px 0;
            font-size: 14px;
            color: #666;
        }

        .checkbox-row input[type="checkbox"] {
            width: 18px;
            height: 18px;
            accent-color: #66bb6a;
        }

        #chat-layer { display: none; flex-direction: column; height: 100%; overflow: hidden; position: relative; }
        
        #header { 
            text-align: center; padding: 5px 0; margin: 0; 
            color: #555; font-size: 0.9em; flex-shrink: 0; display: flex; justify-content: center; align-items: center; gap: 8px;
            position: absolute; top: 0; left: 0; right: 0; z-index: 100;
            background: rgba(255, 255, 255, 0.5);
            backdrop-filter: blur(8px);
            -webkit-backdrop-filter: blur(8px);
        }

        .header-room-name {
            background: linear-gradient(135deg, #66bb6a 0%, #43a047 100%);
            color: white;
            padding: 2px 8px;
            border-radius: 10px;
            font-weight: 500;
            font-size: 0.85em;
            cursor: pointer;
            transition: all 0.2s;
            display: inline-flex;
            align-items: center;
        }
        .header-room-name:hover {
            transform: scale(1.02);
            box-shadow: 0 2px 8px rgba(102,187,106,0.3);
        }

        .online-badge {
            display: inline-flex; align-items: center; background: #e1f5fe; color: #0288d1;
            padding: 2px 8px; border-radius: 10px; font-size: 0.85em; font-weight: bold;
            cursor: pointer; user-select: none; transition: opacity 0.2s;
        }
        .online-badge:active { opacity: 0.6; }
        .online-badge svg { width: 13px; height: 13px; display: block; }
        .online-dot {
            width: 6px; height: 6px; background: #34c759; border-radius: 50%;
            margin-right: 5px; display: inline-block; box-shadow: 0 0 4px #34c759;
        }
        
        #user-list-popover {
            display: none;
            position: absolute;
            top: 40px;
            left: 50%;
            transform: translateX(-50%);
            width: 300px;
            background: white;
            box-shadow: 0 8px 28px rgba(46,59,46,0.12);
            border-radius: 14px;
            padding: 6px 0;
            z-index: 999;
            border: 1px solid #e4e9e2;
            max-height: 50vh;
            overflow-y: auto;
            animation: popIn 0.2s ease-out;
        }
        @keyframes popIn { from { opacity: 0; transform: translate(-50%, -8px); } to { opacity: 1; transform: translate(-50%, 0); } }
        @media (prefers-reduced-motion: reduce) { #user-list-popover { animation: none; } }

        .user-row {
            padding: 10px 16px;
            border-bottom: 1px solid #edf1ec;
            text-align: left;
            font-size: 14px;
            color: #2e3b2e;
            display: flex;
            align-items: center;
            gap: 8px;
            transition: background 0.15s ease-out;
        }
        .user-row:last-child { border-bottom: none; }
        .user-row:hover { background: #f6f9f5; }
        .user-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
        .user-row.is-me .user-name { color: #3f8f5c; font-weight: 600; }
        .user-me-tag {
            font-size: 10px; color: #3f8f5c;
            border: 1px solid #b9cec0; border-radius: 4px;
            padding: 1px 5px; flex-shrink: 0;
        }
        .user-creator-tag {
            font-size: 10px; color: #b8860b;
            background: #faf5e6;
            border-radius: 4px;
            padding: 1px 5px; flex-shrink: 0;
        }

        
        #popover-mask { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 998; background: transparent; }

        #msg-list { flex: 1; overflow-y: auto; list-style: none; background: transparent; margin-bottom: 0; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
        @media (max-width: 767px) { #msg-list { padding: 45px 10px 80px 10px; } }
        @media (min-width: 768px) { #msg-list { padding: 50px 15px 90px 15px; } }
        @media (min-width: 1024px) { #msg-list { padding: 55px 20px 100px 15px; } }
        
        .empty-state {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            text-align: center;
            color: #a0aec0;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            pointer-events: none;
            z-index: 0;
            transition: all 0.5s ease;
        }
        .empty-icon {
            font-size: 64px;
            margin-bottom: 16px;
            opacity: 0.6;
            transition: all 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
            display: block;
        }
        .empty-text {
            font-size: 18px;
            font-weight: 500;
            color: #718096;
            margin-bottom: 8px;
            transition: opacity 0.5s ease;
        }
        .empty-hint {
            font-size: 14px;
            color: #a0aec0;
            transition: opacity 0.5s ease;
        }
        
        .empty-state.watermark .empty-icon {
            transform: scale(3);
            opacity: 0.04;
        }
        .empty-state.watermark .empty-text, 
        .empty-state.watermark .empty-hint {
            opacity: 0;
        }
        
        #msg-list li { 
            margin-bottom: 20px; 
            display: flex; 
            flex-direction: column; 
            animation: slideInUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
            opacity: 0;
        }
        @keyframes slideInUp {
            from { opacity: 0; transform: translateY(20px) scale(0.95); }
            to { opacity: 1; transform: translateY(0) scale(1); }
        }
        @media (min-width: 1024px) { #msg-list li { margin-bottom: 18px; } }
        
        .sender-info { display: flex; align-items: baseline; margin-bottom: 5px; flex-wrap: wrap; gap: 6px; }
        @media (max-width: 767px) { .sender-info { font-size: 0.75em; } .sender-name { margin-right: auto; } }
        @media (min-width: 768px) { .sender-info { gap: 10px; font-size: 0.85em; } }
        
        .sender-name { font-weight: bold; color: #555; }
        .msg-time { color: #bbb; }
        @media (max-width: 767px) { .msg-time { font-size: 0.85em; } }
        @media (min-width: 768px) { .msg-time { font-size: 0.8em; } }

        .bubble { border-radius: 18px; word-wrap: break-word; position: relative; white-space: pre-wrap; line-height: 1.6; transition: all 0.2s; box-shadow: 0 2px 5px rgba(0,0,0,0.05); }
        @media (max-width: 767px) { .bubble { padding: 7px 12px; font-size: 15px; } }
        @media (min-width: 768px) { .bubble { padding: 8px 13px; font-size: 15px; } }
        @media (min-width: 1024px) { .bubble { padding: 9px 15px; font-size: 16px; } }
        @media (max-width: 767px) { .bubble { max-width: 88%; } }
        @media (min-width: 768px) and (max-width: 1023px) { .bubble { max-width: 70%; } }
        @media (min-width: 1024px) { .bubble { max-width: 65%; } }
        
        .mine { align-items: flex-end; }
        .mine .sender-info { flex-direction: row-reverse; }
        .mine .bubble {
            background: linear-gradient(135deg, #c5e5f4 0%, #dcf1f7 100%);
            color: #25586e;
            border-top-right-radius: 4px;
            box-shadow:
                0 4px 6px -1px rgba(120, 170, 195, 0.18),
                0 2px 4px -1px rgba(120, 170, 195, 0.12),
                0 10px 15px -3px rgba(120, 170, 195, 0.07);
        }
        .mine .bubble a { color: #1779a8; text-decoration: underline; }
        .theirs { align-items: flex-start; }
        .theirs .sender-info { flex-direction: row; }
        .theirs .bubble {
            background: linear-gradient(135deg, #e0f7fa 0%, #fce4ec 100%);
            color: #2c4a6e;
            border-top-left-radius: 4px;
            border: 1px solid #c5ddf0;
            box-shadow:
                0 4px 6px -1px rgba(110, 142, 251, 0.12),
                0 2px 4px -1px rgba(110, 142, 251, 0.08),
                0 10px 15px -3px rgba(110, 142, 251, 0.05);
        }
        .theirs .bubble a { color: #6e8efb; }

        #load-more-btn { width: 100%; padding: 8px; margin-bottom: 10px; background: #f0f0f0; border: none; color: #666; border-radius: 4px; font-size: 0.85em; cursor: pointer; display: none; }
        
        .chat-media {
            border-radius: 14px; margin-top: 5px; display: block;
            border: 1px solid rgba(31,45,36,0.06); cursor: pointer;
            box-shadow: 0 2px 8px rgba(31,45,36,0.06);
        }
        .mine .chat-media { margin-left: auto; margin-right: 0; }
        .theirs .chat-media { margin-right: auto; margin-left: 0; }

        /* 图片：统一边界盒（JS fitImage 计算具体尺寸），CSS 上限兜底 */
        img.chat-media { width: auto; height: auto; }
        @media (max-width: 767px) { img.chat-media { max-width: 200px; max-height: 240px; } }
        @media (min-width: 768px) and (max-width: 1023px) { img.chat-media { max-width: 220px; max-height: 264px; } }
        @media (min-width: 1024px) { img.chat-media { max-width: 240px; max-height: 288px; } }

        /* 视频：固定宽度统一尺寸 */
        @media (max-width: 767px) { video.chat-media { width: 200px; } }
        @media (min-width: 768px) { video.chat-media { width: 220px; } }
        video.chat-media { background: black; }

        /* 消息里的视频：内联只当预览（不带原生控制条），点击打开大屏浮层播放 */
        .video-msg { position: relative; margin-top: 5px; }
        .video-msg .chat-media { margin-top: 0; }
        .video-play-badge {
            position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
            width: 46px; height: 46px; border-radius: 50%;
            background: rgba(0,0,0,0.45); border: 1.5px solid rgba(255,255,255,0.9);
            display: flex; align-items: center; justify-content: center;
            color: #fff; pointer-events: none;
        }
        .video-play-badge svg { width: 18px; height: 18px; margin-left: 3px; }

        /* 自定义语音播放器：宽度随语音时长变化（波形条数 = 时长映射） */
        .voice-player {
            display: flex; align-items: center; gap: 9px;
            padding: 4px 11px 4px 6px; width: auto; max-width: 300px; box-sizing: border-box;
            background: #fff;
            border: 1px solid rgba(31,45,36,0.05);
            border-radius: 18px;
            box-shadow: 0 1px 3px rgba(31,45,36,0.04);
            margin-top: 5px;
        }
        .mine .voice-player { margin-left: auto; margin-right: 0; }
        .theirs .voice-player { margin-right: auto; margin-left: 0; }
        /* 方向色区分：我方湖蓝 / 对方青瓷绿（与各自气泡色系呼应） */
        .theirs .vp-btn { background: #5cb88a; }
        .theirs .vp-btn:hover { background: #4aa578; }
        .theirs .vp-track i { background: #d4e4dc; }
        .theirs .vp-track i.on { background: #4aa578; }
        .vp-btn {
            width: 28px; height: 28px; border-radius: 50%; border: none; cursor: pointer; padding: 0;
            background: #5aa8d6;
            display: flex; align-items: center; justify-content: center; flex-shrink: 0;
            transition: transform 0.2s cubic-bezier(0.175,0.885,0.32,1.275);
        }
        .vp-btn:hover { background: #4a97c6; }
        .vp-btn:active { transform: scale(0.9); }
        .vp-btn::before {
            content: ''; width: 0; height: 0; border: none;
            border-style: solid; border-width: 6px 0 6px 9px;
            border-color: transparent transparent transparent #fff;
            margin-left: 3px;
        }
        .vp-btn.playing::before, .vp-btn.playing::after {
            content: ''; width: 3px; height: 10px; border-radius: 1.5px;
            background: #fff; border: none; margin: 0;
        }
        .vp-btn.playing::before { margin-right: 2px; }
        .vp-track {
            display: flex; align-items: center; gap: 2px; height: 20px;
            flex: 1; min-width: 0; cursor: pointer; touch-action: none;
            overflow: hidden;
        }
        .vp-track i { width: 3px; border-radius: 1.5px; background: #cdd8de; flex-shrink: 0; transition: background 0.15s; }
        .vp-track i.on { background: #5aa8d6; }
        .vp-dur {
            font-size: 11px; color: #8a958c; font-variant-numeric: tabular-nums;
            flex-shrink: 0; min-width: 26px; text-align: right;
        }
        /* 录音面板内的预览播放器（紧凑变体）：按内容自适应宽度，不拉伸到按钮下方 */
        #record-panel .voice-player {
            padding: 2px 8px 2px 4px; width: auto; flex: 0 1 auto; min-width: 0;
            background: transparent; border: none; box-shadow: none; margin-top: 0;
        }
        #record-panel .vp-track { overflow: hidden; }
        #record-panel .vp-btn { width: 24px; height: 24px; }
        
        .image-viewer { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.9); z-index: 10000; display: none; justify-content: center; align-items: center; touch-action: none; }
        .image-viewer.active { display: flex; }
        .image-viewer .img-container { width: 100%; height: 100%; display: flex; justify-content: center; align-items: center; overflow: hidden; }
        .image-viewer img { max-width: 95%; max-height: 95%; object-fit: contain; cursor: grab; user-select: none; -webkit-user-drag: none; }
        .image-viewer img.zoomed { cursor: grab; }
        .image-viewer img.zoomed:active { cursor: grabbing; }
        .image-viewer .close-btn, .video-viewer .close-btn { position: absolute; top: 20px; right: 20px; width: 40px; height: 40px; background: rgba(255,255,255,0.2); border: none; border-radius: 50%; color: white; font-size: 24px; cursor: pointer; display: flex; align-items: center; justify-content: center; z-index: 10001; }
        .image-viewer .nav-btn { position: absolute; top: 50%; transform: translateY(-50%); width: 50px; height: 50px; background: rgba(255,255,255,0.2); border: none; border-radius: 50%; color: white; font-size: 24px; cursor: pointer; display: flex; align-items: center; justify-content: center; z-index: 10001; }
        .image-viewer .nav-btn.prev { left: 20px; }
        .image-viewer .nav-btn.next { right: 20px; }
        .image-viewer .nav-btn:disabled { opacity: 0.3; cursor: not-allowed; }
        .image-viewer .image-counter { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); color: white; font-size: 14px; background: rgba(0,0,0,0.5); padding: 5px 15px; border-radius: 15px; }
        .image-viewer .zoom-hint { position: absolute; top: 70px; left: 50%; transform: translateX(-50%); color: white; font-size: 12px; background: rgba(0,0,0,0.5); padding: 5px 15px; border-radius: 15px; opacity: 0; transition: opacity 0.3s; }
        .image-viewer .zoom-hint.show { opacity: 1; } 

        /* 视频大屏浮层：点消息里的视频打开，原生控制条（含右下角…菜单）空间充足不会被挡 */
        .video-viewer { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.92); z-index: 10000; display: none; justify-content: center; align-items: center; }
        .video-viewer.active { display: flex; }
        .video-viewer video { max-width: 95vw; max-height: 88vh; display: block; background: #000; border-radius: 6px; }
        
        .file-card { display: flex; align-items: center; gap: 8px; padding: 8px; background: rgba(255,255,255,0.2); border-radius: 8px; text-decoration: none; font-size: 0.9em; font-weight: bold; border: 1px solid rgba(0,0,0,0.1); }
        .file-icon { font-size: 1.2em; flex-shrink: 0; }
        .file-icon svg { width: 1em; height: 1em; display: block; }
        @media (max-width: 767px) { .file-name { max-width: 120px; } }
        @media (min-width: 768px) { .file-name { max-width: 150px; } }
        .file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

        /* 附件过期占位样式（图片/视频/语音/文件加载失败时统一显示） */
        .expired-media {
            display: flex; flex-direction: column; align-items: center; justify-content: center;
            gap: 5px; padding: 18px 24px; margin-top: 5px; box-sizing: border-box;
            min-width: 140px; min-height: 78px;
            border-radius: 8px;
            background: rgba(130,130,140,0.1);
            border: 1px dashed rgba(130,130,140,0.35);
            color: rgba(100,100,110,0.75); font-size: 12px; text-align: center;
        }
        .mine .expired-media { margin-left: auto; margin-right: 0; }
        .theirs .expired-media { margin-right: auto; margin-left: 0; }
        .expired-media .expired-icon { font-size: 20px; opacity: 0.55; line-height: 1; }
        .expired-media .expired-icon svg { width: 20px; height: 20px; display: block; }

        .controls {
            display: flex; gap: 8px; align-items: center; padding: 8px 16px;
            position: fixed; bottom: 10px; left: 50%; transform: translateX(-50%);
            min-height: 40px; flex-wrap: nowrap;
            background: rgba(245,246,243,0.9);
            backdrop-filter: blur(14px) saturate(112%);
            -webkit-backdrop-filter: blur(14px) saturate(112%);
            border-radius: 26px;
            box-shadow: 0 4px 16px rgba(31,45,36,0.08), 0 1px 3px rgba(31,45,36,0.05);
            border: 1px solid rgba(255,255,255,0.55);
            z-index: 10000;
            width: calc(100% - 24px);
            max-width: 600px;
        }
        textarea#msg-text::placeholder { color: #9aa59b; }
        @media (min-width: 768px) { .controls { gap: 10px; padding: 10px 16px; bottom: 15px; width: calc(100% - 40px); } }
        @media (max-width: 767px) { .controls { gap: 6px; padding: 6px 10px; bottom: 8px; width: calc(100% - 16px); } }
        
        textarea#msg-text {
            flex: 1; min-width: 80px; border: none; border-radius: 12px; outline: none;
            resize: none; font-family: inherit; height: 32px; min-height: 32px; max-height: 120px;
            overflow-y: hidden; line-height: 20px; box-sizing: border-box; -webkit-appearance: none;
            background: transparent; transition: all 0.3s;
        }
        textarea#msg-text.scrollable { overflow-y: auto; }
        textarea#msg-text:focus { background: transparent; }
        @media (max-width: 767px) { textarea#msg-text { padding: 6px 12px; font-size: 16px; } }
        @media (min-width: 768px) { textarea#msg-text { padding: 6px 14px; font-size: 17px; } }
        
        #record-panel {
            display: none; flex: 1; min-width: 0; overflow: hidden;
            align-items: center; justify-content: space-between;
            background: transparent;
            border-radius: 20px; height: 32px; padding: 0 6px 0 14px;
            gap: 8px;
        }
        .rec-live { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
        .rec-dot {
            width: 8px; height: 8px; border-radius: 50%; background: #ff453a;
            animation: recPulse 1.6s infinite; flex-shrink: 0;
        }
        @keyframes recPulse {
            0% { box-shadow: 0 0 0 0 rgba(255,69,58,0.45); }
            70% { box-shadow: 0 0 0 8px rgba(255,69,58,0); }
            100% { box-shadow: 0 0 0 0 rgba(255,69,58,0); }
        }
        .rec-wave { display: flex; align-items: center; gap: 3px; height: 18px; flex-shrink: 0; }
        .rec-wave i {
            width: 3px; border-radius: 2px; background: #ff453a; opacity: 0.85;
            height: 5px; animation: recWave 1s ease-in-out infinite;
        }
        .rec-wave i:nth-child(1) { animation-delay: 0s; }
        .rec-wave i:nth-child(2) { animation-delay: 0.15s; }
        .rec-wave i:nth-child(3) { animation-delay: 0.3s; }
        .rec-wave i:nth-child(4) { animation-delay: 0.45s; }
        .rec-wave i:nth-child(5) { animation-delay: 0.6s; }
        @keyframes recWave { 0%, 100% { height: 5px; } 50% { height: 16px; } }
        .rec-timer {
            font-size: 13px; color: #ff453a; font-weight: 600;
            font-variant-numeric: tabular-nums; letter-spacing: 0.5px; flex-shrink: 0;
        }
        #btn-stop-rec {
            width: 30px; height: 30px; border-radius: 50%; padding: 0;
            background: #ff453a; color: #fff; font-size: 0; flex-shrink: 0;
            box-shadow: 0 3px 10px rgba(255,69,58,0.35);
            transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.2s;
        }
        #btn-stop-rec::before {
            content: ''; width: 10px; height: 10px; border-radius: 3px; background: #fff;
        }
        #btn-stop-rec:hover { transform: scale(1.08); box-shadow: 0 4px 14px rgba(255,69,58,0.45); }
        #btn-stop-rec:active { transform: scale(0.94); }
        #rec-actions { display: none; gap: 5px; flex-shrink: 0; }
        #rec-actions .cancel-btn {
            width: 30px; height: 30px; font-size: 14px; padding: 0;
            background: rgba(142,142,147,0.14); color: #8e8e93; border-radius: 50%;
        }
        #rec-actions .cancel-btn:hover { background: rgba(142,142,147,0.22); color: #6d6d72; }
        #rec-actions .confirm-btn {
            width: 30px; height: 30px; font-size: 13px; padding: 0;
            background: #5aa8d6; color: #fff;
            border-radius: 50%;
        }
        #rec-actions .confirm-btn:hover { transform: translateY(-1px); background: #4d99c8; }
        #rec-actions .confirm-btn.sending { opacity: 0.55; pointer-events: none; }

        .btn-base { height: 32px; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; background: transparent; color: #666; transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
        .icon-btn { width: 34px; height: 34px; border-radius: 50%; font-size: 0; padding: 0; color: #7b8a7d; }
        .icon-btn:hover { color: #2e3b2e; background: rgba(31,45,36,0.07); transform: scale(1.05); }
        .ib-svg { width: 21px; height: 21px; display: block; }
        .send-btn .ib-svg { width: 17px; height: 17px; margin-left: 2px; }
        #rec-actions .confirm-btn .ib-svg { width: 14px; height: 14px; margin-left: 1px; }
        .spinner { animation: spin 1s linear infinite; transform-origin: center; }
        @keyframes spin { to { transform: rotate(360deg); } }
        @media (max-width: 500px) { .icon-btn { width: 32px; height: 32px; font-size: 1em; } .btn-base { height: 30px; } textarea#msg-text { height: 30px; min-height: 30px; } #btn-stop-rec, #rec-actions .cancel-btn, #rec-actions .confirm-btn { width: 26px; height: 26px; } }

        .send-btn {
            background: #5aa8d6;
            color: white;
            border-radius: 50%;
            width: 34px;
            height: 34px;
            padding: 0;
            font-size: 1.2em;
            font-weight: bold;
            white-space: nowrap;
            display: none;
        }
        .send-btn:hover { transform: translateY(-1px); background: #4d99c8; }
        .send-btn:active { transform: translateY(0); }
        .send-btn.show { display: flex; animation: flyIn 0.3s ease-out; }
        @keyframes flyIn {
            0% { transform: translateX(-10px) scale(0.8); opacity: 0; }
            50% { transform: translateX(5px) scale(1.1); }
            100% { transform: translateX(0) scale(1); opacity: 1; }
        }
        /* 点击发送：纸飞机朝右上弧线飞出、旋转淡出，随后轻盈弹回 */
        .send-btn.flyout { animation: flyOut 0.6s cubic-bezier(0.22, 0.61, 0.36, 1); }
        @keyframes flyOut {
            0%   { transform: translate(0, 0) rotate(0deg) scale(1); opacity: 1; }
            40%  { transform: translate(22px, -12px) rotate(12deg) scale(0.85); opacity: 1; }
            70%  { transform: translate(48px, -30px) rotate(24deg) scale(0.3); opacity: 0; }
            70.1% { transform: translate(-4px, 2px) rotate(-6deg) scale(0.6); opacity: 0; }
            85%  { transform: translate(1px, 0) rotate(2deg) scale(1.05); opacity: 1; }
            100% { transform: translate(0, 0) rotate(0deg) scale(1); opacity: 1; }
        }
        .hidden { display: none !important; }

        .reply-preview {
            display: none; align-items: center; justify-content: space-between;
            background: rgba(248, 249, 250, 0.95); padding: 6px 12px; border-radius: 12px;
            margin-bottom: 8px; font-size: 11px; border-left: 2px solid #007aff;
            box-shadow: 0 -2px 10px rgba(0,0,0,0.08);
            position: fixed;
            bottom: 70px;
            left: 50%;
            transform: translateX(-50%);
            width: calc(100% - 40px);
            max-width: 580px;
            z-index: 99;
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
        }
        @media (min-width: 768px) { .reply-preview { bottom: 80px; } }
        @media (max-width: 767px) { .reply-preview { bottom: 65px; width: calc(100% - 30px); } }
        .reply-preview-content { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; color: #888; }
        .reply-preview-close { cursor: pointer; color: #ccc; margin-left: 8px; font-size: 14px; }
        .reply-preview-close:hover { color: #ff3b30; }

        .paste-preview-container {
            display: none;
            flex-direction: column;
            background: rgba(248, 249, 250, 0.95);
            padding: 10px;
            border-radius: 12px;
            margin-bottom: 8px;
            box-shadow: 0 -2px 10px rgba(0,0,0,0.08);
            position: fixed;
            bottom: 70px;
            left: 50%;
            transform: translateX(-50%);
            width: calc(100% - 40px);
            max-width: 580px;
            z-index: 99;
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
        }
        @media (min-width: 768px) { .paste-preview-container { bottom: 80px; } }
        @media (max-width: 767px) { .paste-preview-container { bottom: 65px; width: calc(100% - 30px); } }
        
        .paste-preview-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 10px;
        }
        .paste-preview-title {
            font-size: 13px;
            color: #666;
            font-weight: 500;
        }
        .paste-preview-close {
            cursor: pointer;
            color: #ccc;
            font-size: 16px;
            padding: 2px 6px;
            border-radius: 4px;
            transition: all 0.2s;
        }
        .paste-preview-close:hover {
            color: #ff3b30;
            background: rgba(255, 59, 48, 0.1);
        }
        
        .paste-preview-images {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            max-height: 150px;
            overflow-y: auto;
            padding: 4px;
        }
        
        .paste-preview-item {
            position: relative;
            width: 80px;
            height: 80px;
            border-radius: 8px;
            overflow: hidden;
            box-shadow: 0 2px 8px rgba(0,0,0,0.1);
            flex-shrink: 0;
        }
        .paste-preview-item img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
        .paste-preview-item .remove-btn {
            position: absolute;
            top: 4px;
            right: 4px;
            width: 20px;
            height: 20px;
            border-radius: 50%;
            background: rgba(0,0,0,0.6);
            color: white;
            border: none;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 12px;
            opacity: 0;
            transition: opacity 0.2s;
        }
        .paste-preview-item:hover .remove-btn {
            opacity: 1;
        }
        .paste-preview-item .remove-btn:hover {
            background: rgba(255, 59, 48, 0.9);
        }
        
        .paste-preview-actions {
            display: flex;
            justify-content: flex-end;
            gap: 10px;
            margin-top: 10px;
        }
        .paste-preview-btn {
            padding: 8px 16px;
            border-radius: 8px;
            border: none;
            cursor: pointer;
            font-size: 13px;
            font-weight: 500;
            transition: all 0.2s;
        }
        .paste-preview-btn.cancel {
            background: #f0f0f0;
            color: #666;
        }
        .paste-preview-btn.cancel:hover {
            background: #e0e0e0;
        }
        .paste-preview-btn.send {
            background: linear-gradient(135deg, #6e8efb 0%, #a777e3 100%);
            color: white;
            box-shadow: 0 2px 8px rgba(110, 142, 251, 0.3);
        }
        .paste-preview-btn.send:hover {
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(110, 142, 251, 0.4);
        }
        .paste-preview-btn:disabled {
            opacity: 0.6;
            cursor: not-allowed;
            transform: none;
        }
        
        .paste-loading-overlay {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(255,255,255,0.8);
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 8px;
        }
        .paste-loading-spinner {
            width: 24px;
            height: 24px;
            border: 3px solid #e0e0e0;
            border-top-color: #6e8efb;
            border-radius: 50%;
            animation: paste-spin 0.8s linear infinite;
        }
        @keyframes paste-spin {
            to { transform: rotate(360deg); }
        }
        
        .paste-drop-zone {
            position: relative;
        }
        .paste-drop-zone.drag-over::after {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(110, 142, 251, 0.1);
            border: 2px dashed #6e8efb;
            border-radius: 12px;
            pointer-events: none;
            z-index: 10;
        }

        .quoted-msg {
            background: rgba(0,0,0,0.04); padding: 4px 8px; border-radius: 4px;
            margin-top: 4px; font-size: 11px; border-left: 2px solid rgba(0,0,0,0.1);
            color: #888; cursor: pointer; max-height: 40px; overflow: hidden;
            display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
            line-height: 1.4; width: fit-content; max-width: 90%;
        }
        .mine .quoted-msg { background: rgba(0,0,0,0.05); color: #888; border-left-color: rgba(0,0,0,0.2); margin-left: auto; }
        .theirs .quoted-msg { margin-right: auto; }

        .msg-actions { display: none; margin-top: 4px; gap: 10px; font-size: 11px; }
        #msg-list li:hover .msg-actions { display: flex; }
        .action-btn { cursor: pointer; color: #007aff; opacity: 0.7; transition: opacity 0.2s; }
        .action-btn:hover { opacity: 1; }
        .mine .action-btn { color: #2e6a86; }
        .recall-btn { color: #ff3b30 !important; }

        .history-controls {
            display: none; flex-direction: column; gap: 8px; padding: 10px; background: #fff;
            border-bottom: 1px solid #eee;
            align-items: stretch;
            position: relative; z-index: 101;
        }
        .history-input {
            padding: 6px 14px; border: none; border-radius: 8px;
            font-size: 13px; outline: none;
            background: rgba(120, 170, 195, 0.12); color: #2e6a86;
            transition: background 0.2s ease-out;
            flex-shrink: 0;
        }
        .history-input:focus { background: rgba(120, 170, 195, 0.2); }
        .cal-trigger-wrap { position: relative; flex-shrink: 0; }
        .cal-trigger {
            display: inline-flex; align-items: center; gap: 6px;
            background: rgba(120, 170, 195, 0.12);
            color: #2e6a86; border: none; border-radius: 8px;
            padding: 6px 12px; font-size: 12px; cursor: pointer;
            transition: background 0.2s ease-out;
        }
        .cal-trigger:hover { background: rgba(120, 170, 195, 0.2); }
        .cal-trigger:active { background: rgba(120, 170, 195, 0.28); }
        .temp-pass-panel {
            display: none; margin-top: 2px; padding: 9px 12px 5px 12px;
            background: rgba(120, 170, 195, 0.07);
            border: 1px dashed rgba(120, 170, 195, 0.4);
            border-radius: 10px;
        }
        .tp-head {
            display: flex; align-items: baseline; justify-content: space-between;
            gap: 10px; margin-bottom: 4px;
            font-size: 12px; letter-spacing: 1px; color: #7d9aa8;
        }
        .tp-hint { font-size: 10px; letter-spacing: 0; color: #a9b8bf; }
        .tp-item {
            display: flex; align-items: center; justify-content: space-between;
            gap: 12px; padding: 7px 2px;
            border-top: 1px solid rgba(120, 170, 195, 0.18);
            cursor: pointer; transition: background 0.2s ease-out;
        }
        .tp-item:first-child { border-top: none; }
        .tp-item:hover { background: rgba(120, 170, 195, 0.1); }
        .tp-code {
            font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
            font-size: 13px; font-weight: 600; letter-spacing: 0.5px;
            color: #2e6a86; word-break: break-all; min-width: 0;
        }
        .tp-remain { flex-shrink: 0; font-size: 11px; color: #9aa59b; }
        .search-icon {
            width: 15px; height: 15px; cursor: pointer; color: #7d9aa8;
            flex-shrink: 0; transition: color 0.2s;
        }
        .search-icon:hover { color: #2e6a86; }
        .calendar-popover {
            display: none; position: absolute; top: calc(100% + 8px); left: 0;
            background: #fff; border: 1px solid #e4e9e2; border-radius: 14px;
            box-shadow: 0 8px 28px rgba(46,59,46,0.12);
            padding: 14px; width: 266px; z-index: 200; box-sizing: border-box;
        }
        .calendar-popover.open { display: block; }
        @media (max-width: 767px) {
            .calendar-popover {
                position: fixed;
                top: 50%; left: 50%; transform: translate(-50%, -50%);
                width: calc(100vw - 32px);
                box-shadow: 0 10px 40px rgba(46,59,46,0.2);
            }
        }
        .cal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
        .cal-title { font-size: 13px; font-weight: 600; color: #2e3b2e; letter-spacing: 1px; }
        .cal-nav {
            border: none; background: transparent; color: #98a296; font-size: 15px;
            cursor: pointer; padding: 4px 10px; border-radius: 6px; line-height: 1;
        }
        .cal-nav:hover { background: #f2f6f0; color: #2e3b2e; }
        .cal-week { display: grid; grid-template-columns: repeat(7, 1fr); }
        .cal-week span { font-size: 10px; color: #a8b0a4; text-align: center; padding: 4px 0; }
        .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
        .cal-cell {
            position: relative; height: 34px; display: flex; align-items: center; justify-content: center;
            font-size: 12px; color: #2e3b2e; border-radius: 8px; cursor: pointer; user-select: none;
        }
        .cal-cell:hover { background: #f2f6f0; }
        .cal-cell.cal-future { color: #cdd4cd; cursor: default; }
        .cal-cell.cal-future:hover { background: transparent; }
        .cal-cell.cal-today { color: #3f8f5c; font-weight: 600; }
        .cal-dot {
            position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%);
            width: 4px; height: 4px; border-radius: 50%; background: #3f8f5c;
        }
        .history-close {
            position: absolute; top: 10px; right: 10px;
            cursor: pointer; color: #98a296; font-size: 15px; line-height: 1;
            padding: 6px 8px; border-radius: 8px; user-select: none; z-index: 2;
            transition: color 0.2s, background 0.2s;
        }
        .history-close:hover { color: #2e3b2e; background: rgba(31,45,36,0.06); }
        .today-btn {
            background: rgba(120, 170, 195, 0.12);
            color: #2e6a86;
            border: none;
            border-radius: 8px;
            padding: 6px 14px;
            font-size: 12px;
            cursor: pointer;
            transition: background 0.2s ease-out;
        }
        .today-btn:hover { background: rgba(120, 170, 195, 0.2); }
        .today-btn:active { background: rgba(120, 170, 195, 0.28); }
        .search-wrap { display: flex; align-items: center; gap: 5px; background: rgba(120, 170, 195, 0.1); border-radius: 20px; padding: 2px 10px; flex-shrink: 0; width: 100%; box-sizing: border-box; }
        .search-input { border: none; background: transparent; padding: 6px 0; flex: 1; min-width: 0; font-size: 13px; outline: none; }
        /* 搜索范围自定义下拉菜单 */
        .range-drop { position: relative; flex-shrink: 0; }
        .range-trigger {
            display: inline-flex; align-items: center; gap: 4px;
            border: none; background: transparent; font-size: 12px; color: #666;
            cursor: pointer; padding: 4px 0; font-family: inherit;
            border-right: 1px solid #ddd; margin-right: 2px;
        }
        .range-trigger .range-caret { width: 10px; height: 10px; color: #98a296; transition: transform 0.2s; margin-right: 8px; }
        .range-drop.open .range-caret { transform: rotate(180deg); }
        .range-menu {
            display: none; position: absolute; top: calc(100% + 6px); left: 0;
            background: rgba(255,255,255,0.96); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
            border: 1px solid rgba(90,168,214,0.2); border-radius: 10px;
            box-shadow: 0 8px 28px rgba(46,59,46,0.12);
            padding: 4px; min-width: 92px; z-index: 300;
        }
        .range-menu.open { display: block; }
        .range-opt { display: block; padding: 6px 12px; font-size: 12px; color: #5f6b62; border-radius: 7px; cursor: pointer; white-space: nowrap; }
        .range-opt:hover { background: rgba(120,170,195,0.12); }
        .range-opt.sel { color: #2e6a86; background: rgba(120,170,195,0.12); font-weight: 600; }

        #toast-container {
            position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
            z-index: 10001; display: flex; flex-direction: column; gap: 10px;
            pointer-events: none; width: auto; max-width: 90%;
        }
        .toast {
            background: rgba(0, 0, 0, 0.8);
            backdrop-filter: blur(15px);
            -webkit-backdrop-filter: blur(15px);
            color: #fff; padding: 12px 24px; border-radius: 20px;
            font-size: 14px; font-weight: 500;
            box-shadow: 0 10px 40px rgba(0,0,0,0.3);
            border: 1px solid rgba(255,255,255,0.2);
            animation: toastIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
            transform-origin: center;
            text-align: center;
        }
        @keyframes toastIn {
            from { opacity: 0; transform: scale(0.8); }
            to { opacity: 1; transform: scale(1); }
        }
        .toast.fade-out {
            animation: toastOut 0.3s ease-in forwards;
        }
        @keyframes toastOut {
            to { opacity: 0; transform: scale(0.9); }
        }

        #room-modal {
            display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
            background: rgba(0,0,0,0.5); z-index: 30000; justify-content: center; align-items: center;
            backdrop-filter: blur(5px);
        }
        #room-modal.active { display: flex; }
        .room-modal-content {
            background: white;
            border-radius: 20px;
            padding: 25px;
            width: 90%;
            max-width: 400px;
            max-height: 80vh;
            overflow-y: auto;
            animation: modalIn 0.3s ease-out;
        }
        @keyframes modalIn {
            from { opacity: 0; transform: scale(0.9) translateY(20px); }
            to { opacity: 1; transform: scale(1) translateY(0); }
        }
        .modal-header {
            display: flex;
            justify-content: flex-end;
            align-items: center;
            margin-bottom: 10px;
        }
            color: #2e7d32;
            font-size: 20px;
        }
        .modal-close {
            width: 32px;
            height: 32px;
            border: none;
            background: transparent;
            cursor: pointer;
            font-size: 24px;
            line-height: 32px;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s ease;
            color: #999;
            border-radius: 50%;
            padding: 0;
            margin: 0;
            user-select: none;
            -webkit-user-select: none;
        }
        .modal-close:hover {
            color: #666;
            background: rgba(0,0,0,0.05);
        }
        .modal-close:active {
            background: rgba(0,0,0,0.1);
        }

        /* 轻量密码弹窗：磨砂玻璃小卡片 + 下划线输入（房间管理 / 历史管理共用） */
        #pass-modal {
            display: none; position: fixed; inset: 0;
            background: rgba(46,58,46,0.16);
            z-index: 30001; justify-content: center; align-items: center;
        }
        #pass-modal.active { display: flex; }
        .pass-card {
            width: 250px; padding: 28px 24px 22px;
            background: rgba(255,255,255,0.68);
            backdrop-filter: blur(18px) saturate(1.5);
            -webkit-backdrop-filter: blur(18px) saturate(1.5);
            border: 1px solid rgba(255,255,255,0.75);
            border-radius: 16px;
            text-align: center;
            animation: passIn 0.22s ease-out;
        }
        @keyframes passIn {
            from { opacity: 0; transform: translateY(10px) scale(0.98); }
            to { opacity: 1; transform: translateY(0) scale(1); }
        }
        .pass-title {
            font-size: 13px; color: #98a296;
            letter-spacing: 3px; margin-bottom: 20px;
        }
        .pass-input {
            width: 100%; border: none; border-bottom: 1.5px solid #d5e3d5;
            background: transparent; outline: none; border-radius: 0;
            padding: 4px 2px 8px; margin-bottom: 22px;
            font-size: 16px; color: #2e3b2e;
            text-align: center; letter-spacing: 3px;
            transition: border-color 0.25s ease;
        }
        .pass-input::placeholder {
            color: #bcc8bc; font-size: 13px; letter-spacing: 2px;
        }
        .pass-input:focus { border-color: #66bb6a; }
        .pass-submit {
            border: none; background: rgba(102,187,106,0.12);
            color: #3f8f5c; cursor: pointer;
            padding: 8px 26px; border-radius: 8px;
            font-size: 14px; font-weight: 600; letter-spacing: 2px;
            transition: background 0.2s ease;
        }
        .pass-submit:hover { background: rgba(102,187,106,0.2); }
        .pass-input.shake { animation: passShake 0.3s ease-out; }
        @media (prefers-reduced-motion: reduce) {
            .pass-card { animation: none; }
            .pass-input.shake { animation: none; }
        }

        /* 通用确认弹窗：复用磨砂卡片风格（撤回等轻量确认） */
        #confirm-modal {
            display: none; position: fixed; inset: 0;
            background: rgba(46,58,46,0.16);
            z-index: 30001; justify-content: center; align-items: center;
        }
        #confirm-modal.active { display: flex; }
        .confirm-card { width: 264px; }
        .confirm-text { font-size: 14px; color: #3d4a3f; line-height: 1.6; padding: 0 4px; }
        .confirm-btns { display: flex; gap: 12px; justify-content: center; margin-top: 22px; }
        .confirm-cancel {
            border: none; background: transparent; color: #98a296; cursor: pointer;
            padding: 8px 22px; border-radius: 8px;
            font-size: 14px; letter-spacing: 1px;
            transition: background 0.2s ease;
        }
        .confirm-cancel:hover { background: rgba(0,0,0,0.05); }
        .confirm-ok {
            border: none; background: rgba(226,88,88,0.12);
            color: #d45252; cursor: pointer;
            padding: 8px 22px; border-radius: 8px;
            font-size: 14px; font-weight: 600; letter-spacing: 1px;
            transition: background 0.2s ease;
        }
        .confirm-ok:hover { background: rgba(226,88,88,0.2); }
        .confirm-btns button { font-family: inherit; }
        @media (prefers-reduced-motion: reduce) {
            .confirm-card { animation: none; }
        }

        /* 密码错误抖动（弹窗内 auth-input 通用） */
        input.auth-input.shake { animation: passShake 0.3s ease-out; }
        @keyframes passShake {
            0%, 100% { transform: translateX(0); }
            25% { transform: translateX(-5px); }
            75% { transform: translateX(5px); }
        }
        @media (prefers-reduced-motion: reduce) {
            input.auth-input.shake { animation: none; }
        }

        .admin-btn {
            background: transparent;
            color: #3f8f5c;
            border: 1px solid #b9cec0;
            border-radius: 8px;
            padding: 6px 14px;
            font-size: 13px;
            cursor: pointer;
            transition: background 0.2s ease-out, border-color 0.2s ease-out;
        }
        .admin-btn:hover {
            background: rgba(63,143,92,0.07);
            border-color: #3f8f5c;
            transform: none;
            box-shadow: none;
        }
        .admin-btn:active { background: rgba(63,143,92,0.13); }
        .admin-btn.danger {
            color: #c0564a;
            border-color: #dcb6b0;
        }
        .admin-btn.danger:hover {
            background: rgba(192,86,74,0.07);
            border-color: #c0564a;
            box-shadow: none;
        }

        /* 房间管理列表：下划线行风格 */
        .room-manage-list { margin: 0; }
        .room-manage-row {
            padding: 14px 2px;
            border-bottom: 1px solid #edf1ec;
        }
        .room-manage-row:last-child { border-bottom: none; }
        .room-manage-main {
            display: flex;
            align-items: center;
            gap: 10px;
        }
        .room-manage-info { flex: 1; min-width: 0; text-align: left; }
        .room-manage-name {
            font-size: 14px;
            font-weight: 600;
            color: #2e3b2e;
            word-break: break-all;
            line-height: 1.4;
        }
        .room-manage-name .current-tag {
            font-size: 10px;
            font-weight: 500;
            color: #3f8f5c;
            border: 1px solid #b9cec0;
            border-radius: 4px;
            padding: 1px 5px;
            margin-left: 6px;
            vertical-align: 1px;
        }
        .room-manage-meta {
            font-size: 11px;
            color: #98a296;
            margin-top: 3px;
            display: flex;
            align-items: center;
            gap: 8px;
            flex-wrap: wrap;
        }
        .room-pass-tag {
            color: #98a296;
        }
        .room-pass-tag.locked { color: #3f8f5c; }
        .room-last-msg {
            display: inline-flex;
            align-items: center;
            gap: 4px;
        }
        .room-last-msg.recent { color: #3f8f5c; }
        .room-last-msg.recent::before {
            content: '';
            width: 5px;
            height: 5px;
            border-radius: 50%;
            background: #3f8f5c;
            opacity: 0.7;
            flex-shrink: 0;
        }
        .room-manage-more {
            position: relative;
            flex-shrink: 0;
        }
        .room-more-btn {
            width: 30px; height: 30px;
            border: none;
            background: transparent;
            border-radius: 8px;
            cursor: pointer;
            color: #98a296;
            font-size: 16px;
            line-height: 1;
            display: flex; align-items: center; justify-content: center;
        }
        .room-more-btn:hover { background: rgba(0,0,0,0.05); color: #2e3b2e; }
        .room-more-menu {
            position: absolute;
            right: 0; top: 34px;
            background: #fff;
            border: 1px solid #e4e9e2;
            border-radius: 10px;
            box-shadow: 0 6px 24px rgba(46,59,46,0.1);
            min-width: 108px;
            padding: 4px;
            z-index: 10;
            display: none;
        }
        .room-more-menu.open { display: block; }
        .room-more-menu button {
            display: block;
            width: 100%;
            border: none;
            background: transparent;
            text-align: left;
            padding: 8px 10px;
            font-size: 12px;
            color: #2e3b2e;
            border-radius: 6px;
            cursor: pointer;
        }
        .room-more-menu button:hover { background: #f2f6f0; }
        .room-more-menu button.danger { color: #c0564a; }
        .room-more-menu button.danger:hover { background: rgba(192,86,74,0.07); }
        .room-manage-details {
            display: none;
            margin-top: 12px;
            padding: 12px 2px 2px 2px;
            border-top: 1px dashed #e4e9e2;
            font-size: 12px;
            color: #666;
            text-align: left;
        }
        .room-manage-details.open { display: block; }
        .room-detail-row {
            display: flex;
            align-items: center;
            gap: 8px;
            margin-bottom: 8px;
        }
        .room-detail-row label { color: #98a296; flex-shrink: 0; }
        .room-detail-row code {
            background: #f4f7f2;
            padding: 3px 8px;
            border-radius: 5px;
            font-size: 11px;
            flex: 1;
            min-width: 0;
            word-break: break-all;
            color: #2e3b2e;
        }
        .room-detail-actions { display: flex; gap: 8px; margin-top: 4px; }
        .room-detail-actions .admin-btn { flex: 1; padding: 5px 8px; font-size: 12px; }
        .room-pass-change-form { margin-top: 8px; }
        .room-pass-change-form input {
            width: 100%;
            padding: 8px 2px;
            border: none;
            border-bottom: 1px solid #d9ded7;
            border-radius: 0;
            font-size: 13px;
            color: #2e3b2e;
            outline: none;
            background: transparent;
            box-sizing: border-box;
            margin-bottom: 10px;
        }
        .room-pass-change-form input:focus { border-color: #3f8f5c; box-shadow: 0 1px 0 #3f8f5c; }

        .admin-panel {
            margin-top: 18px;
            padding-top: 15px;
            border-top: 1px solid #edf1ec;
        }
        .admin-panel h4 {
            margin: 0 0 10px 0;
            color: #98a296;
            font-size: 12px;
            font-weight: 500;
            letter-spacing: 2px;
        }
        .admin-user-list {
            max-height: 150px;
            overflow-y: auto;
        }
        .admin-user-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 8px;
            background: white;
            border-radius: 8px;
            margin-bottom: 5px;
        }
        .admin-user-item:last-child {
            margin-bottom: 0;
        }

        /* WebRTC 通话样式 */
        .user-call-btns {
            margin-left: auto;
            display: flex;
            gap: 4px;
            flex-shrink: 0;
        }
        .user-call-btn {
            width: 28px; height: 28px;
            padding: 0;
            border: none;
            border-radius: 7px;
            background: transparent;
            font-size: 14px;
            cursor: pointer;
            display: flex; align-items: center; justify-content: center;
            transition: background 0.15s ease-out;
            opacity: 0.75;
        }
        .user-call-btn:hover { background: #eef3ec; opacity: 1; }
        .user-call-btn:active { background: #e2ebe0; }
        .user-call-btn svg { width: 15px; height: 15px; display: block; color: #5aa8d6; }
        .user-call-btn.vc-btn svg { color: #5cb88a; }

        #call-modal {
            display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
            background: rgba(14, 18, 16, 0.86); backdrop-filter: blur(28px) saturate(120%); -webkit-backdrop-filter: blur(28px) saturate(120%);
            z-index: 20000; justify-content: center; align-items: center; flex-direction: column;
        }
        #call-modal.active { display: flex; }
        #call-modal.video-mode { background: #000; }
        #video-container { display: none; position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
        #call-modal.video-mode #video-container { display: block; }
        #remote-video { width: 100%; height: 100%; object-fit: cover; background: #000; }
        #local-video { position: absolute; top: max(110px, calc(env(safe-area-inset-top) + 104px)); right: 12px; width: 120px; height: 160px; border-radius: 12px; object-fit: cover; border: 2px solid rgba(255,255,255,0.3); box-shadow: 0 4px 15px rgba(0,0,0,0.5); z-index: 10; transition: box-shadow 0.2s, border-color 0.2s; cursor: grab; touch-action: none; }
        /* 呼叫建立阶段：本地画面全屏预览，接通后切回右上角小窗 */
        #video-container.local-full #local-video { position: static; width: 100%; height: 100%; border-radius: 0; border: none; box-shadow: none; cursor: default; touch-action: auto; }
        #video-container.local-full #remote-video { display: none; }
        #local-video:active { cursor: grabbing; }
        #local-video:hover { border-color: rgba(255,255,255,0.6); }
        #local-video.dragging { box-shadow: 0 8px 25px rgba(0,0,0,0.6); border-color: rgba(255,255,255,0.8); }
        #video-container.swapped #remote-video { position: absolute; top: max(110px, calc(env(safe-area-inset-top) + 104px)); right: 12px; width: 120px; height: 160px; border-radius: 12px; border: 2px solid rgba(255,255,255,0.3); box-shadow: 0 4px 15px rgba(0,0,0,0.5); z-index: 10; transition: box-shadow 0.2s, border-color 0.2s; cursor: grab; touch-action: none; }
        #video-container.swapped #remote-video:active { cursor: grabbing; }
        #video-container.swapped #remote-video:hover { border-color: rgba(255,255,255,0.6); }
        #video-container.swapped #remote-video.dragging { box-shadow: 0 8px 25px rgba(0,0,0,0.6); border-color: rgba(255,255,255,0.8); }
        #video-container.swapped #local-video { position: static; width: 100%; height: 100%; border-radius: 0; border: none; box-shadow: none; z-index: 1; cursor: default; touch-action: auto; }
        #call-modal.video-mode .call-peer {
            position: absolute; top: max(60px, calc(env(safe-area-inset-top) + 54px)); left: 50%; transform: translateX(-50%);
            max-width: 78vw;
            background: rgba(18, 23, 21, 0.38); backdrop-filter: blur(20px) saturate(150%); -webkit-backdrop-filter: blur(20px) saturate(150%);
            border: 1px solid rgba(255,255,255,0.10); border-radius: 999px;
            padding: 8px 20px;
            box-shadow: 0 4px 16px rgba(0,0,0,0.14);
            transition: opacity 0.3s ease;
            z-index: 15;
        }
        #call-modal.video-mode .call-name { padding: 0; font-size: 16px; }
        #call-modal.video-mode .call-name.name-long { font-size: 15px; }
        #call-modal.video-mode .call-name.name-xlong { font-size: 14px; }
        #call-modal.video-mode .call-status { font-size: 12px; }
        #call-modal.video-mode.controls-hidden .call-peer,
        #call-modal.video-mode.controls-hidden .call-actions,
        #call-modal.video-mode.controls-hidden .call-timer { opacity: 0; pointer-events: none; }
        #call-modal.video-mode.controls-hidden .call-actions { transform: translateX(-50%) translateY(16px); }
        #call-modal.video-mode #remote-video { cursor: pointer; }
        .call-peer { display: flex; flex-direction: column; align-items: center; width: 100%; }
        .call-name { color: rgba(255,255,255,0.95); font-size: 20px; font-weight: 600; letter-spacing: 0.3px; margin: 0 0 7px; text-shadow: 0 1px 4px rgba(0,0,0,0.18); max-width: 100%; padding: 0 18px; box-sizing: border-box; line-height: 1.35; overflow-wrap: anywhere; word-break: break-word; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-align: center; }
        .call-name.name-long { font-size: 18px; }
        .call-name.name-xlong { font-size: 15px; }
        .call-status { color: rgba(255,255,255,0.52); font-size: 13px; letter-spacing: 0.4px; margin-bottom: 0; }
        .call-timer {
            position: absolute; top: max(16px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%);
            display: flex; align-items: center; gap: 10px;
            padding: 7px 16px; border-radius: 20px;
            background: rgba(22, 28, 26, 0.42);
            backdrop-filter: blur(20px) saturate(150%); -webkit-backdrop-filter: blur(20px) saturate(150%);
            border: 1px solid rgba(255,255,255,0.12);
            box-shadow: 0 4px 18px rgba(0,0,0,0.18);
            color: rgba(255,255,255,0.95); font-size: 14px; font-family: 'SF Mono', 'Monaco', monospace; font-weight: 500; letter-spacing: 1px;
            transition: opacity 0.3s ease;
            z-index: 20;
        }
        .call-net { display: inline-flex; align-items: flex-end; gap: 2px; height: 11px; }
        .call-net i { width: 3px; border-radius: 1px; background: rgba(255,255,255,0.28); transition: background 0.4s ease; }
        .call-net i:nth-child(1) { height: 4px; }
        .call-net i:nth-child(2) { height: 7px; }
        .call-net i:nth-child(3) { height: 11px; }
        .call-net[data-level="0"] i { background: #4ade80; }
        .call-net[data-level="1"] i:nth-child(-n+2) { background: #fbbf24; }
        .call-net[data-level="2"] i:nth-child(1) { background: #f87171; }
        .call-actions {
            position: absolute;
            bottom: max(30px, calc(env(safe-area-inset-bottom) + 22px));
            left: 50%; transform: translateX(-50%);
            display: flex; gap: 16px; justify-content: center;
            padding: 13px 20px;
            background: rgba(255,255,255,0.09);
            border-radius: 999px;
            backdrop-filter: blur(24px) saturate(150%);
            -webkit-backdrop-filter: blur(24px) saturate(150%);
            border: 1px solid rgba(255,255,255,0.12);
            box-shadow: 0 8px 28px rgba(0,0,0,0.18);
            z-index: 18;
            max-width: calc(100vw - 32px);
        }
        #call-modal.video-mode .call-actions { background: rgba(18,23,21,0.34); border-color: rgba(255,255,255,0.10); }
        .call-action-btn { 
            width: 56px; height: 56px; border-radius: 50%; border: none; cursor: pointer; 
            display: flex; align-items: center; justify-content: center; 
            background: rgba(255,255,255,0.13); color: #fff;
            -webkit-tap-highlight-color: transparent;
            transition: background 0.18s ease, color 0.18s ease, transform 0.12s ease;
        }
        .call-action-btn:hover { background: rgba(255,255,255,0.22); }
        .call-action-btn:active { transform: scale(0.92); }
        .call-action-btn svg { width: 22px; height: 22px; display: block; }
        /* 激活态：白底深色图标（静音/摄像头关闭/听筒） */
        .call-action-btn.active, .call-action-btn.active:hover { background: #fff; color: #222824; }
        /* 挂断/拒绝：柔和红 */
        .call-end, .call-reject { background: #e25858; color: #fff; }
        .call-end:hover, .call-reject:hover { background: #e76a6a; }
        /* 接听：青瓷绿 */
        .call-accept { background: #5cb88a; color: #fff; }
        .call-accept:hover { background: #67c093; }
        /* 来电时接听/拒绝加大尺寸并拉开间距防误触 */
        .call-reject, .call-accept { width: 64px; height: 64px; }
        .call-reject + .call-accept { margin-left: 34px; }

        .system-msg {
            text-align: center;
            padding: 8px 15px;
            background: rgba(0,0,0,0.05);
            border-radius: 20px;
            font-size: 12px;
            color: #888;
            margin: 10px auto;
            max-width: 80%;
        }

        .call-summary-msg {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 3px;
            padding: 8px 16px;
            margin: 8px auto;
            width: fit-content;
            max-width: 85%;
            background: rgba(90, 168, 214, 0.06);
            border: 1px solid rgba(90, 168, 214, 0.16);
            border-radius: 12px;
            text-align: center;
        }
        .call-summary-names {
            font-size: 13px;
            font-weight: 600;
            color: #4f5b53;
            line-height: 1.4;
        }
        .call-summary-sub {
            display: flex;
            align-items: center;
            gap: 6px;
            font-size: 12px;
            color: #7d8880;
            line-height: 1.4;
        }
        .call-summary-icon { display: inline-flex; flex-shrink: 0; color: #5aa8d6; }
        .call-summary-icon svg { width: 13px; height: 13px; display: block; }
        .call-summary-msg.video-call .call-summary-icon { color: #5cb88a; }
        .call-summary-duration {
            font-size: 12.5px;
            font-weight: 600;
            color: #6f7d73;
            font-variant-numeric: tabular-nums;
            padding-left: 6px;
            border-left: 1px solid rgba(31, 45, 36, 0.1);
        }
        .call-summary-msg.missed {
            background: rgba(255, 69, 58, 0.05);
            border-color: rgba(255, 69, 58, 0.15);
        }
        .call-summary-msg.missed .call-summary-icon { color: #e06058; }
        .call-summary-msg.missed .call-summary-names { color: #c0564e; }
        .call-summary-msg.missed .call-summary-duration { color: #d0685f; border-left-color: rgba(255, 69, 58, 0.15); }
    