/**
 * 文字转语音插件样式
 */

/* 主容器 */
.tts-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* 标题 */
.tts-title {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    margin-top: 0;
    margin-bottom: 10px;
    text-align: center;
}

/* 描述 */
.tts-description {
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
    text-align: center;
    line-height: 1.5;
}

/* 表单容器 */
.tts-form-container {
    background-color: #fff;
    border-radius: 6px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* 选项区域 */
.tts-options {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
}

/* 选项组 */
.tts-option-group {
    flex: 1;
    min-width: 150px;
}

/* 标签 */
.tts-option-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 5px;
    color: #333;
}

/* 下拉选择框 */
.tts-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
    font-size: 14px;
    color: #333;
    appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="6"><path d="M0 0l6 6 6-6z" fill="%23666"/></svg>');
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 10px;
}

/* 单选按钮组 */
.tts-radio-group {
    display: flex;
    gap: 15px;
}

/* 单选按钮 */
.tts-radio {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.tts-radio input {
    margin-right: 5px;
}

.tts-radio span {
    font-size: 14px;
    color: #333;
}

/* 文本输入区域 */
.tts-input-container {
    position: relative;
    margin-bottom: 15px;
}

/* 文本框 */
.tts-textarea {
    width: 98%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    min-height: 120px;
    transition: border-color 0.3s;
}

.tts-textarea:focus {
    outline: none;
    border-color: #4e6ef2;
    box-shadow: 0 0 0 2px rgba(78, 110, 242, 0.1);
}

/* 字符计数 */
.tts-char-count {
    position: absolute;
    bottom: 8px;
    right: 12px;
    font-size: 12px;
    color: #999;
}

/* 控制区域 */
.tts-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

/* 复选框容器 */
.tts-checkbox-container {
    display: flex;
    align-items: center;
}

/* 复选框 */
.tts-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.tts-checkbox input {
    margin-right: 5px;
}

.tts-checkbox span {
    font-size: 14px;
    color: #333;
}

/* 速度控制 */
.tts-speed-container {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

.tts-speed-container span {
    font-size: 14px;
    color: #333;
}

/* 速度按钮 */
.tts-speed-btn {
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #f5f5f5;
    font-size: 12px;
    color: #333;
    cursor: pointer;
    transition: all 0.2s;
}

.tts-speed-btn:hover {
    background-color: #e9e9e9;
}

.tts-speed-btn.active {
    background-color: #4e6ef2;
    color: #fff;
    border-color: #4e6ef2;
}

/* 按钮 */
.tts-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 4px;
    background-color: #4e6ef2;
    color: #fff;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s;
}

.tts-button:hover {
    background-color: #3d5bd9;
}

.tts-button:disabled {
    background-color: #b0b0b0;
    cursor: not-allowed;
}

/* 按钮图标 */
.tts-btn-icon {
    margin-right: 8px;
    font-size: 18px;
}

/* 结果容器 */
.tts-result-container {
    margin-top: 20px;
    background-color: #fff;
    border-radius: 6px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* 音频容器 */
.tts-audio-container {
    margin-bottom: 15px;
}

/* 音频播放器 */
.tts-audio-container audio {
    width: 100%;
    border-radius: 4px;
}

/* 操作按钮 */
.tts-action-buttons {
    display: flex;
    gap: 10px;
}

.tts-download-btn,
.tts-copy-btn {
    flex: 1;
}

/* 加载中 */
.tts-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 0;
    background-color: #fff;
    border-radius: 6px;
    margin-top: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* 加载动画 */
.tts-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(78, 110, 242, 0.2);
    border-radius: 50%;
    border-top-color: #4e6ef2;
    animation: tts-spin 1s linear infinite;
    margin-bottom: 15px;
}

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

.tts-loading p {
    font-size: 14px;
    color: #666;
    margin: 0;
}

/* 错误信息 */
.tts-error {
    margin-top: 20px;
    background-color: #fff;
    border-radius: 6px;
    padding: 15px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #f44336;
}

.tts-error-message {
    color: #f44336;
    font-size: 14px;
    margin: 0;
}

/* 管理页面样式 */
.tts-admin-instructions,
.tts-admin-test {
    background-color: #fff;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid #ddd;
}

.tts-admin-instructions p,
.tts-admin-test p {
    margin-top: 0;
}

.tts-admin-instructions code {
    background-color: #f5f5f5;
    padding: 2px 5px;
    border-radius: 3px;
    font-family: monospace;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .tts-options {
        flex-direction: column;
    }
    
    .tts-option-group {
        width: 100%;
    }
    
    .tts-controls {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .tts-speed-container {
        margin-top: 10px;
    }
    
    .tts-action-buttons {
        flex-direction: column;
    }
}