
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            -webkit-tap-highlight-color: transparent;
        }

        html, body {
            width: 100%;
            height: 100%;
            font-family: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", sans-serif;
            background-color: #0b0b0b;
            color: #e0e0e0;
            overflow: hidden;
            margin: 0;
            padding: 0;
            /* 微信内置浏览器：禁止自动字体缩放（由我们用 clamp 做自适应） */
            -webkit-text-size-adjust: 100%;
            text-size-adjust: 100%;
        }

        :root {
            /* 手机端友好：基础字号随屏幕变化（微信里看起来更“稳”） */
            --fs-base: clamp(14px, 3.8vw, 16px);
            --fs-small: clamp(12px, 3.4vw, 14px);
            --fs-title: clamp(16px, 4.6vw, 20px);
        }

        body {
            font-size: var(--fs-base);
        }

        .container {
            max-width: 100%;
            margin: 0 auto;
            display: flex;
            flex-direction: column;
            height: 100%;
            position: relative;
            background-color: #0b0b0b;
        }

        /* 弹幕容器/历史布局与样式已统一迁移到公共层：
         * - /css/danmu-page-common.css（页面壳与布局）
         * - /css/danmu-history-common.css（历史 item：角标/时间/昵称/内容）
         * 主站不再保留旧模板的重复定义，避免与桌台分叉。
         */

        /* 弹幕相关样式已移至 /css/danmu-common.css */

        /* 输入区（input-section/input-group/content-input）已统一迁移到公共层：
         * - /css/danmu-page-common.css（页面壳与布局）
         * - /css/danmu-ui-unified.css（输入区间距/输入框外观）
         * - /css/input-button-common.css（按钮尺寸/触控）
         * - /css/mobile-ui-overrides.css（移动端 fixed + 安全区）
         */

        /* 发送按钮样式已移至 /css/input-button-common.css */

        .auth-dialog {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100vh;
            height: 100dvh; /* iOS/微信：随可视区域变化更稳定 */
            background: rgba(0, 0, 0, 0.8);
            display: none;
            justify-content: center;
            align-items: center;
            z-index: 10004; /* 高于输入框/提示条等，避免被挡住 */
            /* 微信内置浏览器：允许弹窗自身滚动，避免内容被底部固定栏/键盘遮挡 */
            overflow-y: auto;
            -webkit-overflow-scrolling: touch;
            box-sizing: border-box;
            padding: 16px;
            padding-top: calc(16px + env(safe-area-inset-top));
            padding-bottom: calc(16px + env(safe-area-inset-bottom));
        }

        /* CSP 收紧准备：用 class 控制显示，避免依赖 style.display */
        .auth-dialog.is-open {
            display: flex;
        }

        .auth-form {
            background: rgba(30, 30, 30, 0.95);
            padding: 24px;
            border-radius: 8px;
            width: 90%;
            max-width: 320px;
            backdrop-filter: blur(10px);
            /* 当键盘弹起/可视高度变小时，内部可滚动 */
            max-height: calc(100dvh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
            overflow-y: auto;
        }

        .auth-form h3 {
            text-align: center;
            margin-bottom: 20px;
            color: #ff6699;
        }

        /* 登录方式 Tab（仅登录时显示） */
        .auth-login-tabs {
            display: flex;
            gap: 8px;
            margin: -6px 0 14px;
            padding: 6px;
            background: rgba(255, 255, 255, 0.06);
            border: 1px solid rgba(255, 255, 255, 0.12);
            border-radius: 999px;
        }

        /* 注册模式：tabs 会被设置 hidden，确保一定隐藏（防止 display:flex 覆盖） */
        .auth-login-tabs[hidden] {
            display: none !important;
        }

        .auth-login-tab {
            flex: 1;
            border: none;
            border-radius: 999px;
            padding: 8px 10px;
            font-size: 13px;
            font-weight: 700;
            cursor: pointer;
            background: transparent;
            color: rgba(255, 255, 255, 0.75);
            transition: all 0.2s ease;
            min-height: 36px;
        }

        .auth-login-tab.active {
            background: linear-gradient(45deg, #ff6699, #ee3377);
            color: #fff;
            box-shadow: 0 6px 16px rgba(255, 102, 153, 0.22);
        }

        .auth-login-tab:active {
            transform: scale(0.98);
        }

        .form-group {
            margin-bottom: 16px;
        }
        
        /* 关键：确保 hidden 的表单组在任何情况下都不显示（微信内置浏览器偶发样式覆盖问题兜底） */
        .auth-form .form-group[hidden] {
            display: none !important;
        }

        .form-group label {
            display: block;
            margin-bottom: 6px;
            color: #e0e0e0;
            font-size: var(--fs-small);
        }

        .form-group input {
            width: 100%;
            padding: 10px;
            border: 1px solid rgba(255, 255, 255, 0.2);
            border-radius: 4px;
            background: rgba(255, 255, 255, 0.1);
            color: #e0e0e0;
            font-size: var(--fs-base);
        }

        .form-group input:focus {
            outline: none;
            border-color: #ff6699;
        }

        .auth-buttons {
            display: flex;
            gap: 8px;
            margin-top: 20px;
        }

        .auth-buttons .btn {
            flex: 1;
            padding: 10px 22px;
            border: none;
            border-radius: 25px;
            font-size: var(--fs-base);
            font-weight: bold;
            cursor: pointer;
            transition: all 0.3s ease;
            white-space: nowrap;
            box-shadow: 0 4px 10px rgba(255, 102, 153, 0.3);
        }

        /* iOS/微信：输入框字号 <16px 会自动放大页面，这里强制移动端 >=16px */
        @media (max-width: 768px) {
            .form-group input {
                font-size: 16px !important;
            }

            .auth-form {
                width: min(92vw, 360px);
                padding: 20px;
            }

            .auth-form h3 {
                font-size: var(--fs-title);
                margin-bottom: 16px;
            }
        }

        .auth-buttons .btn:active {
            transform: scale(0.96);
        }

        .auth-buttons .btn:disabled {
            background: #444;
            cursor: not-allowed;
            box-shadow: none;
        }

        .auth-switch {
            text-align: center;
            margin-top: 16px;
            font-size: 12px;
            color: #aaaaaa;
        }

        .auth-switch a {
            color: #ff6699;
            text-decoration: none;
            cursor: pointer;
        }

        .auth-switch a:hover {
            text-decoration: underline;
        }

        /* 私信长文本编辑器样式已统一迁移到 /css/pm-longtext-common.css */

        /* Toast 样式已移至 /css/toast-common.css */

        @media (min-width: 1920px) {
            .danmu { 
                font-size: 32px;
                /* 根据字体大小调整内边距和圆角 */
                padding: 6px 16px !important;
                border-radius: 32px !important;
                text-shadow: 0 0 3px rgba(255, 255, 255, 0.5);
                box-shadow: 0 0 6px rgba(0, 0, 0, 0.3);
            }
            .danmu-text-rainbow, .danmu-text-random { font-size: 32px; }
        }
        @media (min-width: 3840px) {
            .danmu { 
                font-size: 40px;
                /* 根据字体大小调整内边距和圆角 */
                padding: 8px 20px !important;
                border-radius: 40px !important;
                text-shadow: 0 0 4px rgba(255, 255, 255, 0.5);
                box-shadow: 0 0 8px rgba(0, 0, 0, 0.3);
            }
            .danmu-text-rainbow, .danmu-text-random { font-size: 40px; }
        }
        @media (max-width: 768px) {
            .admin-content {
                padding: 12px;
            }

            .admin-section {
                margin-bottom: 16px;
                background: rgba(255, 255, 255, 0.05);
                border-radius: 12px;
                padding: 12px;
            }

            .section-header {
                margin-bottom: 12px;
                padding-bottom: 8px;
            }

            .section-header h2 {
                font-size: 16px;
                margin-bottom: 8px;
            }

            .form-grid {
                display: block;
                gap: 0;
            }

            .form-group {
                margin-bottom: var(--spacing-lg);
                display: flex;
                flex-direction: column;
                align-items: flex-start;
            }

            .form-group label {
                width: 100%;
                margin-bottom: var(--spacing-xs);
                color: var(--text-secondary);
                font-size: 14px;
                font-weight: 500;
                text-align: left;
            }

            .form-control,
            .search-input-wrapper input,
            #banword-input,
            #old-password,
            #new-password,
            #confirm-password,
            #import-words {
                width: 100%;
                padding: 10px 12px;
                font-size: 15px;
                background: rgba(255, 255, 255, 0.1);
                border: 1px solid rgba(255, 255, 255, 0.2);
                border-radius: 8px;
                color: #fff;
                transition: all 0.3s ease;
                box-sizing: border-box;
            }

            .form-control:focus,
            .search-input-wrapper input:focus,
            #banword-input:focus,
            #old-password:focus,
            #new-password:focus,
            #confirm-password:focus,
            #import-words:focus {
                border-color: #ff6699;
                box-shadow: 0 0 0 2px rgba(255, 102, 153, 0.2);
                outline: none;
            }

            .form-control::placeholder,
            .search-input-wrapper input::placeholder,
            #banword-input::placeholder,
            #import-words::placeholder {
                color: rgba(255, 255, 255, 0.4);
            }

            /* 表单网格布局优化 */
            .form-grid {
                display: grid;
                grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
                gap: 20px;
            }

            /* 移动端表单布局调整 */
            @media (max-width: 768px) {
                .form-grid {
                    grid-template-columns: 1fr;
                    gap: 16px;
                }
                
                .form-group {
                    margin-bottom: 12px;
                }
                
                .form-group label {
                    margin-bottom: 4px;
                    font-size: 14px;
                }
                
                .form-control,
                .search-input-wrapper input,
                #banword-input,
                #old-password,
                #new-password,
                #confirm-password,
                #import-words {
                    padding: 8px 10px;
                    font-size: 15px;
                }
            }

            /* 数字输入框优化 */
            input[type="number"].form-control {
                -moz-appearance: textfield;
                appearance: textfield;
            }

            input[type="number"].form-control::-webkit-outer-spin-button,
            input[type="number"].form-control::-webkit-inner-spin-button {
                -webkit-appearance: none;
                margin: 0;
            }

            /* 开关控件样式 */
            .toggle-control {
                display: flex;
                align-items: center;
                gap: 8px;
                margin-right: 12px;
            }

            .toggle-control label {
                position: relative;
                display: inline-block;
                width: 44px;
                height: 24px;
                cursor: pointer;
            }

            .toggle-control input[type="checkbox"] {
                opacity: 0;
                width: 0;
                height: 0;
            }

            .toggle-slider {
                position: absolute;
                cursor: pointer;
                top: 0;
                left: 0;
                right: 0;
                bottom: 0;
                background-color: rgba(255, 255, 255, 0.2);
                transition: 0.3s;
                border-radius: 24px;
            }

            .toggle-slider:before {
                position: absolute;
                content: "";
                height: 18px;
                width: 18px;
                left: 3px;
                bottom: 3px;
                background-color: white;
                transition: 0.3s;
                border-radius: 50%;
            }

            .toggle-control input:checked + .toggle-slider {
                background: linear-gradient(45deg, #ff6699, #ff88aa);
            }

            .toggle-control input:checked + .toggle-slider:before {
                transform: translateX(20px);
            }

            .toggle-label {
                font-size: 14px;
                color: var(--text-secondary);
                font-weight: 500;
            }

            .section-actions {
                display: flex;
                align-items: center;
                gap: 8px;
            }

            .form-actions {
                margin-top: 16px;
                display: flex;
                justify-content: flex-end;
            }

            .btn-primary {
                padding: 8px 16px;
                font-size: 15px;
                border-radius: 8px;
                background: linear-gradient(45deg, #ff6699, #ff88aa);
                border: none;
                color: #fff;
                font-weight: 500;
                cursor: pointer;
                transition: all 0.3s ease;
                min-width: 80px;
                text-align: center;
            }

            .btn-primary:active {
                transform: scale(0.98);
                background: linear-gradient(45deg, #ff5588, #ff7799);
            }

            /* 保存成功提示优化 */
            .save-success {
                position: fixed;
                bottom: 20px;
                left: 50%;
                transform: translateX(-50%);
                background: rgba(0, 0, 0, 0.8);
                color: #fff;
                padding: 12px 24px;
                border-radius: 8px;
                font-size: 14px;
                z-index: 1000;
                opacity: 0;
                transition: opacity 0.3s ease;
                backdrop-filter: blur(8px);
                -webkit-backdrop-filter: blur(8px);
                box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
            }

            .save-success.show {
                opacity: 1;
            }

            /* 弹幕配置样式 */
            .form-section {
                margin-top: 24px;
                padding-top: 20px;
                border-top: 1px solid rgba(255, 255, 255, 0.1);
            }

            .form-section h3 {
                font-size: 16px;
                color: #ff6699;
                margin-bottom: 16px;
                font-weight: 600;
            }

            .form-help {
                display: block;
                margin-top: 4px;
                font-size: 12px;
                color: rgba(255, 255, 255, 0.6);
                line-height: 1.4;
            }

            textarea.form-control {
                resize: vertical;
                min-height: 80px;
                font-family: inherit;
            }

            /* 弹幕历史移动端优化已移至公共层：
               - /css/danmu-page-common.css（布局）
               - /css/danmu-history-common.css（item）
               - /css/mobile-ui-overrides.css（移动端覆盖：避免固定高度压扁） */
        }

        @media (max-width: 480px) {
            #danmu-container .danmu { 
                font-size: 15px;
                padding: 3px 10px !important;
                border-radius: 15px !important;
            }
            /* 弹幕历史小屏优化已移至公共层（同上），这里不再重复定义 */
            /* 移动端公开私信提示条优化已移至 /css/public-mention-common.css */
        }

        /* 旧“登录提示遮罩”结构已从主站移除：统一直接展示 auth-dialog */

        /* 统一所有主按钮为 send-btn 样式和颜色 */
        .btn, .auth-buttons .btn, .btn-primary, .btn-logout, .btn-cancel {
            padding: 10px 22px;
            border: none;
            border-radius: 25px;
            font-size: 15px;
            font-weight: bold;
            cursor: pointer;
            transition: all 0.3s ease;
            white-space: nowrap;
            background: linear-gradient(45deg, #ff6699, #ee3377);
            color: #fff;
            box-shadow: 0 4px 10px rgba(255, 102, 153, 0.3);
        }
        .btn:active, .auth-buttons .btn:active, .btn-primary:active, .btn-logout:active, .btn-cancel:active {
            transform: scale(0.96);
            background: linear-gradient(45deg, #ee3377, #dd2266);
            box-shadow: 0 2px 6px rgba(255, 102, 153, 0.4);
        }
        .btn:disabled, .auth-buttons .btn:disabled, .btn-primary:disabled, .btn-logout:disabled, .btn-cancel:disabled {
            background: #444;
            cursor: not-allowed;
            box-shadow: none;
        }

        /* 移动端按钮优化 */
        @media (max-width: 600px) {
            .btn, .auth-buttons .btn {
                font-size: 15px;
                padding: 10px 0;
            }
            .danmu { 
                font-size: 15px;
                padding: 3px 10px !important;
                border-radius: 15px !important;
            }
            .danmu-text-rainbow, .danmu-text-random { font-size: 15px; }
            /* 发送按钮字体大小和 padding 已移至 /css/input-button-common.css */
            .toast {
                font-size: 14px;
                padding: 10px 16px;
                top: 8%;
            }
            .btn, .auth-buttons .btn, .btn-primary, .btn-logout, .btn-cancel {
                font-size: 14px;
                padding: 9px 18px;
                border-radius: 25px;
            }
            /* .send-btn 样式已移至 /css/input-button-common.css */
        }

        /* =========================
         * 微信内置浏览器/手机端：更“微信原生”的登录/注册弹窗
         * 仅影响 auth-dialog 内部，不影响主页面按钮风格
         * ========================= */
        @media (max-width: 768px) {
            .auth-dialog {
                /* 更像微信：底部弹出 */
                align-items: flex-end;
                padding: 0;
            }

            .auth-form {
                width: 100%;
                max-width: 100%;
                border-radius: 18px 18px 0 0;
                padding: 18px 16px calc(16px + env(safe-area-inset-bottom));
                background: #fff;
                color: #111;
                backdrop-filter: none;
                box-shadow: 0 -12px 28px rgba(0, 0, 0, 0.25);
            }

            .auth-form h3 {
                color: #111;
                font-size: 17px;
                font-weight: 700;
                margin-bottom: 14px;
            }

            /* 登录方式 Tab：微信风格分段控件 */
            .auth-login-tabs {
                background: #f7f7f7;
                border: 1px solid #e5e5e5;
            }

            .auth-login-tab {
                color: #666;
                box-shadow: none;
            }

            .auth-login-tab.active {
                background: #07C160;
                box-shadow: none;
            }

            /* 表单：微信下划线输入风格 */
            .auth-form .form-group label {
                color: #666;
                font-size: 13px;
                margin-bottom: 6px;
            }

            .auth-form .form-group input {
                background: transparent;
                border: none;
                border-bottom: 1px solid #e5e5e5;
                border-radius: 0;
                padding: 12px 2px;
                color: #111;
                box-shadow: none;
            }

            .auth-form .form-group input:focus {
                border-bottom-color: #07C160;
                box-shadow: none;
            }

            /* 按钮：微信大按钮纵向排列 */
            .auth-form .auth-buttons {
                flex-direction: column;
                gap: 10px;
                margin-top: 16px;
            }

            .auth-form .auth-buttons .btn {
                width: 100%;
                border-radius: 12px;
                padding: 12px 14px;
                font-size: 16px;
                box-shadow: none;
                transform: none;
            }

            .auth-form .auth-buttons .btn-primary {
                background: #07C160 !important;
                color: #fff !important;
            }

            .auth-form .auth-buttons .btn-cancel {
                background: #f7f7f7 !important;
                color: #111 !important;
                border: 1px solid #e5e5e5;
            }

            .auth-switch {
                color: #666;
                margin-top: 12px;
            }

            .auth-switch a {
                color: #576b95;
            }
        }

        @media (max-width: 375px) {
            .danmu { 
                font-size: 14px;
                padding: 2px 8px !important;
                border-radius: 14px !important;
            }
            .danmu-text-rainbow, .danmu-text-random { font-size: 14px; }
            /* 发送按钮字体大小和 padding 已移至 /css/input-button-common.css */
        }

        /* 弹幕飘动层样式与容器布局已由公共 CSS 统一管理（主站 + 桌台一致） */

        /* 私信浮窗样式已移至 /css/pm-float-common.css */
        /* @提及提示样式已移至 /css/mention-suggestions-common.css（主站/桌台共用） */

        /* 公开私信提示条样式已移至 /css/public-mention-common.css */

/* =========================
 * CSP 收紧准备：替代 index.html 的 style="..." 与部分 JS 内联 style
 * ========================= */

/* 顶部标题卡片/布局已统一迁移到 /css/danmu-page-common.css（主站 + 桌台一致） */

/* 输入区定位上下文已统一迁移到 /css/danmu-ui-unified.css（.input-group--relative） */

/* 弹幕容器补充已迁移到 /css/danmu-page-common.css（避免与桌台分叉） */

/* .pm-chat-view 样式已由 /css/pm-float-common.css 统一管理 */

/* 通用布局工具类 */
.pos-rel { position: relative; }

/* 表单提示文本（替代内联样式） */
.form-hint {
    font-size: 14px;
    margin-top: 2px;
}
.form-hint--sm {
    font-size: 12px;
    margin-top: 4px;
}

/* 表单校验态（替代 input.style.borderColor / hint.style.color） */
.hint-valid { color: #4CAF50; }
.hint-invalid { color: #f44336; }
.input-valid { border-color: #4CAF50 !important; }
.input-invalid { border-color: #f44336 !important; }

/* 列表加载占位（替代内联样式） */
.list-loading {
    text-align: center;
    color: #888;
    padding: 20px;
}

/* 列表空状态（替代内联样式） */
.list-empty {
    text-align: center;
    color: #888;
    padding: 20px;
}

/* 统一错误提示（替代 createErrorMessage 的内联 style） */
.inline-msg {
    text-align: center;
    padding: 20px;
}
.inline-msg--error { color: #f00; }
.inline-msg--warn { color: #ff7f00; }
.inline-msg--info { color: #888; }

/* 弹幕敏感词提示样式已迁移到 /css/input-button-common.css（主站/桌台共用） */
