/* ==========================================
   TTS语音合成 - 前端样式
   ========================================== */

/* ====== 布局 ====== */
.tts-layout {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.tts-panel {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.04);
    border: 1px solid #f0f0f0;
    overflow: hidden;
}

.tts-panel-voices {
    width: 55%;
    flex-shrink: 0;
}

.tts-panel-workspace {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 20px;
}

/* ====== 面板头部 ====== */
.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid #f5f5f5;
    background: #fafafa;
}
.panel-title {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #222;
}
.panel-title i {
    color: #6366f1;
    margin-right: 6px;
}
.voice-total {
    font-size: 12px;
    color: #999;
}

/* ====== 分类标签 ====== */
.cat-tabs-wrap {
    padding: 10px 16px 6px;
}
.cat-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.cat-tab {
    padding: 5px 14px;
    font-size: 12px;
    border: 1px solid #e8e8e8;
    border-radius: 20px;
    background: #fff;
    color: #666;
    cursor: pointer;
    transition: all .2s;
    white-space: nowrap;
    font-weight: 500;
}
.cat-tab:hover {
    border-color: #6366f1;
    color: #6366f1;
}
.cat-tab.active {
    background: #6366f1;
    border-color: #6366f1;
    color: #fff;
    font-weight: 600;
}

/* ====== 筛选行 ====== */
.filter-row {
    padding: 0 16px 10px;
}
.filter-select {
    width: 100%;
    padding: 6px 10px;
    font-size: 12px;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    background: #fff;
    color: #555;
    outline: none;
    cursor: pointer;
    transition: border .2s;
}
.filter-select:hover, .filter-select:focus {
    border-color: #6366f1;
}

/* ====== 音色滚动区 ====== */
.voice-scroll-wrap {
    max-height: 520px;
    overflow-y: auto;
    padding: 0 16px 16px;
    scrollbar-width: thin;
    scrollbar-color: #ddd #f9f9f9;
}
.voice-scroll-wrap::-webkit-scrollbar { width: 5px; }
.voice-scroll-wrap::-webkit-scrollbar-track { background: #f9f9f9; border-radius: 3px; }
.voice-scroll-wrap::-webkit-scrollbar-thumb { background: #ddd; border-radius: 3px; }

/* ====== 音色网格 ====== */
.voice-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.voice-item {
    position: relative;
    cursor: pointer;
    padding: 12px 8px 10px;
    border: 1px solid #eee;
    border-radius: 8px;
    text-align: center;
    transition: all .2s;
    background: #fff;
}
.voice-item:hover {
    border-color: #a5b4fc;
    background: #f5f3ff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99,102,241,.08);
}
.voice-item.active {
    border-color: #6366f1;
    background: #eef2ff;
    box-shadow: 0 2px 8px rgba(99,102,241,.15);
}
.voice-item.vip-voice {
    border-style: dashed;
    border-color: #fbbf24;
}
.voice-item.vip-voice:hover {
    border-color: #f59e0b;
    background: #fffbeb;
}
.voice-item.vip-voice.active {
    border-color: #f59e0b;
    background: #fef3c7;
}

/* 音色头像区 */
.voice-avatar-wrap {
    position: relative;
    width: 42px;
    height: 42px;
    margin: 0 auto 6px;
    border-radius: 50%;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    overflow: hidden;
    transition: all .2s;
}
.voice-avatar-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.voice-avatar-wrap .va-icon {
    color: #bbb;
}
.voice-avatar-wrap .va-play-overlay {
    display: none;
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.3);
    color: #fff;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    border-radius: 50%;
}
.voice-item:hover .va-play-overlay {
    display: flex;
}
.voice-item.playing .voice-avatar-wrap {
    background: #6366f1;
    color: #fff;
}
.voice-item.playing .va-icon { color: #fff; }
.voice-item.playing .va-play-overlay { display: flex; background: rgba(99,102,241,.6); }

.voice-item .voice-name {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    display: block;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.voice-item .voice-desc {
    font-size: 11px;
    color: #999;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* VIP 标识 */
.vip-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 10px;
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
    color: #fff;
    font-weight: 700;
    letter-spacing: .5px;
    line-height: 16px;
    z-index: 2;
}
.provider-badge {
    position: absolute;
    top: 4px;
    left: 4px;
    font-size: 10px;
    padding: 1px 5px;
    border-radius: 3px;
    background: #e0e7ff;
    color: #6366f1;
    line-height: 14px;
    z-index: 2;
}

.voice-loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 50px 20px;
    color: #aaa;
    font-size: 13px;
}

/* ====== 工具栏 ====== */
.workspace-toolbar {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    padding-bottom: 4px;
}
.tool-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    font-size: 11px;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    background: #fff;
    color: #555;
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
    font-weight: 500;
}
.tool-btn:hover {
    border-color: #6366f1;
    color: #6366f1;
    background: #f5f3ff;
}
.tool-btn i {
    font-size: 11px;
}

/* ====== 文本输入区 ====== */
.workspace-input-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}
.tts-textarea {
    width: 100%;
    flex: 1;
    min-height: 280px;
    border: 2px solid #f0f0f0;
    border-radius: 10px;
    padding: 14px 16px;
    font-size: 14px;
    line-height: 1.8;
    color: #333;
    resize: vertical;
    outline: none;
    transition: border-color .2s;
    font-family: inherit;
    background: #fafbfc;
}
.tts-textarea:focus {
    border-color: #6366f1;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(99,102,241,.06);
}
.tts-textarea::placeholder {
    color: #ccc;
}

.input-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 8px;
}
.long-text-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 12px;
    color: #888;
}
.long-text-toggle input { display: none; }
.long-text-toggle .toggle-slider {
    width: 32px;
    height: 16px;
    background: #ddd;
    border-radius: 8px;
    position: relative;
    transition: background .2s;
    flex-shrink: 0;
}
.toggle-slider::after {
    content: '';
    position: absolute;
    left: 2px;
    top: 2px;
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    transition: left .2s;
}
.long-text-toggle input:checked + .toggle-slider {
    background: #6366f1;
}
.long-text-toggle input:checked + .toggle-slider::after {
    left: 18px;
}
.text-count {
    font-size: 12px;
    color: #aaa;
}

/* ====== 参数 ====== */
.workspace-params {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px 14px;
    background: #fafbfc;
    border-radius: 10px;
    border: 1px solid #f0f0f0;
}
.param-item {
    display: flex;
    align-items: center;
    gap: 12px;
}
.param-label {
    width: 36px;
    font-size: 13px;
    color: #666;
    font-weight: 500;
    flex-shrink: 0;
}
.param-item input[type=range] {
    flex: 1;
    height: 4px;
    -webkit-appearance: none;
    background: #e8e8e8;
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}
.param-item input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #6366f1;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0,0,0,.12);
}
.param-val {
    width: 36px;
    font-size: 12px;
    color: #6366f1;
    font-weight: 600;
    text-align: right;
    flex-shrink: 0;
}

/* ====== 合成按钮区 ====== */
.workspace-action {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.current-voice-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid rgba(99,102,241,.18);
    border-radius: 14px;
    background: linear-gradient(135deg, #f8faff, #fff);
    box-shadow: 0 8px 22px rgba(99,102,241,.08);
}
.cvi-avatar {
    width: 52px;
    height: 52px;
    flex: 0 0 52px;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    font-size: 24px;
    box-shadow: 0 8px 18px rgba(99,102,241,.25);
}
.cvi-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.cvi-main {
    min-width: 0;
    flex: 1;
}
.cvi-label {
    margin-bottom: 4px;
    font-size: 12px;
    color: #6b7280;
    font-weight: 600;
}
.cvi-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.cvi-name {
    max-width: 100%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: #111827;
    font-size: 17px;
    font-weight: 800;
}
.cvi-vip-badge {
    flex: 0 0 auto;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
    color: #fff;
    font-weight: 800;
    box-shadow: 0 4px 10px rgba(245,158,11,.25);
}
.preview-gen-btn {
    width: 100%;
    padding: 13px;
    font-size: 15px;
    font-weight: 700;
    border: 1px solid rgba(99,102,241,.22);
    border-radius: 10px;
    cursor: pointer;
    background: linear-gradient(135deg, #eef2ff, #f5f3ff);
    color: #4f46e5;
    transition: all .2s;
    letter-spacing: .5px;
}
.preview-gen-btn:hover {
    border-color: rgba(99,102,241,.42);
    background: linear-gradient(135deg, #e0e7ff, #ede9fe);
    box-shadow: 0 6px 18px rgba(99,102,241,.18);
    transform: translateY(-1px);
}
.preview-gen-btn:active {
    transform: scale(.98);
}
.preview-gen-btn.loading {
    opacity: .75;
    pointer-events: none;
}
.preview-gen-btn i {
    margin-right: 5px;
}
.gen-btn {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    background: linear-gradient(135deg, #6366f1, #818cf8);
    color: #fff;
    transition: all .2s;
    letter-spacing: .5px;
}
.gen-btn:hover {
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    box-shadow: 0 4px 16px rgba(99,102,241,.3);
    transform: translateY(-1px);
}
.gen-btn:active {
    transform: scale(.98);
}
.gen-btn.loading {
    opacity: .7;
    pointer-events: none;
}
.gen-btn-disabled {
    background: linear-gradient(135deg, #f59e0b, #fbbf24) !important;
    color: #fff !important;
    cursor: pointer !important;
    box-shadow: 0 8px 20px rgba(245, 158, 11, .28) !important;
}
.gen-btn-disabled:hover {
    background: linear-gradient(135deg, #d97706, #f59e0b) !important;
    box-shadow: 0 10px 24px rgba(245, 158, 11, .35) !important;
}
.gen-btn-disabled i {
    color: #fff7ed;
    text-shadow: 0 1px 2px rgba(0,0,0,.18);
}

/* ====== 提示信息 ====== */
.tts-error {
    padding: 10px 14px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    color: #dc2626;
    font-size: 12px;
    line-height: 1.6;
}
.tts-success {
    padding: 10px 14px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    color: #16a34a;
    font-size: 12px;
}

/* ====== 播放器 ====== */
.player-section {
    border-top: 1px solid #f0f0f0;
    padding-top: 14px;
}
.player-bar {
    display: flex;
    align-items: center;
    gap: 12px;
}
.player-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: #6366f1;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all .2s;
}
.player-btn:hover {
    background: #4f46e5;
}
.player-progress-wrap {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.player-progress {
    position: relative;
    height: 5px;
    background: #f0f0f0;
    border-radius: 3px;
    cursor: pointer;
}
.player-progress-fill {
    position: absolute;
    left: 0; top: 0;
    height: 100%;
    background: #6366f1;
    border-radius: 3px;
    width: 0%;
    transition: width .15s linear;
}
.player-time {
    font-size: 11px;
    color: #aaa;
    font-variant-numeric: tabular-nums;
}
.player-download {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f5f5f5;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 14px;
    flex-shrink: 0;
    transition: all .2s;
}
.player-download:hover {
    background: #eef2ff;
    color: #6366f1;
}

/* ====== 弹窗（通用） ====== */
.tts-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}
.tts-modal-overlay.show {
    display: flex;
}
.tts-modal {
    background: #fff;
    border-radius: 14px;
    padding: 24px;
    width: 90%;
    max-width: 480px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,.2);
}
.tts-modal h4 {
    margin: 0 0 16px;
    font-size: 16px;
    color: #222;
}
.tts-modal .modal-close {
    float: right;
    cursor: pointer;
    font-size: 18px;
    color: #aaa;
    border: none;
    background: none;
    padding: 2px 6px;
}
.tts-modal .modal-close:hover { color: #333; }

/* ====== 弹窗：敏感词结果 ====== */
.sensitive-result .found-item {
    padding: 6px 10px;
    background: #fef2f2;
    border-radius: 6px;
    margin-bottom: 4px;
    font-size: 13px;
    color: #dc2626;
}
.sensitive-result .no-found {
    text-align: center;
    padding: 20px;
    color: #16a34a;
    font-size: 14px;
}

/* ====== 弹窗：替换 ====== */
.replace-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}
.replace-row input {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    font-size: 13px;
    outline: none;
}
.replace-row input:focus {
    border-color: #6366f1;
}

/* ====== 弹窗：多音字 ====== */
.polyphone-list .poly-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f5f5f5;
    font-size: 13px;
}
.poly-item .poly-word {
    color: #6366f1;
    font-weight: 600;
}
.poly-item .poly-replace {
    color: #333;
}

/* ====== 弹窗：背景音乐 ====== */
.bgm-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}
.bgm-item {
    position: relative;
    padding: 14px 12px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    transition: all .2s;
    font-size: 13px;
    background: #fff;
}
.bgm-item:hover {
    border-color: #818cf8;
    background: linear-gradient(180deg, #ffffff 0%, #f5f3ff 100%);
    box-shadow: 0 8px 20px rgba(99, 102, 241, .12);
    transform: translateY(-1px);
}
.bgm-item.active {
    border-color: #6366f1;
    background: #eef2ff;
    font-weight: 600;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, .12);
}
.bgm-item .bgm-icon {
    font-size: 28px;
    display: block;
    margin-bottom: 6px;
}
.bgm-item .bgm-name {
    display: block;
    line-height: 1.4;
    color: #111827;
}
.bgm-preview {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin-top: 10px;
    padding: 6px 13px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 6px 14px rgba(99, 102, 241, .25);
    transition: all .18s;
}
.bgm-preview:hover {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    box-shadow: 0 8px 18px rgba(99, 102, 241, .32);
    transform: translateY(-1px);
}
.bgm-preview.playing {
    background: linear-gradient(135deg, #ef4444, #f97316);
    box-shadow: 0 6px 14px rgba(239, 68, 68, .25);
}
.bgm-preview i {
    font-size: 11px;
}

/* ====== 按钮通用 ====== */
.btn-sm {
    padding: 6px 14px;
    font-size: 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all .15s;
}
.btn-sm.btn-primary {
    background: #6366f1;
    color: #fff;
}
.btn-sm.btn-primary:hover { background: #4f46e5; }
.btn-sm.btn-outline {
    background: #fff;
    border: 1px solid #e8e8e8;
    color: #555;
}
.btn-sm.btn-outline:hover { border-color: #6366f1; color: #6366f1; }

/* ====== 响应式 ====== */
@media (max-width: 1100px) {
    .tts-layout { flex-direction: column; }
    .tts-panel-voices { width: 100%; }
    .voice-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 768px) {
    .tts-panel-workspace { padding: 14px; }
    .voice-grid { grid-template-columns: repeat(3, 1fr); }
    .voice-scroll-wrap { max-height: 350px; }
    .tts-textarea { min-height: 200px; }
    .workspace-toolbar { gap: 2px; }
    .tool-btn { padding: 4px 7px; font-size: 10px; }
}
@media (max-width: 480px) {
    .voice-grid { grid-template-columns: repeat(2, 1fr); }
    .tts-modal { width: 95%; padding: 16px; }
}

/* ====== 视觉增强版：AI语音合成主体 ====== */
.tts-showcase {
    position: relative;
    overflow: hidden;
    padding-top: 28px;
    background:
        radial-gradient(circle at 12% 8%, rgba(124, 58, 237, .16), transparent 30%),
        radial-gradient(circle at 88% 14%, rgba(6, 182, 212, .14), transparent 28%),
        linear-gradient(180deg, #f8fbff 0%, #ffffff 48%, #f8fafc 100%);
}
.tts-showcase::before,
.tts-showcase::after {
    content: '';
    position: absolute;
    pointer-events: none;
    border-radius: 999px;
    filter: blur(8px);
    opacity: .7;
}
.tts-showcase::before {
    width: 340px;
    height: 340px;
    right: -120px;
    top: 90px;
    background: radial-gradient(circle, rgba(99, 102, 241, .22), transparent 65%);
}
.tts-showcase::after {
    width: 260px;
    height: 260px;
    left: -110px;
    bottom: 80px;
    background: radial-gradient(circle, rgba(14, 165, 233, .18), transparent 65%);
}
.tts-showcase > .container {
    position: relative;
    z-index: 1;
}
.tts-hero-card {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 34px;
    margin-bottom: 24px;
    padding: 34px 38px;
    overflow: hidden;
    border-radius: 30px;
    color: #fff;
    background:
        linear-gradient(135deg, rgba(15, 23, 42, .96), rgba(49, 46, 129, .94) 46%, rgba(6, 182, 212, .9));
    box-shadow: 0 30px 80px rgba(30, 41, 59, .24), inset 0 1px 0 rgba(255,255,255,.16);
}
.tts-hero-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(255,255,255,.08) 1px, transparent 1px),
        linear-gradient(0deg, rgba(255,255,255,.07) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: linear-gradient(90deg, #000, transparent 78%);
    opacity: .45;
}
.tts-hero-card::after {
    content: '';
    position: absolute;
    width: 360px;
    height: 360px;
    right: -120px;
    top: -120px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,.28), transparent 62%);
}
.tts-hero-content {
    position: relative;
    z-index: 2;
    max-width: 720px;
}
.tts-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding: 7px 13px;
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 999px;
    background: rgba(255,255,255,.1);
    color: #dbeafe;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .5px;
    backdrop-filter: blur(10px);
}
.tts-hero-content h1 {
    margin: 0;
    font-size: 38px;
    line-height: 1.18;
    font-weight: 900;
    letter-spacing: -1.2px;
    text-shadow: 0 10px 24px rgba(0,0,0,.22);
}
.tts-hero-content p {
    max-width: 650px;
    margin: 14px 0 0;
    color: rgba(255,255,255,.78);
    font-size: 15px;
    line-height: 1.8;
}
.tts-hero-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}
.tts-hero-tags span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 13px;
    border-radius: 14px;
    background: rgba(255,255,255,.12);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.12);
    backdrop-filter: blur(10px);
}
.tts-hero-visual {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    width: 210px;
    min-width: 210px;
    height: 145px;
    border-radius: 28px;
    background: rgba(255,255,255,.11);
    border: 1px solid rgba(255,255,255,.16);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.16), 0 20px 50px rgba(0,0,0,.18);
    backdrop-filter: blur(12px);
}
.tts-hero-visual span {
    width: 13px;
    border-radius: 999px;
    background: linear-gradient(180deg, #fff, #67e8f9 45%, #a78bfa);
    box-shadow: 0 0 22px rgba(103, 232, 249, .7);
    animation: ttsWave 1.2s ease-in-out infinite;
}
.tts-hero-visual span:nth-child(1) { height: 42px; animation-delay: -.1s; }
.tts-hero-visual span:nth-child(2) { height: 82px; animation-delay: -.35s; }
.tts-hero-visual span:nth-child(3) { height: 112px; animation-delay: -.6s; }
.tts-hero-visual span:nth-child(4) { height: 76px; animation-delay: -.25s; }
.tts-hero-visual span:nth-child(5) { height: 52px; animation-delay: -.45s; }
@keyframes ttsWave {
    0%, 100% { transform: scaleY(.72); opacity: .7; }
    50% { transform: scaleY(1.08); opacity: 1; }
}
.tts-layout {
    gap: 24px;
    align-items: stretch;
}
.tts-panel {
    border: 1px solid rgba(148, 163, 184, .24);
    border-radius: 26px;
    background: rgba(255,255,255,.82);
    box-shadow: 0 24px 70px rgba(15, 23, 42, .12);
    backdrop-filter: blur(16px);
}
.tts-panel-voices {
    width: 58%;
}
.tts-panel-workspace {
    padding: 24px;
    background:
        linear-gradient(180deg, rgba(255,255,255,.94), rgba(248,250,252,.92)),
        radial-gradient(circle at 80% 0%, rgba(99,102,241,.12), transparent 36%);
}
.panel-header {
    padding: 18px 22px;
    border-bottom: 1px solid rgba(226, 232, 240, .78);
    background: linear-gradient(135deg, rgba(248,250,252,.92), rgba(238,242,255,.92));
}
.panel-title {
    font-size: 18px;
    font-weight: 900;
    color: #0f172a;
}
.panel-title i {
    display: inline-grid;
    place-items: center;
    width: 30px;
    height: 30px;
    margin-right: 8px;
    border-radius: 10px;
    color: #fff;
    background: linear-gradient(135deg, #6366f1, #06b6d4);
    box-shadow: 0 10px 24px rgba(99,102,241,.26);
}
.voice-total {
    padding: 6px 11px;
    border-radius: 999px;
    color: #4f46e5;
    background: #eef2ff;
    font-weight: 800;
}
.cat-tabs-wrap {
    padding: 16px 18px 10px;
    background: linear-gradient(180deg, rgba(255,255,255,.76), rgba(255,255,255,0));
}
.cat-tabs {
    gap: 9px;
}
.cat-tab {
    padding: 8px 15px;
    border: 1px solid rgba(99,102,241,.13);
    border-radius: 999px;
    background: rgba(255,255,255,.76);
    color: #475569;
    box-shadow: 0 8px 20px rgba(15,23,42,.05);
}
.cat-tab:hover {
    color: #4f46e5;
    border-color: rgba(99,102,241,.35);
    transform: translateY(-1px);
}
.cat-tab.active {
    background: linear-gradient(135deg, #4f46e5, #06b6d4);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 12px 28px rgba(79,70,229,.25);
}
.voice-scroll-wrap {
    max-height: 610px;
    padding: 6px 18px 20px;
    scrollbar-color: #8b5cf6 #eef2ff;
}
.voice-scroll-wrap::-webkit-scrollbar { width: 8px; }
.voice-scroll-wrap::-webkit-scrollbar-track { background: #eef2ff; border-radius: 999px; }
.voice-scroll-wrap::-webkit-scrollbar-thumb { background: linear-gradient(180deg, #6366f1, #06b6d4); border-radius: 999px; }
.voice-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 13px;
}
.voice-item {
    padding: 16px 10px 14px;
    border: 1px solid rgba(148, 163, 184, .2);
    border-radius: 18px;
    background:
        linear-gradient(180deg, rgba(255,255,255,.96), rgba(248,250,252,.9));
    box-shadow: 0 12px 28px rgba(15,23,42,.07);
}
.voice-item::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, rgba(99,102,241,.7), rgba(6,182,212,.55), rgba(244,114,182,.45));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity .2s;
    pointer-events: none;
}
.voice-item:hover {
    background: #fff;
    transform: translateY(-5px);
    box-shadow: 0 20px 44px rgba(79,70,229,.16);
}
.voice-item:hover::before,
.voice-item.active::before {
    opacity: 1;
}
.voice-item.active {
    background: linear-gradient(180deg, #ffffff, #eef2ff);
    box-shadow: 0 20px 48px rgba(79,70,229,.22);
    transform: translateY(-3px);
}
.voice-item.vip-voice {
    border-style: solid;
    background: linear-gradient(180deg, #fffaf0, #fff7ed);
}
.voice-avatar-wrap {
    width: 56px;
    height: 56px;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #e0e7ff, #cffafe);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.75), 0 12px 26px rgba(99,102,241,.18);
}
.voice-avatar-wrap .va-icon {
    color: #4f46e5;
    font-size: 20px;
}
.voice-avatar-wrap .va-avatar-svg,
.cvi-avatar .va-avatar-svg {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    overflow: hidden;
}
.voice-avatar-wrap .va-avatar-svg svg,
.cvi-avatar .va-avatar-svg svg {
    display: block;
    width: 100%;
    height: 100%;
}
.voice-avatar-wrap .va-play-overlay {
    background: linear-gradient(135deg, rgba(79,70,229,.78), rgba(6,182,212,.72));
}
.voice-item .voice-name {
    color: #0f172a;
    font-size: 14px;
    font-weight: 900;
}
.voice-item .voice-desc {
    margin-top: 4px;
    color: #64748b;
    font-weight: 600;
}
.vip-badge {
    top: 8px;
    right: 8px;
    padding: 2px 8px;
    background: linear-gradient(135deg, #f97316, #facc15);
    box-shadow: 0 8px 18px rgba(249,115,22,.25);
}
.workspace-toolbar {
    gap: 8px;
    padding: 6px;
    border-radius: 18px;
    background: rgba(241,245,249,.82);
    border: 1px solid rgba(226,232,240,.8);
}
.tool-btn {
    padding: 9px 12px;
    border: 0;
    border-radius: 13px;
    background: #fff;
    color: #334155;
    box-shadow: 0 8px 18px rgba(15,23,42,.05);
    font-weight: 800;
}
.tool-btn:hover {
    color: #fff;
    background: linear-gradient(135deg, #6366f1, #06b6d4);
    transform: translateY(-2px);
    box-shadow: 0 14px 30px rgba(79,70,229,.2);
}
.tts-textarea {
    min-height: 330px;
    padding: 20px;
    border: 1px solid rgba(148,163,184,.24);
    border-radius: 22px;
    background:
        linear-gradient(180deg, rgba(255,255,255,.95), rgba(248,250,252,.95));
    box-shadow: inset 0 1px 0 rgba(255,255,255,.8), 0 14px 38px rgba(15,23,42,.06);
    color: #0f172a;
    font-size: 15px;
}
.tts-textarea:focus {
    border-color: rgba(99,102,241,.55);
    box-shadow: 0 0 0 5px rgba(99,102,241,.12), 0 18px 42px rgba(79,70,229,.1);
}
.input-footer {
    padding: 10px 4px 0;
}
.long-text-toggle {
    padding: 7px 10px;
    border-radius: 999px;
    background: #f8fafc;
    color: #475569;
    font-weight: 800;
}
.text-count {
    padding: 7px 11px;
    border-radius: 999px;
    background: #eef2ff;
    color: #4f46e5;
    font-weight: 900;
}
.workspace-params {
    gap: 12px;
    padding: 16px;
    border: 1px solid rgba(226,232,240,.9);
    border-radius: 20px;
    background: linear-gradient(180deg, #ffffff, #f8fafc);
    box-shadow: 0 14px 34px rgba(15,23,42,.06);
}
.param-label {
    color: #0f172a;
    font-weight: 900;
}
.param-item input[type=range] {
    height: 7px;
    background: linear-gradient(90deg, #6366f1, #06b6d4);
}
.param-item input[type=range]::-webkit-slider-thumb {
    width: 20px;
    height: 20px;
    border: 3px solid #fff;
    background: linear-gradient(135deg, #4f46e5, #06b6d4);
    box-shadow: 0 8px 18px rgba(79,70,229,.28);
}
.current-voice-info {
    padding: 16px;
    border: 1px solid rgba(99,102,241,.18);
    border-radius: 22px;
    background:
        linear-gradient(135deg, rgba(238,242,255,.95), rgba(240,253,250,.9));
    box-shadow: 0 18px 42px rgba(79,70,229,.12);
}
.cvi-avatar {
    width: 62px;
    height: 62px;
    flex-basis: 62px;
    border-radius: 20px;
    background: linear-gradient(135deg, #4f46e5, #06b6d4);
    box-shadow: 0 16px 34px rgba(79,70,229,.3);
}
.cvi-label {
    color: #64748b;
}
.cvi-name {
    color: #0f172a;
    font-size: 19px;
}
.preview-gen-btn,
.gen-btn {
    border-radius: 18px;
    font-weight: 900;
}
.preview-gen-btn {
    padding: 15px;
    background: linear-gradient(135deg, #f0f9ff, #eef2ff);
    border: 1px solid rgba(79,70,229,.18);
    color: #4f46e5;
    box-shadow: 0 14px 34px rgba(79,70,229,.1);
}
.gen-btn {
    position: relative;
    overflow: hidden;
    padding: 17px;
    font-size: 17px;
    background: linear-gradient(135deg, #4f46e5, #7c3aed 52%, #06b6d4);
    box-shadow: 0 18px 40px rgba(79,70,229,.3);
}
.gen-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent, rgba(255,255,255,.28), transparent);
    transform: translateX(-120%);
    transition: transform .5s;
}
.gen-btn:hover::before {
    transform: translateX(120%);
}
.gen-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 24px 52px rgba(79,70,229,.36);
}
.player-section {
    padding: 16px;
    border: 1px solid rgba(226,232,240,.9);
    border-radius: 20px;
    background: linear-gradient(135deg, #ffffff, #f8fafc);
    box-shadow: 0 16px 36px rgba(15,23,42,.07);
}
.player-btn {
    background: linear-gradient(135deg, #4f46e5, #06b6d4);
    box-shadow: 0 12px 26px rgba(79,70,229,.25);
}
.player-progress {
    height: 8px;
    background: #e2e8f0;
}
.player-progress-fill {
    background: linear-gradient(90deg, #4f46e5, #06b6d4);
}
.player-download {
    background: #eef2ff;
    color: #4f46e5;
    box-shadow: 0 10px 22px rgba(79,70,229,.12);
}
.tts-modal {
    border: 1px solid rgba(255,255,255,.45);
    background: rgba(255,255,255,.94);
    box-shadow: 0 30px 90px rgba(15,23,42,.28);
    backdrop-filter: blur(18px);
}
.bgm-item {
    border-radius: 18px;
    background: linear-gradient(180deg, #fff, #f8fafc);
    box-shadow: 0 12px 26px rgba(15,23,42,.07);
}
.bgm-item:hover,
.bgm-item.active {
    border-color: rgba(99,102,241,.55);
    background: linear-gradient(180deg, #fff, #eef2ff);
    box-shadow: 0 18px 38px rgba(79,70,229,.16);
}
@media (max-width: 1200px) {
    .voice-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 1100px) {
    .tts-hero-card { flex-direction: column; align-items: flex-start; }
    .tts-hero-visual { width: 100%; min-width: 0; }
    .tts-layout { flex-direction: column; }
    .tts-panel-voices { width: 100%; }
    .voice-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 768px) {
    .tts-hero-card { padding: 26px 22px; border-radius: 24px; }
    .tts-hero-content h1 { font-size: 28px; }
    .tts-hero-visual { height: 110px; }
    .voice-grid { grid-template-columns: repeat(3, 1fr); }
    .tts-panel { border-radius: 22px; }
}
@media (max-width: 480px) {
    .tts-hero-content h1 { font-size: 24px; }
    .tts-hero-tags span { width: 100%; justify-content: center; }
    .voice-grid { grid-template-columns: repeat(2, 1fr); }
}