
        * { margin: 0; padding: 0; box-sizing: border-box; }
        
        /* CSS Variables for Theme */
        :root {
            --bg-primary: #ffffff;
            --bg-secondary: rgba(0, 0, 0, 0.04);
            --text-primary: #262626;
            --text-secondary: #6d6d6d;
            --border-color: rgba(0, 0, 0, 0.08);
            --shadow: rgba(0, 0, 0, 0.05);
            --bubble-other: rgba(0, 0, 0, 0.04);
            --bubble-self: #262626;
            --bubble-self-text: #fafafa;
            --at-mention-bg: rgba(29, 29, 31, 0.1);
            --at-mention-text: #262626;
            --reply-bg: rgba(29, 29, 31, 0.05);
            --reply-border: rgba(29, 29, 31, 0.25);
            --footer-gradient: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.02) 100%);
            --chat-scale: 1;
            --message-font-size: calc(14px * var(--chat-scale));
            --message-sender-size: calc(11px * var(--chat-scale));
            --message-time-size: calc(11px * var(--chat-scale));
        }
        
        [data-theme="dark"] {
            --bg-primary: #161616;
            --bg-secondary: rgba(255, 255, 255, 0.04);
            --text-primary: #f5f5f5;
            --text-secondary: #8f8f8f;
            --border-color: rgba(255, 255, 255, 0.06);
            --shadow: rgba(0, 0, 0, 0.3);
            --bubble-other: rgba(255, 255, 255, 0.04);
            --bubble-self: #f5f5f5;
            --bubble-self-text: #262626;
            --at-mention-bg: rgba(245, 245, 247, 0.15);
            --at-mention-text: #f5f5f7;
            --reply-bg: rgba(255, 255, 255, 0.08);
            --reply-border: rgba(255, 255, 255, 0.2);
            --footer-gradient: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.03) 100%);
        }
        
        /* Inter 延迟加载完成后（loader 加 qce-inter class）才把它排进字体栈。 */
        html.qce-inter body {
            font-family: "Inter Variable", -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Hiragino Sans GB", sans-serif;
        }

        body {
            font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Hiragino Sans GB", sans-serif;
            background: var(--bg-primary);
            color: var(--text-primary);
            line-height: 1.5; 
            font-size: 17px;
            -webkit-font-smoothing: antialiased;
            transition: background 0.3s, color 0.3s;
        }
        
        /* Toolbar - 底部胶囊 */
        .toolbar {
            position: fixed;
            bottom: 24px;
            left: 50%;
            transform: translateX(-50%);
            background: rgba(249, 249, 249, 0.78);
            backdrop-filter: saturate(180%) blur(20px);
            border-radius: 20px;
            padding: 8px;
            z-index: 1000;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08),
                        0 8px 32px rgba(0, 0, 0, 0.06),
                        inset 0 0 0 0.5px rgba(0, 0, 0, 0.04);
        }
        
        [data-theme="dark"] .toolbar {
            background: rgba(44, 44, 46, 0.78);
            box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3),
                        0 8px 32px rgba(0, 0, 0, 0.25),
                        inset 0 0 0 0.5px rgba(255, 255, 255, 0.08);
        }
        
        .toolbar-content {
            display: flex;
            gap: 4px;
            align-items: center;
        }
        
        /* 时间范围选择胶囊 */
        .time-range-container {
            position: relative;
        }
        .time-range-btn {
            padding: 8px 12px;
            border: none;
            border-radius: 12px;
            background: rgba(0, 0, 0, 0.04);
            cursor: pointer;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            color: var(--text-primary);
            font-size: 13px;
            font-weight: 500;
        }
        [data-theme="dark"] .time-range-btn {
            background: rgba(255, 255, 255, 0.08);
        }
        .time-range-btn:hover {
            background: rgba(0, 0, 0, 0.08);
        }
        [data-theme="dark"] .time-range-btn:hover {
            background: rgba(255, 255, 255, 0.12);
        }
        .time-range-btn svg {
            width: 16px !important;
            height: 16px !important;
            stroke-width: 2 !important;
        }
        .time-range-dropdown {
            position: absolute;
            bottom: calc(100% + 12px);
            right: 0;
            min-width: 240px;
            padding: 12px;
            border-radius: 14px;
            background: rgba(249, 249, 249, 0.88);
            backdrop-filter: saturate(180%) blur(20px);
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12),
                        0 8px 40px rgba(0, 0, 0, 0.08),
                        inset 0 0 0 0.5px rgba(0, 0, 0, 0.04);
            opacity: 0;
            transform: translateY(8px);
            pointer-events: none;
            transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
            z-index: 1001;
        }
        [data-theme="dark"] .time-range-dropdown {
            background: rgba(44, 44, 46, 0.88);
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4),
                        0 8px 40px rgba(0, 0, 0, 0.3),
                        inset 0 0 0 0.5px rgba(255, 255, 255, 0.08);
        }
        .time-range-dropdown.active {
            opacity: 1;
            transform: translateY(0);
            pointer-events: auto;
        }
        .time-range-inputs {
            display: flex;
            flex-direction: column;
            gap: 8px;
        }
        .time-range-input-group {
            display: flex;
            flex-direction: column;
            gap: 4px;
        }
        .time-range-input-group label {
            font-size: 12px;
            color: var(--text-secondary);
            font-weight: 500;
            text-transform: uppercase;
            letter-spacing: 0.05em;
        }
        .time-range-input-group input {
            padding: 6px 10px;
            border: 1px solid rgba(0, 0, 0, 0.08);
            border-radius: 8px;
            background: var(--bg-primary);
            color: var(--text-primary);
            font-size: 13px;
            transition: all 0.2s;
        }
        [data-theme="dark"] .time-range-input-group input {
            border-color: rgba(255, 255, 255, 0.12);
            color-scheme: dark;
        }
        .time-range-input-group input:focus {
            outline: none;
            border-color: #1d1d1f;
            box-shadow: 0 0 0 3px rgba(29, 29, 31, 0.1);
        }
        [data-theme="dark"] .time-range-input-group input:focus {
            border-color: #f5f5f7;
            box-shadow: 0 0 0 3px rgba(245, 245, 247, 0.1);
        }
        .time-range-actions {
            display: flex;
            gap: 8px;
            margin-top: 8px;
            padding-top: 8px;
            border-top: 1px solid rgba(0, 0, 0, 0.08);
        }
        [data-theme="dark"] .time-range-actions {
            border-top-color: rgba(255, 255, 255, 0.12);
        }
        .time-range-actions button {
            flex: 1;
            padding: 6px 10px;
            border: none;
            border-radius: 8px;
            font-size: 12px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s;
        }
        .time-range-actions .apply-btn {
            background: #1d1d1f;
            color: #ffffff;
        }
        [data-theme="dark"] .time-range-actions .apply-btn {
            background: #f5f5f7;
            color: #000000;
        }
        .time-range-actions .apply-btn:hover {
            opacity: 0.8;
        }
        .time-range-actions .clear-btn {
            background: rgba(0, 0, 0, 0.06);
            color: var(--text-primary);
        }
        [data-theme="dark"] .time-range-actions .clear-btn {
            background: rgba(255, 255, 255, 0.12);
        }
        .time-range-actions .clear-btn:hover {
            background: rgba(0, 0, 0, 0.1);
        }
        [data-theme="dark"] .time-range-actions .clear-btn:hover {
            background: rgba(255, 255, 255, 0.15);
        }
        /* 分隔线 */
        .toolbar-separator {
            width: 1px;
            height: 20px;
            background: rgba(0, 0, 0, 0.08);
            margin: 0 4px;
        }
        
        [data-theme="dark"] .toolbar-separator {
            background: rgba(255, 255, 255, 0.12);
        }
        
        .search-container {
            display: flex;
            align-items: center;
        }
        
        .search-btn {
            padding: 8px;
            border: none;
            border-radius: 12px;
            background: transparent;
            cursor: pointer;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--text-primary);
        }
        
        .search-btn:hover {
            background: rgba(0, 0, 0, 0.06);
        }
        
        [data-theme="dark"] .search-btn:hover {
            background: rgba(255, 255, 255, 0.12);
        }
        
        .search-btn svg {
            width: 18px !important;
            height: 18px !important;
            stroke-width: 2 !important;
        }
        
        .search-input-wrapper {
            position: relative;
            width: 0;
            overflow: hidden;
            transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        }
        
        .search-input-wrapper.active {
            width: 240px;
            margin-left: 4px;
        }
        
        .search-input {
            width: 100%;
            padding: 7px 32px 7px 12px;
            border: none;
            border-radius: 12px;
            background: rgba(0, 0, 0, 0.06);
            color: var(--text-primary);
            font-size: 14px;
            outline: none;
            transition: all 0.2s;
            font-family: inherit;
        }
        
        [data-theme="dark"] .search-input {
            background: rgba(255, 255, 255, 0.12);
        }
        
        .search-input:focus {
            background: rgba(0, 0, 0, 0.1);
        }
        
        [data-theme="dark"] .search-input:focus {
            background: rgba(255, 255, 255, 0.18);
        }
        
        .search-input::placeholder {
            color: var(--text-secondary);
        }
        
        .clear-search {
            position: absolute;
            right: 4px;
            top: 50%;
            transform: translateY(-50%);
            background: none;
            border: none;
            color: var(--text-secondary);
            cursor: pointer;
            padding: 4px;
            border-radius: 50%;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        
        .clear-search:hover {
            background: rgba(0, 0, 0, 0.1);
            color: var(--text-primary);
        }
        
        [data-theme="dark"] .clear-search:hover {
            background: rgba(255, 255, 255, 0.15);
        }
        
        .clear-search svg {
            width: 14px !important;
            height: 14px !important;
            stroke-width: 2.5 !important;
        }
        
        .toolbar-actions {
            display: flex;
            gap: 4px;
            align-items: center;
        }
        
        .filter-container {
            position: relative;
        }
        
        .filter-btn {
            padding: 8px;
            border: none;
            border-radius: 12px;
            background: transparent;
            cursor: pointer;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--text-primary);
        }
        
        .filter-btn:hover {
            background: rgba(0, 0, 0, 0.06);
        }
        
        [data-theme="dark"] .filter-btn:hover {
            background: rgba(255, 255, 255, 0.12);
        }
        
        .filter-btn svg {
            width: 18px !important;
            height: 18px !important;
            stroke-width: 2 !important;
        }
        
        .filter-dropdown {
            position: absolute;
            bottom: calc(100% + 12px);
            right: 0;
            min-width: 200px;
            max-width: 280px;
            padding: 6px;
            border-radius: 14px;
            background: rgba(249, 249, 249, 0.88);
            backdrop-filter: saturate(180%) blur(20px);
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12),
                        0 8px 40px rgba(0, 0, 0, 0.08),
                        inset 0 0 0 0.5px rgba(0, 0, 0, 0.04);
            opacity: 0;
            transform: translateY(8px);
            pointer-events: none;
            transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
            z-index: 1001;
        }
        
        [data-theme="dark"] .filter-dropdown {
            background: rgba(44, 44, 46, 0.88);
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4),
                        0 8px 40px rgba(0, 0, 0, 0.3),
                        inset 0 0 0 0.5px rgba(255, 255, 255, 0.08);
        }
        
        .filter-dropdown.active {
            opacity: 1;
            transform: translateY(0);
            pointer-events: auto;
        }
        
        /* 筛选搜索框 */
        .filter-search-wrapper {
            padding: 4px 6px 8px;
            border-bottom: 1px solid rgba(0, 0, 0, 0.08);
            margin-bottom: 6px;
        }
        
        [data-theme="dark"] .filter-search-wrapper {
            border-bottom-color: rgba(255, 255, 255, 0.12);
        }
        
        .filter-search-input {
            width: 100%;
            padding: 6px 10px;
            border: 1px solid rgba(0, 0, 0, 0.08);
            border-radius: 8px;
            background: var(--bg-primary);
            color: var(--text-primary);
            font-size: 13px;
            outline: none;
            transition: all 0.2s;
        }
        
        [data-theme="dark"] .filter-search-input {
            border-color: rgba(255, 255, 255, 0.12);
        }
        
        .filter-search-input:focus {
            border-color: #1d1d1f;
            box-shadow: 0 0 0 2px rgba(29, 29, 31, 0.1);
        }
        
        [data-theme="dark"] .filter-search-input:focus {
            border-color: #f5f5f7;
            box-shadow: 0 0 0 2px rgba(245, 245, 247, 0.1);
        }
        
        .filter-search-input::placeholder {
            color: var(--text-secondary);
        }
        
        /* 筛选选项列表容器 */
        .filter-options-list {
            max-height: 320px;
            overflow-y: auto;
            overflow-x: hidden;
            scrollbar-width: thin;
            scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
        }
        
        .filter-options-list::-webkit-scrollbar {
            width: 6px;
        }
        
        .filter-options-list::-webkit-scrollbar-track {
            background: transparent;
        }
        
        .filter-options-list::-webkit-scrollbar-thumb {
            background: rgba(0, 0, 0, 0.2);
            border-radius: 3px;
        }
        
        [data-theme="dark"] .filter-options-list::-webkit-scrollbar-thumb {
            background: rgba(255, 255, 255, 0.2);
        }
        
        .filter-option {
            padding: 8px 12px;
            border-radius: 8px;
            cursor: pointer;
            transition: background 0.15s;
            font-size: 14px;
            color: var(--text-primary);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        
        .filter-option:hover {
            background: rgba(0, 0, 0, 0.06);
        }
        
        [data-theme="dark"] .filter-option:hover {
            background: rgba(255, 255, 255, 0.12);
        }
        
        .filter-option.active {
            background: rgba(0, 0, 0, 0.08);
            font-weight: 600;
        }
        
        [data-theme="dark"] .filter-option.active {
            background: rgba(255, 255, 255, 0.15);
        }
        
        .filter-option.hidden {
            display: none;
        }
        
        /* 无搜索结果提示 */
        .filter-no-result {
            padding: 12px;
            text-align: center;
            color: var(--text-secondary);
            font-size: 13px;
            display: none;
        }
        
        .filter-no-result.visible {
            display: block;
        }
        
        .github-btn {
            padding: 8px;
            border: none;
            border-radius: 12px;
            background: transparent;
            cursor: pointer;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--text-primary);
            text-decoration: none;
        }
        
        .github-btn:hover {
            background: rgba(0, 0, 0, 0.06);
        }
        
        [data-theme="dark"] .github-btn:hover {
            background: rgba(255, 255, 255, 0.12);
        }
        
        .github-btn svg {
            width: 18px !important;
            height: 18px !important;
            stroke-width: 2 !important;
        }
        
        .theme-toggle {
            padding: 8px;
            border: none;
            border-radius: 12px;
            background: transparent;
            cursor: pointer;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--text-primary);
        }
        
        .theme-toggle:hover {
            background: rgba(0, 0, 0, 0.06);
        }
        
        [data-theme="dark"] .theme-toggle:hover {
            background: rgba(255, 255, 255, 0.12);
        }
        
        .theme-toggle svg {
            width: 18px !important;
            height: 18px !important;
            stroke-width: 2 !important;
        }
        
        /* 搜索高亮 */
        mark.highlight {
            background: #00ffc860 !important;
            color: #000000 !important;
            font-weight: 600;
            padding: 2px 4px;
            border-radius: 4px;
        }
        
        [data-theme="dark"] mark.highlight {
            background: #00ffc860 !important;
            color: #000000 !important;
        }
        
        /* Hero Section - 左对齐 */
        .hero {
            padding: 80px 64px 48px;
            max-width: 980px;
            margin: 0 auto;
            border-bottom: 1px solid var(--border-color);
        }
        
        .hero-title {
            font-size: 64px;
            font-weight: 700;
            color: var(--text-primary);
            margin-bottom: 8px;
            letter-spacing: -0.03em;
            line-height: 1.05;
        }
        
        .hero-subtitle {
            font-size: 17px;
            color: var(--text-secondary);
            font-weight: 400;
            margin-bottom: 24px;
        }
        
        .hero-meta {
            display: flex;
            gap: 32px;
            flex-wrap: wrap;
        }
        .chat-layout {
            max-width: 1280px;
            margin: 0 auto;
            padding: 0 48px 120px;
        }
        .chat-main {
            min-width: 0;
        }
        
        .meta-item {
            display: flex;
            flex-direction: column;
            gap: 4px;
        }
        
        .meta-label {
            font-size: 13px;
            color: var(--text-secondary);
            font-weight: 400;
            text-transform: uppercase;
            letter-spacing: 0.05em;
        }
        
        .meta-value {
            font-size: 17px;
            color: var(--text-primary);
            font-weight: 500;
        }
        
        /* Chat Content */
        .chat-content {
            padding: 64px 0 120px;
            position: relative;
            max-width: 980px;
            margin: 0 auto;
        }
        
        /* 虚拟滚动容器 */
        .virtual-scroll-container {
            position: relative;
            overflow: hidden;
        }
        
        .virtual-scroll-spacer {
            width: 1px;
            pointer-events: none;
        }
        
        .virtual-scroll-content {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            will-change: transform;
        }
        
        /* 加载指示器 */
        .scroll-loader {
            text-align: center;
            padding: 20px;
            color: var(--text-secondary);
            font-size: 14px;
        }
        
        .message-block {
            margin-bottom: 10px;
        }
        /* 日期分隔 / 系统行：居中的小号灰色文字（对齐 demo .sysrow/.sys） */
        .date-divider {
            text-align: center;
            padding: 12px 0;
            margin: 0;
            font-size: 11px;
            font-weight: 500;
            letter-spacing: 0.01em;
            color: var(--text-secondary);
        }
        .system-message-container {
            text-align: center;
            padding: 6px 12px;
            margin: 0 auto;
            width: fit-content;
            max-width: min(560px, calc(100% - 32px));
            font-size: 11px;
            font-weight: 500;
            letter-spacing: 0.01em;
            color: var(--text-secondary);
        }
        .system-message-container .system-message {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            flex-wrap: wrap;
            gap: 3px;
            line-height: 1.5;
            overflow-wrap: anywhere;
        }
        .system-message-image {
            display: inline-block;
            width: 24px;
            height: 24px;
            border-radius: 6px;
            object-fit: cover;
            vertical-align: middle;
        }
        .system-message-link {
            color: inherit;
            text-decoration: underline;
            text-underline-offset: 2px;
        }
        .system-message-container .text-content { font-size: 11px; }
        .system-message-time {
            color: var(--text-secondary);
            opacity: 0;
            font-size: 10px;
            margin-top: 2px;
            transition: opacity 0.2s ease;
            transition-delay: 0s;
        }
        .system-message-container:hover .system-message-time {
            opacity: 0.7;
            transition-delay: 0.45s;
        }
        .message {
            margin-bottom: 0;
            display: flex;
            gap: 10px;
            align-items: flex-start;
            contain: layout style paint;
            will-change: auto;
        }
        
        .message.self {
            flex-direction: row-reverse;
        }
        
        .avatar {
            width: 30px;
            height: 30px;
            border-radius: 50%;
            background: var(--bg-secondary);
            flex-shrink: 0;
            overflow: hidden;
            border: 1px solid var(--border-color);
        }
        
        .avatar img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
        
        .message-wrapper {
            max-width: 62%;
            min-width: 0;
            display: flex;
            flex-direction: column;
            gap: 3px;
        }
        .message.self .message-wrapper { align-items: flex-end; }
        
        .message-header {
            display: flex;
            align-items: baseline;
            gap: 6px;
            padding: 0 2px;
        }
        
        .message.self .message-header {
            flex-direction: row-reverse;
        }
        
        .sender {
            font-size: 11px;
            font-weight: 400;
            color: var(--text-secondary);
        }

        /* 群头衔徽章 */
        .sender-title {
            display: inline-flex;
            align-items: center;
            font-size: 10px;
            font-weight: 500;
            line-height: 1.4;
            color: var(--text-secondary);
            background: var(--bg-secondary);
            border: 0;
            padding: 1px 5px;
            border-radius: 6px;
            margin-right: 0;
            white-space: nowrap;
        }

        .qce-hide-group-member-titles .sender-title {
            display: none;
        }

        .time {
            font-size: var(--message-time-size);
            color: var(--text-secondary);
            opacity: 0;
            transition: opacity 0.2s ease;
            transition-delay: 0s;
        }
        .message:hover .time {
            opacity: 1;
            transition-delay: 0.45s;
        }
        
        /* 消息气泡 - 带角 */
        .message-bubble {
            padding: 9px 14px;
            border-radius: 16px;
            position: relative;
            width: fit-content;
            max-width: 100%;
            word-wrap: break-word;
            overflow-wrap: anywhere;
            word-break: break-word;
        }
        .message.self .message-bubble { margin-left: auto; }
        /* 富媒体元素自带边框/圆角，去掉外层气泡底色与内边距 */
        .message-bubble:has(> .content > .voice-bubble),
        .message-bubble:has(> .content > .video-bubble),
        .message-bubble:has(> .content > .message-file),
        .message-bubble:has(> .content:not(.mixed-media) > .image-content),
        .message-bubble:has(> .content > .sticker-wrap),
        .message-bubble:has(> .content > .media-fallback) {
            background: transparent !important;
            padding: 0 !important;
        }
        
        .message.other .message-bubble {
            background: var(--bubble-other);
            color: var(--text-primary);
        }
        
        .message.self .message-bubble {
            background: var(--bubble-self);
            color: var(--bubble-self-text);
        }

        .message-bubble.reply-jump-highlight {
            animation: reply-jump-highlight 700ms ease-out;
        }

        @keyframes reply-jump-highlight {
            0%, 100% { box-shadow: inset 0 0 0 999px rgba(0, 0, 0, 0); }
            40% { box-shadow: inset 0 0 0 999px rgba(0, 0, 0, 0.14); }
        }
        
        /* 去掉消息角 - 直接用圆角矩形 */
        
        .content {
            font-size: var(--message-font-size);
            line-height: 1.6;
        }
        
        .text-content {
            display: inline;
        }

        /* 消息内链接：虚线下划线 + hover 变色（对齐 WebUI 预览样式） */
        .msg-link {
            color: inherit;
            text-decoration: underline;
            text-decoration-style: dashed;
            text-underline-offset: 3px;
            text-decoration-thickness: 1px;
            word-break: break-all;
            transition: color 0.15s ease;
        }
        .message.other .msg-link:hover { color: #2563eb; }
        .message.self .msg-link:hover { opacity: 0.8; }
        [data-theme="dark"] .message.other .msg-link:hover { color: #60a5fa; }
        
        /* 图片内容 */
        .image-content {
            margin: 10px 0 4px;
            border-radius: 16px;
            overflow: hidden;
            max-width: 320px;
        }

        .content.mixed-media .image-content {
            display: inline-block;
            margin: 2px 0 0;
            vertical-align: top;
        }
        
        .image-content img {
            width: 100%;
            height: auto;
            display: block;
            cursor: pointer;
            transition: opacity 0.2s;
        }
        
        .image-content img:hover {
            opacity: 0.9;
        }
        
        /* @提及 */
        .at-mention {
            color: var(--at-mention-text);
            font-weight: 600;
            display: inline;
            transition: opacity 0.2s;
        }
        
        .message.other .at-mention:hover {
            opacity: 0.85;
        }
        
        .message.self .at-mention {
            color: var(--bubble-self-text);
        }
        
        .message.self .at-mention:hover {
            opacity: 0.85;
        }
        
        /* 表情 */
        .face-emoji {
            display: inline;
            font-size: 20px;
            margin: 0 2px;
            vertical-align: baseline;
        }
        
        /* 引用消息 */
        .reply-content {
            background: transparent;
            border: 0;
            padding: 0;
            margin-bottom: 8px;
            font-size: 13px;
            line-height: 1.5;
            color: var(--text-secondary);
        }
        
        .reply-content[data-reply-to] {
            cursor: pointer;
        }

        .reply-content[data-reply-to]:focus-visible {
            outline: 2px solid var(--reply-border);
            outline-offset: 2px;
        }
        
        .reply-content-header {
            display: flex;
            align-items: center;
            gap: 5px;
            margin-bottom: 4px;
        }

        .reply-content-icon {
            width: 15px;
            height: 15px;
            flex: 0 0 auto;
            stroke-width: 1.8;
        }
        
        .reply-content strong {
            font-weight: 600;
            color: var(--text-secondary);
        }
        
        .reply-content-time {
            display: inline-block;
            width: 90px;
            opacity: 0;
            font-size: 11px;
            color: var(--text-tertiary);
            white-space: nowrap;
            transition: opacity 0.18s ease;
        }

        .reply-content:hover .reply-content-time,
        .reply-content:focus-visible .reply-content-time {
            opacity: 1;
        }
        
        .reply-content-text {
            color: var(--text-secondary);
            margin-top: 4px;
            word-break: break-word;
        }
        
        .reply-content-image {
            margin-top: 6px;
            max-width: 80px;
            max-height: 80px;
            border-radius: 6px;
            object-fit: cover;
        }

        /* issue #128: 引用框里跟文字混排的缩略图 / 表情 */
        .reply-content-thumb {
            display: inline-block;
            vertical-align: middle;
            max-width: 64px;
            max-height: 64px;
            border-radius: 4px;
            object-fit: cover;
            margin: 0 4px;
        }
        .reply-content-emoji {
            display: inline-block;
            vertical-align: middle;
            width: 20px;
            height: 20px;
            margin: 0 2px;
        }
        
        .message.self .reply-content strong {
            color: var(--bubble-self-text);
        }

        .reply-back-button {
            position: fixed;
            left: 50%;
            bottom: 24px;
            z-index: 1000;
            display: inline-flex;
            align-items: center;
            gap: 5px;
            padding: 4px;
            border: 0;
            background: transparent;
            box-shadow: none;
            color: var(--text-secondary);
            font: inherit;
            font-size: 13px;
            cursor: pointer;
            transform: translateX(-50%);
        }

        .reply-back-button:hover {
            color: var(--text-primary);
        }

        .reply-back-button svg {
            width: 14px;
            height: 14px;
            fill: none;
            stroke: currentColor;
            stroke-width: 2;
            stroke-linecap: round;
            stroke-linejoin: round;
        }
        
        /* 音频包装器 */
        .audio-wrapper {
            display: flex;
            align-items: center;
            gap: 8px;
            flex-wrap: wrap;
        }
        
        .audio-download-link {
            display: inline-flex;
            align-items: center;
            padding: 4px 10px;
            background: rgba(0, 0, 0, 0.05);
            border-radius: 8px;
            color: var(--text-secondary);
            text-decoration: none;
            font-size: 13px;
            transition: all 0.2s;
        }
        
        .audio-download-link:hover {
            background: rgba(0, 0, 0, 0.1);
            color: var(--text-primary);
        }
        
        [data-theme="dark"] .audio-download-link {
            background: rgba(255, 255, 255, 0.08);
        }
        
        [data-theme="dark"] .audio-download-link:hover {
            background: rgba(255, 255, 255, 0.15);
        }
        
        /* JSON 卡片 */
        .json-card {
            padding: 2px 0;
            margin: 0;
            min-width: 0;
        }
        
        .json-title {
            font-weight: 600;
            font-size: 15px;
            margin-bottom: 4px;
            line-height: 1.3;
        }
        
        .json-description {
            font-size: 14px;
            opacity: 0.75;
            margin-bottom: 6px;
            line-height: 1.4;
        }
        
        .json-url {
            font-size: 12px;
            opacity: 0.6;
            text-decoration: none;
            overflow-wrap: anywhere;
            transition: opacity 0.2s;
        }

        .json-url:hover {
            opacity: 0.9;
            text-decoration: underline;
        }

        .native-card {
            min-width: min(280px, 70vw);
            max-width: min(420px, 78vw);
            padding: 12px 14px;
            border: 1px solid rgba(0, 0, 0, 0.08);
            border-radius: 12px;
            background: rgba(255, 255, 255, 0.45);
        }

        [data-theme="dark"] .native-card {
            border-color: rgba(255, 255, 255, 0.12);
            background: rgba(255, 255, 255, 0.06);
        }

        .native-card-wallet {
            border-color: rgba(224, 92, 68, 0.25);
            background: rgba(224, 92, 68, 0.08);
        }

        .native-card-gift {
            border-color: rgba(193, 91, 161, 0.25);
            background: rgba(193, 91, 161, 0.08);
        }

        .native-card-label {
            color: var(--text-tertiary);
            font-size: 11px;
            line-height: 1.3;
        }

        .native-card-summary {
            margin-top: 4px;
            color: var(--text-primary);
            font-size: 14px;
            font-weight: 600;
            line-height: 1.4;
            overflow-wrap: anywhere;
        }

        .native-card-detail {
            margin-top: 6px;
            color: var(--text-secondary);
            font-size: 13px;
            line-height: 1.5;
            white-space: pre-wrap;
            overflow-wrap: anywhere;
        }

        .native-card-detail-markdown {
            font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
            font-size: 12px;
        }

        .native-card-actions {
            display: flex;
            flex-wrap: wrap;
            gap: 6px;
            margin-top: 9px;
        }

        .native-card-action {
            padding: 4px 9px;
            border-radius: 999px;
            background: rgba(49, 124, 255, 0.1);
            color: #317cff;
            font-size: 12px;
            line-height: 1.4;
        }
        
        /* 市场表情 */
        .market-face {
            display: inline-block;
            width: 80px;
            height: 80px;
            background-size: contain;
            background-repeat: no-repeat;
            background-position: center;
            vertical-align: middle;
            margin: 4px 0;
        }
        
        /* QQ表情 */
        .face-emoji {
            display: inline-block;
            padding: 2px 8px;
            background: rgba(0, 0, 0, 0.05);
            border-radius: 6px;
            font-size: 13px;
            color: var(--text-secondary);
            margin: 0 2px;
        }
        
        [data-theme="dark"] .face-emoji {
            background: rgba(255, 255, 255, 0.1);
        }

        .face-emoji-image {
            width: 24px;
            height: 24px;
            padding: 0;
            background: transparent;
            border-radius: 0;
            object-fit: contain;
            vertical-align: middle;
        }

        .native-face-wrap {
            display: inline-flex;
            align-items: flex-end;
            gap: 5px;
            vertical-align: middle;
        }

        .native-face-wrap.native-face-large {
            display: inline-flex;
        }

        .native-face-large .face-emoji-image {
            width: 96px;
            height: 96px;
            object-fit: contain;
        }

        .native-face-result {
            margin-bottom: 5px;
            color: var(--text-secondary);
            font-size: 12px;
            white-space: nowrap;
        }

        .native-game-face.face-emoji {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 96px;
            height: 96px;
            margin: 0;
            padding: 0;
            border-radius: 0;
            background: transparent;
            vertical-align: middle;
        }

        .native-die {
            position: relative;
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            grid-template-rows: repeat(3, 1fr);
            width: 76px;
            height: 76px;
            padding: 10px;
            border: 1px solid rgba(17, 24, 39, 0.14);
            border-radius: 18px;
            background: linear-gradient(145deg, #fff, #edf0f3);
            box-shadow: 0 6px 14px rgba(17, 24, 39, 0.14);
        }

        .native-die-pip {
            align-self: center;
            justify-self: center;
            width: 13px;
            height: 13px;
            border-radius: 50%;
            background: #e5484d;
            box-shadow: inset 0 -1px 2px rgba(92, 15, 18, 0.3);
        }

        .native-die-pip-1 { grid-area: 1 / 1; }
        .native-die-pip-3 { grid-area: 1 / 3; }
        .native-die-pip-4 { grid-area: 2 / 1; }
        .native-die-pip-5 { grid-area: 2 / 2; }
        .native-die-pip-6 { grid-area: 2 / 3; }
        .native-die-pip-7 { grid-area: 3 / 1; }
        .native-die-pip-9 { grid-area: 3 / 3; }

        .native-rps-result {
            position: relative;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 94px;
            height: 94px;
            overflow: hidden;
            color: var(--text-secondary);
            font-size: 13px;
        }

        .native-rps-result img {
            position: absolute;
            width: 200px;
            height: 200px;
            max-width: none;
        }

        .native-rps-result-1 img {
            left: -53px;
            top: 0;
        }

        .native-rps-result-2 img {
            left: 0;
            top: -100px;
        }

        .native-rps-result-3 img {
            left: -103px;
            top: -99px;
        }

        [data-theme="dark"] .face-emoji-image {
            background: transparent;
        }
        
        /* 视频播放器 */
        .message-video {
            max-width: 100%;
            width: 400px;
            max-height: 300px;
            border-radius: 12px;
            margin: 8px 0;
            display: block;
            background: #000;
        }
        
        /* 音频播放器 */
        .message-audio {
            width: 280px;
            max-width: 100%;
            margin: 8px 0;
            display: block;
        }
        
        /* 合并转发消息卡片 */
        .forward-card {
            min-width: min(280px, 70vw);
            max-width: 100%;
            padding: 2px 0;
            margin: 2px 0;
            color: var(--text-primary);
        }
        
        .message.self .forward-card {
            color: var(--bubble-self-text);
        }
        
        .forward-card-header {
            display: flex;
            align-items: center;
            margin-bottom: 9px;
            font-size: 13px;
            font-weight: 600;
            color: inherit;
        }
        
        .forward-card-content {
            font-size: 13px;
            line-height: 1.55;
        }

        .forward-card-line + .forward-card-line {
            margin-top: 5px;
        }

        .forward-card-sender {
            font-weight: 600;
            color: inherit;
            opacity: 0.9;
        }

        .forward-card-body {
            color: inherit;
            opacity: 0.7;
        }

        .forward-card-extra {
            display: none;
        }

        .forward-card.is-expanded > .forward-card-content > .forward-card-extra {
            display: block;
        }

        /* issue #434：嵌套的合并转发消息卡片，缩进 + 左侧分隔线，区分层级。 */
        .forward-card-nested {
            min-width: 0;
            margin: 7px 0 0 8px;
            padding-left: 10px;
            border-left: 1px solid color-mix(in srgb, currentColor 20%, transparent);
        }

        .forward-card-footer {
            display: flex;
            align-items: center;
            justify-content: flex-end;
            margin-top: 10px;
            font-size: 11px;
            color: inherit;
            opacity: 0.68;
        }

        .forward-card-toggle {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            padding: 0;
            border: 0;
            background: transparent;
            color: inherit;
            font: inherit;
            font-weight: 600;
            cursor: pointer;
        }

        .forward-card-toggle-icon {
            width: 14px;
            height: 14px;
            fill: none;
            stroke: currentColor;
            stroke-linecap: round;
            stroke-linejoin: round;
            stroke-width: 2;
            transition: transform 160ms ease;
        }

        .forward-card-toggle[aria-expanded="true"] .forward-card-toggle-icon {
            transform: rotate(180deg);
        }

        .forward-card-toggle:hover {
            opacity: 0.78;
        }

        /* 图片模态框 */
        .image-modal {
            display: none;
            position: fixed;
            z-index: 1000;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.95);
            cursor: pointer;
        }
        
        .image-modal img {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            max-width: 90vw;
            max-height: 90vh;
            object-fit: contain;
            border-radius: 8px;
        }
        
        /* 滚动条 */
        ::-webkit-scrollbar {
            width: 8px;
        }
        
        ::-webkit-scrollbar-track {
            background: transparent;
        }
        
        ::-webkit-scrollbar-thumb {
            background: #d1d1d6;
            border-radius: 4px;
        }
        
        ::-webkit-scrollbar-thumb:hover {
            background: #c7c7cc;
        }
        
        /* 响应式 */
        @media (max-width: 768px) {
            .hero {
                padding: 48px 24px 32px;
            }
            
            .hero-title {
                font-size: 40px;
            }
            
            .hero-subtitle {
                font-size: 15px;
            }
            
            .hero-meta {
                gap: 24px;
            }
            
            .chat-content {
                padding: 48px 24px 80px;
            }
            
            .message-wrapper {
                max-width: 80%;
            }
        }
        
        /* Footer */
        .footer {
            margin-top: 100px;
            padding: 80px 0;
            background: var(--footer-gradient);
        }
        
        .footer-content {
            max-width: 800px;
            margin: 0 auto;
            text-align: center;
        }
        
        .footer-brand h3 {
            font-size: 24px;
            font-weight: 700;
            letter-spacing: -0.5px;
            color: var(--text-primary);
            margin-bottom: 8px;
        }
        
        .footer-version {
            font-size: 13px;
            color: var(--text-secondary);
            font-weight: 500;
            margin-bottom: 32px;
        }
        
        .footer-info {
            display: flex;
            flex-direction: column;
            gap: 12px;
        }
        
        .footer-copyright {
            font-size: 15px;
            color: var(--text-primary);
            font-weight: 400;
        }
        
        .footer-copyright strong {
            font-weight: 600;
            color: var(--text-primary);
        }
        
        .footer-links {
            font-size: 14px;
            color: var(--text-secondary);
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
        }
        
        .footer-links a,
        .footer-links > span:not(.separator) {
            color: var(--text-primary);
            text-decoration: none;
            font-weight: 500;
        }
        
        .footer-links a {
            transition: opacity 0.2s;
        }
        
        .footer-links a:hover {
            opacity: 0.7;
        }
        
        .footer-links .separator {
            color: var(--text-secondary);
            font-weight: 300;
        }
        
        .footer-notice {
            font-size: 13px;
            color: var(--text-secondary);
            margin-top: 8px;
            font-weight: 400;
        }
        
        /* 隐藏消息 (搜索/筛选) */
        .message.hidden {
            display: none !important;
        }
        @media (max-width: 1100px) {
            .chat-layout {
                padding: 0 24px 80px;
            }
            .chat-content {
                padding: 32px 0 80px;
            }
            .message-wrapper {
                max-width: 80%;
            }
        }

        /* ============ 富媒体气泡（对齐 HyperScroll demo） ============ */
        /* 图片 */
        .image-content {
            padding: 4px;
            border: 1px solid var(--border-color);
            border-radius: 16px;
            overflow: hidden;
            max-width: 320px;
            background: transparent;
            margin: 0;
        }
        .image-content img {
            border-radius: 12px;
            width: 100%;
            height: auto;
            display: block;
            cursor: zoom-in;
        }

        /* 语音气泡 */
        .voice-bubble {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            cursor: pointer;
            min-width: 130px;
            padding: 9px 14px;
            border-radius: 16px;
            background: var(--bubble-other);
            color: var(--text-primary);
            border: none;
            font: inherit;
        }
        .message.self .voice-bubble { background: var(--bubble-self); color: var(--bubble-self-text); }
        .vplay {
            flex: none; width: 0; height: 0; margin-left: 2px;
            border-left: 8px solid currentColor;
            border-top: 5px solid transparent; border-bottom: 5px solid transparent;
            opacity: .75;
        }
        .voice-bubble.playing .vplay {
            width: 8px; height: 10px; border: none;
            border-left: 3px solid currentColor; border-right: 3px solid currentColor;
        }
        .vbars { display: inline-flex; align-items: center; gap: 2px; height: 16px; flex: 1; }
        .vbars i { display: inline-block; width: 2px; border-radius: 1px; background: currentColor; opacity: .55; }
        .voice-bubble.playing .vbars i { animation: vpulse 1s ease-in-out infinite; }
        .voice-bubble.playing .vbars i:nth-child(odd) { animation-delay: .18s; }
        .voice-bubble.playing .vbars i:nth-child(3n) { animation-delay: .36s; }
        @keyframes vpulse { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(1.6); } }
        .vsec { font-size: 12px; font-variant-numeric: tabular-nums; opacity: .75; }
        .vdl {
            display: inline-flex; align-items: center; justify-content: center;
            width: 20px; height: 20px; margin-left: 2px; border-radius: 6px;
            opacity: .45; transition: opacity .15s ease, background .15s ease;
        }
        .vdl svg { width: 13px; height: 13px; }
        .vdl:hover { opacity: 1; background: color-mix(in srgb, currentColor 12%, transparent); }

        /* 视频气泡 */
        .video-bubble {
            position: relative; padding: 4px;
            background: transparent; border: 1px solid var(--border-color);
            border-radius: 16px; display: flex; flex-direction: column; gap: 4px;
            max-width: 320px; cursor: zoom-in;
        }
        .video-bubble video.img {
            border-radius: 12px; width: 100%; height: auto; display: block;
            filter: brightness(.85); pointer-events: none;
        }
        .vbadge {
            position: absolute; top: 12px; left: 12px; display: inline-flex; align-items: center; gap: 5px;
            background: rgba(0,0,0,.6); color: #fff; font-size: 11px;
            padding: 2px 8px; border-radius: 999px;
        }
        .vtri {
            width: 0; height: 0; border-left: 6px solid #fff;
            border-top: 4px solid transparent; border-bottom: 4px solid transparent;
        }
        .vname { font-size: 11px; color: var(--text-secondary); padding: 0 6px 2px; word-break: break-all; }

        /* 文件气泡 */
        .message-file.file-bubble {
            display: inline-flex; align-items: center; gap: 10px;
            padding: 9px 14px; border-radius: 16px; text-decoration: none;
            background: transparent; border: 1px solid var(--border-color);
            color: var(--text-primary); max-width: 300px;
        }
        .message.self .message-file.file-bubble { background: var(--bubble-self); color: var(--bubble-self-text); border-color: transparent; }
        .ficon {
            flex: none; display: inline-flex; align-items: center; justify-content: center;
            width: 34px; height: 34px; border-radius: 8px;
            background: var(--bubble-other); color: var(--text-secondary);
        }
        .ficon svg { width: 16px; height: 16px; }
        .message.self .ficon { background: color-mix(in srgb, var(--bubble-self-text) 16%, transparent); color: var(--bubble-self-text); }
        .fmeta { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
        .fname { font-size: 13px; font-weight: 500; word-break: break-all; }
        .fsize { font-size: 11px; opacity: .65; }

        /* 表情包 / 商城表情 */
        .sticker-wrap { width: fit-content; padding: 2px 0; display: block; }
        img.sticker { display: block; }
        img.sticker-img { width: 130px; height: 130px; object-fit: contain; border-radius: 10px; }

        /* 媒体加载失败占位 */
        .media-fallback {
            display: inline-flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 8px;
            max-width: 100%;
            min-width: 64px;
            min-height: 64px;
            border: 1px solid var(--border-color);
            border-radius: 12px;
            background: color-mix(in srgb, var(--bg-secondary) 55%, transparent);
            color: var(--text-secondary);
            cursor: default;
            box-sizing: border-box;
        }
        .mf-icon {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 32px;
            height: 32px;
            flex: none;
            border: 1px solid var(--border-color);
            border-radius: 8px;
            background: var(--bg-primary);
            box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
            color: var(--text-secondary);
        }
        .mf-icon svg { width: 15px; height: 15px; }
        .mf-text {
            padding: 0 8px;
            color: var(--text-secondary);
            font-size: 11px;
            font-weight: 500;
            letter-spacing: .01em;
            text-align: center;
        }
        .mf-image, .mf-video { width: min(240px, 100%); height: 158px; }
        .mf-audio { width: min(180px, 100%); height: 70px; }
        .mf-sticker { width: 130px; height: 130px; border-radius: 10px; }
        .mf-compact {
            display: inline-flex;
            min-width: 0;
            min-height: 0;
            margin-left: 6px;
            border-radius: 6px;
            vertical-align: middle;
        }
        .mf-compact .mf-icon { width: 26px; height: 26px; }
        .video-bubble.media-broken .vbadge { display: none; }
        .avatar-fallback {
            display: inline-flex;
            width: 100%;
            height: 100%;
            align-items: center;
            justify-content: center;
            color: #fff;
            font-size: 12px;
            font-weight: 600;
            user-select: none;
        }
