:root {
    --primary-color: #2563eb;  /* 更深邃的蓝色 */
    --secondary-color: #f1f5f9;
    --border-color: #e2e8f0;
    --text-color: #1e293b;
    --light-text: #64748b;
    --hover-color: #1d4ed8;
    --card-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --transition: all 0.2s ease;
}

.tts-container {
    display: flex;
    flex-direction: row;
    gap: 20px;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 16px;
    background: #fff;
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    overflow-x: hidden;
    box-sizing: border-box;
}

/* 左侧面板固定为20% */
.tts-left-panel {
    flex: 0 0 20%; /* 修改为固定20%宽度 */
    width: 20%;
    border-right: 1px solid var(--border-color);
    padding-right: 16px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* 右侧面板固定为80% */
.tts-right-panel,
.multi-voice-panel {
    flex: 0 0 80%;
    width: 80%;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-right: 16px;  /* 添加右侧内边距 */
}

/* 配音模式切换 */
.tts-mode-switch {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
}

.tts-mode-switch button {
    flex: 1;
    padding: 8px;
    border: 1px solid var(--border-color);
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.tts-mode-switch button.active {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

/* 搜索框样式 */
.tts-search {
    position: relative;
    width: 100%;
    padding: 0;
    margin: 0;
}

.tts-search input {
    width: 100%;
    height: 32px;
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    color: #333;
    background: #fff;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.tts-search input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.tts-search input::placeholder {
    color: #999;
}

/* 筛选区域 */
.tts-filters {
    display: flex;
    gap: 20px;
    margin: 0;
}

.filter-group {
    flex: 1;
}

.filter-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    color: #333;
    background-color: #fff;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' stroke='%23999' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.filter-select:hover {
    border-color: #999;
}

/* 自定义下拉框样式 */
.filter-select option {
    padding: 8px;
    font-size: 14px;
}

/* 格式切换按钮组 */
.format-switch {
    width: 100%;
    margin: 0;
}

.format-switch button {
    flex: 1;
    padding: 8px;
    border: 1px solid var(--border-color);
    background: #fff;
    border-radius: 4px;
    font-size: 14px;
    color: var(--text-color);
    cursor: pointer;
    transition: var(--transition);
    min-width: 80px;
}

.format-switch button.active {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

/* 文本输入区域 */
.text-input-area {
    width: 100%;
    margin: 0;
}

.text-input-area textarea {
    width: 100%;
    min-height: 120px;
    padding: 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
    transition: var(--transition);
}

.text-input-area textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* 控制器布局 */
.control-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
    padding: 8px;
}

/* 控制组基础样式 */
.control-group {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-width: 0;
}

/* 控制标签样式 */
.control-label {
    font-size: 14px;
    white-space: nowrap;
    color: #999;
    flex-shrink: 0;
    min-width: 42px;
}

/* 滑块容器样式 */
.slider-container {
    position: relative;
    margin: 6px 0;
    flex: 1;
    min-width: 0;
    width: 100%;
    display: flex;
    align-items: center;
}

/* 滑块本身的样式 */
input[type="range"] {
    flex: 1;
    width: auto;
    margin-right: 8px;
    -webkit-appearance: none;
    height: 4px;
    background: #e0e0e0;
    border-radius: 2px;
    outline: none;
}

/* 滑块拖动按钮样式 */
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 范围值显示样式 */
.range-value {
    font-size: 12px;
    color: #666;
    margin-left: 8px;
    white-space: nowrap;
    min-width: 30px;  /* 减小宽度，只显示数值 */
    text-align: left;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .slider-container {
        flex-wrap: nowrap;  /* 防止在小屏幕上换行 */
    }
    
    .range-value {
        font-size: 11px;
        min-width: 60px;
    }
}

/* 正常文字样式 */
.normal-text {
    display: none;
}

/* 语音合成控制区域 */
.synthesis-controls {
    display: flex;  /* 恢复flex布局 */
    flex-direction: row;  /* 保持水平排列 */
    align-items: center;  /* 垂直居中对齐 */
    gap: 16px;  /* 元素之间的间距 */
    width: 100%;
    padding: 12px 16px;
    background: var(--secondary-color);  /* 恢复背景色 */
    border: 1px solid var(--border-color);  /* 恢复边框 */
    border-radius: 8px;  /* 恢复圆角 */
}

/* 控制按钮组样式 */
.control-buttons {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* 进度条容器样式 */
.progress-container {
    flex: 1;
    width: 100%;
}

/* 控制器区域 */
.tts-controls {
    width: 100%;
    margin: 0;
}

/* 情感控制区域 */
.emotion-controls {
    width: 100%;
    margin-top: 8px;
    padding: 8px;
}

/* 情感控制行样式 */
.emotion-controls .control-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

/* 情感风格选择行 */
.emotion-style-group {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

/* 情感标签样式 */
.emotion-label {
    font-size: 14px;
    white-space: nowrap;
    color: #999;
    flex-shrink: 0;
    min-width: 70px;
}

/* 情感风格选择框 */
.emotion-style-select {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    background-color: #fff;
}

/* 情感程度组样式 */
.emotion-level-group {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin-top: 12px;  /* 增加上边距 */
}

/* 合成控制区域样式调整 */
.synthesis-controls .primary-btn {
    flex: 0 0 auto;
    height: 40px;
    padding: 0 24px;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    display: inline-flex; /* 改为 inline-flex */
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
    width: auto; /* 确保按钮宽度自适应内容 */
}

/* 合成按钮图标和文字样式 */
.synthesis-controls .primary-btn svg,
.synthesis-controls .primary-btn span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* 合成按钮悬停效果 */
.synthesis-controls .primary-btn:hover {
    background: var(--hover-color);
}

/* 合成按钮点击效果 */
.synthesis-controls .primary-btn:active {
    transform: translateY(1px);
}

/* 播放器控件布局 */
.player-controls {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    min-width: unset;
}

/* 播放和下载按钮样式 */
.control-btn {
    width: 40px;
    height: 40px;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.2s ease;
}

/* 按钮悬停效果 */
.control-btn:hover {
    border-color: var(--primary-color);
    transform: translateY(-1px); /* 轻微上浮 */
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.15); /* 添加阴影 */
}

/* 按钮图标样式 */
.control-btn svg {
    width: 20px;
    height: 20px;
    fill: var(--primary-color);
    transition: all 0.2s ease;
}

/* 按钮点击效果 */
.control-btn:active {
    transform: scale(0.95); /* 轻微缩小 */
    box-shadow: none;
}

/* 禁用状态样式 */
.control-btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed !important;
    background: #fff;
    border-color: var(--border-color);
    pointer-events: auto;
    transform: none;
    box-shadow: none;
}

.control-btn[disabled] svg {
    fill: #999;
}

/* 禁用状态悬停效果 */
.control-btn[disabled]:hover {
    background: #fff;
    border-color: var(--border-color);
    transform: none;
    box-shadow: none;
}

/* 进度条样式 */
.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    position: relative;
    cursor: pointer;
    overflow: hidden;
}

/* 进度条进度样式 */
.progress {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: var(--primary-color);
    border-radius: 3px;
    transition: width 0.1s linear;
}

/* 工具提示样式优化 */
[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 10px;
    background: #333;  /* 改为纯色背景 */
    color: white;
    font-size: 12px;
    border-radius: 4px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 1000;
}

/* 时间显示样式 */
.time-display {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #999;
    margin-top: 4px;
}

.time-display span {
    color: #999;
}

/* 响应式布局调整 */
@media (max-width: 768px) {
    .control-row {
        flex-direction: column;
        gap: 12px;
    }

    .control-group,
    .slider-container {
        width: 100%;
        min-width: 0;
    }

    .control-label,
    .normal-text {
        font-size: 13px;
        min-width: 24px;
    }

    /* 右侧面板布局 */
    .tts-right-panel {
        width: 100%;
        padding: 0;
    }

    /* 语音合成控制区域 */
    .synthesis-controls,
    .emotion-controls {
        flex-direction: column;
        padding: 12px;
        gap: 12px;
    }

    .synthesis-controls .primary-btn {
        width: 100%;
        justify-content: center;
        padding: 0 16px;
    }

    .control-buttons {
        width: 100%;
        justify-content: center;
    }

    .progress-container {
        width: 100%;
    }

    /* 正常文字在特小屏幕下隐藏 */
    @media screen and (max-width: 360px) {
        .normal-text {
            display: none;
        }
    }
}

/* 播放器控件 */
.player-controls {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    min-width: unset;
}

/* 控制按钮 */
.control-btn {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    padding: 8px;
    border: none;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    position: relative;
}

/* 播放暂停图标切换 */
.icon-pause {
    display: none;
}

.playing .icon-play {
    display: none;
}

.playing .icon-pause {
    display: block;
}

.tencent-tts-container {
    max-width: 600px;
    margin: 20px auto;
    padding: 20px;
    background: #fff;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

.tencent-tts-container textarea {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

#tts-voice {
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

#tts-loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-content {
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 300px;
    text-align: center;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #1a73e8;
    border-radius: 50%;
    margin: 0 auto 16px;
    animation: spin 1s linear infinite;
}

.loading-message {
    color: #333;
    margin-bottom: 16px;
    font-size: 14px;
}

.loading-progress-bar {
    height: 4px;
    background: #f0f0f0;
    border-radius: 2px;
    overflow: hidden;
    margin-top: 12px;
}

.loading-progress {
    height: 100%;
    background: #1a73e8;
    width: 0;
    transition: width 0.3s ease;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#tts-audio-container {
    margin-top: 0;
}

#tts-audio-container audio {
    width: 100%;
}

/* 音色卡片区域 */
.voice-cards-container {
    max-height: 500px;
    overflow-y: auto;
    margin: 0;
    padding-right: 10px;
}

.voice-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 改回3列 */
    gap: 6px; /* 减小间距 */
    width: 100%;
}

.voice-card {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 6px; /* 减小内边距 */
    position: relative;
    background: var(--secondary-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.voice-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--card-shadow);
}

.voice-card.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

/* 头像区域样式 */
.voice-avatar-wrapper {
    position: relative;
    width: 40px; /* 减小头像尺寸 */
    height: 40px;
    margin: 0 auto 6px;
    border-radius: 50%;
    overflow: hidden;
    background: #fff;
    transition: all 0.2s;
}

.voice-avatar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #f8f9fa;
    background-size: cover;
    background-position: center;
    border-radius: 50%;
}

/* 性别区分的头像边框 - 使用伪元素实现完全一致的圆形边框 */
.voice-avatar-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 1px solid transparent;
    box-sizing: border-box;
}

.voice-card.female .voice-avatar-wrapper::after {
    border-color: #FF69B4;
}

.voice-card.male .voice-avatar-wrapper::after {
    border-color: #4169E1;
}

/* 悬停效果 */
.voice-card:hover .voice-avatar-wrapper::after {
    border-color: var(--primary-color);
    border-width: 2px;
}

/* 选中状态 */
.voice-card.active .voice-avatar-wrapper::after {
    border-color: var(--primary-color);
    border-width: 2px;
}

/* 试听按钮样式 */
.preview-btn {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s;
    z-index: 2;
}

.preview-btn svg {
    width: 22px;
    height: 22px;
    fill: #fff;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.2));  /* 给图标添加阴影 */
}

.voice-card:hover .preview-btn {
    opacity: 1;
}

.preview-btn:hover {
    background: rgba(0, 0, 0, 0.6);
}

.preview-btn.playing {
    opacity: 1;
    background: rgba(0, 0, 0, 0.7);
}

/* 头像图片 */
.voice-card.female .voice-avatar {
    background-image: url('../images/female-avatar.png');
}

.voice-card.male .voice-avatar {
    background-image: url('../images/male-avatar.png');
}

/* 名字样式 */
.voice-name {
    font-size: 12px;
    font-weight: 500;
    margin: 0 0 2px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 描述样式 */
.voice-desc {
    font-size: 11px;
    color: #666;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 选中状态 */
.voice-card.active .voice-name,
.voice-card.active .voice-desc {
    color: #fff;
}

/* 悬停效果 */
.voice-card:hover:not(.active) {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/* 滚动条样式 */
.voice-cards-container::-webkit-scrollbar {
    width: 4px;
}

.voice-cards-container::-webkit-scrollbar-track {
    background: transparent;
}

.voice-cards-container::-webkit-scrollbar-thumb {
    background-color: #E5E5EA;
    border-radius: 2px;
}

.voice-cards-container::-webkit-scrollbar-thumb:hover {
    background-color: #D1D1D6;
}

/* 移除搜索图标 */
.search-icon {
    display: none;
}

/* 右上角标签通用样式 */
.corner-tag {
    position: absolute;
    top: 0;
    right: 0;
    font-size: 8px; /* 更小的字体 */
    padding: 1px 4px; /* 更小的内边距 */
    border-top-right-radius: 4px; /* 更小的圆角 */
    border-bottom-left-radius: 4px;
    font-weight: 500;
    letter-spacing: 0.2px; /* 更小的字母间距 */
    z-index: 3;
    box-shadow: -1px 1px 3px rgba(0, 0, 0, 0.08); /* 更淡的阴影 */
}

/* 情感音色标签 */
.corner-tag.emotion {
    background: rgba(255, 71, 87, 0.8);
    color: white;
}

/* AI音色标签 */
.corner-tag.ai {
    background: rgba(52, 152, 219, 0.8);
    color: white;
}

/* 基础音色标签 */
.corner-tag.basic {
    background: rgba(44, 62, 80, 0.8);
    color: white;
}

/* 方言音色标签 */
.corner-tag.dialect {
    background: rgba(39, 174, 96, 0.8);
    color: white;
}

/* 儿童音色标签 */
.corner-tag.child {
    background: rgba(155, 89, 182, 0.8);
    color: white;
}

/* 外语音色标签 */
.corner-tag.foreign {
    background: rgba(156, 39, 176, 0.8);  /* 紫色背景 */
    color: white;
}

/* 选中状态下的标签样式 */
.voice-card.active .corner-tag {
    background: linear-gradient(135deg, #fff, #fff);
    color: var(--primary-color);
}

/* 标签装饰效果 */
.corner-tag::before {
    display: none;
}

/* 情感控制区域样式 */
.emotion-controls {
    margin-top: 8px;
    padding: 8px;
    background: var(--secondary-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

/* 控制区域样式 */
.tts-controls .control-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
}

.tts-controls .control-group {
    flex: 1;
    min-width: 0; /* 移除 200px 的限制 */
}

.tts-controls .slider-container {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0; /* 移除 200px 的限制 */
}

.tts-controls .control-label {
    white-space: nowrap;
    min-width: 60px;
}

/* 情感控制区域样式 */
.emotion-controls .control-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
}

.emotion-controls .control-group {
    flex: 1;
    min-width: 0; /* 移除 200px 的限制 */
}

.emotion-controls .emotion-label {
    white-space: nowrap;
    min-width: 70px;
}

.emotion-controls .emotion-style-select {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    background-color: #fff;
}

.emotion-controls .emotion-level-group {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 动画效果 */
.emotion-controls {
    transform-origin: top;
    transition: all 0.3s ease;
}

/* 统一控制区域样式 */
.tts-controls, .emotion-controls {
    margin-top: 0px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    width: 100%;  /* 让容器占满宽度 */
}

/* 按钮样式优化 */
.primary-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.primary-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

@keyframes slideInDown {
    from {
        margin-top: -40px;
        opacity: 0;
    }
    to {
        margin-top: 0;
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        margin-top: 0;
    }
    to {
        opacity: 0;
        margin-top: -40px;
    }
}

/* 移除播放和下载按钮的工具提示 */
#play-btn[data-tooltip]:hover::after,
#tts-download[data-tooltip]:hover::after {
    display: none;
}

/* 或者更具体地针对这两个按钮 */
.player-controls .control-btn[data-tooltip]:hover::after {
    display: none;
}

/* 消息容器样式 */
body .message-container {
    position: fixed !important;
    top: 24px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    z-index: 100000 !important;
    width: auto !important;
    max-width: 90% !important;
    pointer-events: none !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 8px !important;
}

/* 基础消息样式 */
body .tts-message {
    background: #ffffff !important;
    border-radius: 12px !important;
    padding: 16px !important;
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08) !important;
    margin-bottom: 8px !important;
    min-width: 360px !important;
    max-width: 480px !important;
    border: 1px solid transparent !important;
    backdrop-filter: blur(8px) !important;
    transition: all 0.3s ease !important;
}

/* 成功提示 */
body .tts-message.success {
    background: #f0fdf4 !important;
    border-color: #86efac !important;
    color: #166534 !important;
}

body .tts-message.success svg {
    fill: #22c55e !important;
}

/* 错误提示样式优化 */
body .tts-message.error {
    background: #fff1f2 !important;
    border: 1px solid #fecaca !important;
    color: #be123c !important;
    padding: 16px 20px !important;
    display: flex !important;
    align-items: flex-start !important; /* 改为顶部对齐 */
    gap: 14px !important;
}

/* 错误图标样式 */
body .tts-message.error svg {
    width: 24px !important;
    height: 24px !important;
    fill: #e11d48 !important;
    margin-top: 2px !important; /* 微调图标位置 */
}

/* 错误消息文本样式 */
body .tts-message.error .message-text {
    font-size: 14px !important;
    line-height: 1.6 !important;
    color: #be123c !important;
    font-weight: 500 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
}

/* 错误详情样式 */
body .tts-message.error .error-details {
    font-size: 13px !important;
    color: #9f1239 !important;
    font-weight: normal !important;
    opacity: 0.9 !important;
}

/* 错误提示动画优化 */
@keyframes errorShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

body .tts-message.error.fade-in {
    animation: ttsSlideIn 0.2s cubic-bezier(0.4, 0, 0.2, 1) forwards,
               errorShake 0.4s cubic-bezier(0.36, 0, 0.66, 1) 0.2s !important;
}

/* 移动端适配 */
@media screen and (max-width: 480px) {
    body .tts-message.error {
        padding: 14px 16px !important;
    }
    
    body .tts-message.error .message-text {
        font-size: 13px !important;
    }
    
    body .tts-message.error .error-details {
        font-size: 12px !important;
    }
}

/* 警告提示 */
body .tts-message.warning {
    background: #fffbeb !important;
    border-color: #fcd34d !important;
    color: #92400e !important;
}

body .tts-message.warning svg {
    fill: #f59e0b !important;
}

/* 信息提示 */
body .tts-message.info {
    background: #eff6ff !important;
    border-color: #bfdbfe !important;
    color: #1e40af !important;
}

body .tts-message.info svg {
    fill: #3b82f6 !important;
}

/* 图标样式 */
body .tts-message svg {
    width: 22px !important;
    height: 22px !important;
    flex-shrink: 0 !important;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1)) !important;
}

/* 消息文本样式 */
body .tts-message .message-text {
    flex: 1 !important;
    font-weight: 500 !important;
    letter-spacing: -0.01em !important;
}

/* 动画效果 */
@keyframes ttsSlideIn {
    from {
        opacity: 0;
        transform: translateY(-12px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes ttsSlideOut {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(-12px) scale(0.98);
    }
}

body .tts-message.fade-in {
    animation: ttsSlideIn 0.2s cubic-bezier(0.4, 0, 0.2, 1) forwards !important;
}

body .tts-message.fade-out {
    animation: ttsSlideOut 0.2s cubic-bezier(0.4, 0, 0.2, 1) forwards !important;
}

/* 移动端适配 */
@media screen and (max-width: 480px) {
    body .tts-message {
        min-width: calc(100vw - 32px) !important;
        margin: 0 16px !important;
        padding: 14px !important;
        font-size: 13px !important;
        border-radius: 10px !important;
    }
}

/* 响应式布局断点 */
@media (max-width: 1200px) {
    .voice-cards {
        grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    }
}

@media (max-width: 992px) {
    .tts-container {
        flex-direction: column;
    }

    .tts-left-panel,
    .tts-right-panel,
    .multi-voice-panel {
        flex: 1 0 100%;
        width: 100%;
    }

    .tts-left-panel {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding-right: 0;
        padding-bottom: 16px;
    }

    .control-row,
    .emotion-controls {
        flex-direction: column;
    }
    
    .synthesis-controls {
        flex-direction: column;
    }
    
    .control-buttons {
        justify-content: center;
    }
    
    .voice-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}

@media (max-width: 768px) {
    .tts-container {
        padding: 8px;
    }
    
    .control-row,
    .emotion-controls,
    .synthesis-controls {
        padding: 8px;
    }
    
    .control-group {
        width: 100%;
    }
    
    .voice-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .player-controls {
        min-width: 300px;
    }
    
    .progress-container {
        min-width: 200px;
    }
    
    .progress-bar {
        min-width: 150px;
    }
}

@media (max-width: 480px) {
    .voice-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .voice-card {
        padding: 8px;
    }
    
    .voice-avatar-wrapper {
        width: 40px;
        height: 40px;
    }
    
    .voice-name {
        font-size: 12px;
    }
    
    .voice-desc {
        font-size: 11px;
    }
    
    .primary-btn {
        width: 100%;
    }
}

/* 确保所有容器都使用border-box */
* {
    box-sizing: border-box;
}

/* 基础样式设置 */
body {
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100vh;
    overflow-x: hidden;
    max-width: 100vw;
}

/* 滑块组件美化 */
.slider-container input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    outline: none;
}

.slider-container input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
}

.slider-container input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

/* 文本区域美化 */
.text-input-area textarea {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    font-size: 15px;
    line-height: 1.6;
    transition: var(--transition);
}

.text-input-area textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

/* 播放器控件美化 */
.player-controls {
    background: var(--secondary-color);
    border-radius: 12px;
    padding: 16px 24px;
}

.progress-bar {
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
}

.progress {
    background: var(--primary-color);
    border-radius: 3px;
}

/* 动画效果优化 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.voice-card {
    animation: fadeIn 0.3s ease-out;
}

/* 情感风格选择框样式 */
.emotion-style-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    color: #999;
    background-color: #fff;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' stroke='%23999' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

.emotion-style-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.emotion-style-select:hover {
    border-color: #999;
}

/* 统一标签文字样式 */
.emotion-controls .control-label {
    min-width: 70px;
    font-size: 14px;
    color: #999;
    white-space: nowrap;
}

/* 保持情感控制区域原有布局 */
.emotion-controls .emotion-style-select {
    flex: 1;
}

/* 右侧控制面板统一样式 */
.control-item {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    padding: 8px;
}

.control-item label {
    min-width: 70px;
    font-size: 14px;
    color: #333;
    margin-right: 10px;
}

.control-item input[type="range"] {
    flex: 1;
    height: 4px;
    background: #e0e0e0;
    border-radius: 2px;
    -webkit-appearance: none;
    outline: none;
}

.control-item input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #4a90e2;
    cursor: pointer;
    transition: all 0.2s ease;
}

/* 数值显示样式 */
.control-value {
    min-width: 40px;
    text-align: right;
    margin-left: 8px;
    font-size: 14px;
    color: #666;
}

/* 统一右侧控制面板样式 */
.control-group {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* 统一所有标签文字样式 */
.control-label,
.emotion-label,
.control-group label {
    min-width: 70px;
    font-size: 14px;
    color: #999;
    white-space: nowrap;
    font-weight: normal;
}

/* 统一下拉选择框样式 */
.emotion-style-select,
.control-group select {
    min-width: 120px;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    color: #999;
    background-color: #fff;
}

/* 统一滑块容器样式 */
.slider-container {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 统一滑块值显示样式 */
.slider-value,
.control-value {
    min-width: 40px;
    text-align: right;
    font-size: 14px;
    color: #999;
}

/* 统一"正常"文字样式 */
.slider-container .normal-text {
    font-size: 14px;
    color: #999;
    white-space: nowrap;
}

/* 情感控制区域 */
.emotion-controls {
    display: flex;
    flex-direction: row;
    gap: 24px;
    background: var(--secondary-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 16px;
    width: 100%;
}

/* 情感控制组样式 */
.emotion-controls .control-group {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0; /* 允许内容压缩 */
}

/* 情感风格选择框样式 */
.emotion-style-select {
    flex: 1;
}

/* 情感程度滑块容器样式 */
.emotion-controls .slider-container {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: unset; /* 移除最小宽度限制 */
}

/* 标签样式统一 */
.emotion-controls .control-label {
    min-width: 80px; /* 稍微增加标签宽度 */
    font-size: 14px;
    color: #999;
    white-space: nowrap;
}

/* 滑块值和正常文字样式 */
.emotion-controls .slider-value,
.emotion-controls .normal-text {
    min-width: 40px;
    font-size: 14px;
    color: #999;
    white-space: nowrap;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .emotion-controls {
        flex-direction: column;
        padding: 12px;
    }

    .emotion-controls .control-group {
        width: 100%;
    }

    .emotion-style-select {
        min-width: 150px;
    }

    .emotion-controls .slider-container {
        min-width: 150px;
    }
}

/* 禁用状态的按钮样式 */
.control-btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed !important; /* 强制使用禁止指针 */
    background-color: #f5f5f5;
    border: 1px solid var(--border-color);
    pointer-events: none; /* 禁用所有鼠标事件 */
}

.control-btn[disabled] svg {
    fill: #999; /* 图标颜色变灰 */
}

/* 禁用状态下移除悬停效果 */
.control-btn[disabled]:hover {
    background-color: #f5f5f5;
    transform: none;
}

/* 禁用状态下移除提示 */
.control-btn[disabled]::before,
.control-btn[disabled]::after {
    display: none;
}

/* 播放按钮禁用状态 */
#play-btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed !important;
    pointer-events: auto; /* 允许鼠标事件以显示禁止指针 */
}

/* 下载按钮禁用状态 */
#tts-download[disabled] {
    opacity: 0.5;
    cursor: not-allowed !important;
    pointer-events: auto; /* 允许鼠标事件以显示禁止指针 */
}

/* 合成按钮禁用状态 */
.primary-btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed !important;
    background: #ccc;
    pointer-events: auto; /* 允许鼠标事件以显示禁止指针 */
}

/* 移动端适配 */
@media screen and (max-width: 992px) {
    /* 整体容器布局 */
    .tts-container {
        flex-direction: column;
        padding: 2vw;
        gap: 2vw;
    }
    
    /* 左侧面板 */
    .tts-left-panel {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: 2vw;
    }
    
    /* 右侧面板 */
    .tts-right-panel,
    .multi-voice-panel {
        width: 100%;
        padding: 2vw;
    }
    
    /* 音色卡片网格布局 */
    .voice-cards {
        grid-template-columns: repeat(4, 1fr);
        gap: 2vw;
    }

    /* 音色卡片样式 */
    .voice-card {
        padding: 2vw;
    }

    /* 控制面板布局 */
    .synthesis-controls {
        flex-wrap: wrap;
        gap: 2vw;
        padding: 2vw;
    }

    /* 文本输入区域 */
    .text-input-area {
        padding: 2vw;
    }

    /* 控制器区域 */
    .control-row {
        gap: 2vw;
    }

    /* 多人配音部分 */
    .role-binding-header {
        padding: 2vw;
        gap: 2vw;
    }
    
    .role-binding-container {
        gap: 2vw;
        padding: 2vw;
    }

    /* 搜索筛选区域 */
    .search-filter-row {
        padding: 2vw;
        gap: 2vw;
    }
}

@media screen and (max-width: 768px) {
    .action-buttons button,
    .format-switch button,
    #multi-voice-synthesize-btn,
    #multi-voice-play-btn,
    #multi-voice-download-btn {
        padding: 2.5vw;
        font-size: 3.5vw;
        max-font-size: 14px;
    }
}

@media screen and (max-width: 576px) {
    .action-buttons button,
    .format-switch button,
    #multi-voice-synthesize-btn,
    #multi-voice-play-btn,
    #multi-voice-download-btn {
        padding: 3vw;
        font-size: 4vw;
        max-font-size: 14px;
    }
    
    .multi-voice-controls button svg {
        width: 5vw;
        height: 5vw;
    }
}

@media screen and (max-width: 375px) {
    .action-buttons button,
    .format-switch button,
    #multi-voice-synthesize-btn,
    #multi-voice-play-btn,
    #multi-voice-download-btn {
        padding: 3.5vw;
        font-size: 4.5vw;
        max-font-size: 13px;
    }
    
    .multi-voice-controls button svg {
        width: 6vw;
        height: 6vw;
    }
}

/* 移动端适配 - 768px及以下屏幕 */
@media screen and (max-width: 768px) {
    /* 音色卡片布局 */
    .voice-cards {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* 筛选器布局 */
    .tts-filters {
        flex-direction: column;
        gap: 2vw;
    }
    
    /* 控制器布局 */
    .control-row {
        flex-direction: column;
        gap: 2vw;
    }

    /* 字数统计区域 */
    .word-count-container {
        padding: 2vw;
        gap: 2vw;
    }

    /* 按钮组布局 */
    .action-buttons,
    .control-buttons {
        gap: 2vw;
    }

    /* 进度条区域 */
    .progress-container {
        padding: 2vw;
    }
}

/* 移动端适配 - 576px及以下屏幕 */
@media screen and (max-width: 576px) {
    /* 音色卡片布局 */
    .voice-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* 按钮和控件大小调整 */
    .control-btn,
    .format-btn,
    .action-buttons button {
        padding: 2vw;
    }
    
    /* 多人配音角色绑定 */
    .role-binding-container {
        grid-template-columns: 1fr;
    }

    /* 搜索筛选区域 */
    .search-filter-wrapper {
        padding: 2vw;
    }

    /* 文本区域 */
    textarea {
        padding: 2vw;
    }
}

/* 移动端适配 - 375px及以下超小屏幕 */
@media screen and (max-width: 375px) {
    /* 音色卡片进一步优化 */
    .voice-cards {
        gap: 1.5vw;
    }
    
    .voice-card {
        padding: 1.5vw;
    }

    /* 按钮和控件进一步优化 */
    .control-btn,
    .format-btn,
    .action-buttons button {
        padding: 1.5vw;
    }

    /* 文本区域 */
    textarea {
        padding: 1.5vw;
    }

    /* 搜索筛选区域 */
    .search-filter-wrapper {
        padding: 1.5vw;
    }
}

/* 触摸屏优化 */
@media (pointer: coarse) {
    /* 增加点击区域 */
    .control-btn,
    .voice-card,
    button,
    select,
    input[type="range"] {
        padding: 2vw;
    }
    
    /* 增加间距防止误触 */
    .tts-filters,
    .control-group,
    .action-buttons {
        gap: 2vw;
    }
}

/* 确保视口设置正确 */
@-ms-viewport {
    width: device-width;
}

@viewport {
    width: device-width;
}

/* 添加视口meta标签 */

/* 移除所有固定宽度限制 */
.player-controls {
    min-width: unset; /* 移除固定最小宽度 */
}

.progress-container {
    min-width: unset; /* 移除固定最小宽度 */
}

.progress-bar {
    min-width: unset; /* 移除固定最小宽度 */
}

/* 移除情感控制区域的固定宽度 */
.emotion-controls .slider-container {
    min-width: unset;
}

.emotion-style-select {
    min-width: unset;
}

/* 移除控制标签的固定宽度 */
.control-label {
    min-width: unset;
    margin-right: 8px;
}

/* 优化移动端布局 */
@media screen and (max-width: 768px) {
    /* 确保所有容器都是完全自适应的 */
    .tts-container,
    .tts-left-panel,
    .tts-right-panel,
    .control-row,
    .emotion-controls,
    .synthesis-controls,
    .control-group,
    .slider-container,
    .progress-container {
        width: 100%;
        min-width: unset;
        max-width: 100%;
    }

    /* 优化控制组的布局 */
    .control-group {
        display: grid;
        grid-template-columns: auto 1fr auto;
        gap: 8px;
        align-items: center;
    }

    /* 优化滑块容器 */
    .slider-container {
        display: grid;
        grid-template-columns: 1fr auto;
        gap: 8px;
    }

    /* 调整文字大小 */
    .slider-value,
    .normal-text,
    .control-label {
        font-size: 13px;
    }
}

/* 特小屏幕的额外优化 */
@media screen and (max-width: 480px) {
    .tts-container {
        padding: 8px;
    }

    .synthesis-controls,
    .emotion-controls,
    .control-row {
        padding: 8px;
        gap: 8px;
    }

    /* 在特小屏幕下隐藏"正常"文字 */
    .normal-text {
        display: none;
    }
}

/* 多人配音布局相关样式 */
.tts-container[data-mode="multi"] .tts-right-panel {
    display: none;
}

.tts-container[data-mode="single"] .multi-voice-panel {
    display: none;
}

.multi-voice-panel {
    flex: 2;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* 移动端适配 */
@media screen and (max-width: 768px) {
    .slider-container {
        padding-top: 12px; /* 减小上方padding */
    }

    .control-group {
        display: flex;
        flex-direction: column;
        gap: 8px;
        width: 100%;
    }

    .slider-container {
        display: flex;
        flex-direction: column;
        width: 100%;
    }

    /* 调整滑块值到更合适的位置 */
    .slider-value {
        top: -12px; /* 减小与滑块的距离 */
    }
}

/* 特小屏幕的额外优化 */
@media screen and (max-width: 480px) {
    .slider-value {
        font-size: 11px;
        top: -10px; /* 在特小屏幕上距离更小 */
    }
}

/* 范围值显示样式 */
.range-value {
    font-size: 12px;
    color: #666;
    margin-left: 8px;
    white-space: nowrap;
    min-width: 30px;  /* 减小宽度，只显示数值 */
    text-align: left;
}

/* 字数统计样式 - 只针对单人配音 */
.tts-right-panel .char-counter {
    margin-left: 15px;
    font-size: 12px;
    color: #666;
    display: inline-flex;
    align-items: center;
}

/* 调整长文本开关和字数统计的布局 - 只针对单人配音 */
.tts-right-panel .long-text-switch {
    position: absolute;
    bottom: 10px;
    right: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.9);
    padding: 4px 8px;
    border-radius: 4px;
}

.tencent-tts-admin {
    max-width: 800px;
    margin: 20px;
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.tencent-tts-admin h2 {
    color: #1e293b;
    margin-bottom: 20px;
    font-weight: 600;
}

.tencent-tts-form {
    display: grid;
    gap: 20px;
}

.tencent-tts-field {
    display: grid;
    gap: 8px;
}

.tencent-tts-label {
    font-size: 14px;
    font-weight: 500;
    color: #475569;
}

.tencent-tts-input {
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    width: 100%;
    transition: all 0.2s ease;
}

.tencent-tts-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.tencent-tts-submit {
    background: #2563eb;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.tencent-tts-submit:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
}

.tencent-tts-message {
    padding: 12px;
    border-radius: 6px;
    margin-top: 15px;
    font-size: 14px;
}

.tencent-tts-success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.tencent-tts-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* 长文本开关样式优化 */
.long-text-switch {
    position: absolute;
    bottom: 10px;
    right: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
}

.long-text-switch input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 44px;
    height: 26px;
    background: #e9e9ea;
    border-radius: 13px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.long-text-switch input[type="checkbox"]:checked {
    background: #34c759;
}

.long-text-switch input[type="checkbox"]::before {
    content: '';
    position: absolute;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    top: 1px;
    left: 1px;
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.long-text-switch input[type="checkbox"]:checked::before {
    left: 19px;
}

.long-text-switch label {
    font-size: 14px;
    color: #333;
    cursor: pointer;
    user-select: none;
}

/* 移动端适配 */
@media screen and (max-width: 480px) {
    .long-text-switch {
        padding: 6px 10px;
    }
    
    .long-text-switch input[type="checkbox"] {
        width: 40px;
        height: 24px;
    }
    
    .long-text-switch input[type="checkbox"]::before {
        width: 22px;
        height: 22px;
    }
    
    .long-text-switch input[type="checkbox"]:checked::before {
        left: 17px;
    }
    
    .long-text-switch label {
        font-size: 13px;
    }
}

/* 长文本开关禁用状态样式 */
.long-text-switch.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.long-text-switch.disabled input[type="checkbox"] {
    cursor: not-allowed;
}

.long-text-switch.disabled label {
    cursor: not-allowed;
}

.word-count-container {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin: 15px 0;
    padding: 12px 20px;
    background: #f8fafc;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    gap: 15px;
}

/* 字数信息样式 */
.word-count-info {
    color: #64748b;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
    text-align: right;
}

/* 已使用字数样式 */
#daily-word-count {
    color: #0ea5e9;
    font-weight: 600;
    margin: 0 3px;
}

/* 剩余字数样式 */
.word-count-remaining {
    color: #64748b;
}

#remaining-word-count {
    color: #10b981;
    font-weight: 600;
    margin: 0 3px;
}

/* 提示信息样式 */
.word-count-tip {
    color: #f59e0b;
    font-size: 13px;
    padding: 4px 12px;
    background: #fff7ed;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.word-count-tip:hover {
    background: #ffedd5;
}

/* 响应式布局 */
@media screen and (max-width: 768px) {
    .word-count-container {
        flex-direction: column;
        gap: 10px;
        align-items: flex-end;
    }
    
    .word-count-info {
        justify-content: flex-end;
    }
}

/* VIP 功能按钮样式 */
.save-binding-btn {
    position: relative;
}

/* VIP 标志样式 */
.vip-badge {
    position: absolute;
    top: -10px;
    left: -10px;
    background: linear-gradient(45deg, #FFD700, #FFA500);
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    transform: rotate(-45deg);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    z-index: 1;
}

/* 非会员按钮样式 */
.save-binding-btn[disabled] {
    cursor: not-allowed !important;
    opacity: 0.7;
    pointer-events: auto !important;  /* 允许hover效果 */
}

/* 非会员按钮悬停样式 */
.save-binding-btn[disabled]:hover {
    cursor: not-allowed !important;
    background-color: #2271b1 !important;  /* 保持WordPress按钮原色 */
}

/* 非会员悬停提示样式 */
.save-binding-btn .tooltip {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    color: #666;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 100;
}

/* 非会员悬停时显示提示 */
.save-binding-btn[disabled]:hover .tooltip {
    opacity: 1;
    visibility: visible;
}

/* 确保标签样式在弹窗中也生效 */
.multi-voice-dialog .voice-card {
    position: relative; /* 确保标签定位正确 */
}

.multi-voice-dialog .corner-tag {
    position: absolute;
    top: 0;
    right: 0;
    font-size: 8px;
    padding: 1px 4px;
    border-top-right-radius: 4px;
    border-bottom-left-radius: 4px;
    font-weight: 500;
    letter-spacing: 0.2px;
    z-index: 3;
    box-shadow: -1px 1px 3px rgba(0, 0, 0, 0.08);
}

/* 确保所有标签类型的样式在弹窗中也生效 */
.multi-voice-dialog .corner-tag.emotion,
.multi-voice-dialog .corner-tag.ai,
.multi-voice-dialog .corner-tag.basic,
.multi-voice-dialog .corner-tag.dialect,
.multi-voice-dialog .corner-tag.child,
.multi-voice-dialog .corner-tag.foreign {
    background: rgba(0, 0, 0, 0.8);
    color: white;
}

/* 基础响应式布局设置 */
@media screen and (max-width: 1200px) {
    .tts-container {
        padding: 12px;
    }
    
    .tts-left-panel {
        flex: 0 0 25%;
        width: 25%;
    }
    
    .tts-right-panel,
    .multi-voice-panel {
        flex: 0 0 75%;
        width: 75%;
    }
}

@media screen and (max-width: 992px) {
    .tts-container {
        flex-direction: column;
        gap: 16px;
    }
    
    .tts-left-panel {
        flex: 0 0 auto;
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding-bottom: 16px;
    }
    
    .tts-right-panel,
    .multi-voice-panel {
        flex: 0 0 auto;
        width: 100%;
        padding-right: 0;
    }
    
    /* 音色卡片网格布局优化 */
    .voice-cards {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
    }
    
    /* 控制面板布局优化 */
    .synthesis-controls {
        flex-direction: column;
        gap: 12px;
    }
    
    .control-buttons {
        width: 100%;
        justify-content: center;
    }
}

@media screen and (max-width: 768px) {
    /* 头部控制区域 */
    .tts-mode-switch {
        flex-wrap: wrap;
    }
    
    .tts-mode-switch button {
        flex: 1 1 calc(50% - 4px);
        font-size: 14px;
    }
    
    /* 筛选区域 */
    .tts-filters {
        flex-direction: column;
        gap: 8px;
    }
    
    .filter-group {
        width: 100%;
    }
    
    /* 控制器布局 */
    .control-row {
        flex-direction: column;
    }
    
    .control-group {
        width: 100%;
    }
    
    /* 字数统计区域 */
    .word-count-container {
        flex-direction: column;
        align-items: flex-start;
        padding: 10px;
    }
    
    .word-count-info,
    .word-count-remaining {
        width: 100%;
        text-align: left;
    }
}

@media screen and (max-width: 576px) {
    .tts-container {
        padding: 8px;
    }
    
    /* 文本输入区域 */
    .text-input-area textarea {
        min-height: 100px;
        font-size: 14px;
    }
    
    /* 控制按钮 */
    .control-btn {
        padding: 8px;
    }
    
    /* 音色卡片进一步优化 */
    .voice-cards {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 8px;
    }
    
    .voice-card {
        padding: 8px;
    }
    
    .voice-name {
        font-size: 13px;
    }
    
    .voice-desc {
        font-size: 12px;
    }
    
    /* 长文本开关位置调整 */
    .long-text-switch {
        bottom: 5px;
        right: 5px;
        font-size: 12px;
    }
}

/* 超小屏幕适配 */
@media screen and (max-width: 375px) {
    .tts-container {
        padding: 6px;
    }
    
    /* 进一步简化音色卡片 */
    .voice-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* 调整按钮和控制器大小 */
    .control-btn {
        padding: 6px;
    }
    
    .control-btn svg {
        width: 18px;
        height: 18px;
    }
    
    /* 调整输入框和标签大小 */
    input[type="text"],
    input[type="number"],
    select {
        font-size: 13px;
    }
    
    .control-label {
        font-size: 13px;
    }
}

/* 优化滑块控制器在移动端的触摸体验 */
@media (hover: none) and (pointer: coarse) {
    input[type="range"]::-webkit-slider-thumb {
        width: 24px;
        height: 24px;
    }
    
    .slider-container {
        margin: 10px 0;
    }
    
    input[type="range"] {
        height: 6px;
    }
}

/* 优化触摸屏交互 */
@media (pointer: coarse) {
    .control-btn,
    .voice-card,
    button {
        min-height: 44px; /* 确保触摸目标足够大 */
    }
    
    select {
        height: 44px;
    }
    
    /* 增加点击区域的间距 */
    .tts-filters,
    .control-group {
        gap: 12px;
    }
}

/* 移动端适配 - 992px及以下屏幕 */
@media screen and (max-width: 992px) {
    /* 整体容器布局 */
    .tts-container {
        flex-direction: column;
        padding: 2vw;
        gap: 2vw;
    }
    
    /* 左侧面板 */
    .tts-left-panel {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: 2vw;
    }
    
    /* 右侧面板 */
    .tts-right-panel,
    .multi-voice-panel {
        width: 100%;
        padding: 2vw;
    }
    
    /* 音色卡片网格布局 */
    .voice-cards {
        grid-template-columns: repeat(4, 1fr);
        gap: 2vw;
    }

    /* 音色卡片样式 */
    .voice-card {
        padding: 2vw;
    }

    /* 控制面板布局 */
    .synthesis-controls {
        flex-wrap: wrap;
        gap: 2vw;
        padding: 2vw;
    }

    /* 文本输入区域 */
    .text-input-area {
        padding: 2vw;
    }

    /* 控制器区域 */
    .control-row {
        gap: 2vw;
    }

    /* 多人配音部分 */
    .role-binding-header {
        padding: 2vw;
        gap: 2vw;
    }
    
    .role-binding-container {
        gap: 2vw;
        padding: 2vw;
    }

    /* 搜索筛选区域 */
    .search-filter-row {
        padding: 2vw;
        gap: 2vw;
    }
}

/* 移动端适配 - 768px及以下屏幕 */
@media screen and (max-width: 768px) {
    /* 音色卡片布局 */
    .voice-cards {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* 筛选器布局 */
    .tts-filters {
        flex-direction: column;
        gap: 2vw;
    }
    
    /* 控制器布局 */
    .control-row {
        flex-direction: column;
        gap: 2vw;
    }

    /* 字数统计区域 */
    .word-count-container {
        padding: 2vw;
        gap: 2vw;
    }

    /* 按钮组布局 */
    .action-buttons,
    .control-buttons {
        gap: 2vw;
    }

    /* 进度条区域 */
    .progress-container {
        padding: 2vw;
    }
}

/* 移动端适配 - 576px及以下屏幕 */
@media screen and (max-width: 576px) {
    /* 音色卡片布局 */
    .voice-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* 按钮和控件大小调整 */
    .control-btn,
    .format-btn,
    .action-buttons button {
        padding: 2vw;
    }
    
    /* 多人配音角色绑定 */
    .role-binding-container {
        grid-template-columns: 1fr;
    }

    /* 搜索筛选区域 */
    .search-filter-wrapper {
        padding: 2vw;
    }

    /* 文本区域 */
    textarea {
        padding: 2vw;
    }
}

/* 移动端适配 - 375px及以下超小屏幕 */
@media screen and (max-width: 375px) {
    /* 音色卡片进一步优化 */
    .voice-cards {
        gap: 1.5vw;
    }
    
    .voice-card {
        padding: 1.5vw;
    }

    /* 按钮和控件进一步优化 */
    .control-btn,
    .format-btn,
    .action-buttons button {
        padding: 1.5vw;
    }

    /* 文本区域 */
    textarea {
        padding: 1.5vw;
    }

    /* 搜索筛选区域 */
    .search-filter-wrapper {
        padding: 1.5vw;
    }
}

/* 触摸屏优化 */
@media (pointer: coarse) {
    /* 增加点击区域 */
    .control-btn,
    .voice-card,
    button,
    select,
    input[type="range"] {
        padding: 2vw;
    }
    
    /* 增加间距防止误触 */
    .tts-filters,
    .control-group,
    .action-buttons {
        gap: 2vw;
    }
}

/* 多人配音按钮自适应 */
@media screen and (max-width: 992px) {
    /* 插入删除按钮组 */
    .search-filter-row .action-buttons {
        display: flex;
        width: 100%;
        gap: 2vw;
    }
    
    .search-filter-row .action-buttons button {
        flex: 1;
        padding: 2vw;
        white-space: nowrap;
    }
    
    /* 音频控制按钮组 */
    .voice-control-area {
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 2vw;
    }
    
    /* 格式切换按钮组 */
    .voice-control-area .format-switch {
        display: flex;
        gap: 2vw;
        width: 100%;
    }
    
    .voice-control-area .format-switch button {
        flex: 1;
        padding: 2vw;
    }
    
    /* 音频播放控制按钮组 */
    .multi-voice-controls {
        display: flex;
        gap: 2vw;
        width: 100%;
    }
    
    .multi-voice-controls button {
        flex: 1;
        padding: 2vw;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 1vw;
    }
    
    .multi-voice-controls button svg {
        width: 4vw;
        height: 4vw;
        max-width: 24px;
        max-height: 24px;
    }
}

@media screen and (max-width: 768px) {
    .search-filter-row {
        flex-direction: column;
        gap: 2vw;
    }
    
    .search-filter-wrapper {
        width: 100%;
    }
    
    .search-filter-row .action-buttons {
        width: 100%;
    }
    
    .search-filter-row .action-buttons button,
    .voice-control-area .format-switch button,
    .multi-voice-controls button {
        padding: 2.5vw;
        font-size: 3.5vw;
    }
}

@media screen and (max-width: 576px) {
    .search-filter-row .action-buttons button,
    .voice-control-area .format-switch button,
    .multi-voice-controls button {
        padding: 3vw;
        font-size: 4vw;
    }
    
    .multi-voice-controls button svg {
        width: 5vw;
        height: 5vw;
    }
}

@media screen and (max-width: 375px) {
    .search-filter-row .action-buttons button,
    .voice-control-area .format-switch button,
    .multi-voice-controls button {
        padding: 3.5vw;
        font-size: 4.5vw;
    }
    
    .multi-voice-controls button svg {
        width: 6vw;
        height: 6vw;
    }
}