
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
            background: #0a0a1a;
            overflow: hidden;
            width: 100vw;
            height: 100vh;
        }

        /* 标题 */
        .title {
            position: fixed;
            top: 20px;
            left: 20px;
            font-size: 1.5rem;
            font-weight: 700;
            background: linear-gradient(45deg, #00d4ff, #7b2cbf, #ff006e);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            z-index: 100;
            pointer-events: none;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .title .version {
            font-size: 0.85rem;
            font-weight: 400;
            color: #cccccc;
            align-self: flex-end;
            margin-bottom: 3px;
            margin-left: -5px;
        }

        /* 画布容器 */
        .canvas-container {
            width: 100%;
            height: 100%;
            overflow: hidden;
            cursor: grab;
        }

        .canvas-container:active {
            cursor: grabbing;
        }

        /* 主画布左右翻页按钮（2026-11-30）：悬挂在画布两侧垂直居中，半透明圆钮 */
        .canvas-page-btn {
            position: absolute;
            top: 50%;
            transform: translateY(-50%);
            width: 44px;
            height: 44px;
            border-radius: 50%;
            border: 1px solid rgba(255, 255, 255, 0.18);
            background: rgba(20, 20, 40, 0.55);
            color: rgba(255, 255, 255, 0.8);
            font-size: 28px;
            line-height: 40px;
            text-align: center;
            cursor: pointer;
            z-index: 90;
            user-select: none;
            padding: 0;
            transition: background 0.15s, color 0.15s;
        }

        .canvas-page-btn:hover {
            background: rgba(0, 212, 255, 0.25);
            color: #fff;
        }

        .canvas-page-prev { left: 12px; }
        .canvas-page-next { right: 12px; }

        /* 画布 */
        #canvas {
            background: #0a0a1a;
        }

        /* 缩放控制 */
        .zoom-controls {
            position: fixed;
            bottom: 20px;
            right: 20px;
            display: flex;
            flex-direction: column;
            gap: 8px;
            z-index: 100;
        }

        .zoom-btn {
            width: 36px;
            height: 36px;
            border-radius: 8px;
            background: rgba(255, 255, 255, 0.1);
            border: 1px solid rgba(255, 255, 255, 0.2);
            color: #fff;
            font-size: 1.2rem;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s ease;
        }

        .zoom-btn:hover {
            background: rgba(255, 255, 255, 0.2);
        }

        .zoom-level {
            width: 36px;
            height: 24px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #888;
            font-size: 0.75rem;
        }

        .help-btn {
            position: fixed;
            bottom: 186px;
            right: 20px;
            width: 36px;
            height: 36px;
            border-radius: 50%;
            background: linear-gradient(135deg, rgba(0, 212, 255, 0.3), rgba(123, 44, 191, 0.3));
            border: 1px solid rgba(255, 255, 255, 0.2);
            color: #fff;
            font-size: 1.2rem;
            font-weight: 600;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 100;
            transition: all 0.3s ease;
        }

        .help-btn:hover {
            background: linear-gradient(135deg, rgba(0, 212, 255, 0.6), rgba(123, 44, 191, 0.6));
            border-color: rgba(0, 212, 255, 0.5);
            transform: scale(1.1);
        }

        .help-popup {
            position: fixed;
            bottom: 240px;
            right: 20px;
            background: linear-gradient(135deg, rgba(30, 30, 60, 0.98), rgba(20, 20, 40, 0.98));
            border: 1px solid rgba(255, 255, 255, 0.15);
            border-radius: 16px;
            padding: 20px;
            z-index: 100;
            display: none;
            box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
            backdrop-filter: blur(10px);
        }

        .help-popup.show {
            display: block;
            animation: fadeIn 0.3s ease;
        }

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

        .help-popup-content {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 10px;
        }

        .help-qrcode {
            width: 140px;
            height: 140px;
            border-radius: 8px;
            object-fit: cover;
        }

        .help-popup-text {
            color: #e5e7eb;
            font-size: 0.85rem;
            text-align: center;
        }

        /* 上传进度面板 */
        .upload-panel {
            position: fixed;
            top: 20px;
            right: 20px;
            width: 320px;
            background: rgba(20, 20, 40, 0.95);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 12px;
            padding: 16px;
            z-index: 200;
            display: none;
            backdrop-filter: blur(10px);
        }

        .upload-panel.active {
            display: block;
        }

        /* 片场管理面板遮罩层 */
        .project-panel-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.5);
            z-index: 199;
            justify-content: flex-end;
            align-items: flex-start;
            padding: 20px;
        }

        .upload-panel-title {
            color: #fff;
            font-size: 0.9rem;
            font-weight: 600;
            margin-bottom: 12px;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .upload-panel-title::before {
            content: '';
            width: 8px;
            height: 8px;
            background: #00d4ff;
            border-radius: 50%;
            animation: pulse 1.5s infinite;
        }

        @keyframes pulse {
            0%, 100% { opacity: 1; }
            50% { opacity: 0.5; }
        }

        .upload-item {
            margin-bottom: 12px;
            padding: 10px;
            background: rgba(255, 255, 255, 0.05);
            border-radius: 8px;
        }

        .upload-item-fileName {
            color: #ccc;
            font-size: 0.8rem;
            margin-bottom: 6px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .upload-item-status {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 0.75rem;
            color: #888;
        }

        .upload-progress-bar {
            flex: 1;
            height: 4px;
            background: rgba(255, 255, 255, 0.1);
            border-radius: 2px;
            overflow: hidden;
        }

        .upload-progress-fill {
            height: 100%;
            background: linear-gradient(90deg, #00d4ff, #7b2cbf);
            border-radius: 2px;
            transition: width 0.3s ease;
        }

        .upload-progress-text {
            min-width: 36px;
            text-align: right;
        }

        .upload-item.success .upload-progress-fill {
            background: #4ade80;
        }

        .upload-item.error .upload-progress-fill {
            background: #ef4444;
        }

        .upload-item.success .upload-item-status {
            color: #4ade80;
        }

        .upload-item.error .upload-item-status {
            color: #ef4444;
        }

        /* 调试信息面板 */
        .debug-panel {
            position: fixed;
            bottom: 20px;
            left: 20px;
            right: 100px;
            max-height: 200px;
            background: rgba(10, 10, 20, 0.98);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 12px;
            padding: 16px;
            z-index: 200;
            display: none;
            backdrop-filter: blur(10px);
            font-family: 'Consolas', 'Monaco', monospace;
            font-size: 0.8rem;
        }

        .debug-panel.active {
            display: block;
        }

        .debug-panel-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 10px;
            padding-bottom: 10px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        }

        .debug-panel-title {
            color: #fff;
            font-weight: 600;
        }

        .debug-panel-clear {
            background: rgba(255, 255, 255, 0.1);
            border: none;
            color: #888;
            padding: 4px 10px;
            border-radius: 4px;
            cursor: pointer;
            font-size: 0.75rem;
        }

        .debug-panel-clear:hover {
            background: rgba(255, 255, 255, 0.2);
            color: #fff;
        }

        .debug-content {
            max-height: 140px;
            overflow-y: auto;
            color: #888;
        }

        .debug-line {
            padding: 4px 0;
            border-bottom: 1px solid rgba(255, 255, 255, 0.05);
            word-break: break-all;
        }

        .debug-line:last-child {
            border-bottom: none;
        }

        .debug-line.error {
            color: #ef4444;
        }

        .debug-line.success {
            color: #4ade80;
        }

        .debug-line.info {
            color: #60a5fa;
        }

        .debug-time {
            color: #666;
            margin-right: 8px;
        }

        /* 登录头像 */
        .user-avatar {
            position: fixed;
            top: 20px;
            right: 20px;
            width: 40px;
            height: 40px;
            border-radius: 50%;
            background: rgba(255, 255, 255, 0.1);
            border: 1px solid rgba(255, 255, 255, 0.2);
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s ease;
            z-index: 100;
        }

        .user-avatar:hover {
            background: rgba(255, 255, 255, 0.2);
            transform: scale(1.1);
        }

        .user-avatar svg {
            width: 24px;
            height: 24px;
            fill: #666;
            transition: fill 0.2s ease;
        }

        .user-avatar.logged-in {
            background: linear-gradient(135deg, #00d4ff, #7b2cbf);
            border: none;
        }

        .user-avatar.logged-in svg {
            fill: #fff;
        }

        /* 登录遮罩层 */
        .login-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.8);
            display: flex;
            justify-content: center;
            align-items: center;
            z-index: 2000;
        }

        .login-overlay.hidden {
            display: none;
        }

        .login-box {
            background: linear-gradient(135deg, #1a1a2e, #16213e);
            padding: 40px 50px;
            border-radius: 12px;
            box-shadow: 0 10px 40px rgba(0, 212, 255, 0.2);
            width: 90%;
            max-width: 360px;
            text-align: center;
            border: 1px solid rgba(255, 255, 255, 0.1);
        }

        .login-box h2 {
            margin-bottom: 30px;
            font-size: 1.6em;
            color: #00d4ff;
            border-bottom: none;
            font-weight: 600;
        }

        .login-form input {
            width: 100%;
            padding: 14px 16px;
            margin-bottom: 20px;
            border: 2px solid rgba(255, 255, 255, 0.1);
            border-radius: 8px;
            background: rgba(255, 255, 255, 0.05);
            color: #fff;
            outline: none;
            transition: border-color 0.3s;
            font-size: 1rem;
        }

        .login-form input:focus {
            border-color: #00d4ff;
        }

        .login-form input::placeholder {
            color: #666;
        }

        .login-btn {
            width: 100%;
            padding: 14px;
            background: linear-gradient(135deg, #00d4ff, #7b2cbf);
            color: #fff;
            border: none;
            border-radius: 8px;
            font-size: 1rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s;
            margin-bottom: 15px;
        }

        .login-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 15px rgba(0, 212, 255, 0.4);
        }

        .login-btn:active {
            transform: translateY(0);
        }

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

        .login-error {
            color: #ef4444;
            font-size: 14px;
            margin-bottom: 15px;
            min-height: 20px;
        }

        /* 用户菜单 */
        .user-menu {
            position: fixed;
            top: 70px;
            right: 20px;
            background: rgba(20, 20, 40, 0.98);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 12px;
            padding: 12px;
            z-index: 150;
            display: none;
            min-width: 160px;
            max-width: 200px;
            backdrop-filter: blur(10px);
        }

        .user-menu.active {
            display: block;
        }

        .user-menu-header {
            padding: 8px 12px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
            margin-bottom: 8px;
            color: #fff;
            font-weight: 600;
            font-size: 0.9rem;
        }

        .user-menu-btn {
            width: 100%;
            padding: 10px 16px;
            background: transparent;
            border: none;
            color: #ccc;
            text-align: left;
            cursor: pointer;
            border-radius: 6px;
            transition: all 0.2s;
            font-size: 0.9rem;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .user-menu-btn:hover {
            background: rgba(255, 255, 255, 0.1);
            color: #fff;
        }

        .user-menu-btn.hidden {
            display: none;
        }

        /* 上下文菜单 */
        .context-menu {
            position: fixed;
            background: rgba(20, 20, 40, 0.98);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 12px;
            padding: 12px;
            z-index: 200;
            display: none;
            min-width: 80px;
            max-width: 120px;
            backdrop-filter: blur(10px);
        }

        .context-menu.active {
            display: block;
        }

        .context-menu-btn {
            width: 100%;
            padding: 10px 16px;
            background: transparent;
            border: none;
            color: #ccc;
            text-align: left;
            cursor: pointer;
            border-radius: 6px;
            transition: all 0.2s;
            font-size: 0.9rem;
        }

        .context-menu-btn:hover {
            background: rgba(255, 255, 255, 0.1);
            color: #fff;
        }

        /* 自定义确认弹窗 */
        .confirm-modal {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.7);
            display: none;
            align-items: center;
            justify-content: center;
            z-index: 10000;
            backdrop-filter: blur(5px);
        }

        .confirm-modal.active {
            display: flex;
        }

        .confirm-modal-content {
            background: linear-gradient(135deg, rgba(30, 30, 60, 0.95), rgba(20, 20, 40, 0.95));
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 16px;
            padding: 24px;
            width: 90%;
            max-width: 480px;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
            backdrop-filter: blur(10px);
        }

        .confirm-modal-header h3 {
            color: #fff;
            font-size: 1.2rem;
            margin: 0 0 16px 0;
            text-align: center;
        }

        .confirm-modal-body p {
            color: #ccc;
            font-size: 0.95rem;
            line-height: 1.6;
            margin: 0 0 24px 0;
            text-align: center;
            /* 积分预估明细等多行文案按 \n 换行展示（对齐方式由调用方按需覆盖） */
            white-space: pre-line;
        }

        .confirm-modal-footer {
            display: flex;
            justify-content: center;
            gap: 12px;
        }

        .confirm-btn {
            padding: 12px 32px;
            border: none;
            border-radius: 8px;
            font-size: 0.95rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
            min-width: 120px;
        }

        .cancel-btn {
            background: rgba(255, 255, 255, 0.1);
            color: #fff;
        }

        .cancel-btn:hover {
            background: rgba(255, 255, 255, 0.2);
        }

        .confirm-btn-primary {
            background: linear-gradient(135deg, #00d4ff, #7b2cbf);
            color: #fff;
            box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3);
        }

        .confirm-btn-primary:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(0, 212, 255, 0.5);
        }

        /* 轻量提示弹窗（单按钮） */
        .light-modal {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.55);
            display: none;
            align-items: center;
            justify-content: center;
            z-index: 10001;
            backdrop-filter: blur(3px);
        }

        .light-modal.active {
            display: flex;
        }

        .light-modal-content {
            background: linear-gradient(135deg, rgba(30, 30, 60, 0.96), rgba(20, 20, 40, 0.96));
            border: 1px solid rgba(255, 255, 255, 0.12);
            border-radius: 12px;
            padding: 24px 28px 20px;
            width: 86%;
            max-width: 320px;
            box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
            backdrop-filter: blur(10px);
            text-align: center;
        }

        .light-modal-content p {
            color: #ddd;
            font-size: 0.95rem;
            line-height: 1.6;
            margin: 0 0 18px 0;
            word-break: break-all;
        }

        .light-modal-btn {
            padding: 9px 40px;
            border: none;
            border-radius: 8px;
            font-size: 0.9rem;
            font-weight: 600;
            cursor: pointer;
            background: linear-gradient(135deg, #00d4ff, #7b2cbf);
            color: #fff;
            box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3);
            transition: all 0.3s ease;
        }

        .light-modal-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(0, 212, 255, 0.5);
        }

        #progressOverlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.7);
            display: flex;
            justify-content: center;
            align-items: center;
            z-index: 9999;
        }

        #progressOverlay.hidden {
            display: none;
        }

        .progressContainer {
            background: linear-gradient(135deg, rgba(30, 30, 60, 0.98), rgba(20, 20, 40, 0.98));
            border: 1px solid rgba(255, 255, 255, 0.15);
            padding: 30px;
            border-radius: 16px;
            box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
            text-align: center;
            min-width: 320px;
        }

        .progressSpinner {
            width: 48px;
            height: 48px;
            margin: 0 auto 20px;
            border: 4px solid rgba(0, 212, 255, 0.2);
            border-top-color: #00d4ff;
            border-radius: 50%;
            animation: spin 1s linear infinite;
        }

        .progressBar {
            width: 280px;
            height: 8px;
            background: rgba(255, 255, 255, 0.1);
            border-radius: 4px;
            margin: 0 auto 15px;
            overflow: hidden;
        }

        .progressFill {
            height: 100%;
            width: 0%;
            background: linear-gradient(90deg, #00d4ff, #7b2cbf);
            border-radius: 4px;
            transition: width 0.3s ease;
        }

        .progressText {
            font-size: 16px;
            color: #e5e7eb;
            font-weight: 500;
        }

        /* 成片下载进度弹窗 */
        .batch-download-modal {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.7);
            display: flex;
            justify-content: center;
            align-items: center;
            z-index: 10000;
        }

        .batch-download-modal.hidden {
            display: none;
        }

        .batch-download-content {
            background: linear-gradient(135deg, rgba(30, 30, 60, 0.95), rgba(20, 20, 40, 0.95));
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 12px;
            padding: 24px 28px;
            width: 360px;
            max-width: 90%;
            box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
            text-align: center;
        }

        .batch-download-header h3 {
            color: #fff;
            font-size: 1.2rem;
            margin: 0 0 16px 0;
        }

        .batch-download-body {
            margin-bottom: 20px;
        }

        .batch-download-info {
            color: #ccc;
            font-size: 0.95rem;
            margin-bottom: 14px;
            min-height: 1.4em;
        }

        .batch-download-progress-bar {
            width: 100%;
            height: 10px;
            background: rgba(255, 255, 255, 0.1);
            border-radius: 5px;
            overflow: hidden;
            margin-bottom: 10px;
        }

        .batch-download-progress-fill {
            height: 100%;
            width: 0%;
            background: linear-gradient(90deg, #00d4ff, #7b2cbf);
            border-radius: 5px;
            transition: width 0.3s ease;
        }

        .batch-download-detail {
            color: #888;
            font-size: 0.85rem;
        }

        .batch-download-footer {
            display: flex;
            justify-content: center;
        }

        .batch-download-cancel-btn {
            padding: 10px 24px;
            background: rgba(255, 255, 255, 0.1);
            color: #fff;
            border: 1px solid rgba(255, 255, 255, 0.2);
            border-radius: 8px;
            font-size: 0.9rem;
            cursor: pointer;
            transition: all 0.3s;
        }

        .batch-download-cancel-btn:hover {
            background: rgba(255, 80, 80, 0.2);
            border-color: rgba(255, 80, 80, 0.5);
        }

        /* 剧本预览弹窗 */
        .script-preview-modal {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.7);
            display: none;
            align-items: center;
            justify-content: center;
            z-index: 2000;
            backdrop-filter: blur(5px);
        }

        .script-preview-modal.active {
            display: flex;
        }

        .script-preview-content {
            background: linear-gradient(135deg, rgba(30, 30, 60, 0.95), rgba(20, 20, 40, 0.95));
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 16px;
            width: 90%;
            max-width: 800px;
            height: 80%;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
            backdrop-filter: blur(10px);
            display: flex;
            flex-direction: column;
        }

        .script-preview-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 20px 24px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        }

        .script-preview-header h3 {
            color: #fff;
            font-size: 1.2rem;
            margin: 0;
        }

        .close-btn {
            background: none;
            border: none;
            color: #888;
            font-size: 1.5rem;
            cursor: pointer;
            transition: color 0.3s;
        }

        .close-btn:hover {
            color: #fff;
        }

        .script-preview-body {
            flex: 1;
            padding: 24px;
            overflow: hidden;
            display: flex;
            flex-direction: column;
            gap: 12px;
        }

        #scriptPreviewText {
            width: 100%;
            flex: 1;
            min-height: 0;
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 12px;
            color: #fff;
            padding: 16px;
            font-size: 1rem;
            line-height: 1.6;
            resize: none;
            font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
            overflow-y: auto;
        }

        #scriptPreviewText:focus {
            outline: none;
            border-color: #00d4ff;
            box-shadow: 0 0 20px rgba(0, 212, 255, 0.2);
        }

        #scriptPreviewText::placeholder {
            color: #666;
        }

        /* 预览/编辑切换按钮（剧本编导弹窗，2026-11-25 Markdown 渲染） */
        .script-view-toggle {
            background: rgba(0, 212, 255, 0.1);
            border: 1px solid rgba(0, 212, 255, 0.35);
            border-radius: 8px;
            color: #00d4ff;
            font-size: 0.82rem;
            padding: 4px 14px;
            cursor: pointer;
            transition: background 0.2s;
            user-select: none;
        }

        .script-view-toggle:hover {
            background: rgba(0, 212, 255, 0.22);
        }

        /* 通用隐藏（严格互斥）：任何挂 .md-hidden 的元素连容器一起消失 */
        .md-hidden {
            display: none !important;
        }

        .script-md-rendered {
            width: 100%;
            flex: 1;
            min-height: 0;
            overflow-y: auto;
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 12px;
            color: #ddd;
            padding: 16px 20px;
            font-size: 0.95rem;
            line-height: 1.7;
        }

        .script-md-rendered h1,
        .script-md-rendered h2,
        .script-md-rendered h3 {
            color: #00d4ff;
            margin: 0.9em 0 0.4em;
            line-height: 1.4;
        }

        .script-md-rendered h1 { font-size: 1.25rem; }
        .script-md-rendered h2 { font-size: 1.1rem; }
        .script-md-rendered h3 { font-size: 1rem; }
        .script-md-rendered h1:first-child,
        .script-md-rendered h2:first-child,
        .script-md-rendered h3:first-child { margin-top: 0; }

        .script-md-rendered p { margin: 0.5em 0; }

        .script-md-rendered ul,
        .script-md-rendered ol { margin: 0.5em 0; padding-left: 1.6em; }

        .script-md-rendered blockquote {
            border-left: 3px solid rgba(0, 212, 255, 0.4);
            margin: 0.6em 0;
            padding: 2px 12px;
            color: #9ab;
        }

        .script-md-rendered table {
            border-collapse: collapse;
            margin: 0.6em 0;
            font-size: 0.85rem;
            width: 100%;
        }

        .script-md-rendered th,
        .script-md-rendered td {
            border: 1px solid rgba(255, 255, 255, 0.14);
            padding: 5px 9px;
            text-align: left;
            vertical-align: top;
        }

        .script-md-rendered th {
            color: #00d4ff;
            background: rgba(0, 212, 255, 0.08);
            white-space: nowrap;
        }

        .script-md-rendered code {
            background: rgba(255, 255, 255, 0.08);
            border-radius: 4px;
            padding: 1px 5px;
            font-size: 0.85em;
        }

        /* 折叠块（<details><summary>）：原生三角，无边框盒，summary 即小标题 */
        .script-md-rendered details {
            margin: 0.6em 0;
        }

        .script-md-rendered summary {
            cursor: pointer;
            color: #fff;
            font-size: 1.05rem;
            font-weight: 600;
            line-height: 1.4;
            user-select: none;
        }

        .script-md-rendered details > p {
            margin: 0.4em 0 0.2em;
        }

        /* 剧本/分镜预览弹窗底部的审稿意见行：意见输入框 + 重写按钮 + 确认按钮 */
        .script-review-row {
            display: flex;
            align-items: center;
            gap: 8px;
            flex-shrink: 0;
        }

        /* 默认一行高（JS输入时自动增高），内容撑得下就不出滚动条。
           flex 必须带 auto basis（flex:1 的 basis 0% 会被浏览器把内联 height 钳回 min-height，autogrow 失效） */
        #scriptReviewInput {
            flex: 1 1 auto;
            height: 38px;
            min-height: 38px;
            max-height: 140px;
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 12px;
            color: #fff;
            padding: 7px 14px;
            font-size: 0.9rem;
            line-height: 1.5;
            resize: none;
            font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
            overflow-y: hidden;
            box-sizing: border-box;
        }

        #scriptReviewInput:focus {
            outline: none;
            border-color: #00d4ff;
            box-shadow: 0 0 20px rgba(0, 212, 255, 0.2);
        }

        #scriptReviewInput::placeholder {
            color: #666;
        }

        .script-review-btn {
            padding: 0 17px;
            height: 31px;
            flex-shrink: 0;
            border: none;
            border-radius: 8px;
            background: linear-gradient(135deg, #00d4ff, #0077ff);
            color: #001018;
            font-size: 0.85rem;
            font-weight: 600;
            cursor: pointer;
            white-space: nowrap;
            transition: opacity 0.2s, transform 0.2s;
        }

        .script-review-btn:hover {
            opacity: 0.85;
            transform: translateY(-1px);
        }

        .script-review-btn:disabled {
            opacity: 0.4;
            cursor: not-allowed;
            transform: none;
        }

        /* 确认按钮：保存修改并关闭弹窗（绿色系与重写按钮区分） */
        .script-review-confirm {
            background: linear-gradient(135deg, #34d399, #059669);
            color: #00251a;
        }

        /* 全本预览弹窗的文本区（2026-11-24 起为 contenteditable 容器，支持样式；
           与剧本预览共用滚动样式） */
        #bookPreviewText {
            width: 100%;
            height: 100%;
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 12px;
            color: #fff;
            padding: 16px;
            font-size: 1rem;
            line-height: 1.6;
            font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
            overflow-y: auto;
            white-space: pre-wrap;      /* 保留 \n 换行，长行自动折行 */
            word-break: break-word;
            overflow-wrap: anywhere;    /* 超长无标点串也能折行，不横向溢出 */
            cursor: text;
        }

        #bookPreviewText:focus {
            outline: none;
            border-color: #00d4ff;
            box-shadow: 0 0 20px rgba(0, 212, 255, 0.2);
        }

        /* contenteditable 没有 placeholder 属性：空态用 ::before 显示提示 */
        #bookPreviewText:empty::before {
            content: attr(data-placeholder);
            color: #666;
        }

        /* 剧本操作菜单 */
        .script-menu {
            position: fixed;
            background: rgba(20, 20, 40, 0.98);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 12px;
            padding: 6px;
            z-index: 200;
            display: none;
            width: auto;
            min-width: 80px;
            max-width: 120px;
            backdrop-filter: blur(10px);
        }

        .script-menu.active {
            display: block;
        }

        .script-menu-btn {
            width: 100%;
            padding: 8px 12px;
            background: transparent;
            border: none;
            color: #ccc;
            text-align: left;
            cursor: pointer;
            border-radius: 6px;
            transition: all 0.2s;
            font-size: 0.9rem;
        }

        .script-menu-btn:hover {
            background: rgba(255, 255, 255, 0.1);
            color: #fff;
        }

        #scriptMenuDeleteNode:hover {
            color: #ff4444;
            background: rgba(255, 68, 68, 0.1);
        }

        /* 场景弹窗 */
        .scene-modal {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.7);
            display: none;
            align-items: center;
            justify-content: center;
            z-index: 2000;
            backdrop-filter: blur(5px);
        }

        .scene-modal.active {
            display: flex;
        }

        .scene-content {
            background: linear-gradient(135deg, rgba(30, 30, 60, 0.95), rgba(20, 20, 40, 0.95));
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 16px;
            width: 90%;
            max-width: 600px;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
            backdrop-filter: blur(10px);
        }

        .scene-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 20px 24px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        }

        .scene-header h3 {
            color: #fff;
            font-size: 1.2rem;
            margin: 0;
        }

        .scene-body {
            padding: 24px;
        }

        .scene-info p {
            color: #ccc;
            margin-bottom: 12px;
            line-height: 1.6;
        }

        .scene-info strong {
            color: #00d4ff;
        }

        .scene-content-text {
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 8px;
            padding: 16px;
            color: #e5e7eb;
            line-height: 1.6;
            max-height: 300px;
            overflow-y: auto;
        }

        /* 构图弹窗 */
        .composition-modal {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.7);
            display: none;
            align-items: center;
            justify-content: center;
            z-index: 2000;
            backdrop-filter: blur(5px);
        }

        .composition-modal.active {
            display: flex;
        }

        .composition-content {
            background: linear-gradient(135deg, rgba(30, 30, 60, 0.95), rgba(20, 20, 40, 0.95));
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 16px;
            width: 90%;
            max-width: 600px;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
            backdrop-filter: blur(10px);
        }

        .composition-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 20px 24px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        }

        .composition-header h3 {
            color: #fff;
            font-size: 1.2rem;
            margin: 0;
        }

        .composition-body {
            padding: 24px;
            overflow-y: auto;
            flex: 1;
            min-height: 0; /* 允许收缩定高：layout height:100% 才能解析为可用高度 */
        }

        .composition-content {
            background: linear-gradient(135deg, rgba(30, 30, 60, 0.98), rgba(20, 20, 40, 0.98));
            border: 1px solid rgba(255, 255, 255, 0.15);
            border-radius: 20px;
            width: 90%;
            max-width: 800px;
            max-height: 85vh;
            box-shadow: 0 25px 80px rgba(0, 0, 0, 0.6);
            backdrop-filter: blur(15px);
            display: flex;
            flex-direction: column;
            position: relative; /* 历史构图浮层的定位基准（与 img-view-win-content 同款） */
        }

        .composition-layout {
            display: flex;
            gap: 24px;
            height: 100%;
            align-items: stretch;
            min-height: 0;
        }

        .composition-display-area {
            flex: 1;
            display: flex;
            flex-direction: column;
            gap: 16px;
            min-height: 480px;
        }

        .composition-image-area {
            width: 100%;
            height: 360px;
            border-radius: 16px;
            background: linear-gradient(135deg, rgba(0, 212, 255, 0.1), rgba(123, 44, 191, 0.1));
            border: 1px solid rgba(255, 255, 255, 0.1);
            display: flex;
            align-items: center;
            justify-content: center;
            overflow: hidden;
            flex-shrink: 0;
        }

        .composition-image-area img {
            max-width: 100%;
            max-height: 100%;
            width: auto;
            height: auto;
            object-fit: contain;
        }

        .composition-image-area .image-placeholder {
            color: #666;
            font-size: 1rem;
        }

        .composition-info-area {
            flex: 1;
            overflow-y: auto;
        }

        .composition-info-area textarea.composition-description {
            width: 100%;
            min-height: 180px;
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid rgba(255, 255, 255, 0.15);
            border-radius: 8px;
            padding: 12px;
            color: #ccc;
            font-size: 0.95rem;
            line-height: 1.6;
            resize: vertical;
            font-family: inherit;
        }

        .composition-info-area textarea.composition-description:focus {
            outline: none;
            border-color: rgba(0, 212, 255, 0.5);
            background: rgba(255, 255, 255, 0.08);
        }

        .composition-list-area {
            width: 180px;
            display: flex;
            flex-direction: column;
            gap: 8px;
            padding-right: 4px;
            min-height: 0;
        }

        .composition-actions {
            padding-top: 0;  /* 顶部对齐由 JS 精确计算（与左侧内容区齐平），不再加 padding */
            display: flex;
            flex-direction: column;
            gap: 10px;
            flex-shrink: 0;
            /* 按钮区限高：放不下时内部滚动，不撑破布局（与左侧描述区对齐的规范，2026-11-18） */
            max-height: 280px;
            overflow-y: auto;
            scrollbar-width: thin;
            scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
        }

        .composition-actions::-webkit-scrollbar {
            width: 6px;
        }

        .composition-actions::-webkit-scrollbar-thumb {
            background: rgba(255, 255, 255, 0.25);
            border-radius: 3px;
        }

        /* 上传构图/下载构图大文字按钮已改到预览区右下角小图标（状态仍由这两个隐藏按钮管理） */
        #compositionUploadBtn,
        #compositionDownloadBtn {
            display: none !important;
        }

        /* 构图预览区右下角上传/下载小图标已统一为 img-view-win-corner-btn（见 pop.css，2026-11-19） */

        .composition-action-btn {
            padding: 10px 16px;
            background: linear-gradient(135deg, rgba(0, 212, 255, 0.3), rgba(123, 44, 191, 0.3));
            color: #fff;
            border: 1px solid rgba(255, 255, 255, 0.2);
            border-radius: 8px;
            font-size: 0.9rem;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.3s ease;
            text-align: center;
        }

        .composition-action-btn:hover {
            background: linear-gradient(135deg, rgba(0, 212, 255, 0.5), rgba(123, 44, 191, 0.5));
            border-color: rgba(0, 212, 255, 0.5);
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(0, 212, 255, 0.2);
        }

        /* 构图弹窗切换按钮 */
        .composition-tab-btn {
            width: 100%;
            padding: 12px 16px;
            background: linear-gradient(135deg, rgba(0, 212, 255, 0.3), rgba(123, 44, 191, 0.3));
            color: #fff;
            border: 1px solid rgba(255, 255, 255, 0.2);
            border-radius: 10px;
            font-size: 0.95rem;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.3s ease;
            text-align: center;
            white-space: nowrap;
        }

        .composition-tab-btn:hover {
            background: linear-gradient(135deg, rgba(0, 212, 255, 0.5), rgba(123, 44, 191, 0.5));
            border-color: rgba(0, 212, 255, 0.5);
        }

        .composition-tab-btn.active {
            background: linear-gradient(135deg, rgba(0, 212, 255, 0.6), rgba(123, 44, 191, 0.6));
            color: #fff;
            border: 2px solid rgba(0, 212, 255, 0.8);
            box-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
        }

        /* 构图弹窗高度自适应：小屏幕时自动压缩按钮与间距 */
        @media screen and (max-height: 750px) {
            .composition-content {
                max-height: 92vh;
                width: 95%;
            }
            .composition-header {
                padding: 16px 20px;
            }
            .composition-body {
                padding: 16px 20px;
            }
            .composition-layout {
                gap: 16px;
            }
            .composition-display-area {
                min-height: 360px;
            }
            .composition-image-area {
                height: 240px;
            }
            .composition-info-area textarea.composition-description {
                min-height: 120px;
            }
            .composition-tab-btn {
                padding: 8px 12px;
                font-size: 0.85rem;
            }
            .composition-action-btn {
                padding: 8px 12px;
                font-size: 0.8rem;
            }
            .composition-actions {
                padding-top: 10px;
                gap: 6px;
            }
        }

        @media screen and (max-height: 600px) {
            .composition-content {
                max-height: 95vh;
            }
            .composition-display-area {
                min-height: 280px;
            }
            .composition-image-area {
                height: 180px;
            }
            .composition-info-area textarea.composition-description {
                min-height: 80px;
            }
            .composition-tab-btn {
                padding: 6px 10px;
                font-size: 0.8rem;
            }
            .composition-action-btn {
                padding: 6px 10px;
                font-size: 0.75rem;
            }
            .composition-actions {
                padding-top: 8px;
                gap: 4px;
            }
        }

        /* 整体风格弹窗 */
        .overall-style-modal {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.8);
            display: none;
            align-items: center;
            justify-content: center;
            z-index: 2000;
            backdrop-filter: blur(8px);
        }

        .overall-style-modal.active {
            display: flex;
        }

        .overall-style-content {
            background: linear-gradient(135deg, rgba(30, 30, 60, 0.98), rgba(20, 20, 40, 0.98));
            border: 1px solid rgba(255, 255, 255, 0.15);
            border-radius: 20px;
            width: 90%;
            max-width: 800px;
            max-height: 85vh;
            box-shadow: 0 25px 80px rgba(0, 0, 0, 0.6);
            backdrop-filter: blur(15px);
            display: flex;
            flex-direction: column;
        }

        .overall-style-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 24px 28px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        }

        .overall-style-header h3 {
            color: #fff;
            font-size: 1.3rem;
            margin: 0;
            font-weight: 600;
        }

        .overall-style-body {
            padding: 24px 28px;
            overflow-y: auto;
            flex: 1;
        }

        .overall-style-layout {
            display: flex;
            gap: 24px;
            height: 100%;
            min-height: 0;
        }

        .overall-style-display-area {
            flex: 1;
            display: flex;
            flex-direction: column;
            gap: 16px;
        }

        .overall-style-image-area {
            background: rgba(255, 255, 255, 0.03);
            border: 2px dashed rgba(255, 255, 255, 0.15);
            border-radius: 12px;
            min-height: 200px;
            display: flex;
            align-items: center;
            justify-content: center;
            overflow: hidden;
        }

        .overall-style-image-area img {
            max-width: 100%;
            max-height: 300px;
            object-fit: contain;
            border-radius: 8px;
        }

        .overall-style-image-area .image-placeholder {
            color: #888;
            font-size: 0.95rem;
        }

        /* 上传分析：拖拽图片悬停到预览区时的高亮 */
        .overall-style-image-area.dragover {
            border-color: rgba(0, 212, 255, 0.6);
            background: rgba(0, 212, 255, 0.08);
        }

        .overall-style-info-area {
            display: flex;
            flex-direction: column;
            gap: 12px;
        }

        .overall-style-styles-area {
            width: 200px;
            display: flex;
            flex-direction: column;
            gap: 8px;
            padding-right: 4px;
            min-height: 0;
            flex-shrink: 0;
        }

        #overallStyleList {
            overflow-y: auto;
            max-height: 200px;
        }

        .overall-style-name-btn {
            padding: 14px 16px;
            background: linear-gradient(135deg, rgba(0, 212, 255, 0.15), rgba(123, 44, 191, 0.15));
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 10px;
            color: #fff;
            font-size: 0.95rem;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.3s ease;
            text-align: center;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            min-height: 44px;
            box-sizing: border-box;
        }

        .overall-style-name-btn:hover {
            background: linear-gradient(135deg, rgba(0, 212, 255, 0.3), rgba(123, 44, 191, 0.3));
            border-color: rgba(0, 212, 255, 0.3);
            transform: translateY(-2px);
        }

        .overall-style-name-btn.active {
            background: linear-gradient(135deg, rgba(0, 212, 255, 0.5), rgba(123, 44, 191, 0.5));
            border: 2px solid rgba(0, 212, 255, 0.6);
            box-shadow: 0 0 15px rgba(0, 212, 255, 0.3);
        }

        .overall-style-actions {
            display: flex;
            flex-direction: column;
            gap: 10px;
            padding-top: 0;  /* 顶部对齐由 JS 精确计算（与左侧风格描述文本框齐平），不能再加 padding */
            flex-shrink: 0;
        }

        .overall-style-action-btn {
            padding: 10px 16px;
            background: linear-gradient(135deg, rgba(0, 212, 255, 0.2), rgba(123, 44, 191, 0.2));
            border: 1px solid rgba(255, 255, 255, 0.15);
            border-radius: 10px;
            color: #fff;
            font-size: 0.9rem;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .overall-style-action-btn:hover {
            background: linear-gradient(135deg, rgba(0, 212, 255, 0.4), rgba(123, 44, 191, 0.4));
            border-color: rgba(0, 212, 255, 0.4);
            transform: translateY(-2px);
        }

        .overall-style-action-btn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
            transform: none;
        }

        /* 三层风格标签选择器（剧情/画风/美学）：每排 label + 标签 + 展开箭头 */
        .style-tag-row {
            display: flex;
            align-items: flex-start;
            gap: 8px;
            margin-bottom: 8px;
        }

        .style-tag-row:last-of-type {
            margin-bottom: 0;
        }

        .style-tag-label {
            color: #00d4ff;
            font-size: 0.8rem;
            font-weight: 500;
            min-width: 36px;
            line-height: 26px;
            flex-shrink: 0;
        }

        .style-tag-chips {
            display: flex;
            gap: 6px;
            flex-wrap: wrap;
            flex: 1;
        }

        .style-tag-chip {
            display: inline-block;
            padding: 4px 12px;
            border-radius: 14px;
            border: 1px solid rgba(255, 255, 255, 0.15);
            background: rgba(255, 255, 255, 0.05);
            color: #bbb;
            font-size: 0.78rem;
            line-height: 1.4;
            cursor: pointer;
            user-select: none;
            transition: all 0.15s ease;
            white-space: nowrap;
        }

        .style-tag-chip.recommended {
            border-color: rgba(0, 212, 255, 0.35);
        }

        .style-tag-chip:hover {
            border-color: rgba(0, 212, 255, 0.5);
            color: #fff;
        }

        .style-tag-chip.active {
            background: linear-gradient(135deg, rgba(0, 212, 255, 0.35), rgba(123, 44, 191, 0.35));
            border-color: rgba(0, 212, 255, 0.7);
            color: #fff;
        }

        .style-tag-arrow {
            cursor: pointer;
            color: #00d4ff;
            font-size: 0.85rem;
            line-height: 26px;
            user-select: none;
            padding: 0 4px;
            flex-shrink: 0;
        }

        .style-tag-dropdown {
            position: relative;
            margin-top: 10px;
            padding: 10px;
            background: rgba(30, 30, 60, 0.98);
            border: 1px solid rgba(255, 255, 255, 0.15);
            border-radius: 10px;
            box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
            z-index: 20;
        }

        /* 下拉弹框右上角关闭叉号（2026-11-25 用户定） */
        .style-tag-dd-close {
            position: absolute;
            top: 4px;
            right: 8px;
            color: #999;
            font-size: 1rem;
            line-height: 1;
            cursor: pointer;
            user-select: none;
            padding: 2px 4px;
        }

        .style-tag-dd-close:hover {
            color: #fff;
        }

        .style-tag-dropdown-grid {
            display: flex;
            flex-wrap: wrap;
            gap: 6px;
        }

        .style-tag-chip.extra-hidden {
            display: none;
        }

        .style-tag-more-btn {
            display: inline-block;
            padding: 4px 12px;
            border-radius: 14px;
            border: 1px dashed rgba(255, 255, 255, 0.25);
            color: #999;
            font-size: 0.78rem;
            line-height: 1.4;
            cursor: pointer;
            user-select: none;
        }

        .style-tag-more-btn:hover {
            color: #fff;
            border-color: rgba(0, 212, 255, 0.5);
        }

        /* 调色风格自定义下拉（2026-11-24，替换原生 select，样式对齐载入风格菜单） */
        .colour-select-wrap {
            position: relative;
            width: 100%;
        }

        .colour-select-btn {
            display: flex;
            align-items: center;
            justify-content: space-between;
            width: 100%;
            padding: 10px 12px;
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid rgba(255, 255, 255, 0.15);
            border-radius: 8px;
            color: #ccc;
            font-size: 0.9rem;
            cursor: pointer;
            transition: border-color 0.2s ease;
            font-family: inherit;
        }

        .colour-select-btn:hover {
            border-color: rgba(0, 212, 255, 0.4);
        }

        .colour-select-arrow {
            color: #00d4ff;
            font-size: 0.8rem;
            margin-left: 8px;
        }

        .colour-select-menu {
            position: absolute;
            bottom: calc(100% + 6px);
            left: 0;
            right: 0;
            background: rgba(30, 30, 60, 0.98);
            border: 1px solid rgba(255, 255, 255, 0.15);
            border-radius: 10px;
            box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
            z-index: 30;
            overflow: hidden;
            max-height: 280px;
            overflow-y: auto;
        }

        .colour-select-menu button {
            display: block;
            width: 100%;
            padding: 10px 14px;
            background: transparent;
            border: none;
            border-bottom: 1px solid rgba(255, 255, 255, 0.08);
            color: #ccc;
            font-size: 0.85rem;
            text-align: left;
            cursor: pointer;
            transition: background 0.2s ease;
            font-family: inherit;
        }

        .colour-select-menu button:last-child {
            border-bottom: none;
        }

        .colour-select-menu button:hover {
            background: rgba(0, 212, 255, 0.15);
            color: #fff;
        }

        .colour-select-menu button.active {
            background: linear-gradient(135deg, rgba(0, 212, 255, 0.3), rgba(123, 44, 191, 0.3));
            color: #fff;
        }

        /* 载入风格：合并单按钮（点主体=载入，点右侧下拉箭头=展开菜单），菜单向上弹出 */
        .load-save-style-wrap {
            position: relative;
            display: flex;
        }

        .load-save-style-main {
            flex: 1;
            display: flex;
            align-items: center;
            justify-content: center;
            text-align: center;
            position: relative;
        }

        /* 箭头绝对定位到右侧，不影响"载入风格"文字与上方按钮的水平对齐 */
        .load-save-style-arrow {
            position: absolute;
            right: 10px;
            top: 50%;
            transform: translateY(-50%);
            font-size: 0.75rem;
            line-height: 1;
            opacity: 0.85;
            cursor: pointer;
            padding: 2px;
        }

        .load-save-style-arrow:hover {
            opacity: 1;
        }

        .load-save-style-menu {
            position: absolute;
            bottom: calc(100% + 6px);
            left: 0;
            right: 0;
            background: rgba(30, 30, 60, 0.98);
            border: 1px solid rgba(255, 255, 255, 0.15);
            border-radius: 10px;
            box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
            z-index: 20;
            overflow: hidden;
        }

        .load-save-style-menu button {
            display: block;
            width: 100%;
            padding: 10px 14px;
            background: transparent;
            border: none;
            border-bottom: 1px solid rgba(255, 255, 255, 0.08);
            color: #ccc;
            font-size: 0.85rem;
            text-align: left;
            cursor: pointer;
            transition: background 0.2s ease;
        }

        .load-save-style-menu button:last-child {
            border-bottom: none;
        }

        .load-save-style-menu button:hover {
            background: rgba(0, 212, 255, 0.15);
            color: #fff;
        }

        /* 整体风格弹窗高度自适应：小屏幕时自动压缩按钮与间距 */
        @media screen and (max-height: 750px) {
            .overall-style-content {
                max-height: 92vh;
                width: 95%;
            }
            .overall-style-header {
                padding: 16px 20px;
            }
            .overall-style-body {
                padding: 16px 20px;
            }
            .overall-style-layout {
                gap: 16px;
            }
            .overall-style-image-area img {
                max-height: 200px;
            }
            .overall-style-name-btn {
                padding: 10px 12px;
                font-size: 0.85rem;
            }
            .overall-style-action-btn {
                padding: 8px 12px;
                font-size: 0.8rem;
            }
            .overall-style-actions {
                padding-top: 0;
                gap: 6px;
            }
        }

        @media screen and (max-height: 600px) {
            .overall-style-content {
                max-height: 95vh;
            }
            .overall-style-image-area img {
                max-height: 150px;
            }
            .overall-style-name-btn {
                padding: 8px 10px;
                font-size: 0.8rem;
            }
            .overall-style-action-btn {
                padding: 6px 10px;
                font-size: 0.75rem;
            }
            .overall-style-actions {
                padding-top: 8px;
                gap: 4px;
            }
        }

        /* 角色弹窗 */
        .character-modal {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.8);
            display: none;
            align-items: center;
            justify-content: center;
            z-index: 2000;
            backdrop-filter: blur(8px);
        }

        .character-modal.active {
            display: flex;
        }

        .character-content {
            background: linear-gradient(135deg, rgba(30, 30, 60, 0.98), rgba(20, 20, 40, 0.98));
            border: 1px solid rgba(255, 255, 255, 0.15);
            border-radius: 20px;
            width: 90%;
            max-width: 800px;
            max-height: 85vh;
            box-shadow: 0 25px 80px rgba(0, 0, 0, 0.6);
            backdrop-filter: blur(15px);
            display: flex;
            flex-direction: column;
            position: relative;
        }

        .character-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 24px 28px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
            flex-shrink: 0;
        }

        .character-header h3 {
            color: #fff;
            font-size: 1.3rem;
            margin: 0;
            font-weight: 600;
        }

        /* 标题区域：标题 + 历史图标 */
        .character-title-area {
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .character-body {
            padding: 24px 28px;
            overflow-y: auto;
            flex: 1;
            min-height: 0; /* 允许收缩定高：layout height:100% 才能解析为可用高度，描述框得以撑满 */
        }

        .character-layout {
            display: flex;
            gap: 24px;
            height: 100%;
            min-height: 0;
        }

        .character-display-area {
            flex: 1;
            display: flex;
            flex-direction: column;
            gap: 16px;
        }

        .character-image-area {
            width: 100%;
            height: 240px;
            border-radius: 16px;
            background: linear-gradient(135deg, rgba(0, 212, 255, 0.1), rgba(123, 44, 191, 0.1));
            border: 1px solid rgba(255, 255, 255, 0.1);
            display: flex;
            align-items: center;
            justify-content: center;
            overflow: hidden;
            flex-shrink: 0;
        }

        .character-image-area img {
            max-width: 100%;
            max-height: 100%;
            width: auto;
            height: auto;
            object-fit: contain;
        }

        .character-image-area .image-placeholder {
            color: #666;
            font-size: 1rem;
        }

        .character-info-area {
            flex: 1;
            background: rgba(255, 255, 255, 0.05);
            border-radius: 12px;
            padding: 16px;
            overflow-y: auto;
        }

        .character-info-area .character-description-label {
            color: #00d4ff;
            font-size: 0.8rem;
            margin-bottom: 8px;
            font-weight: 500;
        }

        .character-info-area .character-description {
            width: 100%;
            min-height: 120px;
            background: transparent;
            border: none;
            border-radius: 8px;
            padding: 12px;
            color: #ccc;
            font-size: 0.95rem;
            line-height: 1.6;
            resize: vertical;
            font-family: inherit;
            margin-bottom: 12px;
        }

        .character-info-area .character-description:focus {
            outline: none;
            background: rgba(255, 255, 255, 0.03);
        }

        /* 全本分析（角色/道具/场景共用角色弹窗）：描述框撑满信息区剩余高度。
           2026-11-26 修小屏描述框只有一半的 bug：与大屏同款方案——body 改 flex 列 +
           overflow:hidden（布局自身收缩定高，滚动交给内部列表/描述框），不再依赖
           .character-layout height:100%（body 出滚动条时百分比解析失真，描述框被压半截） */
        /* 全本模式小屏也要给弹窗一个确定高度：.character-content 原本只有 max-height:85vh
           （高度由内容撑），而 body→layout→描述框整条链都是 flex:1，没有确定高度就全部
           塌缩成内容自然高——描述框只剩几行（2026-11-26 浏览器实测 textarea 仅 73px）。
           与大屏 height:94vh 同一思路 */
        #characterModal.book-desc-fill .character-content {
            height: 85vh;
        }

        #characterModal.book-desc-fill .character-body {
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }

        /* body 不再整体滚动后，右侧名称列表+按钮列自身接收滚动（小屏高度紧张时按钮不被裁掉） */
        #characterModal.book-desc-fill .character-list-area {
            overflow-y: auto;
            min-height: 0;
        }

        #characterModal.book-desc-fill .character-layout {
            height: auto;
            flex: 1;
            min-height: 0;
        }

        #characterModal.book-desc-fill .character-display-area {
            min-height: 0;
        }

        #characterModal.book-desc-fill .character-info-area {
            display: flex;
            flex-direction: column;
            overflow: hidden;
            min-height: 0;
        }

        #characterModal.book-desc-fill .character-info-area .character-description {
            flex: 1;
            height: auto;
            min-height: 0;
            margin-bottom: 0;
            resize: none;
        }

        /* 全本模式同样要处理 entity_highlight 的动态包裹：打开弹窗约 1 秒后，
           entity_highlight.js 的定时扫描把 #characterPromptText 包进 .entity-hl-wrap
           （普通块级），截断 flex 链路——描述框先是对的高度、一两秒后塌缩（与
           大屏模式同款问题，修法同 pop.css 的 big-screen-mode 段：wrap 接管 flex） */
        #characterModal.book-desc-fill .character-info-area .entity-hl-wrap {
            flex: 1 1 0;
            display: flex;
            flex-direction: column;
            min-height: 0;
            height: auto;
        }

        #characterModal.book-desc-fill .character-info-area .entity-hl-wrap > textarea.character-description {
            flex: 1 1 0;
            height: auto;
            min-height: 0;
        }

        /* 角色提示词区域 - 暂时注释掉
        .character-info-area .character-prompt-label {
            color: #00d4ff;
            font-size: 0.8rem;
            margin-bottom: 6px;
            font-weight: 500;
        }

        .character-info-area .character-prompt {
            background: rgba(0, 212, 255, 0.08);
            border: 1px solid rgba(0, 212, 255, 0.2);
            border-radius: 8px;
            padding: 10px 12px;
            color: #aaa;
            font-size: 0.85rem;
            line-height: 1.4;
            margin: 0;
        }
        */

        /* 角色描述"重新生成中"转圈（保留原文叠加提示，2026-11-26） */
        .character-info-area.desc-regen-wrap {
            position: relative;
        }

        .character-info-area .desc-regen-spinner {
            position: absolute;
            top: 8px;
            right: 12px;
            display: flex;
            align-items: center;
            gap: 6px;
            font-size: 0.8rem;
            color: #00d4ff;
            background: rgba(0, 0, 0, 0.6);
            padding: 4px 10px;
            border-radius: 12px;
            pointer-events: none;
            z-index: 5;
        }

        .character-info-area .desc-regen-spin {
            width: 13px;
            height: 13px;
            border: 2px solid rgba(0, 212, 255, 0.3);
            border-top-color: #00d4ff;
            border-radius: 50%;
            animation: descRegenSpin 0.8s linear infinite;
        }

        @keyframes descRegenSpin {
            to { transform: rotate(360deg); }
        }

        .character-info-area textarea.desc-regen-active {
            opacity: 0.55;
        }

        /* 文本生成类转圈通用规则（2026-11-30 用户定稿）：转圈提示符号落在对应文本框中间，
           不放到图片预览区上。构图弹窗描述框等复用 desc-regen-wrap/desc-regen-center 修饰类，
           转圈元素结构与角色弹窗同款（.desc-regen-spinner / .desc-regen-spin） */
        .desc-regen-center {
            position: relative;
        }

        .desc-regen-center .desc-regen-spinner {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            font-size: 0.85rem;
        }

        .desc-regen-center textarea.desc-regen-active {
            opacity: 0.55;
        }

        .character-list-area {
            width: 180px;
            display: flex;
            flex-direction: column;
            gap: 8px;
            padding-right: 4px;
            min-height: 0;
        }

        /* 名称按钮列表：最高与左上角预览区（.character-image-area）同高，
           节点/资产很多时列表内部滚动，不撑高弹窗、不挤压下方功能按钮区 */
        #characterList {
            max-height: 240px;
        }

        .character-actions {
            padding-top: 16px;
            display: flex;
            flex-direction: column;
            gap: 10px;
            flex-shrink: 0;
            /* 功能按钮区锚定在右栏底部，与上方名称列表分开 */
            margin-top: auto;
            /* 功能按钮多时区内滚动，不挤压上方名称列表（与其他弹窗功能按钮区一致） */
            max-height: 240px;
            overflow-y: auto;
            scrollbar-width: thin;
            scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
        }

        .character-actions::-webkit-scrollbar {
            width: 6px;
        }

        .character-actions::-webkit-scrollbar-thumb {
            background: rgba(255, 255, 255, 0.25);
            border-radius: 3px;
        }

        /* 上传/下载图片大文字按钮已改到预览区右下角小图标（按钮仍保留作状态管理层，
           各处 JS 对它的 display 切换经 MutationObserver 镜像到 #characterImageActions 小图标） */
        #uploadCharacterBtn,
        #downloadCharacterBtn {
            display: none !important;
        }

        .character-action-btn {
            padding: 10px 16px;
            background: linear-gradient(135deg, rgba(0, 212, 255, 0.3), rgba(123, 44, 191, 0.3));
            color: #fff;
            border: 1px solid rgba(255, 255, 255, 0.2);
            border-radius: 8px;
            font-size: 0.9rem;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.3s ease;
            text-align: center;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .character-action-btn:hover {
            background: linear-gradient(135deg, rgba(0, 212, 255, 0.5), rgba(123, 44, 191, 0.5));
            border-color: rgba(0, 212, 255, 0.5);
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(0, 212, 255, 0.2);
        }

        .character-name-btn {
            padding: 12px 16px;
            background: linear-gradient(135deg, rgba(0, 212, 255, 0.2), rgba(123, 44, 191, 0.2));
            color: #fff;
            border: 1px solid rgba(255, 255, 255, 0.15);
            border-radius: 10px;
            font-size: 0.95rem;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.3s ease;
            text-align: center;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            /* 列表限高后按钮保持原高度，超出由列表滚动，不被压缩 */
            flex-shrink: 0;
        }

        .character-name-btn:hover {
            background: linear-gradient(135deg, rgba(0, 212, 255, 0.4), rgba(123, 44, 191, 0.4));
            border-color: rgba(0, 212, 255, 0.4);
            transform: translateX(-2px);
        }

        .character-name-btn.active {
            background: linear-gradient(135deg, #00d4ff, #7b2cbf);
            border-color: transparent;
            box-shadow: 0 4px 16px rgba(0, 212, 255, 0.3);
        }

        /* 全本资产已生成/未生成的视觉区分（2026-11-25 需求）：
           已生成=背景加深变亮（青紫渐变更实），未生成=背景压暗变淡 */
        .character-name-btn.book-asset-hasimg {
            background: linear-gradient(135deg, rgba(0, 212, 255, 0.32), rgba(123, 44, 191, 0.32));
            border-color: rgba(0, 212, 255, 0.35);
        }

        .character-name-btn.book-asset-noimg {
            background: rgba(255, 255, 255, 0.06);
            color: rgba(255, 255, 255, 0.65);
        }

        .character-name-btn.book-asset-noimg:hover {
            background: rgba(255, 255, 255, 0.12);
            color: #fff;
        }

        /* 全本批量生成的画布顶部浮动进度提示（关窗后仍显示；z-index 高于
           .character-modal 的 2000，弹窗开着时也要浮在最前面——2026-11-27 用户反馈） */
        #bookBatchFloatHint {
            position: fixed;
            top: 14px;
            left: 50%;
            transform: translateX(-50%);
            z-index: 3500;
            display: none;
            align-items: center;
            gap: 8px;
            padding: 8px 18px;
            border-radius: 20px;
            background: linear-gradient(135deg, rgba(0, 212, 255, 0.18), rgba(123, 44, 191, 0.25));
            border: 1px solid rgba(0, 212, 255, 0.45);
            color: #fff;
            font-size: 0.9rem;
            cursor: pointer;
            box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
            backdrop-filter: blur(6px);
        }

        #bookBatchFloatHint .book-asset-spinner {
            display: inline-block;
            width: 12px;
            height: 12px;
            border: 2px solid rgba(255, 255, 255, 0.35);
            border-top-color: #00d4ff;
            border-radius: 50%;
            animation: bookAssetSpin 0.8s linear infinite;
        }

        #bookBatchFloatHint .book-batch-float-progress {
            font-weight: 700;
            color: #00d4ff;
        }

        /* 批量实拍/彩排的画布顶部浮动进度提示（2026-11-29 用户反馈：点击"全部实拍"
           后长时间无反馈易误解——点下即刻出提示，组装/排队/生成全程可见 n/m 进度；
           多项目批次并行时并列显示。样式对齐 #bookBatchFloatHint） */
        #videoBatchFloatHint {
            position: fixed;
            top: 14px;
            left: 50%;
            transform: translateX(-50%);
            z-index: 3500;
            display: none;
            align-items: center;
            gap: 8px;
            padding: 8px 18px;
            border-radius: 20px;
            background: linear-gradient(135deg, rgba(0, 212, 255, 0.18), rgba(123, 44, 191, 0.25));
            border: 1px solid rgba(0, 212, 255, 0.45);
            color: #fff;
            font-size: 0.9rem;
            white-space: nowrap;
            box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
            backdrop-filter: blur(6px);
        }

        #videoBatchFloatHint .video-batch-spinner {
            display: inline-block;
            width: 12px;
            height: 12px;
            border: 2px solid rgba(255, 255, 255, 0.35);
            border-top-color: #00d4ff;
            border-radius: 50%;
            animation: bookAssetSpin 0.8s linear infinite;
        }

        #videoBatchFloatHint .video-batch-float-progress {
            font-weight: 700;
            color: #00d4ff;
        }

        /* 全本分析/批量生成的画布浮动进度（2026-12-01：分析任务后台化——关窗继续跑，
           浮标显示几分之几进度，点击重开对应窗口；样式对齐 #videoBatchFloatHint） */
        #bookTaskFloatHint {
            position: fixed;
            top: 14px;
            left: 50%;
            transform: translateX(-50%) translateY(44px);
            z-index: 3500;
            display: none;
            align-items: center;
            gap: 8px;
            padding: 8px 18px;
            border-radius: 20px;
            background: linear-gradient(135deg, rgba(0, 212, 255, 0.18), rgba(123, 44, 191, 0.25));
            border: 1px solid rgba(0, 212, 255, 0.45);
            color: #fff;
            font-size: 0.9rem;
            white-space: nowrap;
            box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
            backdrop-filter: blur(6px);
            cursor: pointer;
        }

        #bookTaskFloatHint .video-batch-spinner {
            display: inline-block;
            width: 12px;
            height: 12px;
            border: 2px solid rgba(255, 255, 255, 0.35);
            border-top-color: #00d4ff;
            border-radius: 50%;
            animation: bookAssetSpin 0.8s linear infinite;
        }

        #bookTaskFloatHint .video-batch-float-progress {
            font-weight: 700;
            color: #00d4ff;
        }

        /* 「全部生成」按钮右键菜单：取消/中止生成 */
        #bookGenAbortMenu,
        #bookRangeMenu {
            position: fixed;
            z-index: 3500;  /* 高于 .character-modal 的 2000，弹窗内右键不被挡（2026-11-27） */
            display: none;
            min-width: 140px;
            background: #1e1e2e;
            border: 1px solid rgba(0, 212, 255, 0.4);
            border-radius: 8px;
            box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
            overflow: hidden;
        }

        #bookGenAbortMenu .book-gen-abort-item,
        #bookRangeMenu .book-gen-abort-item {
            display: block;
            width: 100%;
            padding: 10px 16px;
            background: none;
            border: none;
            color: #f87171;
            font-size: 0.9rem;
            text-align: left;
            cursor: pointer;
        }

        #bookGenAbortMenu .book-gen-abort-item:hover,
        #bookRangeMenu .book-gen-abort-item:hover {
            background: rgba(248, 113, 113, 0.15);
        }

        /* 全本资产按钮内的转圈动图（批量生成时标记正在生成的那个） */
        .character-name-btn .book-asset-spinner {
            display: inline-block;
            width: 12px;
            height: 12px;
            margin-left: 6px;
            vertical-align: -1px;
            border: 2px solid rgba(255, 255, 255, 0.35);
            border-top-color: #00d4ff;
            border-radius: 50%;
            animation: bookAssetSpin 0.8s linear infinite;
        }

        /* 分析中占位按钮（2026-11-26）：复用名称按钮样式，呼吸动画提示分析进行中 */
        .character-name-btn.analyzing-placeholder {
            cursor: default;
            opacity: 0.75;
            animation: analyzingPulse 1.6s ease-in-out infinite;
        }
        @keyframes analyzingPulse {
            0%, 100% { opacity: 0.45; }
            50% { opacity: 0.85; }
        }

        /* 大屏模式：顶部那条通栏长进度条观感突兀，隐藏之（分析进度看占位按钮的转圈） */
        .character-modal.big-screen-mode #characterProgressContainer {
            display: none !important;
        }

        .character-name-btn .book-asset-mark-done {
            margin-left: 6px;
            color: #4ade80;
            font-weight: 700;
        }

        .character-name-btn .book-asset-mark-fail {
            margin-left: 6px;
            color: #f87171;
            font-weight: 700;
        }

        /* 名称按钮编辑态：右上角"×"删除钮（全本资产改名时出现） */
        .character-name-btn {
            position: relative;
        }

        .asset-name-delete-btn {
            position: absolute;
            top: 2px;
            right: 4px;
            width: 16px;
            height: 16px;
            line-height: 14px;
            text-align: center;
            border-radius: 50%;
            background: rgba(248, 113, 113, 0.85);
            color: #fff;
            font-size: 12px;
            font-weight: 700;
            cursor: pointer;
            z-index: 2;
            user-select: none;
        }

        .asset-name-delete-btn:hover {
            background: #ff4d4f;
        }

        /* 名称按钮长按拖动排序：拖动中的按钮半透明+虚线框 */
        .asset-name-dragging {
            opacity: 0.5;
            outline: 1px dashed #00d4ff;
            cursor: grabbing !important;
        }

        /* 名称列表末尾"+新增"按钮：虚线边框弱化显示 */
        .add-asset-btn {
            background: rgba(255, 255, 255, 0.04);
            border: 1px dashed rgba(0, 212, 255, 0.45);
            color: #00d4ff;
        }

        .add-asset-btn:hover {
            background: rgba(0, 212, 255, 0.12);
            border-style: solid;
        }

        @keyframes bookAssetSpin {
            to { transform: rotate(360deg); }
        }

        /* 按钮转圈动图（2026-11-27）：分析进行中在按钮文字后追加旋转圆圈，
           进度条有时走得很慢，转圈让用户明确知道还在跑 */
        .btn-busy-spin {
            pointer-events: none;
            opacity: 0.75;
        }

        .btn-busy-spin::after {
            content: '';
            display: inline-block;
            width: 12px;
            height: 12px;
            margin-left: 6px;
            border: 2px solid currentColor;
            border-top-color: transparent;
            border-radius: 50%;
            vertical-align: middle;
            animation: bookAssetSpin 0.8s linear infinite;
        }

        /* 全本资产图片预览区的状态提示块（生成中/排队中/失败） */
        .book-asset-status-block {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 10px;
            padding: 20px;
            text-align: center;
            height: 100%;
            box-sizing: border-box;
        }

        .book-asset-status-block .book-asset-spinner {
            display: inline-block;
            width: 34px;
            height: 34px;
            border: 4px solid rgba(0, 212, 255, 0.2);
            border-top-color: #00d4ff;
            border-radius: 50%;
            animation: bookAssetSpin 0.8s linear infinite;
        }

        .book-asset-status-block .book-asset-status-text {
            color: #00d4ff;
            font-size: 1rem;
        }

        .book-asset-status-block.queued .book-asset-status-text {
            color: #b9a3ff;
        }

        .book-asset-status-block.queued .book-asset-status-icon {
            font-size: 2.2rem;
        }

        .book-asset-status-block.failed .book-asset-status-text {
            color: #f87171;
            word-break: break-all;
        }

        .book-asset-status-block.failed .book-asset-status-icon {
            font-size: 2.2rem;
        }

        .book-asset-status-block .book-asset-status-code {
            color: #f87171;
            font-size: 0.8rem;
            opacity: 0.85;
            word-break: break-all;
        }

        .book-asset-status-block .book-asset-status-hint {
            color: #888;
            font-size: 0.8rem;
        }

        /* 角色弹窗高度自适应：小屏幕时自动压缩按钮与间距 */
        @media screen and (max-height: 750px) {
            .character-content {
                max-height: 92vh;
                width: 95%;
            }
            .character-header {
                padding: 16px 20px;
            }
            .character-body {
                padding: 16px 20px;
            }
            .character-layout {
                gap: 16px;
            }
            .character-image-area {
                height: 180px;
            }
            #characterList {
                max-height: 180px;
            }
            .character-info-area .character-description {
                min-height: 80px;
            }
            .character-name-btn {
                padding: 8px 12px;
                font-size: 0.85rem;
            }
            .character-action-btn {
                padding: 8px 12px;
                font-size: 0.8rem;
            }
            .character-actions {
                padding-top: 10px;
                gap: 6px;
            }
        }

        @media screen and (max-height: 600px) {
            .character-content {
                max-height: 95vh;
            }
            .character-image-area {
                height: 140px;
            }
            #characterList {
                max-height: 140px;
            }
            .character-info-area .character-description {
                min-height: 60px;
            }
            .character-name-btn {
                padding: 6px 10px;
                font-size: 0.8rem;
            }
            .character-action-btn {
                padding: 6px 10px;
                font-size: 0.75rem;
            }
            .character-actions {
                padding-top: 8px;
                gap: 4px;
            }
        }

        .character-empty-state {
            text-align: center;
            padding: 40px 20px;
            color: #888;
        }

        /* 图片操作按钮已统一为 img-view-win-corner-btn（见 pop.css，2026-11-19） */

        /* 拖放上传区域高亮样式 */
        .drag-over {
            border-color: #00d4ff !important;
            background: rgba(0, 212, 255, 0.15) !important;
            transform: scale(1.02);
        }

        /* 上传中状态 */
        .uploading-state {
            position: relative;
        }

        .uploading-state::after {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.7);
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 8px;
        }

        .uploading-spinner {
            width: 40px;
            height: 40px;
            border: 3px solid rgba(0, 212, 255, 0.3);
            border-top-color: #00d4ff;
            border-radius: 50%;
            animation: spin 1s linear infinite;
        }

        .character-empty-state p {
            margin: 8px 0;
        }

        /* 服装弹窗 */
        .clothing-modal {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.8);
            display: none;
            align-items: center;
            justify-content: center;
            z-index: 2000;
            backdrop-filter: blur(8px);
        }

        .clothing-modal.active {
            display: flex;
        }

        .clothing-content {
            background: linear-gradient(135deg, rgba(30, 30, 60, 0.98), rgba(20, 20, 40, 0.98));
            border: 1px solid rgba(255, 255, 255, 0.15);
            border-radius: 20px;
            width: 90%;
            max-width: 800px;
            max-height: 85vh;
            box-shadow: 0 25px 80px rgba(0, 0, 0, 0.6);
            backdrop-filter: blur(15px);
            display: flex;
            flex-direction: column;
        }

        .clothing-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 24px 28px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
            flex-shrink: 0;
        }

        .clothing-header h3 {
            color: #fff;
            font-size: 1.3rem;
            margin: 0;
            font-weight: 600;
        }

        .clothing-body {
            padding: 24px 28px;
            overflow-y: auto;
            flex: 1;
            min-height: 0; /* 允许收缩定高：layout height:100% 才能解析为可用高度 */
        }

        .clothing-layout {
            display: flex;
            gap: 24px;
            height: 100%;
            min-height: 0;
        }

        .clothing-display-area {
            flex: 1;
            display: flex;
            flex-direction: column;
            gap: 16px;
        }

        .clothing-image-area {
            width: 100%;
            height: 240px;
            border-radius: 16px;
            background: linear-gradient(135deg, rgba(0, 212, 255, 0.1), rgba(123, 44, 191, 0.1));
            border: 1px solid rgba(255, 255, 255, 0.1);
            display: flex;
            align-items: center;
            justify-content: center;
            overflow: hidden;
            flex-shrink: 0;
        }

        .clothing-image-area img {
            max-width: 100%;
            max-height: 100%;
            width: auto;
            height: auto;
            object-fit: contain;
        }

        .clothing-image-area .image-placeholder {
            color: #666;
            font-size: 1rem;
        }

        .clothing-info-area {
            flex: 1;
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 12px;
            padding: 16px;
            overflow-y: auto;
        }

        .clothing-info-area .clothing-description-label {
            color: #00d4ff;
            font-size: 0.8rem;
            margin-bottom: 8px;
            font-weight: 500;
        }

        .clothing-info-area .clothing-description {
            width: 100%;
            min-height: 120px;
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid rgba(255, 255, 255, 0.15);
            border-radius: 8px;
            padding: 12px;
            color: #ccc;
            font-size: 0.95rem;
            line-height: 1.6;
            resize: vertical;
            font-family: inherit;
            margin-bottom: 12px;
        }

        .clothing-info-area .clothing-description:focus {
            outline: none;
            border-color: rgba(0, 212, 255, 0.5);
            background: rgba(255, 255, 255, 0.08);
        }

        .clothing-list-area {
            width: 180px;
            display: flex;
            flex-direction: column;
            gap: 8px;
            padding-right: 4px;
            min-height: 0;
        }

        /* 名称按钮列表：最高与左上角预览区（.clothing-image-area）同高，超高内部滚动 */
        #clothingList {
            max-height: 240px;
        }

        .clothing-actions {
            padding-top: 16px;
            display: flex;
            flex-direction: column;
            gap: 10px;
            flex-shrink: 0;
            /* 功能按钮区锚定在右栏底部，与上方名称列表分开 */
            margin-top: auto;
        }

        .clothing-action-btn {
            padding: 10px 16px;
            background: linear-gradient(135deg, rgba(0, 212, 255, 0.3), rgba(123, 44, 191, 0.3));
            color: #fff;
            border: 1px solid rgba(255, 255, 255, 0.2);
            border-radius: 8px;
            font-size: 0.9rem;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.3s ease;
            text-align: center;
        }

        .clothing-action-btn:hover {
            background: linear-gradient(135deg, rgba(0, 212, 255, 0.5), rgba(123, 44, 191, 0.5));
            border-color: rgba(0, 212, 255, 0.5);
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(0, 212, 255, 0.2);
        }

        .clothing-name-btn {
            padding: 12px 16px;
            background: linear-gradient(135deg, rgba(0, 212, 255, 0.2), rgba(123, 44, 191, 0.2));
            color: #fff;
            border: 1px solid rgba(255, 255, 255, 0.15);
            border-radius: 10px;
            font-size: 0.95rem;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.3s ease;
            text-align: center;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            /* 列表限高后按钮保持原高度，超出由列表滚动，不被压缩 */
            flex-shrink: 0;
        }

        .clothing-name-btn:hover {
            background: linear-gradient(135deg, rgba(0, 212, 255, 0.4), rgba(123, 44, 191, 0.4));
            border-color: rgba(0, 212, 255, 0.4);
            transform: translateX(-2px);
        }

        .clothing-name-btn.active {
            background: linear-gradient(135deg, #00d4ff, #7b2cbf);
            border-color: transparent;
            box-shadow: 0 4px 16px rgba(0, 212, 255, 0.3);
        }

        /* 服装弹窗高度自适应：小屏幕时自动压缩按钮与间距 */
        @media screen and (max-height: 750px) {
            .clothing-content {
                max-height: 92vh;
                width: 95%;
            }
            .clothing-header {
                padding: 16px 20px;
            }
            .clothing-body {
                padding: 16px 20px;
            }
            .clothing-layout {
                gap: 16px;
            }
            .clothing-image-area {
                height: 180px;
            }
            #clothingList {
                max-height: 180px;
            }
            .clothing-info-area .clothing-description {
                min-height: 80px;
            }
            .clothing-name-btn {
                padding: 8px 12px;
                font-size: 0.85rem;
            }
            .clothing-action-btn {
                padding: 8px 12px;
                font-size: 0.8rem;
            }
            .clothing-actions {
                padding-top: 10px;
                gap: 6px;
            }
        }

        @media screen and (max-height: 600px) {
            .clothing-content {
                max-height: 95vh;
            }
            .clothing-image-area {
                height: 140px;
            }
            #clothingList {
                max-height: 140px;
            }
            .clothing-info-area .clothing-description {
                min-height: 60px;
            }
            .clothing-name-btn {
                padding: 6px 10px;
                font-size: 0.8rem;
            }
            .clothing-action-btn {
                padding: 6px 10px;
                font-size: 0.75rem;
            }
            .clothing-actions {
                padding-top: 8px;
                gap: 4px;
            }
        }

        /* 道具弹窗 */
        .prop-modal {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.8);
            display: none;
            align-items: center;
            justify-content: center;
            z-index: 2000;
            backdrop-filter: blur(8px);
        }

        .prop-modal.active {
            display: flex;
        }

        .prop-content {
            background: linear-gradient(135deg, rgba(30, 30, 60, 0.98), rgba(20, 20, 40, 0.98));
            border: 1px solid rgba(255, 255, 255, 0.15);
            border-radius: 20px;
            width: 90%;
            max-width: 800px;
            max-height: 85vh;
            box-shadow: 0 25px 80px rgba(0, 0, 0, 0.6);
            backdrop-filter: blur(15px);
            display: flex;
            flex-direction: column;
        }

        .prop-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 24px 28px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
            flex-shrink: 0;
        }

        .prop-header h3 {
            color: #fff;
            font-size: 1.3rem;
            margin: 0;
            font-weight: 600;
        }

        .prop-body {
            padding: 24px 28px;
            overflow-y: auto;
            flex: 1;
            min-height: 0; /* 允许收缩定高：layout height:100% 才能解析为可用高度 */
        }

        .prop-layout {
            display: flex;
            gap: 24px;
            height: 100%;
            min-height: 0;
        }

        .prop-display-area {
            flex: 1;
            display: flex;
            flex-direction: column;
            gap: 16px;
        }

        .prop-image-area {
            width: 100%;
            height: 240px;
            border-radius: 16px;
            background: linear-gradient(135deg, rgba(0, 212, 255, 0.1), rgba(123, 44, 191, 0.1));
            border: 1px solid rgba(255, 255, 255, 0.1);
            display: flex;
            align-items: center;
            justify-content: center;
            overflow: hidden;
            flex-shrink: 0;
        }

        .prop-image-area img {
            max-width: 100%;
            max-height: 100%;
            width: auto;
            height: auto;
            object-fit: contain;
        }

        .prop-image-area .image-placeholder {
            color: #666;
            font-size: 1rem;
        }

        .prop-info-area {
            flex: 1;
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 12px;
            padding: 16px;
            overflow-y: auto;
        }

        .prop-info-area .prop-description-label {
            color: #00d4ff;
            font-size: 0.8rem;
            margin-bottom: 8px;
            font-weight: 500;
        }

        .prop-info-area .prop-description {
            width: 100%;
            min-height: 120px;
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid rgba(255, 255, 255, 0.15);
            border-radius: 8px;
            padding: 12px;
            color: #ccc;
            font-size: 0.95rem;
            line-height: 1.6;
            resize: vertical;
            font-family: inherit;
            margin-bottom: 12px;
        }

        .prop-info-area .prop-description:focus {
            outline: none;
            border-color: rgba(0, 212, 255, 0.5);
            background: rgba(255, 255, 255, 0.08);
        }

        .prop-list-area {
            width: 180px;
            display: flex;
            flex-direction: column;
            gap: 8px;
            padding-right: 4px;
            min-height: 0;
        }

        /* 名称按钮列表：最高与左上角预览区（.prop-image-area）同高，超高内部滚动 */
        #propList {
            max-height: 240px;
        }

        .prop-actions {
            padding-top: 16px;
            display: flex;
            flex-direction: column;
            gap: 10px;
            flex-shrink: 0;
            /* 功能按钮区锚定在右栏底部，与上方名称列表分开 */
            margin-top: auto;
        }

        .prop-action-btn {
            padding: 10px 16px;
            background: linear-gradient(135deg, rgba(0, 212, 255, 0.3), rgba(123, 44, 191, 0.3));
            color: #fff;
            border: 1px solid rgba(255, 255, 255, 0.2);
            border-radius: 8px;
            font-size: 0.9rem;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.3s ease;
            text-align: center;
        }

        .prop-action-btn:hover {
            background: linear-gradient(135deg, rgba(0, 212, 255, 0.5), rgba(123, 44, 191, 0.5));
            border-color: rgba(0, 212, 255, 0.5);
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(0, 212, 255, 0.2);
        }

        .prop-name-btn {
            padding: 12px 16px;
            background: linear-gradient(135deg, rgba(0, 212, 255, 0.2), rgba(123, 44, 191, 0.2));
            color: #fff;
            border: 1px solid rgba(255, 255, 255, 0.15);
            border-radius: 10px;
            font-size: 0.95rem;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.3s ease;
            text-align: center;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            /* 列表限高后按钮保持原高度，超出由列表滚动，不被压缩 */
            flex-shrink: 0;
        }

        .prop-name-btn:hover {
            background: linear-gradient(135deg, rgba(0, 212, 255, 0.4), rgba(123, 44, 191, 0.4));
            border-color: rgba(0, 212, 255, 0.4);
            transform: translateX(-2px);
        }

        .prop-name-btn.active {
            background: linear-gradient(135deg, #00d4ff, #7b2cbf);
            border-color: transparent;
            box-shadow: 0 4px 16px rgba(0, 212, 255, 0.3);
        }

        /* 道具弹窗高度自适应：小屏幕时自动压缩按钮与间距 */
        @media screen and (max-height: 750px) {
            .prop-content {
                max-height: 92vh;
                width: 95%;
            }
            .prop-header {
                padding: 16px 20px;
            }
            .prop-body {
                padding: 16px 20px;
            }
            .prop-layout {
                gap: 16px;
            }
            .prop-image-area {
                height: 180px;
            }
            #propList {
                max-height: 180px;
            }
            .prop-info-area .prop-description {
                min-height: 80px;
            }
            .prop-name-btn {
                padding: 8px 12px;
                font-size: 0.85rem;
            }
            .prop-action-btn {
                padding: 8px 12px;
                font-size: 0.8rem;
            }
            .prop-actions {
                padding-top: 10px;
                gap: 6px;
            }
        }

        @media screen and (max-height: 600px) {
            .prop-content {
                max-height: 95vh;
            }
            .prop-image-area {
                height: 140px;
            }
            #propList {
                max-height: 140px;
            }
            .prop-info-area .prop-description {
                min-height: 60px;
            }
            .prop-name-btn {
                padding: 6px 10px;
                font-size: 0.8rem;
            }
            .prop-action-btn {
                padding: 6px 10px;
                font-size: 0.75rem;
            }
            .prop-actions {
                padding-top: 8px;
                gap: 4px;
            }
        }

        /* 图片放大查看弹窗 */
        .image-zoom-modal {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.9);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 10000;
            opacity: 0;
            visibility: hidden;
            transition: all 0.3s ease;
        }

        .image-zoom-modal.active {
            opacity: 1;
            visibility: visible;
        }

        .image-zoom-content {
            position: relative;
            max-width: 90%;
            max-height: 90%;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .image-zoom-content img {
            max-width: 100%;
            max-height: 90vh;
            object-fit: contain;
            border-radius: 8px;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
        }

        .image-zoom-close {
            position: absolute;
            /* 右上角外侧：right:-48px 与翻页箭头同距（图片右侧外 ~8px 间距），
               top:-44px 高于图片顶边，横竖两个方向都错开图片不遮挡（2026-11-28 用户反馈） */
            top: -44px;
            right: -48px;
            width: 36px;
            height: 36px;
            background: rgba(255, 255, 255, 0.1);
            border: 1px solid rgba(255, 255, 255, 0.2);
            border-radius: 50%;
            color: #fff;
            font-size: 24px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.3s ease;
        }

        .image-zoom-close:hover {
            background: rgba(255, 255, 255, 0.2);
            transform: scale(1.1);
        }

        /* 大图弹窗左右翻页箭头（列表>1 张时显示）。挂在 image-zoom-content（position:relative）
           内，absolute 负偏移 = 图片外侧两边、靠近图片留约 8px 间距（2026-11-28 用户定稿：
           位置跟图片走，不再随窗口大小漂移）；统一纯三角符号无圆圈底，黑色投影保证可见 */
        .image-zoom-nav {
            position: absolute;
            top: 50%;
            transform: translateY(-50%);
            background: none;
            border: none;
            color: rgba(255, 255, 255, 0.85);
            font-size: 44px;
            line-height: 1;
            cursor: pointer;
            z-index: 10001;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s ease;
            user-select: none;
            padding: 0 4px;
            text-shadow: 0 0 10px rgba(0, 0, 0, 0.9), 0 1px 3px rgba(0, 0, 0, 0.8);
        }

        .image-zoom-nav:hover {
            color: #00d4ff;
            transform: translateY(-50%) scale(1.15);
        }

        .image-zoom-prev { left: -48px; }
        .image-zoom-next { right: -48px; }

        .image-zoom-counter {
            position: fixed;
            bottom: 24px;
            left: 50%;
            transform: translateX(-50%);
            color: rgba(255, 255, 255, 0.8);
            font-size: 0.85rem;
            background: rgba(0, 0, 0, 0.5);
            padding: 4px 12px;
            border-radius: 12px;
            z-index: 10001;
            pointer-events: none;
        }

        /* 大图弹窗顶部资产名称（翻页清单条目带 name 时显示，2026-11-28）；
           top 压到 8px：大图最高 90vh 时顶边距视口仅约 5vh，18px 会压到图（2026-11-28 用户反馈重叠） */
        .image-zoom-name {
            position: fixed;
            top: 8px;
            left: 50%;
            transform: translateX(-50%);
            max-width: 60vw;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            color: rgba(255, 255, 255, 0.92);
            font-size: 1rem;
            background: rgba(0, 0, 0, 0.55);
            padding: 5px 16px;
            border-radius: 14px;
            z-index: 10001;
            pointer-events: none;
        }

        /* 退出大图翻页后焦点回位闪高亮（资产名称按钮/选择浮窗行共用，
           动画结束后由 JS 摘除 class，可重复触发） */
        .zoom-return-focus {
            animation: zoomReturnFocusFlash 1.6s ease;
        }

        @keyframes zoomReturnFocusFlash {
            0% {
                box-shadow: 0 0 0 0 rgba(0, 212, 255, 0);
            }
            20% {
                box-shadow: 0 0 0 2px rgba(0, 212, 255, 0.95);
                background: rgba(0, 212, 255, 0.28);
            }
            100% {
                box-shadow: 0 0 0 0 rgba(0, 212, 255, 0);
            }
        }

        /* 角色图片区域添加点击光标 */
        .character-image-area img {
            cursor: zoom-in;
        }

        /* 视频弹窗 */
        .video-modal {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.85);
            display: none;
            align-items: center;
            justify-content: center;
            z-index: 3000;
            backdrop-filter: blur(5px);
        }

        .video-modal.active {
            display: flex;
        }

        .video-modal-content {
            background: linear-gradient(135deg, rgba(30, 30, 60, 0.98), rgba(20, 20, 40, 0.98));
            border: 1px solid rgba(255, 255, 255, 0.15);
            border-radius: 16px;
            width: 90%;
            max-width: 900px;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
            backdrop-filter: blur(10px);
        }

        .video-modal-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 20px 24px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        }

        .video-modal-header h3 {
            color: #fff;
            font-size: 1.2rem;
            margin: 0;
        }

        .video-modal-body {
            padding: 24px;
            display: flex;
            justify-content: center;
            background: rgba(0, 0, 0, 0.3);
        }

        .video-modal-body video {
            border-radius: 8px;
            max-height: 70vh;
        }

        .video-modal-footer {
            padding: 16px 24px;
            border-top: 1px solid rgba(255, 255, 255, 0.1);
            text-align: center;
        }

        .download-btn {
            display: inline-block;
            padding: 10px 24px;
            background: linear-gradient(135deg, #00d4ff, #0099cc);
            color: #fff;
            text-decoration: none;
            border-radius: 8px;
            font-size: 0.95rem;
            transition: all 0.3s ease;
        }

        .download-btn:hover {
            background: linear-gradient(135deg, #00e5ff, #00aadd);
            transform: translateY(-2px);
            box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3);
        }

        /* 充值功能样式 */
        .points-badge {
            font-size: 0.75rem;
            color: #00d4ff;
            margin-left: 8px;
            background: rgba(0, 212, 255, 0.15);
            padding: 2px 8px;
            border-radius: 10px;
        }

        /* 充值弹窗 */
        .recharge-modal {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.8);
            display: none;
            align-items: center;
            justify-content: center;
            z-index: 3000;
            backdrop-filter: blur(8px);
        }

        .recharge-modal.active {
            display: flex;
        }

        .recharge-modal-content {
            background: linear-gradient(135deg, rgba(30, 30, 60, 0.98), rgba(20, 20, 40, 0.98));
            border: 1px solid rgba(255, 255, 255, 0.15);
            border-radius: 20px;
            width: 90%;
            max-width: 420px;
            box-shadow: 0 25px 80px rgba(0, 0, 0, 0.6);
            backdrop-filter: blur(15px);
        }

        .recharge-modal-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 20px 24px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        }

        .recharge-modal-header h3 {
            color: #fff;
            font-size: 1.2rem;
            margin: 0;
            font-weight: 600;
        }

        .recharge-modal-body {
            padding: 24px;
        }

        .current-points {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 16px 20px;
            background: linear-gradient(135deg, rgba(0, 212, 255, 0.1), rgba(123, 44, 191, 0.1));
            border: 1px solid rgba(0, 212, 255, 0.2);
            border-radius: 12px;
            margin-bottom: 20px;
        }

        .points-label {
            color: #888;
            font-size: 0.9rem;
        }

        .points-value {
            color: #00d4ff;
            font-size: 1.5rem;
            font-weight: 700;
        }

        .refresh-points-btn {
            background: rgba(0, 212, 255, 0.2);
            border: 1px solid rgba(0, 212, 255, 0.3);
            color: #00d4ff;
            width: 28px;
            height: 28px;
            border-radius: 50%;
            cursor: pointer;
            font-size: 14px;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.3s ease;
            margin-left: 10px;
        }

        .refresh-points-btn:hover {
            background: rgba(0, 212, 255, 0.3);
            transform: rotate(180deg);
        }

        .recharge-package {
            margin-bottom: 20px;
        }

        .package-label {
            color: #888;
            font-size: 0.85rem;
            margin-bottom: 12px;
        }

        .package-card {
            background: linear-gradient(135deg, rgba(0, 212, 255, 0.15), rgba(123, 44, 191, 0.15));
            border: 2px solid rgba(0, 212, 255, 0.3);
            border-radius: 12px;
            padding: 20px;
            text-align: center;
            position: relative;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .package-card.selected {
            border-color: #00d4ff;
            background: linear-gradient(135deg, rgba(0, 212, 255, 0.25), rgba(123, 44, 191, 0.25));
            box-shadow: 0 4px 20px rgba(0, 212, 255, 0.2);
        }

        /* 卡片翻转容器 */
        .package-card-flipper {
            perspective: 1000px;
            cursor: pointer;
        }

        .package-card-inner {
            position: relative;
            width: 100%;
            min-height: 85px;
            transition: transform 0.6s ease;
            transform-style: preserve-3d;
        }

        .package-card-flipper.flipped .package-card-inner {
            transform: rotateY(180deg);
            min-height: 160px;
        }

        .package-card-front,
        .package-card-back {
            position: absolute;
            width: 100%;
            top: 0;
            left: 0;
            backface-visibility: hidden;
            border-radius: 12px;
            padding: 20px;
        }

        .package-card-front {
            background: linear-gradient(135deg, rgba(0, 212, 255, 0.15), rgba(123, 44, 191, 0.15));
            border: 2px solid rgba(0, 212, 255, 0.3);
            position: relative;
        }

        .package-card-back {
            background: linear-gradient(135deg, rgba(0, 212, 255, 0.25), rgba(123, 44, 191, 0.25));
            border: 2px solid #00d4ff;
            transform: rotateY(180deg);
            box-shadow: 0 4px 20px rgba(0, 212, 255, 0.2);
            display: flex;
            flex-direction: column;
            justify-content: center;
        }

        .package-points {
            color: #00d4ff;
            font-size: 1.4rem;
            font-weight: 700;
            margin-bottom: 4px;
            position: relative;
            text-align: center;
        }

        .exchange-hint {
            color: #00d4ff;
            font-size: 0.75rem;
            font-weight: 500;
            text-decoration: underline;
            text-decoration-color: #00d4ff;
            transition: all 0.3s ease;
            text-align: center;
            margin-top: 4px;
            cursor: pointer;
        }

        .package-card-front:hover .exchange-hint {
            color: #66e5ff;
            text-decoration-color: #66e5ff;
            text-shadow: 0 0 12px rgba(102, 229, 255, 0.9);
            transform: scale(1.05);
        }

        .exchange-title {
            color: #00d4ff;
            font-size: 1rem;
            font-weight: 600;
            text-align: center;
            margin-bottom: 12px;
            padding-bottom: 8px;
            border-bottom: 1px solid rgba(0, 212, 255, 0.3);
        }

        .exchange-item {
            color: #ccc;
            font-size: 0.8rem;
            line-height: 1.7;
            padding: 3px 0;
            font-weight: 400;
        }

        .exchange-item:first-of-type {
            color: #fff;
            font-weight: 500;
        }

        .exchange-hint-back {
            color: #888;
            font-size: 0.7rem;
            text-align: center;
            margin-top: 12px;
            font-style: italic;
        }

        .package-price {
            color: #fff;
            font-size: 1rem;
            text-align: center;
        }

        .package-tag {
            position: absolute;
            top: -10px;
            right: 12px;
            background: linear-gradient(135deg, #ff006e, #ff4d8a);
            color: #fff;
            font-size: 0.7rem;
            padding: 4px 10px;
            border-radius: 10px;
            font-weight: 600;
        }

        .recharge-quantity {
            margin-top: 30px;
            margin-bottom: 20px;
        }

        .quantity-label {
            color: #888;
            font-size: 0.85rem;
            margin-bottom: 12px;
        }

        .quantity-selector {
            display: flex;
            align-items: center;
            gap: 12px;
            width: 100%;
        }

        .quantity-btn {
            width: 40px;
            height: 40px;
            border-radius: 10px;
            background: rgba(255, 255, 255, 0.1);
            border: 1px solid rgba(255, 255, 255, 0.2);
            color: #fff;
            font-size: 1.2rem;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s ease;
        }

        .quantity-btn:hover {
            background: rgba(0, 212, 255, 0.3);
            border-color: rgba(0, 212, 255, 0.5);
        }

        .quantity-btn:disabled {
            opacity: 0.3;
            cursor: not-allowed;
        }

        .quantity-input {
            flex: 1;
            height: 40px;
            text-align: center;
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid rgba(255, 255, 255, 0.2);
            border-radius: 10px;
            color: #fff;
            font-size: 1.1rem;
            font-weight: 600;
        }

        .quantity-input:focus {
            outline: none;
            border-color: rgba(0, 212, 255, 0.5);
        }

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

        .summary-row {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 8px;
        }

        .summary-row:last-child {
            margin-bottom: 0;
        }

        .summary-row span:first-child {
            color: #888;
            font-size: 0.9rem;
        }
        
        .summary-points {
            color: #00d4ff;
            font-size: 1.2rem;
            font-weight: 700;
        }
        .summary-amount {
            color: #fff;
            font-size: 0.9rem;
            font-weight: 400;
            
        }


        .recharge-pay-btn {
            width: 100%;
            padding: 16px;
            background: linear-gradient(135deg, #00d4ff, #7b2cbf);
            border: none;
            border-radius: 12px;
            color: #fff;
            cursor: pointer;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 4px;
            transition: all 0.3s ease;
        }

        .recharge-pay-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 8px 25px rgba(0, 212, 255, 0.3);
        }

        .recharge-pay-btn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
            transform: none;
        }

        .pay-btn-text {
            font-size: 1.1rem;
            font-weight: 600;
        }

        .pay-btn-sub {
            font-size: 0.8rem;
            opacity: 0.8;
        }

        /* 支付二维码弹窗 */
        .recharge-qr-modal {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.85);
            display: none;
            align-items: center;
            justify-content: center;
            z-index: 3100;
            backdrop-filter: blur(8px);
        }

        .recharge-qr-modal.active {
            display: flex;
        }

        .recharge-qr-content {
            background: linear-gradient(135deg, rgba(30, 30, 60, 0.98), rgba(20, 20, 40, 0.98));
            border: 1px solid rgba(255, 255, 255, 0.15);
            border-radius: 20px;
            width: 90%;
            max-width: 380px;
            box-shadow: 0 25px 80px rgba(0, 0, 0, 0.6);
            backdrop-filter: blur(15px);
        }

        .recharge-qr-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 20px 24px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        }

        .recharge-qr-header h3 {
            color: #fff;
            font-size: 1.2rem;
            margin: 0;
            font-weight: 600;
        }

        .recharge-qr-body {
            padding: 24px;
            text-align: center;
        }

        .qr-container {
            width: 200px;
            height: 200px;
            margin: 0 auto 20px;
            background: #fff;
            border-radius: 12px;
            padding: 12px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .qr-container img {
            width: 100%;
            height: 100%;
            object-fit: contain;
        }

        .qr-loading {
            color: #666;
            font-size: 0.9rem;
        }

        .qr-tip {
            color: #888;
            font-size: 0.9rem;
            margin-bottom: 20px;
        }

        .qr-order-info {
            background: rgba(255, 255, 255, 0.05);
            border-radius: 10px;
            padding: 12px 16px;
            margin-bottom: 20px;
        }

        .order-info-row {
            display: flex;
            justify-content: space-between;
            margin-bottom: 8px;
        }

        .order-info-row:last-child {
            margin-bottom: 0;
        }

        .order-info-row span:first-child {
            color: #888;
            font-size: 0.85rem;
        }

        .order-info-row span:last-child {
            color: #fff;
            font-weight: 600;
        }

        .qr-status {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            margin-bottom: 16px;
        }

        .status-dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: #ffa500;
            animation: pulse 1.5s infinite;
        }

        .status-dot.success {
            background: #00ff88;
            animation: none;
        }

        .status-dot.timeout {
            background: #ff4444;
            animation: none;
        }

        .status-text {
            color: #888;
            font-size: 0.9rem;
        }

        @keyframes pulse {
            0%, 100% { opacity: 1; }
            50% { opacity: 0.5; }
        }

        .qr-refresh-btn {
            width: 100%;
            padding: 12px;
            background: rgba(255, 255, 255, 0.1);
            border: 1px solid rgba(255, 255, 255, 0.2);
            border-radius: 10px;
            color: #fff;
            font-size: 0.9rem;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .qr-refresh-btn:hover {
            background: rgba(0, 212, 255, 0.2);
            border-color: rgba(0, 212, 255, 0.4);
        }

        /* 产投分析弹窗 */
        .analysis-modal {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.8);
            display: none;
            align-items: center;
            justify-content: center;
            z-index: 3200;
            backdrop-filter: blur(8px);
        }

        .analysis-modal.active {
            display: flex;
        }

        .analysis-modal-content {
            background: linear-gradient(135deg, rgba(30, 30, 60, 0.98), rgba(20, 20, 40, 0.98));
            border: 1px solid rgba(255, 255, 255, 0.15);
            border-radius: 20px;
            width: 90%;
            max-width: 500px;
            max-height: 80vh;
            box-shadow: 0 25px 80px rgba(0, 0, 0, 0.6);
            backdrop-filter: blur(15px);
            display: flex;
            flex-direction: column;
        }

        .analysis-modal-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 20px 24px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        }

        .analysis-modal-header h3 {
            color: #fff;
            font-size: 1.2rem;
            margin: 0;
            font-weight: 600;
        }

        .analysis-modal-body {
            padding: 24px;
            overflow-y: auto;
        }

        .analysis-summary {
            display: flex;
            gap: 12px;
            margin-bottom: 20px;
        }

        .summary-card {
            flex: 1;
            background: linear-gradient(135deg, rgba(0, 212, 255, 0.1), rgba(123, 44, 191, 0.1));
            border: 1px solid rgba(0, 212, 255, 0.2);
            border-radius: 12px;
            padding: 16px 12px;
            text-align: center;
        }

        .summary-label {
            color: #888;
            font-size: 0.8rem;
            margin-bottom: 8px;
        }

        .summary-value {
            color: #00d4ff;
            font-size: 1.2rem;
            font-weight: 700;
        }

        .analysis-records {
            background: rgba(255, 255, 255, 0.03);
            border: 1px solid rgba(255, 255, 255, 0.08);
            border-radius: 12px;
            padding: 16px;
        }

        .records-header {
            color: #ccc;
            font-size: 0.9rem;
            margin-bottom: 12px;
            padding-bottom: 10px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        }

        .records-list {
            max-height: 300px;
            overflow-y: auto;
        }

        .records-list::-webkit-scrollbar {
            width: 6px;
        }

        .records-list::-webkit-scrollbar-track {
            background: rgba(255, 255, 255, 0.05);
            border-radius: 3px;
        }

        .records-list::-webkit-scrollbar-thumb {
            background: rgba(0, 212, 255, 0.3);
            border-radius: 3px;
        }

        .record-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 10px 0;
            border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        }

        .record-item:last-child {
            border-bottom: none;
        }

        .record-info {
            flex: 1;
        }

        .record-reason {
            color: #ccc;
            font-size: 0.85rem;
            margin-bottom: 4px;
        }

        .record-time {
            color: #666;
            font-size: 0.75rem;
        }

        .record-integral {
            font-weight: 600;
            font-size: 0.9rem;
        }

        .record-integral.earned {
            color: #4caf50;
        }

        .record-integral.used {
            color: #ff6b6b;
        }

        .analysis-pagination {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 12px;
            margin-top: 16px;
            padding-top: 12px;
            border-top: 1px solid rgba(255, 255, 255, 0.08);
        }

        .analysis-pagination .page-btn {
            background: rgba(0, 212, 255, 0.1);
            border: 1px solid rgba(0, 212, 255, 0.3);
            color: #00d4ff;
            padding: 6px 14px;
            border-radius: 8px;
            cursor: pointer;
            font-size: 0.85rem;
            transition: all 0.2s ease;
        }

        .analysis-pagination .page-btn:hover:not(:disabled) {
            background: rgba(0, 212, 255, 0.2);
            border-color: rgba(0, 212, 255, 0.5);
        }

        .analysis-pagination .page-btn:disabled {
            opacity: 0.4;
            cursor: not-allowed;
        }

        .analysis-pagination .page-info {
            color: #888;
            font-size: 0.85rem;
            min-width: 60px;
            text-align: center;
        }

        .loading-tip {
            color: #888;
            text-align: center;
            padding: 20px;
        }

        .empty-tip {
            color: #666;
            text-align: center;
            padding: 20px;
            font-size: 0.9rem;
        }

        /* 新手引导气泡 */
        .guide-bubble {
            position: fixed;
            pointer-events: none; /* 隐藏（opacity:0）时不拦截鼠标，避免挡住书本节点的点击 */
            cursor: pointer;
            z-index: 1500;
            opacity: 0;
            transition: opacity 0.5s ease;
            display: flex;
            flex-direction: column;
            align-items: center;
        }

        .guide-bubble.show {
            opacity: 1;
            pointer-events: auto; /* 只有可见时才可点击 */
        }

        .guide-bubble-content {
            background: linear-gradient(135deg, rgba(30, 30, 60, 0.98), rgba(20, 20, 40, 0.98));
            border: 2px solid #00d4ff;
            border-radius: 20px;
            padding: 24px 32px;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 12px;
            box-shadow: 0 0 60px rgba(0, 212, 255, 0.3), 0 20px 60px rgba(0, 0, 0, 0.5);
            animation: guidePulse 2s ease-in-out infinite;
        }

        .guide-bubble-text {
            color: #fff;
            font-size: 18px;
            text-align: center;
            line-height: 1.5;
        }

        .guide-bubble-hint {
            color: #00d4ff;
            font-size: 14px;
        }

        @keyframes guidePulse {
            0%, 100% {
                box-shadow: 0 0 40px rgba(0, 212, 255, 0.3), 0 20px 60px rgba(0, 0, 0, 0.5);
            }
            50% {
                box-shadow: 0 0 80px rgba(0, 212, 255, 0.5), 0 20px 60px rgba(0, 0, 0, 0.5);
            }
        }

        .guide-bubble-arrow {
            width: 0;
            height: 0;
            margin: 0 auto;
            border-left: 14px solid transparent;
            border-right: 14px solid transparent;
            border-top: 18px solid #00d4ff;
            filter: drop-shadow(0 0 6px rgba(0, 212, 255, 0.8));
        }

        /* 书本节点菜单 */
        .book-menu {
            position: fixed;
            z-index: 1600;
            display: none;
            animation: menuFadeIn 0.2s ease;
        }

        .book-menu.show {
            display: block;
        }

        .book-menu-content {
            background: linear-gradient(135deg, rgba(30, 30, 60, 0.98), rgba(20, 20, 40, 0.98));
            border: 1px solid rgba(255, 255, 255, 0.15);
            border-radius: 16px;
            padding: 8px;
            box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
            backdrop-filter: blur(10px);
        }

        .book-menu-item {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 14px 20px;
            cursor: pointer;
            border-radius: 10px;
            transition: all 0.2s ease;
            min-width: 160px;
        }

        .book-menu-item:hover {
            background: rgba(0, 212, 255, 0.15);
        }

        .book-menu-icon {
            font-size: 20px;
        }

        .book-menu-text {
            color: #fff;
            font-size: 15px;
        }

        .book-menu-divider {
            height: 1px;
            background: rgba(255, 255, 255, 0.1);
            margin: 4px 8px;
        }

        @keyframes menuFadeIn {
            from {
                opacity: 0;
                transform: translateY(-10px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        /* 通用旋转动画 */
        @keyframes spin {
            to {
                transform: rotate(360deg);
            }
        }

        /* 上下文菜单按钮loading状态 */
        .context-menu-btn.loading {
            position: relative;
            color: transparent !important;
            pointer-events: none;
        }

        .context-menu-btn.loading::after {
            content: '';
            position: absolute;
            top: 50%;
            left: 50%;
            width: 16px;
            height: 16px;
            margin: -8px 0 0 -8px;
            border: 2px solid rgba(255, 255, 255, 0.3);
            border-top-color: #fff;
            border-radius: 50%;
            animation: spin 0.8s linear infinite;
        }

        .context-menu-btn.loading.spinner-blue::after {
            border-color: rgba(0, 212, 255, 0.3);
            border-top-color: #00d4ff;
        }

        /* ========== 偏好设置弹窗 ========== */
        .pref-modal {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.8);
            display: none;
            align-items: center;
            justify-content: center;
            z-index: 3300;
            backdrop-filter: blur(8px);
        }
        .pref-modal.active { display: flex; }
        .pref-modal-content {
            background: linear-gradient(135deg, rgba(30, 30, 60, 0.98), rgba(20, 20, 40, 0.98));
            border: 1px solid rgba(255, 255, 255, 0.15);
            border-radius: 20px;
            width: 92%;
            max-width: 560px;
            max-height: 86vh;
            box-shadow: 0 25px 80px rgba(0, 0, 0, 0.6);
            backdrop-filter: blur(15px);
            display: flex;
            flex-direction: column;
        }
        .pref-modal-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 20px 24px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        }
        .pref-modal-header h3 {
            color: #fff;
            font-size: 1.2rem;
            margin: 0;
            font-weight: 600;
        }
        .pref-modal-body {
            padding: 20px 24px;
            overflow-y: auto;
        }
        .pref-tip {
            color: #888;
            font-size: 0.82rem;
            margin-bottom: 16px;
            padding: 10px 12px;
            background: rgba(0, 212, 255, 0.06);
            border-left: 3px solid rgba(0, 212, 255, 0.4);
            border-radius: 6px;
            line-height: 1.5;
        }
        .pref-section {
            margin-bottom: 18px;
            padding-bottom: 16px;
            border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
        }
        .pref-section:last-of-type { border-bottom: none; }
        .pref-section-title {
            color: #00d4ff;
            font-size: 0.95rem;
            margin-bottom: 12px;
            font-weight: 600;
        }
        .pref-tip-mini {
            color: #888;
            font-size: 0.8rem;
            font-weight: 400;
            margin-left: 6px;
        }
        /* 账号类型多选 */
        .pref-type-list {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
        }
        .pref-type-chip {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 8px 14px;
            background: rgba(255, 255, 255, 0.04);
            border: 1px solid rgba(255, 255, 255, 0.15);
            border-radius: 999px;
            cursor: pointer;
            color: #ccc;
            font-size: 0.9rem;
            transition: all 0.2s;
            position: relative;
            user-select: none;
        }
        .pref-type-chip:hover {
            border-color: rgba(0, 212, 255, 0.5);
            background: rgba(0, 212, 255, 0.06);
        }
        .pref-type-chip.checked {
            background: linear-gradient(135deg, rgba(0, 212, 255, 0.2), rgba(123, 44, 191, 0.2));
            border-color: rgba(0, 212, 255, 0.6);
            color: #fff;
            box-shadow: 0 0 0 1px rgba(0, 212, 255, 0.3);
        }
        /* 当前使用身份角标 */
        .pref-active-mark {
            display: inline-flex;
            align-items: center;
            padding: 1px 7px;
            background: rgba(0, 212, 255, 0.18);
            color: #00d4ff;
            border: 1px solid rgba(0, 212, 255, 0.35);
            border-radius: 999px;
            font-size: 0.7rem;
            font-weight: 500;
            margin-left: 5px;
            pointer-events: none;
            white-space: nowrap;
        }
        .pref-help-tip {
            position: absolute;
            bottom: calc(100% + 8px);
            left: 50%;
            transform: translateX(-50%);
            min-width: 200px;
            max-width: 280px;
            padding: 8px 12px;
            background: rgba(20, 20, 40, 0.98);
            color: #e0e0e0;
            font-size: 0.78rem;
            font-weight: 400;
            line-height: 1.5;
            border: 1px solid rgba(0, 212, 255, 0.3);
            border-radius: 8px;
            box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.2s;
            z-index: 999;
            white-space: normal;
            text-align: left;
        }
        .pref-help-tip.show { opacity: 1; pointer-events: auto; }
        .pref-help-tip::after {
            content: '';
            position: absolute;
            top: 100%;
            left: 50%;
            transform: translateX(-50%);
            border: 5px solid transparent;
            border-top-color: rgba(0, 212, 255, 0.3);
        }
        .pref-help-tip-below {
            top: calc(100% + 8px);
            bottom: auto;
            left: 0;
            transform: none;
            min-width: 240px;
            max-width: 320px;
        }
        .pref-help-tip-below::after {
            top: auto;
            bottom: 100%;
            left: 6px;
            transform: none;
            border-top-color: transparent;
            border-bottom-color: rgba(0, 212, 255, 0.3);
        }
        /* 栏目级问号（账号类型后） */
        .pref-section-title .pref-help {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 16px;
            height: 16px;
            border-radius: 50%;
            background: rgba(255, 255, 255, 0.1);
            color: #aaa;
            font-size: 0.7rem;
            cursor: help;
            transition: all 0.15s;
            position: relative;
            margin-left: 6px;
            vertical-align: middle;
        }
        .pref-section-title .pref-help:hover {
            background: rgba(0, 212, 255, 0.3);
            color: #fff;
        }
        /* 表单字段 */
        .pref-field {
            display: flex;
            flex-direction: column;
            gap: 6px;
            margin-bottom: 10px;
        }
        .pref-field label {
            color: #aaa;
            font-size: 0.82rem;
        }
        .pref-field input,
        .pref-field textarea,
        .pref-field select {
            width: 100%;
            padding: 8px 12px;
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid rgba(255, 255, 255, 0.12);
            border-radius: 8px;
            color: #fff;
            font-size: 0.9rem;
            font-family: inherit;
            outline: none;
            transition: border-color 0.2s;
            box-sizing: border-box;
        }
        .pref-field input:focus,
        .pref-field textarea:focus,
        .pref-field select:focus {
            border-color: rgba(0, 212, 255, 0.6);
        }
        .pref-field textarea {
            min-height: 60px;
            resize: vertical;
        }
        /* 组织列表 */
        .pref-org-list {
            display: flex;
            flex-direction: column;
            gap: 8px;
            margin-bottom: 10px;
        }
        .pref-org-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 10px 14px;
            background: rgba(255, 255, 255, 0.04);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 10px;
        }
        .pref-org-info {
            flex: 1;
            display: flex;
            flex-direction: column;
            gap: 4px;
        }
        .pref-org-name {
            color: #fff;
            font-size: 0.95rem;
            font-weight: 500;
        }
        .pref-org-meta {
            color: #888;
            font-size: 0.78rem;
        }
        .pref-org-tag {
            display: inline-block;
            padding: 1px 8px;
            margin-right: 6px;
            background: rgba(0, 212, 255, 0.15);
            color: #00d4ff;
            border-radius: 4px;
            font-size: 0.7rem;
        }
        .pref-org-tag.owner { background: rgba(255, 193, 7, 0.15); color: #ffc107; }
        .pref-org-actions-row {
            display: flex;
            gap: 6px;
        }
        .pref-org-mini-btn {
            padding: 4px 10px;
            background: rgba(255, 255, 255, 0.08);
            border: 1px solid rgba(255, 255, 255, 0.15);
            border-radius: 6px;
            color: #ccc;
            font-size: 0.78rem;
            cursor: pointer;
        }
        .pref-org-mini-btn:hover { background: rgba(0, 212, 255, 0.15); color: #fff; }
        .pref-org-mini-btn.danger:hover { background: rgba(255, 80, 80, 0.2); color: #ff8a8a; }
        .pref-add-btn {
            padding: 8px 14px;
            background: rgba(0, 212, 255, 0.1);
            border: 1px dashed rgba(0, 212, 255, 0.4);
            border-radius: 8px;
            color: #00d4ff;
            cursor: pointer;
            font-size: 0.85rem;
            width: 100%;
        }
        .pref-add-btn:hover { background: rgba(0, 212, 255, 0.18); }
        .pref-org-form {
            background: rgba(0, 212, 255, 0.04);
            padding: 14px;
            border-radius: 10px;
            border: 1px solid rgba(0, 212, 255, 0.15);
        }
        .pref-org-status {
            color: #ffc107;
            font-size: 0.82rem;
            margin: 6px 0;
            min-height: 20px;
        }
        .pref-org-actions {
            display: flex;
            gap: 10px;
            justify-content: flex-end;
            margin-top: 8px;
        }
        .pref-btn-primary {
            padding: 8px 20px;
            background: linear-gradient(135deg, #00d4ff, #7b2cbf);
            border: none;
            border-radius: 8px;
            color: #fff;
            font-size: 0.9rem;
            cursor: pointer;
            font-weight: 500;
        }
        .pref-btn-primary:hover { opacity: 0.9; }
        .pref-btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
        .pref-btn-secondary {
            padding: 8px 20px;
            background: rgba(255, 255, 255, 0.08);
            border: 1px solid rgba(255, 255, 255, 0.2);
            border-radius: 8px;
            color: #ccc;
            font-size: 0.9rem;
            cursor: pointer;
        }
        .pref-btn-secondary:hover { background: rgba(255, 255, 255, 0.12); }
        .pref-active-tip {
            color: #888;
            font-size: 0.8rem;
            margin-top: 6px;
            line-height: 1.5;
        }
        .pref-footer {
            margin-top: 8px;
            padding-top: 14px;
            border-top: 1px solid rgba(255, 255, 255, 0.08);
            display: flex;
            justify-content: flex-end;
        }
        .pref-empty {
            color: #888;
            font-size: 0.85rem;
            padding: 12px;
            text-align: center;
            background: rgba(255, 255, 255, 0.02);
            border-radius: 8px;
            border: 1px dashed rgba(255, 255, 255, 0.1);
        }

        /* "无台词无旁白"提示小字：审稿意见行上方，悬停看具体说明 */
        .speech-hint {
            font-size: 12px;
            line-height: 1.4;
            color: #e0a24a;
            margin: 0 0 4px 2px;
            cursor: help;
            user-select: none;
            flex-shrink: 0;
        }

        /* 轻浮动提示条：屏幕上方浮出小消息（如"修改意见无变化"），自动消失 */
        #floatToast {
            position: fixed;
            top: 12%;
            left: 50%;
            transform: translateX(-50%) translateY(-8px);
            background: rgba(40, 40, 46, 0.92);
            color: #fff;
            font-size: 13px;
            padding: 8px 18px;
            border-radius: 8px;
            pointer-events: none;
            opacity: 0;
            transition: opacity 0.2s ease, transform 0.2s ease;
            z-index: 99999;
            white-space: nowrap;
        }

        #floatToast.show {
            opacity: 1;
            transform: translateX(-50%) translateY(0);
        }

        /* ==================== 描述框角色/道具虚线下划线 + 悬停缩略图卡（entity_highlight.js） ==================== */
        /* 镜像覆盖层容器：精确包住 textarea（display:block 消除 inline-block 基线空隙） */
        .entity-hl-wrap {
            position: relative;
            width: 100%;
        }

        /* 剧本预览弹窗的描述框靠 flex:1 撑满，包裹后由容器接管 flex 属性 */
        .entity-hl-wrap-flex {
            display: flex;
            flex-direction: column;
            flex: 1 1 auto;
            min-height: 0;
        }

        .entity-hl-wrap > textarea {
            display: block;
        }

        /* 覆盖层：叠在 textarea 文字上方，文字透明只画虚线下划线；不拦截鼠标事件 */
        .entity-hl-overlay {
            position: absolute;
            top: 0;
            left: 0;
            margin: 0;
            box-sizing: border-box;
            overflow: hidden;
            pointer-events: none;
            color: transparent;
            white-space: pre-wrap;
            word-wrap: break-word;
            overflow-wrap: break-word;
            z-index: 2;
        }

        /* 角色：青色虚线（与主色一致）；道具：琥珀色虚线 */
        .entity-hl-overlay .entity-hl-char {
            text-decoration: underline dotted;
            text-decoration-color: rgba(0, 212, 255, 0.85);
            text-decoration-thickness: 1px;
            text-underline-offset: 4px;
        }

        .entity-hl-overlay .entity-hl-prop {
            text-decoration: underline dotted;
            text-decoration-color: rgba(255, 170, 80, 0.9);
            text-decoration-thickness: 1px;
            text-underline-offset: 4px;
        }

        /* 场景：绿色虚线 */
        .entity-hl-overlay .entity-hl-scene {
            text-decoration: underline dotted;
            text-decoration-color: rgba(80, 220, 120, 0.9);
            text-decoration-thickness: 1px;
            text-underline-offset: 4px;
        }

        /* 自己的名字：灰色虚线（2026-11-19）：生成时不会引用自己，与引用色区分 */
        .entity-hl-overlay .entity-hl-self {
            text-decoration: underline dotted;
            text-decoration-color: rgba(170, 170, 180, 0.8);
            text-decoration-thickness: 1px;
            text-underline-offset: 4px;
        }

        /* 跨类别重名资产：红色实线下划线（2026-11-30）：生图链路会出问题，提示用户改名 */
        .entity-hl-overlay .entity-hl-dup {
            text-decoration: underline;
            text-decoration-color: rgba(255, 70, 70, 0.95);
            text-decoration-thickness: 2px;
            text-underline-offset: 4px;
        }

        /* 悬停缩略图卡：仅显示资产图片（无图时显示占位表情） */
        .entity-hover-card {
            position: fixed;
            display: none;
            flex-direction: column;
            background: rgba(30, 32, 40, 0.96);
            border: 1px solid rgba(0, 212, 255, 0.35);
            border-radius: 10px;
            box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
            overflow: hidden;
            z-index: 100000;
            pointer-events: none;
        }

        .entity-hover-card[data-eh-type="prop"] {
            border-color: rgba(255, 170, 80, 0.45);
        }

        .entity-hover-card[data-eh-type="scene"] {
            border-color: rgba(80, 220, 120, 0.45);
        }

        .entity-hover-card-thumb {
            width: 96px;
            height: 96px;
            background: rgba(255, 255, 255, 0.08);
        }

        .entity-hover-card-img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            display: block;
        }

        .entity-hover-card-fallback {
            width: 100%;
            height: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.5rem;
        }

        /* 名称+类型行：悬停卡一眼可核对命中的资产（图片+名称+类型） */
        .entity-hover-card-meta {
            display: flex;
            align-items: center;
            gap: 6px;
            max-width: 220px;
            padding: 6px 10px;
            font-size: 12px;
            line-height: 1.2;
        }

        .entity-hover-card-name {
            color: #e8eaf0;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            min-width: 0;
        }

        .entity-hover-card-type {
            flex-shrink: 0;
            color: rgba(0, 212, 255, 0.85);
            font-size: 11px;
        }

        /* 重名警告行（2026-11-30）：跨类别同名资产悬停时提示需改名 */
        .entity-hover-card-warn {
            padding: 4px 10px 7px;
            margin-top: -2px;
            color: #ff6b6b;
            font-size: 11px;
            line-height: 1.3;
            max-width: 220px;
        }
