:root {
    --primary: #4361ee;
    --primary-dark: #3a56d4;
    --secondary: #7209b7;
    --success: #4cc9f0;
    --danger: #f72585;
    --warning: #f8961e;
    --info: #4895ef;
    --download: #4CAF50;
    --download-hover: #45a049;
    --listen: #2196F3;
    --listen-hover: #1976D2;
    --light: #f8f9fa;
    --dark: #212529;
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #6c757d;
    --gray-700: #495057;
    --gray-800: #343a40;
    --gray-900: #212529;
    --border-radius: 12px;
    --box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #303030;
    min-height: 100vh;
    padding: 20px;
    color: white;
}
.container {
    max-width: 1000px;
    margin: 0 auto;
}
header {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    color: white;
}
header h1 {
    font-size: 2rem;
    color: #2383ff;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
header p {
    font-size: 1rem;
    opacity: 0.9;
    margin: 0 auto;
}
.tabs {
    display: flex;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: var(--box-shadow);
}
.tab {
    flex: 1;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
    border-bottom: 3px solid transparent;
    font-size: 15px;
}
.tab.active {
    background-color: rgba(67, 97, 238, 0.05);
    font-size: 18px;
}
.tab-content {
    display: none;
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--box-shadow);
    animation: fadeIn 0.3s ease;
}
.tab-content.active {
    display: block;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.section {
    margin-bottom: 80px;
}
.section h2 {
    color: var(--primary);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--gray-200);
    display: flex;
    align-items: center;
    gap: 10px;
}
.section h2 i {
    font-size: 1.2em;
}
.form-group {
    margin-bottom: 20px;
}
label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}
input, textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #636363;
    border-radius: 8px;
    font-size: 14px;
    transition: var(--transition);
    background-color: #454545;
    color: white;
}
input:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    background-color: #343a40;
}
textarea {
    min-height: 100px;
    resize: vertical;
}
 .wechat-browser-tip {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.5);
            display: flex;
            justify-content: center;
            align-items: center;
            z-index: 9999;
        }

        .wechat-browser-tip .tip-content {
            background: white;
            padding: 20px;
            border-radius: 8px;
            text-align: center;
            max-width: 80%;
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        }

        .wechat-browser-tip h3 {
            margin-top: 0;
            color: #333;
        }

        .wechat-browser-tip p {
            color: #666;
            line-height: 1.5;
        }

        .wechat-browser-tip .close-tip {
            margin-top: 15px;
            padding: 8px 16px;
            background-color: #007bff;
            color: white;
            border: none;
            border-radius: 4px;
            cursor: pointer;
        }

        .wechat-browser-tip .close-tip:hover {
            background-color: #0056b3;
        }
.text-info-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 5px;
}
.text-length-counter {
    text-align: right;
    font-size: 12px;
    color: var(--gray-500);
}
.text-length-counter.over-limit {
    color: var(--danger);
}
/* 文本框清除按钮 */
.clear-text-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 4px;
    padding: 2px 8px;
    color: #ccc;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
}
.clear-text-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}
/* 完全自定义的输入框组件 */
.custom-text-input {
    position: relative;
    width: 100%;
    min-height: 46px;
}
.custom-text-input .input-display {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #636363;
    border-radius: 8px;
    font-size: 14px;
    background-color: #454545;
    color: #cccccc;
    transition: all 0.3s ease;
    box-sizing: border-box;
    cursor: text;
    position: relative;
}
.custom-text-input .input-display:focus {
    outline: none;
    border-color: #4361ee;
    background-color: #343a40;
    color: white;
    box-shadow: 0 0 0 2px rgba(67, 97, 238, 0.2);
}
/* 有内容时的样式 */
.custom-text-input.has-content .input-display {
    background-color: #1e3a5f; /* 指令输入后的背景色 */
    color: #4cc9f0;             /* 指令输入后的字体色 */
    border-color: #4895ef;
}
.custom-text-input.has-content .input-display:focus {
    background-color: #2a4a7a;
    color: white;
    border-color: #4361ee;
}
.custom-text-input .hidden-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.custom-text-input .input-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 12px 15px;
    border: none;
    background: transparent;
    color: inherit;
    font-size: 14px;
    box-sizing: border-box;
    caret-color: white;
}
.custom-text-input .placeholder {
    top: 12px;
    left: 15px;
    color: #888888;
    pointer-events: none;
    transition: opacity 0.2s;
}
.custom-text-input.has-content .placeholder {
    opacity: 0;
}
.custom-text-input.focused .placeholder {
    opacity: 0;
}
.file-upload {
    position: relative;
    display: flex;
    align-items: center;
    gap: 15px;
}
.file-upload input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 2;
}
.file-upload-label {
    flex: 1;
    padding: 12px 15px;
    border: 2px dashed var(--gray-300);
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    z-index: 1;
    box-sizing: border-box;
}
.file-upload-label:hover {
    border-color: var(--primary);
}
.file-upload-label i {
    margin-right: 8px;
}
.file-name {
    font-size: 14px;
    color: var(--gray-600);
    margin-top: 5px;
}
.inline-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}
.inline-group label {
    margin-bottom: 0;
    font-weight: 600;
}
.slider-container {
    flex: 1;
    display: flex;
    align-items: center;
}
/* 修改滑块样式为灰色 */
.slider-container input[type="range"] {
    flex: 1;
    height: 6px;
    background: #9e9e9e; /* 灰色轨道 */
    border-radius: 3px;
    outline: none;
}
.slider-container input[type="range"]::-webkit-slider-thumb {
    width: 20px;
    height: 20px;
    background: #e0e0e0; /* 浅灰色滑块手柄 */
    border-radius: 50%;
    cursor: pointer;
}
.slider-container input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #e0e0e0; /* 浅灰色滑块手柄 */
    border-radius: 50%;
    cursor: pointer;
    border: none;
}
.slider-value {
    min-width: 40px;
    text-align: center;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 14px;
}
button {
    padding: 15px;
    background: linear-gradient(135deg, var(--download) 0%, #2E7D32 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}
button:hover:not(:disabled) {
    transform: translateY(-2px);
}
button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}
.result {
    margin-top: 20px;
    padding: 20px;
    border-radius: 8px;
    background: #454545;
}
.result.error {
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
    border-left: 4px solid var(--danger);
}
.result h3 {
    margin-bottom: 15px;
}
.custom-audio-player.reference-player .play-btn {
    background: var(--gray-600);
}
.custom-audio-player.reference-player .play-btn:hover {
    background: var(--gray-700);
}
/* 修改进度条为灰色 */
.custom-audio-player.reference-player .progress-bar-filled {
    background: #9e9e9e; /* 灰色进度条（参考音频） */
}
.custom-audio-player.reference-player .progress-bar {
    background: #e0e0e0; /* 浅灰色背景 */
}
.custom-audio-player.generated-player .play-btn {
    background: var(--primary);
}
.custom-audio-player.generated-player .play-btn:hover {
    background: var(--primary-dark);
}
/* 修改进度条为灰色 */
.custom-audio-player.generated-player .progress-bar-filled {
    background: #9e9e9e; /* 灰色进度条（生成音频） */
}
.custom-audio-player.generated-player .progress-bar {
    background: #e0e0e0; /* 浅灰色背景 */
}
/* 自定义音频播放器样式 */
.custom-audio-player {
    display: flex;
    align-items: center;
    border-radius: 8px;
    padding: 10px 0px;
    width: 100%;
    box-sizing: border-box;
    gap: 10px;
}
.custom-audio-player .play-btn {
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    font-size: 14px;
    flex-shrink: 0;
}
.custom-audio-player .play-btn:hover {
    transform: scale(1.05);
}
.custom-audio-player .progress-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}
.custom-audio-player .time-display {
    font-size: 12px;
    color: var(--gray-600);
    text-align: left;
}
.custom-audio-player .progress-bar {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    cursor: pointer;
    position: relative;
}
.custom-audio-player .progress-bar-filled {
    height: 100%;
    border-radius: 3px;
    width: 0%;
}
.hidden-audio {
    display: none;
}
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px;
    background: var(--gray-100);
    border-radius: 8px;
    margin: 10px 0;
}
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(67, 97, 238, 0.2);
    border-top: 2px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
.auto-recognized {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border-left: 4px solid #4caf50;
    padding: 15px;
    margin: 15px 0;
    border-radius: 8px;
}
.auto-recognized.error {
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
    border-left: 4px solid var(--danger);
}
.audio-preview {
    margin-top: 15px;
    padding: 15px;
    background: var(--gray-100);
    border-radius: 8px;
}
.audio-preview p {
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--gray-700);
}
.audio-controls {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    flex-wrap: wrap;
}
.audio-controls .btn {
    flex: 1;
    min-width: 120px;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: none;
    cursor: pointer;
}
.audio-controls .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}
.btn-download {
    background: linear-gradient(135deg, var(--download) 0%, #2E7D32 100%);
    color: white;
}
.btn-download:hover {
    background: linear-gradient(135deg, var(--download-hover) 0%, #1B5E20 100%);
}
.btn-listen {
    background: linear-gradient(135deg, var(--listen) 0%, #0D47A1 100%);
    color: white;
}
.btn-listen:hover {
    background: linear-gradient(135deg, var(--listen-hover) 0%, #01579B 100%);
}
footer {
    text-align: center;
    color: #595959;
    margin-top: 30px;
    padding: 20px;
    opacity: 0.8;
}
footer a{
    color: #595959;
    text-decoration: none;
}
.uploaded-audio-preview {
    background: #454545;
    border-radius: 12px;
    padding: 20px;
    margin-top: 15px;
    position: relative;
    width: 100%;
    box-sizing: border-box;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}
.uploaded-audio-preview:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
}
.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #d1e0ee;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}
.preview-file-name {
    font-weight: 600;
    flex: 1;
    min-width: 0;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}
.remove-btn {
    background: rgba(0, 0, 0, 0) !important;
    color:  var(--gray-600) !important;
    border: none !important;
    border-radius: 6px;
    padding: 8px 15px;
    cursor: pointer;
    font-size: 14px;
    flex-shrink: 0;
    white-space: nowrap;
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
    box-shadow: none !important;
    height: 50px;
    box-sizing: border-box;
}
.remove-btn:hover .fa-trash {
    color: var(--gray-600) !important;
}
.remove-btn:active {
    background: rgba(0, 0, 0, 0) !important;
    color: var(--gray-600) !important;
    transform: translateY(0);
}
.audio-player-container {
    background: transparent !important;
}
.audio-player-container {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100%;
    box-sizing: border-box;
}
.audio-player-container .custom-audio-player {
    flex: 1;
    margin: 0;
    min-width: 0;
}
.audio-player-container .remove-btn {
    margin: 0;
    height: 50px;
}
/* 自定义下拉菜单样式 */
.custom-select {
    position: relative;
    width: 100%;
}
.custom-select-trigger {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #636363;
    border-radius: 8px;
    background-color: #454545;
    color: white;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
    font-size: 14px;
}
.custom-select-trigger:hover {
    border-color: var(--primary);
    background-color: #343a40;
}
.custom-select-trigger i {
    transition: transform 0.3s ease;
}
.custom-select-trigger.active i {
    transform: rotate(180deg);
}
.custom-select-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #454545;
    border: 1px solid #636363;
    margin-top: 5px;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: none;
    max-height: 300px;
    overflow-y: auto;
}
.custom-select-dropdown.show {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
}
/* 两列布局 */
.custom-select-dropdown.show.two-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
}
/* 三列布局 */
.custom-select-dropdown.show.three-columns {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
}
.custom-select-option {
    color: white;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}
.custom-select-option:hover {
    background-color: #343a40;
}
.custom-select-option.selected {
    background-color: rgba(67, 97, 238, 0.2);
}
/* 横排显示的说话人选项 */
.sft-options-horizontal {
    display: flex;
    gap: 10px;
    padding: 10px;
    flex-wrap: wrap;
    width: 100%;
}
.sft-option-item {
    flex: 1 1 calc(33.333% - 7px);
    min-width: calc(33.333% - 7px);
    background: #3a3a3a;
    border: 1px solid #5a5a5a;
    padding: 10px;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
    box-sizing: border-box;
}
.sft-option-item:hover {
    border-color: var(--primary);
    background: #4a4a4a;
}
.sft-option-item.selected {
    border-color: var(--primary);
    background: rgba(67, 97, 238, 0.2);
}
.sft-option-name {
    font-weight: 600;
    margin-bottom: 8px;
    display: block;
    font-size: 14px;
}
.sft-option-preview {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
}
.sft-preview-player {
    flex: 1;
    max-width: 100px;
}
.sft-option-item .custom-audio-player {
    padding: 3px 0;
}
.sft-option-item .custom-audio-player .play-btn {
    width: 24px;
    height: 24px;
    font-size: 10px;
}
.sft-option-item .custom-audio-player .time-display {
    font-size: 8px;
}
.sft-option-item .custom-audio-player .progress-bar {
    height: 4px;
}
/* 帮助图标样式 */
.help-icon {
    margin-left: 5px;
    cursor: pointer;
    color: #888888; /* 默认灰色 */
    position: relative;
    user-select: none; /* 防止误选 */
    padding: 5px 5px 20px 5px;
    border-radius: 50%;
    transition: color 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.help-icon.active {
    color: #4361ee; /* 点击后变为蓝色 */
}
/* 修改帮助提示框样式 */
.help-tooltip {
    position: absolute;
    top: 100%;
    left: 490%;
    transform: translateX(-50%);
    width: 250px;
    z-index: 1000;
    font-size: 14px;
    font-weight: normal;
    display: none;
    max-width: 90vw;
}
.help-tooltip.show {
    display: block;
}
.help-tooltip-content {
    background-color: #454545;
    color: white;
    padding: 10px 15px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    max-height: 200px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #6c757d #454545;
    position: relative;
}
.help-tooltip::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 5%;
    transform: translateX(-50%);
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid #454545;
}
/* 添加生成过程中的提示文字样式 */
.generating-tip {
    color: #888888;
    font-size: 14px;
    margin-bottom: 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.generating-tip.show {
    opacity: 1;
}
/* 标签容器样式 */
.label-container {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    header h1 {
        font-size: 2rem;
        color: #2383ff;
    }
    .tabs {
        flex-direction: row;
    }
    .tab {
        padding: 12px 5px;
        font-size: 14px;
    }
    .tab-content {
        padding: 20px;
    }
    .inline-group {
        flex-direction: row;
        align-items: center;
        gap: 10px;
        flex-wrap: wrap;
    }
    .inline-group label {
        margin-bottom: 0;
        min-width: 60px;
        font-size: 14px;
    }
    .slider-value {
        min-width: 35px;
        padding: 3px 6px;
        font-size: 13px;
    }
    .audio-controls {
        flex-direction: column;
    }
    .audio-controls .btn {
        width: 100%;
    }
    .audio-player-container {
        flex-direction: row;
        gap: 10px;
    }
    .preview-header {
        flex-direction: column;
        align-items: stretch;
    }
    .audio-player-container .remove-btn {
        height: auto;
        padding: 6px 10px;
        font-size: 12px;
    }
    .custom-audio-player {
        padding: 8px 0px;
    }
    .custom-audio-player .play-btn {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }
    /* 保持和电脑端一样的位置 */
    .custom-select-dropdown {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        margin-top: 5px;
    }
    /* 手机端也保持三个选项横排 */
    .sft-option-item {
        min-width: calc(33.333% - 7px);
    }
}
@media (max-width: 480px) {
    .audio-player-container {
        flex-direction: row;
        gap: 8px;
    }
    .audio-player-container .remove-btn {
        align-self: auto;
        padding: 5px 8px;
        font-size: 14px;
    }
    .custom-audio-player .play-btn {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }
    .custom-audio-player {
        padding: 6px 0px;
    }
    .custom-audio-player .time-display {
        font-size: 10px;
    }
    .tab {
        padding: 10px 3px;
        font-size: 15px;
    }
    .inline-group label {
        min-width: 30px;
        font-size: 13px;
    }
    .slider-value {
        min-width: 30px;
        padding: 2px 5px;
        font-size: 12px;
    }
    /* 保持和电脑端一样的位置 */
    .custom-select-dropdown {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        margin-top: 5px;
    }
    /* 手机端也保持三个选项横排 */
    .sft-option-item {
        min-width: calc(33.333% - 7px);
    }
}
.wechat {
    position: fixed;
    bottom: 135px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 15px 20px;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    display: none;
    align-items: center;
    gap: 10px;
    color: #333;
    z-index: 10000;
    max-width: 280px;
    box-sizing: border-box;
    white-space: nowrap;
    min-width: max-content;
}

@media screen and (max-width: 768px) {
    .wechat {
        max-width: 90vw;
        bottom: 131px;
        padding: 12px 15px;
        flex-wrap: wrap;
        justify-content: center;
    }    
    .wechat span {
        word-break: break-all;
        margin: 5px 0;
    }
}

.copy-btn {
    background: #000789;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.copy-btn:hover {
    opacity: 0.9;
}

.copy-notice {
    z-index: 100000;
    position: fixed;
    bottom: 140px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;  
    animation: fadeInOut 1.5s;
}

@keyframes fadeInOut {
    0%,100% { opacity: 0 }
    20%,80% { opacity: 1 }
}