        /* ===== 全局重置 & 令牌（遵循 ChatUI 设计规范：色彩/字体/间距/圆角） ===== */
        :root {
            /* 品牌色：淘宝橙（ChatUI 品牌主色） */
            --primary: #FF6200;
            --primary-light: #FFA040;
            --primary-bg: #FFF4E6;
            /* 次要琥珀色（原 accent 珍珠白改为暖色调，与新主色协调） */
            --accent: #FFE8CC;
            --accent-light: #FFF4E6;
            --success: #22C55E;
            --warning: #F59E0B;
            --danger: #EF4444;
            --info: #8C9AB5;
            /* 文字：夜青黑 + 暖灰蓝（ChatUI 语义色梯度） */
            --text-primary: #11192D;
            --text-regular: #4A5675;
            --text-secondary: #8C9AB5;
            /* 线条/填充：雾灰蓝系 */
            --border-base: #E2E8F0;
            --border-light: #ECF0F4;
            --bg-page: #F3F6F8;
            --bg-card: #ffffff;
            /* 阴影：夜青黑中性阴影 */
            --shadow-card: 0 2px 12px rgba(17, 25, 45, 0.06);
            /* 圆角梯度遵循 ChatUI 规范：12px 卡片/面板 · 8px 标签/气泡 · 9999px 胶囊 · 0px 背景层 */
            --radius: 12px;
            --radius-sm: 8px;
            --radius-btn: 9999px;
        }
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        body {
            /* 字体遵循 ChatUI 规范：优先系统原生字体（中文 PingFang SC / 思源黑体） */
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
            background: var(--bg-page);
            height: 100vh;
            display: flex;
            flex-direction: column;
            color: var(--text-primary);
            overflow: hidden;
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
        }

        /* ===== 顶部导航（与语音合成页面 tts.html 风格统一） ===== */
        .container {
            /* 内边距遵循 ChatUI 4px 基础单位 */
            max-width: min(98%, 1920px);
            margin: 0 auto;
            padding: 0 24px;
        }
        .navbar {
            flex-shrink: 0;
            background: rgba(255, 255, 255, 0.85);
            backdrop-filter: blur(12px);
            -webkit-backdrop-filter: blur(12px);
            border-bottom: 1px solid rgba(255, 98, 0, 0.06);
        }
        .navbar .container {
            max-width: 100%;
            display: flex;
            align-items: center;
            justify-content: space-between;
            height: 68px;
        }
        .nav-logo {
            display: flex;
            align-items: center;
            gap: 10px;
            text-decoration: none;
        }
        .nav-logo .logo-group {
            display: flex;
            flex-direction: column;
            align-items: flex-start;
            gap: 0px;
        }
        .nav-logo .logo-main {
            display: flex;
            align-items: center;
            gap: 10px;
        }
        .nav-logo .logo-icon {
            width: 36px;
            height: 36px;
            background: linear-gradient(135deg, #FF6200, #FFA040);
            border-radius: var(--radius);
            display: flex;
            align-items: center;
            justify-content: center;
            color: #fff;
            font-size: 18px;
            font-weight: 700;
            flex-shrink: 0;
        }
        .nav-logo .brand-name {
            font-weight: 800;
            font-size: 22px;
            color: #11192D;
            letter-spacing: -0.5px;
            white-space: nowrap;
        }
        .nav-logo .brand-name .highlight {
            color: #FF6200;
        }
        .nav-logo .brand-sub {
            font-size: 11px;
            font-weight: 500;
            color: #94A3B8;
            letter-spacing: 0.3px;
            margin-left: 46px;
            padding-top: 1px;
            white-space: nowrap;
        }
        .nav-actions {
            display: flex;
            align-items: center;
            gap: 12px;
        }
        .nav-link {
            font-family: inherit;
            font-size: 14px;
            font-weight: 500;
            color: #4A5675;
            text-decoration: none;
            padding: 8px 16px;
            border: none;
            background: transparent;
            border-radius: var(--radius-btn);
            cursor: pointer;
            transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        }
        .nav-link:hover {
            color: #FF6200;
            background: rgba(255, 98, 0, 0.06);
        }
        .nav-actions .btn-nav-coming {
            position: relative;
            text-decoration: none;
            font-size: 13px;
            font-weight: 500;
            color: #FF6200;
            padding: 7px 14px;
            border: 1px dashed rgba(255, 98, 0, 0.35);
            border-radius: var(--radius-btn);
            background: rgba(255, 98, 0, 0.04);
            cursor: pointer;
            transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            white-space: nowrap;
        }
        .nav-actions .btn-nav-coming:hover {
            background: rgba(255, 98, 0, 0.10);
            border-color: #FF6200;
        }
        .nav-actions .btn-nav-coming.btn-highlight {
            color: #fff;
            background: linear-gradient(135deg, #FF6200, #FFA040);
            border: 1px solid transparent;
            box-shadow: 0 4px 16px rgba(255, 98, 0, 0.30);
        }
        .nav-actions .btn-nav-coming.btn-highlight:hover {
            transform: translateY(-1px);
            box-shadow: 0 6px 20px rgba(255, 98, 0, 0.40);
            background: linear-gradient(135deg, #FF6200, #FFA040);
        }

        /* ===== 功能操作按钮（导入文本 / 提交合成） ===== */
        /* 导入文本：淡绿色（次要操作） */
        .nav-actions .btn-action {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            font-size: 13px;
            font-weight: 600;
            color: #15803D;
            padding: 8px 16px;
            border: 1px solid #BBF7D0;
            border-radius: var(--radius-btn);
            background: #DCFCE7;
            cursor: pointer;
            transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            white-space: nowrap;
            text-decoration: none;
            box-sizing: border-box;
        }
        .nav-actions .btn-action:hover {
            background: #BBF7D0;
            color: #166534;
            border-color: #86EFAC;
        }
        /* 提交合成：绿色渐变实心高亮（主操作） */
        .nav-actions .btn-action.btn-highlight {
            color: #FFFFFF;
            background: linear-gradient(135deg, #22C55E, #4ADE80);
            border: 1px solid transparent;
            box-shadow: 0 4px 16px rgba(34, 197, 94, 0.30);
        }
        .nav-actions .btn-action.btn-highlight:hover {
            transform: translateY(-1px);
            box-shadow: 0 6px 20px rgba(34, 197, 94, 0.40);
            background: linear-gradient(135deg, #16A34A, #22C55E);
            color: #FFFFFF;
            border-color: transparent;
        }

        /* ===== 分组分隔符（功能按钮 | 导航按钮） ===== */
        .nav-actions .nav-divider {
            width: 1px;
            height: 22px;
            background: rgba(255, 98, 0, 0.18);
            margin: 0 6px;
            display: inline-block;
            align-self: center;
            flex-shrink: 0;
        }

        /* ===== 左右布局主体 ===== */
        .app-body {
            flex: 1;
            display: flex;
            overflow: hidden;
        }
        .editor-area {
            flex: 1;
            display: flex;
            flex-direction: column;
            overflow: hidden;
            min-width: 0;
        }

        /* ===== 全局设置面板 (右侧侧栏) ===== */
        .global-settings {
            width: 340px;
            flex-shrink: 0;
            background: #fff;
            border-left: 1px solid var(--border-light);
            padding: 16px 18px;
            overflow-y: auto;
            display: flex;
            flex-direction: column;
            gap: 4px;
        }
        .global-settings .settings-header {
            font-size: 14px;
            font-weight: 600;
            color: var(--text-primary);
            padding-bottom: 10px;
            margin-bottom: 4px;
            border-bottom: 1px solid var(--border-light);
            flex-shrink: 0;
        }
        .global-settings .group-divider {
            height: 1px;
            background: var(--border-light);
            margin: 12px 0;
        }
        .global-settings .group {
            display: flex;
            flex-direction: column;
            gap: 8px;
            font-size: 13px;
        }
        .global-settings .group .label {
            font-size: 12px;
            font-weight: 600;
            color: var(--text-secondary);
            margin-bottom: 2px;
        }
        .global-settings .group .ctrl-row {
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .global-settings .group .ctrl-row .switch-hint {
            font-size: 11px;
            color: var(--text-secondary);
            line-height: 18px;
            display: inline-flex;
            align-items: center;
        }
        .global-settings .group .ctrl-label {
            font-size: 12px;
            color: var(--text-secondary);
            min-width: 32px;
            flex-shrink: 0;
        }
        .global-settings .group select,
        .global-settings .group input[type="number"] {
            padding: 2px 6px;
            border: 1px solid var(--border-base);
            border-radius: var(--radius-sm);
            font-size: 12px;
            background: #fff;
            height: 28px;
        }

        /* ===== 自定义音色下拉组件（enhanceSelectToCustom 生成） ===== */
        .voice-select {
            position: relative;
            display: inline-block;
            width: 100%;
        }
        /* 在 ctrl-row 中跟随原 select 的 flex:1 行为撑满剩余空间 */
        .global-settings .ctrl-row .voice-select {
            flex: 1;
            min-width: 0;
        }
        .voice-select .vs-trigger {
            display: flex;
            align-items: center;
            gap: 6px;
            width: 100%;
            padding: 2px 6px;
            border: 1px solid var(--border-base);
            border-radius: var(--radius-sm);
            font-size: 12px;
            background: #fff;
            height: 28px;
            cursor: pointer;
            text-align: left;
            transition: border-color 0.15s ease, box-shadow 0.15s ease;
        }
        .voice-select .vs-trigger:hover {
            border-color: var(--primary);
        }
        .voice-select.open .vs-trigger {
            border-color: var(--primary);
            box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.15);
        }
        .voice-select .vs-value {
            flex: 1;
            min-width: 0;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            color: var(--text-primary);
        }
        .voice-select .vs-arrow {
            flex-shrink: 0;
            color: var(--text-secondary);
            transition: transform 0.15s ease;
        }
        .voice-select.open .vs-arrow {
            transform: rotate(180deg);
        }
        .voice-select .vs-options {
            display: none;
            position: absolute;
            top: calc(100% + 2px);
            left: 0;
            right: 0;
            max-height: 220px;
            overflow-y: auto;
            background: #fff;
            border: 1px solid var(--border-base);
            border-radius: var(--radius-sm);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
            z-index: 100;
            padding: 4px 0;
        }
        .voice-select.open .vs-options {
            display: block;
        }
        .voice-select .vs-option {
            display: flex;
            align-items: center;
            gap: 6px;
            padding: 6px 10px;
            font-size: 12px;
            cursor: pointer;
            color: var(--text-regular);
            transition: background 0.12s ease;
        }
        .voice-select .vs-option:hover {
            background: var(--primary-bg);
        }
        .voice-select .vs-option.selected {
            background: var(--primary-bg);
            color: var(--primary);
            font-weight: 600;
        }
        .voice-select .vs-option-name {
            flex: 1;
            min-width: 0;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        /* SSML 绿色徽章（trigger 与 option 共用） */
        .ssml-badge {
            display: none;
            font-size: 10px;
            font-weight: 600;
            color: var(--success);
            border: 1px solid var(--success);
            border-radius: 3px;
            padding: 0 4px;
            line-height: 16px;
            flex-shrink: 0;
        }
        .ssml-badge.show {
            display: inline-block;
        }
        .global-settings .group input[type="range"] {
            flex: 1;
            min-width: 0;
            height: 6px;
            -webkit-appearance: none;
            appearance: none;
            background: linear-gradient(to right, var(--primary) 0%, var(--primary) var(--range-progress, 50%), #E2E8F0 var(--range-progress, 50%), #E2E8F0 100%);
            border-radius: 3px;
            outline: none;
            cursor: pointer;
        }
        .global-settings .group input[type="range"]::-webkit-slider-thumb {
            -webkit-appearance: none;
            appearance: none;
            width: 16px;
            height: 16px;
            border-radius: 50%;
            background: #fff;
            border: 2px solid var(--primary);
            box-shadow: 0 1px 4px rgba(64, 158, 255, 0.4);
            cursor: pointer;
            transition: transform 0.15s ease, box-shadow 0.15s ease;
        }
        .global-settings .group input[type="range"]::-webkit-slider-thumb:hover {
            transform: scale(1.15);
            box-shadow: 0 2px 8px rgba(64, 158, 255, 0.5);
        }
        .global-settings .group input[type="range"]::-moz-range-thumb {
            width: 16px;
            height: 16px;
            border-radius: 50%;
            background: #fff;
            border: 2px solid var(--primary);
            box-shadow: 0 1px 4px rgba(64, 158, 255, 0.4);
            cursor: pointer;
        }
        .global-settings .group input[type="range"]::-moz-range-track {
            height: 6px;
            background: #E2E8F0;
            border-radius: 3px;
        }
        .global-settings .group input[type="range"]::-moz-range-progress {
            height: 6px;
            background: var(--primary);
            border-radius: 3px;
        }
        .global-settings .group .range-val {
            min-width: 32px;
            font-weight: 600;
            font-size: 12px;
            text-align: right;
            color: var(--primary);
        }
        .global-settings .group .el-switch {
            display: inline-flex;
            align-items: center;
            cursor: pointer;
            gap: 4px;
        }
        .global-settings .group .el-switch .core {
            width: 32px;
            height: 18px;
            border-radius: var(--radius-btn);
            background: #c0ccda;
            border: 1px solid #c0ccda;
            position: relative;
            transition: 0.2s;
        }
        .global-settings .group .el-switch .core::after {
            content: '';
            position: absolute;
            top: 1px;
            left: 1px;
            width: 14px;
            height: 14px;
            background: #fff;
            border-radius: 50%;
            transition: 0.2s;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
        }
        .global-settings .group .el-switch.is-checked .core {
            background: var(--primary);
            border-color: var(--primary);
        }
        .global-settings .group .el-switch.is-checked .core::after {
            transform: translateX(14px);
        }
        .global-settings .group .el-switch .label-text {
            font-size: 12px;
            color: var(--text-secondary);
        }
        .global-settings .btn-apply {
            padding: 4px 14px;
            border-radius: var(--radius-sm);
            border: none;
            background: var(--primary);
            color: #fff;
            font-size: 12px;
            font-weight: 500;
            cursor: pointer;
            transition: background 0.15s;
            height: 28px;
        }
        .global-settings .btn-apply:hover {
            background: var(--primary-light);
        }
        .global-settings .btn-apply.secondary {
            background: var(--primary);
        }
        .global-settings .btn-apply.secondary:hover {
            background: var(--primary-light);
        }
        /* ===== 前奏音乐设置 ===== */
        .global-settings .music-group {
            background: linear-gradient(135deg, #fafbff 0%, #f5f7ff 100%);
            border: 1px solid #e8ecf7;
            border-radius: var(--radius-sm);
            padding: 12px;
            gap: 10px;
        }
        .global-settings .preset-music {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 6px;
        }
        .global-settings .preset-music .item {
            padding: 6px 8px;
            border: 1px solid var(--border-light);
            border-radius: var(--radius-sm);
            font-size: 12px;
            cursor: pointer;
            background: #fff;
            text-align: center;
            transition: all 0.18s ease;
            user-select: none;
        }
        .global-settings .preset-music .item:hover {
            border-color: var(--primary);
            background: var(--primary-bg);
            transform: translateY(-1px);
            box-shadow: 0 2px 6px rgba(64, 158, 255, 0.12);
        }
        .global-settings .preset-music .item.active {
            border-color: var(--primary);
            background: var(--primary);
            color: #fff;
            font-weight: 500;
            box-shadow: 0 2px 6px rgba(255, 98, 0, 0.3);
        }
        .global-settings .music-upload-row {
            display: flex;
            justify-content: flex-end;
        }
        .global-settings .custom-upload {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            width: 100%;
            font-size: 12px;
            color: var(--primary);
            cursor: pointer;
            padding: 6px 12px;
            border: 1px dashed var(--primary);
            border-radius: var(--radius-sm);
            background: #fff;
            transition: all 0.18s ease;
        }
        .global-settings .custom-upload:hover {
            background: var(--primary-bg);
            border-style: solid;
        }
        .global-settings .custom-upload .upload-icon {
            flex-shrink: 0;
        }
        .global-settings .music-current {
            display: flex;
            align-items: center;
            gap: 6px;
            padding: 6px 8px;
            background: #fff;
            border-radius: var(--radius-sm);
            border: 1px solid var(--border-light);
            font-size: 12px;
        }
        .global-settings .music-current-label {
            color: var(--text-secondary);
            flex-shrink: 0;
        }
        .global-settings .music-current-name {
            color: var(--text-primary);
            font-weight: 500;
            flex: 1;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        /* ===== 主内容区 (滚动) ===== */
        .main-content {
            flex: 1;
            overflow-y: auto;
            padding: 16px 24px 32px;
            background: var(--bg-page);
        }
        .flow-container {
            /* 用百分比自适应各种屏幕宽度，配合 max-width 防止超大屏过度拉伸 */
            width: 100%;
            max-width: 92%;
            margin: 0 auto;
            display: flex;
            flex-direction: column;
            gap: 16px;
            min-height: calc(100vh - 200px);
        }
        .flow-container:has(.empty-state) {
            justify-content: center;
        }
        /* 小屏减少内边距与最大宽度限制，避免内容拥挤 */
        @media (max-width: 820px) {
            .flow-container { max-width: 100%; }
            .main-content { padding: 12px 12px 24px; }
        }
        /* 超大屏（2K+）稍微放宽，避免内容左右留白过多 */
        @media (min-width: 2400px) {
            .flow-container { max-width: 2000px; }
            .main-content { padding: 20px 40px 40px; }
        }

        /* ===== 卡片 ===== */
        .card {
            background: var(--bg-card);
            border-radius: var(--radius);
            box-shadow: var(--shadow-card);
            border-left: 4px solid var(--border-light);
            overflow: hidden;
            transition: box-shadow 0.2s;
        }
        .card:hover {
            box-shadow: 0 4px 14px rgba(0, 0, 0, 0.07);
        }
        .card-header {
            padding: 12px 18px 8px 18px;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        .card-header .title {
            font-weight: 600;
            font-size: 15px;
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .card-header .title .badge {
            font-size: 11px;
            font-weight: 400;
            background: var(--bg-page);
            padding: 0 10px;
            border-radius: 12px;
            color: var(--text-secondary);
        }
        .card-body {
            padding: 0 18px 16px 18px;
        }
        .card-body textarea {
            width: 100%;
            border: 1px solid var(--border-light);
            border-radius: var(--radius-sm);
            padding: 8px 10px;
            font-family: inherit;
            font-size: 14px;
            resize: vertical;
            background: #fafbfc;
            transition: border-color 0.2s;
            box-sizing: border-box;
            display: block;
        }
        /* Text 10 的文本输入框与容器同宽（抵消 card-body 的内边距，无边框） */
        .card.type-text .card-body textarea.editable-textarea {
            width: calc(100% + 36px);
            margin-left: -18px;
            margin-right: -18px;
            border: none;
            border-radius: 0;
        }
        .card-body textarea:focus {
            outline: none;
            border-color: var(--primary);
            background: #fff;
            box-shadow: 0 0 0 3px rgba(64, 158, 255, 0.08);
        }

        /* 卡片类型颜色 */
        .card.type-preamble {
            border-left-color: #E6A23C;
        }

        /* ===== 卷首语背景音乐栏 ===== */
        .preamble-music-bar {
            display: flex;
            align-items: center;
            flex-wrap: wrap;
            gap: 8px;
            margin-top: 8px;
            padding: 6px 10px;
            background: rgba(230, 162, 60, 0.08);
            border-radius: var(--radius-sm);
            font-size: 12px;
            color: var(--text-secondary);
        }
        .preamble-music-bar .pm-label {
            font-weight: 500;
        }
        .preamble-music-bar .pm-play {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            padding: 4px 10px;
            background: var(--primary);
            color: #fff;
            border: none;
            border-radius: var(--radius-sm);
            cursor: pointer;
            font-size: 12px;
            transition: all 0.2s;
            user-select: none;
        }
        .preamble-music-bar .pm-play:hover {
            background: #FFA040;
        }
        .preamble-music-bar .pm-upload,
        .preamble-music-bar .pm-remove {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            padding: 4px 10px;
            background: transparent;
            border: 1px dashed var(--border-color);
            border-radius: var(--radius-sm);
            cursor: pointer;
            font-size: 12px;
            transition: all 0.2s;
            user-select: none;
        }
        .preamble-music-bar .pm-upload {
            margin-left: auto;
        }
        .preamble-music-bar .pm-upload:hover {
            border-color: var(--primary);
            color: var(--primary);
        }
        .preamble-music-bar .pm-remove {
            color: #EF4444;
            border-color: #EF4444;
        }
        .preamble-music-bar .pm-remove:hover {
            background: rgba(245, 108, 108, 0.1);
        }
        .preamble-music-bar .pm-hint {
            flex-basis: 100%;
            width: 100%;
            margin-top: 4px;
            padding-top: 6px;
            border-top: 1px dashed rgba(230, 162, 60, 0.3);
            font-size: 11px;
            line-height: 1.5;
            color: #8C9AB5;
        }

        /* ===== 卷首语背景音乐音量栏 ===== */
        .preamble-volume-bar {
            display: flex;
            align-items: center;
            gap: 8px;
            margin-top: 4px;
            padding: 4px 10px 6px;
            background: rgba(230, 162, 60, 0.04);
            border-radius: var(--radius-sm);
            font-size: 12px;
            color: var(--text-secondary);
        }
        .preamble-volume-bar .pv-label {
            font-weight: 500;
            white-space: nowrap;
        }
        .preamble-volume-bar .pv-range {
            flex: 1;
            height: 4px;
            -webkit-appearance: none;
            appearance: none;
            background: linear-gradient(to right,
                var(--primary) 0%,
                var(--primary) var(--range-progress, 30%),
                #e4e7ed var(--range-progress, 30%),
                #e4e7ed 100%);
            border-radius: 2px;
            outline: none;
            cursor: pointer;
        }
        .preamble-volume-bar .pv-range::-webkit-slider-thumb {
            -webkit-appearance: none;
            appearance: none;
            width: 14px;
            height: 14px;
            background: #fff;
            border: 2px solid var(--primary);
            border-radius: 50%;
            cursor: pointer;
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        }
        .preamble-volume-bar .pv-range::-moz-range-thumb {
            width: 14px;
            height: 14px;
            background: #fff;
            border: 2px solid var(--primary);
            border-radius: 50%;
            cursor: pointer;
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        }
        .preamble-volume-bar .pv-value {
            min-width: 28px;
            text-align: right;
            color: var(--primary);
            font-weight: 600;
        }
        .card.type-guide {
            border-left-color: #8C9AB5;
        }
        .card.type-ending {
            border-left-color: #8C9AB5;
        }
        .card.type-prompt {
            border-left-color: var(--primary);
        }
        .card.type-text {
            border-left-color: #67C23A;
        }

        /* ===== Text 卡片独立配置栏 ===== */
        .text-config-bar {
            background: #f7f9fc;
            padding: 8px 18px;
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            gap: 8px 16px;
            border-bottom: 1px solid var(--border-light);
            font-size: 13px;
        }
        .text-config-bar .label {
            color: var(--text-secondary);
            font-weight: 500;
        }
        .text-config-bar input[type="number"] {
            width: 48px;
            padding: 2px 4px;
            border: 1px solid var(--border-base);
            border-radius: var(--radius-sm);
            font-size: 13px;
            text-align: center;
        }
        .text-config-bar .readonly-text {
            color: var(--text-secondary);
            font-size: 13px;
        }
        .text-config-bar .readonly-text strong {
            color: var(--text-primary);
            font-weight: 600;
        }
        .text-config-bar .unit {
            color: var(--text-secondary);
            font-size: 12px;
            margin-left: -4px;
        }
        .text-config-bar .play-count {
            margin-left: auto;
            font-size: 12px;
            color: var(--text-secondary);
        }
        .text-config-bar .play-count strong {
            color: var(--danger);
            font-weight: 600;
            font-size: 14px;
        }

        /* ===== 气泡对话区域 ===== */
        .bubble-flow {
            padding: 12px 0 4px 0;
            display: flex;
            flex-direction: column;
            gap: 6px;
        }
        .bubble-row {
            display: flex;
            align-items: flex-start;
            gap: 10px;
            padding: 2px 0;
        }
        .bubble-row.female {
            flex-direction: row-reverse;
        }
        .bubble-row .avatar {
            flex-shrink: 0;
            width: 32px;
            height: 32px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 14px;
            font-weight: 600;
            color: #fff;
            margin-top: 2px;
            user-select: none;
        }
        .bubble-row.male .avatar {
            background: var(--primary);
        }
        .bubble-row.female .avatar {
            background: var(--danger);
        }
        .bubble-row .bubble {
            min-width: 85%;
            max-width: 85%;
            padding: 8px 12px;
            border: 1px solid transparent;
            /* 气泡遵循 ChatUI 圆角规范：8px */
            border-radius: var(--radius-sm);
            font-size: 14px;
            line-height: 1.6;
            background: #ECF0F4;
            color: var(--text-primary);
            position: relative;
            min-height: 40px;
            transition: background 0.15s, border-color 0.15s;
        }
        .bubble-row.male .bubble {
            background: #FFF4E6;
        }
        /* 男声尖角 - 边框层 (::before) */
        .bubble-row.male .bubble::before {
            content: '';
            position: absolute;
            left: -12px;
            top: 10px;
            width: 0;
            height: 0;
            border-top: 8px solid transparent;
            border-bottom: 8px solid transparent;
            border-right: 12px solid transparent;
        }
        /* 男声尖角 - 填充层 (::after) */
        .bubble-row.male .bubble::after {
            content: '';
            position: absolute;
            left: -10px;
            top: 11px;
            width: 0;
            height: 0;
            border-top: 7px solid transparent;
            border-bottom: 7px solid transparent;
            border-right: 11px solid #FFF4E6;
        }
        .bubble-row.female .bubble {
            background: #FEE2E2;
        }
        /* 女声尖角 - 边框层 (::before) */
        .bubble-row.female .bubble::before {
            content: '';
            position: absolute;
            right: -12px;
            top: 10px;
            width: 0;
            height: 0;
            border-top: 8px solid transparent;
            border-bottom: 8px solid transparent;
            border-left: 12px solid transparent;
        }
        /* 女声尖角 - 填充层 (::after) */
        .bubble-row.female .bubble::after {
            content: '';
            position: absolute;
            right: -10px;
            top: 11px;
            width: 0;
            height: 0;
            border-top: 7px solid transparent;
            border-bottom: 7px solid transparent;
            border-left: 11px solid #FEE2E2;
        }
        .bubble-row .bubble textarea {
            width: 100%;
            border: none;
            background: transparent;
            resize: none;
            overflow: hidden;
            font-family: inherit;
            font-size: 15px;
            line-height: 1.6;
            font-family: 'Times New Roman', Times, serif;
            padding: 0;
            outline: none;
            min-height: 28px;
            color: var(--text-primary);
        }
        .bubble-row .bubble textarea:focus {
            outline: none;
            border: none;
            box-shadow: none;
        }
        /* 文本框聚焦时高亮所在气泡边框 */
        .bubble-row.male .bubble:has(textarea:focus),
        .bubble-row.male .bubble.focused {
            border: 1px solid var(--primary);
            background: #FFE8CC;
        }
        .bubble-row.female .bubble:has(textarea:focus),
        .bubble-row.female .bubble.focused {
            border: 1px solid var(--danger);
            background: #FECACA;
        }
        /* 聚焦时同步尖角边框与填充颜色 */
        .bubble-row.male .bubble:has(textarea:focus)::before,
        .bubble-row.male .bubble.focused::before {
            border-right-color: var(--primary);
        }
        .bubble-row.male .bubble:has(textarea:focus)::after,
        .bubble-row.male .bubble.focused::after {
            border-right-color: #FFE8CC;
        }
        .bubble-row.female .bubble:has(textarea:focus)::before,
        .bubble-row.female .bubble.focused::before {
            border-left-color: var(--danger);
        }
        .bubble-row.female .bubble:has(textarea:focus)::after,
        .bubble-row.female .bubble.focused::after {
            border-left-color: #FECACA;
        }
        .bubble-row .bubble .index-tag {
            font-size: 10px;
            color: var(--text-secondary);
            opacity: 0.6;
            margin-right: 6px;
        }
        .bubble-row .bubble:hover {
            background: #fff;
            box-shadow: 0 0 0 1px var(--border-light);
        }
        .bubble-row.male .bubble:hover {
            background: #FFE8CC;
        }
        .bubble-row.female .bubble:hover {
            background: #FECACA;
        }

        /* ===== 空状态 ===== */
        .empty-state {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            text-align: center;
            padding: 40px 20px;
            margin: 60px auto;
            max-width: 360px;
            color: var(--text-secondary);
            cursor: pointer;
            border-radius: var(--radius-sm);
            transition: background 0.2s;
        }
        .empty-state:hover {
            background: var(--bg-page);
        }
        .empty-state .big-icon {
            font-size: 64px;
            margin-bottom: 20px;
            opacity: 0.6;
            line-height: 1;
        }
        .empty-state .empty-title {
            font-size: 17px;
            font-weight: 500;
            color: var(--text-primary);
            margin: 0 0 8px;
        }
        .empty-state .empty-hint {
            font-size: 13px;
            margin: 0;
        }

        /* ===== 模态框 ===== */
        .modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.45);
            display: none;
            justify-content: center;
            align-items: center;
            z-index: 200;
        }
        .modal-overlay.open {
            display: flex;
        }
        .modal {
            background: #fff;
            border-radius: var(--radius);
            width: 75vw;
            max-width: 900px;
            height: 80vh;
            max-height: 90vh;
            display: flex;
            flex-direction: column;
            box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
        }
        .modal-header {
            padding: 14px 24px;
            border-bottom: 1px solid var(--border-light);
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        .modal-header h2 {
            font-size: 18px;
        }
        .modal-header .close-btn {
            background: none;
            border: none;
            font-size: 24px;
            cursor: pointer;
            color: var(--text-secondary);
        }
        .modal-body {
            flex: 1;
            padding: 16px 24px;
            overflow-y: auto;
            display: flex;
            flex-direction: column;
        }
        /* 导入向导步骤容器 */
        .modal-body > div[id^="step"] {
            display: flex;
            flex-direction: column;
            flex: 1;
            min-height: 0;
        }
        .modal-body > div[id^="step"].hidden {
            display: none;
        }
        .modal-footer {
            padding: 12px 24px;
            border-top: 1px solid var(--border-light);
            display: flex;
            justify-content: flex-end;
            gap: 10px;
        }
        .modal-footer button {
            padding: 8px 20px;
            border-radius: var(--radius-sm);
            border: none;
            font-weight: 500;
            cursor: pointer;
        }
        .modal-footer .btn-secondary {
            background: var(--bg-page);
            color: var(--text-primary);
        }
        .modal-footer .btn-primary {
            background: var(--primary);
            color: #fff;
        }
        .modal-footer .btn-success {
            background: var(--success);
            color: #fff;
        }
        .hidden {
            display: none !important;
        }

        .step-indicator {
            display: flex;
            gap: 16px;
            margin-bottom: 14px;
            font-size: 13px;
            color: var(--text-secondary);
        }
        .step-indicator .step {
            display: flex;
            align-items: center;
            gap: 6px;
        }
        .step-indicator .step .num {
            width: 24px;
            height: 24px;
            border-radius: 50%;
            background: var(--border-light);
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 600;
            font-size: 12px;
        }
        .step-indicator .step.active .num {
            background: var(--primary);
            color: #fff;
        }
        .step-indicator .step.done .num {
            background: var(--success);
            color: #fff;
        }
        /* step-indicator 行右侧的「模板管理」入口：红色系（--danger: #EF4444） */
        .step-indicator .step-tpl-entry {
            margin-left: auto;
            display: inline-flex;
            align-items: center;
            gap: 4px;
            padding: 5px 12px;
            font-size: 12px;
            color: #fff;
            font-weight: 500;
            text-decoration: none;
            cursor: pointer;
            background: #EF4444;
            border: 1px solid transparent;
            border-radius: var(--radius-btn);
            line-height: 1;
            box-shadow: 0 4px 12px rgba(245, 108, 108, 0.30);
            transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
        }
        .step-indicator .step-tpl-entry:hover {
            color: #fff;
            background: #E64D4D;
            box-shadow: 0 6px 16px rgba(245, 108, 108, 0.45);
            transform: translateY(-1px);
        }
        .step-indicator .step-tpl-entry:active {
            transform: translateY(0);
            box-shadow: 0 2px 6px rgba(245, 108, 108, 0.30);
        }
        .preview-table {
            width: 100%;
            border-collapse: collapse;
            font-size: 13px;
        }
        .preview-table th {
            text-align: left;
            padding: 6px 10px;
            background: var(--bg-page);
            border-bottom: 2px solid var(--border-light);
        }
        .preview-table td {
            padding: 6px 10px;
            border-bottom: 1px solid #f0f0f0;
        }
        .preview-table td.col-type {
            white-space: nowrap;
            text-align: center;
        }
        .preview-table .tag {
            background: var(--primary-bg);
            color: var(--primary);
            padding: 2px 8px;
            border-radius: var(--radius-btn);
            font-size: 11px;
        }
        .validation-error {
            background: #FEF2F2;
            border: 1px solid #FECACA;
            border-radius: var(--radius-sm);
            padding: 8px 14px;
            margin-top: 10px;
            display: none;
            align-items: center;
            gap: 8px;
        }
        .validation-error.show {
            display: flex;
        }
        .validation-error .error-dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: #EF4444;
            flex-shrink: 0;
        }
        .validation-error .error-text {
            font-size: 14px;
            color: #EF4444;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        /* ===== 导入弹窗：简洁人性化样式 ===== */
        .import-tips {
            display: flex;
            align-items: flex-start;
            gap: 8px;
            background: var(--primary-bg);
            border-radius: var(--radius-sm);
            padding: 10px 14px;
            margin-bottom: 10px;
            font-size: 13px;
            color: var(--text-regular);
            line-height: 1.6;
        }
        .import-tips .tips-icon { flex-shrink: 0; font-size: 14px; }
        .import-tips .tips-text strong { color: var(--primary); font-weight: 600; }

        .format-rules {
            display: flex;
            flex-direction: column;
            gap: 4px;
            background: var(--bg-page);
            border: 1px solid var(--border-light);
            border-radius: var(--radius-sm);
            padding: 6px 10px;
            flex: 1;
        }
        .format-rules .rule-group {
            display: flex;
            align-items: flex-start;
            gap: 10px;
            font-size: 12px;
            line-height: 1.6;
        }
        .format-rules .rule-title {
            flex-shrink: 0;
            width: 90px;
            color: var(--text-secondary);
            font-weight: 600;
        }
        .format-rules .rule-items {
            display: flex;
            flex-wrap: wrap;
            gap: 6px;
            flex: 1;
        }
        .format-rules .rule-tag {
            display: inline-block;
            padding: 2px 8px;
            border-radius: var(--radius-btn);
            background: var(--primary-bg);
            color: var(--primary);
            font-size: 11px;
            white-space: nowrap;
        }
        .format-rules .rule-tag.required {
            background: #fef0f0;
            color: #EF4444;
            border: 1px solid #FEE2E2;
            font-weight: 600;
        }

        .import-header {
            display: flex;
            gap: 10px;
            margin-bottom: 10px;
        }
        .import-header-left {
            flex: 1;
            display: flex;
            flex-direction: column;
            min-width: 0;
        }

        .upload-zone {
            border: 2px dashed var(--border-light);
            border-radius: var(--radius-sm);
            padding: 8px;
            text-align: center;
            color: var(--text-secondary);
            cursor: pointer;
            transition: all 0.2s;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 4px;
            width: 120px;
            flex-shrink: 0;
        }
        .upload-zone:hover,
        .upload-zone.dragover {
            border-color: var(--primary);
            background: var(--primary-bg);
            color: var(--primary);
        }
        .upload-zone .upload-icon { font-size: 22px; line-height: 1; }
        .upload-zone .upload-text { font-size: 12px; }

        .textarea-wrap {
            flex: 1;
            display: flex;
            flex-direction: column;
            min-height: 280px;
        }
        .modal-body textarea#textInput {
            flex: 1;
            width: 100%;
            min-height: 320px;
            border: 1px solid var(--border-light);
            border-radius: var(--radius-sm);
            padding: 12px 14px;
            font-size: 13px;
            line-height: 1.6;
            resize: none;
            outline: none;
            transition: border-color 0.15s;
            font-family: inherit;
        }
        .modal-body textarea#textInput:focus {
            border-color: var(--primary);
        }
        .modal-body textarea#textInput::placeholder {
            color: #c0c4cc;
            opacity: 0.7;
        }
        .textarea-toolbar {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0 4px 8px;
            gap: 12px;
        }
        .example-btns {
            display: flex;
            gap: 24px;
            flex-wrap: wrap;
        }
        .example-btn {
            font-size: 12px;
            color: var(--primary);
            font-weight: 500;
            text-decoration: none;
            cursor: pointer;
            transition: color 0.15s, opacity 0.15s;
            white-space: nowrap;
        }
        .example-btn:hover { opacity: 0.75; }
        .link-btn {
            font-size: 12px;
            color: var(--text-secondary);
            text-decoration: none;
            cursor: pointer;
            transition: color 0.15s;
            white-space: nowrap;
        }
        .link-btn:hover { color: var(--primary); }

      /* ===== 合成进度弹窗 ===== */
       .synth-modal {
           width: 400px;
           background: #fff;
           border-radius: var(--radius);
           box-shadow: 0 24px 80px rgba(0,0,0,0.18), 0 0 0 1px rgba(0,0,0,0.04);
           overflow: hidden;
       }
        .synth-header {
            padding: 22px 28px 16px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            position: relative;
        }
        .synth-header::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 24px;
            right: 24px;
            height: 1px;
            background: linear-gradient(90deg, transparent, #E2E8F0, transparent);
        }
        .synth-header-left {
            display: flex;
            align-items: center;
            gap: 10px;
        }
        .synth-header-icon {
            width: 36px;
            height: 36px;
            border-radius: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 18px;
        }
        .synth-header-icon.synth-icon-ready,
        .synth-header-icon.synth-icon-running { background: linear-gradient(135deg, #FFF4E6, #DBEAFE); }
        .synth-header-icon.synth-icon-success { background: linear-gradient(135deg, #ECFDF5, #D1FAE5); }
        .synth-header-icon.synth-icon-error { background: linear-gradient(135deg, #FEF2F2, #FEE2E2); }
        .synth-header-title { font-size: 16px; font-weight: 700; color: #11192D; }
        .synth-close-btn {
            width: 30px; height: 30px; border-radius: 8px; border: none;
            background: #F1F5F9; color: #94A3B8; font-size: 14px; cursor: pointer;
            display: flex; align-items: center; justify-content: center; transition: all 0.2s;
        }
        .synth-close-btn:hover { background: #E2E8F0; color: #4A5675; }
        .synth-body { padding: 24px 28px; }

        .synth-progress-ring-wrap { display: flex; flex-direction: column; align-items: center; margin-bottom: 20px; }
        .synth-progress-ring { position: relative; width: 120px; height: 120px; }
        .synth-progress-ring svg { transform: rotate(-90deg); }
        .synth-progress-ring .ring-bg { fill: none; stroke: #F1F5F9; stroke-width: 8; }
        .synth-progress-ring .ring-fill {
            fill: none; stroke: url(#synthProgressGrad); stroke-width: 8;
            stroke-linecap: round; stroke-dasharray: 326.7; stroke-dashoffset: 326.7;
            transition: stroke-dashoffset 0.5s ease;
        }
        .synth-progress-ring .ring-fill.ring-success { stroke: #22C55E; }
        .synth-ring-center {
            position: absolute; inset: 0;
            display: flex; flex-direction: column; align-items: center; justify-content: center;
        }
        .synth-percent { font-size: 28px; font-weight: 800; color: #11192D; line-height: 1; }
        .synth-percent-sign { font-size: 13px; font-weight: 500; color: #94A3B8; }
        .synth-elapsed { font-size: 12px; color: #94A3B8; margin-top: 2px; }

        .synth-stages { display: flex; flex-direction: column; margin-bottom: 18px; }
        .synth-stage {
            display: flex; align-items: center; gap: 12px;
            padding: 7px 0; position: relative;
        }
        .synth-stage:not(:last-child)::after {
            content: ''; position: absolute; left: 13px; top: 28px; bottom: -5px;
            width: 2px; background: #E2E8F0;
        }
        .synth-stage.done:not(:last-child)::after { background: #22C55E; }
        .synth-stage.active:not(:last-child)::after {
            background: linear-gradient(180deg, #3B82F6 50%, #E2E8F0 50%);
        }
        .synth-stage-dot {
            width: 28px; height: 28px; border-radius: 50%;
            display: flex; align-items: center; justify-content: center;
            font-size: 12px; flex-shrink: 0;
            background: #ECF0F4; border: 2px solid #E2E8F0; color: #94A3B8; transition: all 0.3s;
        }
        .synth-stage.done .synth-stage-dot { background: #22C55E; border-color: #22C55E; color: #fff; }
        .synth-stage.active .synth-stage-dot {
            background: var(--primary); border-color: var(--primary); color: #fff;
            box-shadow: 0 0 0 4px rgba(59,130,246,0.15);
            animation: synthDotPulse 1.5s infinite;
        }
        @keyframes synthDotPulse {
            0%,100% { box-shadow: 0 0 0 4px rgba(59,130,246,0.15); }
            50%     { box-shadow: 0 0 0 8px rgba(59,130,246,0.08); }
        }
        .synth-stage-text { font-size: 13px; color: #94A3B8; transition: color 0.3s; }
        .synth-stage.done .synth-stage-text { color: #16A34A; }
        .synth-stage.active .synth-stage-text { color: #11192D; font-weight: 600; }

        .synth-result {
            background: #ECF0F4; border: 1px solid #E2E8F0; border-radius: var(--radius);
            padding: 16px; margin-top: 4px; display: none;
        }
        .synth-result-label { font-size: 12px; color: #94A3B8; margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }
        .synth-result audio { width: 100%; border-radius: var(--radius-sm); margin-bottom: 8px; }
        .synth-download-link {
            display: inline-flex; align-items: center; gap: 6px;
            font-size: 13px; color: #3B82F6; text-decoration: none; font-weight: 500;
            padding: 6px 14px; background: #FFF4E6; border-radius: 8px; transition: all 0.2s;
        }
        .synth-download-link:hover { background: #DBEAFE; color: #D45A00; }

        .synth-error-box {
            display: none; align-items: center; gap: 10px;
            padding: 14px 16px; background: #FEF2F2; border: 1px solid #FECACA;
            border-radius: var(--radius-sm); margin-bottom: 14px;
        }
        .synth-error-icon { font-size: 20px; flex-shrink: 0; }
        .synth-error-text { font-size: 13px; color: #991B1B; line-height: 1.5; }

        .synth-footer { padding: 0 28px 22px; display: flex; gap: 10px; }
        .synth-btn {
            flex: 1; padding: 12px 16px; border-radius: var(--radius);
            font-size: 14px; font-weight: 600; font-family: inherit;
            cursor: pointer; border: none; transition: all 0.2s;
        }
        .synth-btn-start {
            background: linear-gradient(135deg, #FF6200, #FFA040); color: #fff;
            box-shadow: 0 4px 20px rgba(255, 98, 0, 0.30);
        }
        .synth-btn-start:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 8px 28px rgba(43,95,215,0.40); }
        .synth-btn-start:disabled { opacity: 0.65; cursor: not-allowed; transform: none; }
        .synth-btn-close { background: #F1F5F9; color: #4A5675; }
        .synth-btn-close:hover { background: #E2E8F0; }

        #synthesisModal.synth-overlay {
            position: fixed; inset: 0; z-index: 9999;
            background: rgba(15,23,42,0.50);
            backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
            display: flex; align-items: center; justify-content: center; padding: 24px;
            opacity: 0; visibility: hidden;
            transition: opacity 0.25s ease, visibility 0.25s ease;
        }
        #synthesisModal.synth-overlay.open { opacity: 1; visibility: visible; }

        /* ===== Toast ===== */
        .toast-container {
            position: fixed;
            bottom: 80px;
            right: 24px;
            z-index: 300;
            display: flex;
            flex-direction: column;
            gap: 8px;
            pointer-events: none;
        }
        .toast {
            background: #303133;
            color: #fff;
            padding: 10px 20px;
            border-radius: var(--radius-sm);
            font-size: 14px;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
            animation: toastIn 0.3s ease, toastOut 0.3s ease 2.2s forwards;
            pointer-events: auto;
        }
        .toast.success {
            background: var(--success);
        }
        .toast.warning {
            background: var(--warning);
        }
        @keyframes toastIn {
            from {
                opacity: 0;
                transform: translateX(40px);
            }
            to {
                opacity: 1;
                transform: translateX(0);
            }
        }
        @keyframes toastOut {
            from {
                opacity: 1;
                transform: translateX(0);
            }
            to {
                opacity: 0;
                transform: translateX(40px);
            }
        }

        /* ===== 状态栏 ===== */
        .statusbar {
            background: var(--bg-page);
            border-top: 1px solid var(--border-light);
            padding: 4px 24px;
            font-size: 12px;
            color: var(--text-secondary);
            display: flex;
            justify-content: space-between;
            flex-shrink: 0;
            height: 30px;
            align-items: center;
        }

        /* ===== 滚动条 ===== */
        ::-webkit-scrollbar {
            width: 5px;
            height: 5px;
        }
        ::-webkit-scrollbar-track {
            background: var(--bg-page);
        }
        ::-webkit-scrollbar-thumb {
            background: #c0c4cc;
            border-radius: 3px;
        }
        ::-webkit-scrollbar-thumb:hover {
            background: #8C9AB5;
        }

        /* ===== 响应式微调 ===== */
        @media (max-width: 820px) {
            .app-body {
                flex-direction: column;
            }
            .global-settings {
                width: 100%;
                border-left: none;
                border-top: 1px solid var(--border-light);
                max-height: 40vh;
            }
            .modal {
                width: 94vw;
                height: 94vh;
            }
            .bubble-row .bubble {
                max-width: 82%;
            }
        }

        /* ===== SSML 工具栏 ===== */
        .ssml-toolbar {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 8px 24px;
            background: #fff;
            border-bottom: 1px solid var(--border-light);
            flex-wrap: wrap;
            flex-shrink: 0;
            position: sticky;
            top: 0;
            z-index: 5;
        }
        .ssml-toolbar .toolbar-label {
            font-size: 12px;
            font-weight: 600;
            color: var(--text-secondary);
            margin-right: 4px;
        }
        .ssml-toolbar .btn-ssml {
            background: #fff;
            border: 1px solid var(--border-base);
            border-radius: var(--radius-sm);
            padding: 4px 12px;
            font-size: 12px;
            font-weight: 500;
            color: var(--text-primary);
            cursor: pointer;
            transition: all 0.15s;
            white-space: nowrap;
        }
        .ssml-toolbar .btn-ssml:hover {
            background: var(--primary-bg);
            border-color: var(--primary-light);
        }
        .ssml-toolbar .btn-ssml:active {
            background: #ECF0F4;
        }
        .ssml-toolbar .btn-ssml.primary {
            background: var(--primary);
            color: #fff;
            border-color: var(--primary);
        }
        .ssml-toolbar .btn-ssml.primary:hover {
            background: var(--primary-light);
            border-color: var(--primary-light);
        }
        .ssml-toolbar .divider {
            width: 1px;
            height: 24px;
            background: var(--border-light);
            margin: 0 4px;
        }
        .ssml-toolbar .hint {
            font-size: 11px;
            color: var(--text-secondary);
            margin-left: auto;
        }
        .ssml-toolbar .break-group {
            display: flex;
            align-items: center;
            background: #fff;
            border: 1px solid var(--border-base);
            border-radius: var(--radius-sm);
            overflow: hidden;
        }
        .ssml-toolbar .break-group .btn-ssml {
            border: none;
            border-radius: 0;
            padding: 4px 10px;
        }
        .ssml-toolbar .break-group .break-select {
            border: none;
            background: transparent;
            padding: 4px 4px 4px 0;
            font-size: 12px;
            font-weight: 500;
            color: var(--text-primary);
            cursor: pointer;
            outline: none;
            min-width: 50px;
        }

        /* ===== SSML 工具栏禁用状态（当前音色不支持 SSML） ===== */
        .ssml-toolbar.disabled {
            opacity: 0.55;
            background: #f5f7fa;
            border-bottom-color: var(--border-light);
        }
        .ssml-toolbar.disabled .btn-ssml {
            cursor: not-allowed;
            color: var(--text-secondary);
            background: #f5f7fa;
            border-color: var(--border-light);
        }
        .ssml-toolbar.disabled .btn-ssml:hover {
            background: #f5f7fa;
            color: var(--text-secondary);
            border-color: var(--border-light);
        }
        .ssml-toolbar.disabled .btn-ssml.primary {
            background: #c0c6d4;
            color: #fff;
            border-color: #c0c6d4;
        }
        .ssml-toolbar.disabled .btn-ssml.primary:hover {
            background: #c0c6d4;
            color: #fff;
            border-color: #c0c6d4;
        }
        .ssml-toolbar.disabled .break-group {
            background: #f5f7fa;
            border-color: var(--border-light);
        }
        .ssml-toolbar.disabled .break-group .btn-ssml {
            background: #f5f7fa;
            color: var(--text-secondary);
        }
        .ssml-toolbar.disabled .break-select {
            cursor: not-allowed;
            color: var(--text-secondary);
        }
        /* 工具栏右侧 hint：支持/不支持 SSML 的文案与配色 */
        .ssml-toolbar .hint.hint-ok {
            color: var(--success);
        }
        .ssml-toolbar .hint.hint-warning {
            color: #B45309;
            background: rgba(245, 158, 11, 0.08);
            padding: 2px 8px;
            border-radius: var(--radius-sm);
        }

        /* ===== 时间轴预览 ===== */
        .timeline-preview {
            margin-top: 8px;
            padding: 8px 12px;
            background: #f7f9fc;
            border-radius: var(--radius-sm);
            display: flex;
            align-items: center;
            gap: 12px;
            font-size: 12px;
            color: var(--text-primary);
            flex-wrap: wrap;
        }
        .timeline-preview .segment {
            display: flex;
            align-items: center;
            gap: 4px;
        }
        .timeline-preview .bar {
            height: 6px;
            border-radius: 3px;
            background: var(--info);
            min-width: 20px;
        }
        .timeline-preview .bar.blue {
            background: var(--primary);
        }
        .timeline-preview .bar.green {
            background: var(--success);
        }
        .timeline-preview .bar.orange {
            background: var(--warning);
        }

        /* ===== Text 信息栏 (题数/预读/作答/播放/提示音) ===== */
        .text-info-bar {
            margin-top: 6px;
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            gap: 6px 16px;
            padding: 8px 12px;
            background: #f7f9fc;
            border-radius: var(--radius-sm);
            font-size: 12px;
            color: var(--text-secondary);
        }
        .text-info-bar span {
            white-space: nowrap;
        }

        /* ===== 高亮动画 ===== */
        .bubble-row .bubble textarea.highlight,
        .card-body textarea.highlight {
            animation: highlightFlash 0.6s ease;
        }
        @keyframes highlightFlash {
            0% { background: #b3e19d; }
            50% { background: #16A34A; }
            100% { background: transparent; }
        }

        /* ===== 音乐移除按钮 ===== */
        .music-remove-btn {
            font-size: 11px;
            color: var(--danger);
            cursor: pointer;
            padding: 1px 6px;
            border-radius: var(--radius-sm);
            transition: all 0.15s ease;
            flex-shrink: 0;
        }
        .music-remove-btn:hover {
            background: #fef0f0;
        }

        /* ===== 作题说明模板管理模态框 ===== */
        .tpl-modal-overlay {
            z-index: 10000;
        }
        /* 复合选择器 .modal-box.tpl-modal-box 提升特异性，
           覆盖 modal.css 中 .modal-box 的 max-width:520px 等尺寸限制，
           使本模态框尺寸与导入文本模态框（.modal: 75vw/900px/80vh）一致 */
        .modal-box.tpl-modal-box {
            width: 75vw;
            max-width: 900px;
            min-height: 322px;
            height: 80vh;
            max-height: 90vh;
            display: flex;
            flex-direction: column;
            border-radius: var(--radius);
            overflow: hidden;
            box-shadow: 0 24px 64px rgba(15, 23, 42, 0.18), 0 4px 12px rgba(15, 23, 42, 0.08);
        }
        .tpl-modal-header {
            display: flex;
            flex-direction: column;
            gap: 6px;
            padding: 20px 28px 18px;
            border-bottom: 1px solid #E2E8F0;
            background: linear-gradient(180deg, #FAFBFD 0%, #F1F5F9 100%);
        }
        .tpl-modal-toprow {
            display: flex;
            justify-content: flex-start;
            align-items: center;
            gap: 12px;
        }
        .tpl-modal-title {
            font-size: 17px;
            font-weight: 700;
            color: #11192D;
            letter-spacing: 0.2px;
        }
        .tpl-modal-source {
            font-size: 12px;
            color: #4A5675;
            background: #fff;
            border: 1px solid #CBD5E1;
            padding: 3px 10px;
            border-radius: 12px;
            font-weight: 500;
        }
        /* 主标题下方的小副标题 */
        .tpl-modal-tip {
            font-size: 12px;
            color: #94A3B8;
            font-weight: 400;
            line-height: 1.4;
        }
        /* 右上角关闭按钮：与导入文本模态框 .close-btn 风格一致 */
        .tpl-modal-close {
            margin-left: auto;
            background: none;
            border: none;
            font-size: 20px;
            line-height: 1;
            cursor: pointer;
            color: #5A6680;
            padding: 4px 8px;
            border-radius: var(--radius-sm);
            transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
        }
        .tpl-modal-close:hover {
            background: rgba(245, 108, 108, 0.10);
            color: #EF4444;
            transform: rotate(90deg);
        }
        .tpl-modal-body {
            flex: 1;
            overflow-y: auto;
            padding: 24px 28px 8px;
            background: #fff;
        }
        .tpl-modal-body::-webkit-scrollbar { width: 8px; }
        .tpl-modal-body::-webkit-scrollbar-thumb {
            background: #D6DCE4;
            border-radius: 4px;
        }
        .tpl-modal-body::-webkit-scrollbar-thumb:hover { background: #94A3B8; }
        .tpl-modal-body::-webkit-scrollbar-track { background: transparent; }

        .tpl-field {
            margin-bottom: 16px;
        }
        /* 分组分隔符：第二节结束语与提示语(Text 1)之间 */
        .tpl-field-divider {
            display: flex;
            align-items: center;
            gap: 12px;
            margin: 22px 0 18px;
            padding: 8px 12px;
            background: linear-gradient(90deg, rgba(245, 108, 108, 0.06) 0%, rgba(245, 108, 108, 0.02) 100%);
            border-left: 3px solid #EF4444;
            border-radius: var(--radius-sm);
        }
        .tpl-field-divider .tpl-divider-line {
            display: none;
        }
        .tpl-field-divider .tpl-divider-label {
            font-size: 13px;
            font-weight: 600;
            color: #EF4444;
            white-space: nowrap;
            letter-spacing: 0.5px;
        }
        .tpl-field-label {
            display: flex;
            align-items: center;
            font-size: 13px;
            font-weight: 600;
            color: #334155;
            margin-bottom: 6px;
        }
        .tpl-field-label::before {
            content: '';
            display: inline-block;
            width: 3px;
            height: 13px;
            background: var(--primary);
            border-radius: 2px;
            margin-right: 8px;
        }
        .tpl-field-input {
            width: 100%;
            padding: 9px 12px;
            border: 1px solid #E2E8F0;
            border-radius: var(--radius-sm);
            font-size: 13px;
            color: #11192D;
            background: #FAFBFD;
            font-family: inherit;
            transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
            box-sizing: border-box;
        }
        .tpl-field-input:hover {
            border-color: #CBD5E1;
            background: #fff;
        }
        .tpl-field-input:focus {
            outline: none;
            border-color: var(--primary);
            background: #fff;
            box-shadow: 0 0 0 3px rgba(64, 158, 255, 0.12);
        }
        textarea.tpl-field-input {
            resize: vertical;
            line-height: 1.6;
            min-height: 64px;
        }
        .tpl-modal-footer {
            display: flex;
            justify-content: flex-end;
            align-items: center;
            padding: 16px 28px;
            border-top: 1px solid #E2E8F0;
            background: linear-gradient(180deg, #ECF0F4 0%, #F1F5F9 100%);
            gap: 10px;
        }
        .tpl-footer-left,
        .tpl-footer-right {
            display: flex;
            gap: 8px;
        }
        .tpl-btn {
            padding: 8px 16px;
            border-radius: var(--radius-btn);
            font-size: 13px;
            font-weight: 600;
            cursor: pointer;
            border: 1.5px solid transparent;
            transition: all 0.2s ease;
            font-family: inherit;
            white-space: nowrap;
            letter-spacing: 0.2px;
        }
        .tpl-btn-primary {
            background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
            color: #fff;
            box-shadow: 0 4px 12px rgba(64, 158, 255, 0.30);
        }
        .tpl-btn-primary:hover {
            transform: translateY(-1px);
            box-shadow: 0 6px 18px rgba(64, 158, 255, 0.40);
        }
        .tpl-btn-secondary {
            background: #fff;
            color: #4A5675;
            border-color: #CBD5E1;
        }
        .tpl-btn-secondary:hover {
            background: #ECF0F4;
            border-color: #94A3B8;
        }
        .tpl-btn-warning {
            background: #fff;
            color: #D97706;
            border-color: #FBBF24;
        }
        .tpl-btn-warning:hover {
            background: #FFFBEB;
        }
        .tpl-btn-cancel {
            background: #F1F5F9;
            color: #4A5675;
        }
        .tpl-btn-cancel:hover {
            background: #E2E8F0;
        }
        @media (max-width: 600px) {
            .modal-box.tpl-modal-box {
                width: 94vw;
                max-height: 92vh;
            }
            .tpl-modal-footer {
                flex-direction: column;
                gap: 8px;
            }
            .tpl-footer-left,
            .tpl-footer-right {
                width: 100%;
                justify-content: space-between;
            }
            .tpl-btn {
                flex: 1;
            }
        }
