.azure-speech-tts-container {
    margin: 0 auto;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #333;
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.azure-speech-tts-grid {
    flex-grow: 1;
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-top: 20px;
}

.azure-speech-tts-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    width: calc(33.33% - 14px);
    height: 700px;
}

.custom-roles-section {
    order: 1;
    display: flex;
    flex-direction: column;
}

.custom-roles-section h3 {
    position: sticky;
    top: 0;
    background-color: #ffffff;
    padding: 10px 0;
    margin: 0;
    z-index: 1;
}

.custom-roles-content {
    flex-grow: 1;
    overflow-y: auto;
    padding-top: 10px;
    display: flex;
    flex-direction: column;
}

#azure-speech-tts-custom-roles {
    flex-grow: 1;
    overflow-y: auto;
    margin-bottom: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.custom-role {
    flex: 0 0 calc(50% - 5px);
    display: flex;
    flex-direction: column;
    gap: 5px;
    background-color: #f0f0f0;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 10px;
}

.custom-role-buttons {
    position: sticky;
    bottom: 0;
    background-color: #ffffff;
    padding-top: 10px;
    z-index: 1;
}

.text-input-section {
    order: 2;
    display: flex;
    flex-direction: column;
}

#azure-speech-tts-text {
    width: 100%;
    height: calc(100% - 40px);
    min-height: 500px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: none;
    font-size: 16px;
    flex-grow: 1;
}

.voice-options-section {
    order: 3;
}

.voice-options-section .option-group {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.voice-options-section .option-group label {
    flex: 0 0 80px; /* 调整标签宽度，根据需要修改 */
    margin-right: 10px;
    margin-bottom: 0;
    font-weight: bold;
}

.voice-options-section .option-group select,
.voice-options-section .option-group input {
    flex: 1;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.custom-role input,
.custom-role select {
    width: 100%;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.custom-role button {
    padding: 5px 10px;
    background-color: #d32f2f;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.custom-role button:hover {
    background-color: #b71c1c;
}

#azure-speech-tts-add-role,
#azure-speech-tts-save-roles {
    width: 100%;
    padding: 10px 20px;
    background-color: #0073aa;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
    margin-bottom: 10px;
}

#azure-speech-tts-add-role:hover,
#azure-speech-tts-save-roles:hover {
    background-color: #005177;
}

.azure-speech-tts-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    height: calc(100% - 40px);
    overflow-y: auto;
    padding-right: 10px; /* 添加一些右侧填充 */
}

.azure-speech-tts-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}

.azure-speech-tts-buttons button {
    padding: 10px 20px;
    background-color: #0073aa;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.azure-speech-tts-buttons button:hover {
    background-color: #005177;
}

#azure-speech-tts-result {
    margin-top: 20px;
    padding: 15px;
    background-color: #f0f0f0;
    border-radius: 4px;
}

@media (max-width: 1200px) {
    .azure-speech-tts-grid {
        flex-direction: column;
    }
    
    .azure-speech-tts-section {
        width: 100%;
        height: auto;
    }
    
    .custom-roles-content {
        max-height: 500px;
    }

    .custom-role {
        flex: 0 0 100%;
    }

    #azure-speech-tts-text {
        min-height: 300px;
    }
}

#azure-speech-tts-save-roles.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.vip-badge {
    background-color: #ffd700;
    color: #333;
    padding: 2px 5px;
    border-radius: 3px;
    font-size: 10px;
    margin-left: 5px;
    vertical-align: top;
}

/* 在文件末尾添加以下样式 */

.reference-audio-select {
    width: auto;
    flex: 1;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 0;
}

.reference-audio-player {
    width: 100%;
    margin-top: 5px;
}

/* 调整参考音频播放器的样式 */
.option-group:has(.reference-audio-select) {
    flex-direction: row;
    align-items: center;
}

.option-group:has(.reference-audio-select) label {
    margin-bottom: 0;
}

/* 添加到文件末尾 */

.azure-speech-tts-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #fff;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0,0,0,0.3);
    z-index: 1000;
    max-width: 80%;
    width: 400px;
}

.azure-speech-tts-popup h3 {
    margin-top: 0;
    color: #333;
}

.azure-speech-tts-popup p {
    margin-bottom: 10px;
}

.azure-speech-tts-popup .close-popup {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #333;
}

.azure-speech-tts-popup .vip-link {
    display: inline-block;
    margin-top: 10px;
    padding: 5px 10px;
    background-color: #0073aa;
    color: white;
    text-decoration: none;
    border-radius: 3px;
}

.azure-speech-tts-popup.limit-exceeded {
    border: 2px solid #d32f2f;
}