/* 文字转语音在线报读 - 特有样式（公共布局/按钮样式依赖 common.css） */

/* ====== 文本输入框（加大以匹配左侧设置区高度） ====== */
.setting-textarea {
    width: 100%;
    min-height: 360px;
    padding: 14px 16px;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 10px;
    background: var(--bg-white, #fff);
    color: var(--text-color, #1f2937);
    font-size: 15px;
    line-height: 1.65;
    resize: vertical;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.setting-textarea:focus {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.12);
}
.setting-textarea::placeholder {
    color: var(--text-muted, #9ca3af);
}
body.dark .setting-textarea {
    background: var(--bg-soft-dark, #1e293b);
    border-color: var(--border-color-dark, #334155);
    color: var(--text-color-dark, #e2e8f0);
}

/* ====== 左侧参数调节（与 yinpintiaozhengyinliang 音量调节样式一致） ====== */
.speed-control {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.speed-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.speed-value {
    font-size: 16px;
    font-weight: 600;
    color: #8b5cf6;
}

.speed-control input[type="range"] {
    width: 100%;
    accent-color: #8b5cf6;
    cursor: pointer;
}

/* 朗读进度 */
.reading-progress {
    background: var(--bg-soft, #f8fafc);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 10px;
    padding: 12px 14px;
    margin-top: 4px;
}
body.dark .reading-progress {
    background: var(--bg-soft-dark, #1e293b);
    border-color: var(--border-color-dark, #334155);
}
.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.progress-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-color, #1f2937);
}
.progress-time {
    font-size: 12px;
    color: var(--text-muted, #6b7280);
}
.progress-bar-container {
    height: 8px;
    background: var(--bg-muted, #e5e7eb);
    border-radius: 999px;
    overflow: hidden;
}
.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #7c3aed, #a855f7);
    border-radius: 999px;
    transition: width 0.25s ease;
}
.progress-percent {
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-muted, #6b7280);
    text-align: right;
}

/* 快捷短语（已移除） */

body.dark .speed-value {
    color: #c4b5fd;
}

/* ====== 左侧朗读状态 ====== */
.tts-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    background: var(--bg-soft, #f8fafc);
    color: var(--text-muted, #6b7280);
    margin-top: 10px;
    margin-bottom: 0;
}
.tts-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #9ca3af;
    flex-shrink: 0;
}
.tts-status-text {
    font-weight: 500;
}
.tts-status-seg {
    margin-left: auto;
    font-size: 12px;
    color: var(--text-muted, #9ca3af);
    white-space: nowrap;
}
.tts-status--speaking {
    background: #f5f3ff;
    color: #7c3aed;
}
.tts-status--speaking .tts-status-dot {
    background: #8b5cf6;
    animation: tts-pulse 1s infinite;
}
.tts-status--paused {
    background: #fff7ed;
    color: #c2410c;
}
.tts-status--paused .tts-status-dot {
    background: #f59e0b;
}
.tts-status--done {
    background: #ecfdf5;
    color: #047857;
}
.tts-status--done .tts-status-dot {
    background: #10b981;
}
.tts-status--error {
    background: #fef2f2;
    color: #b91c1c;
}
.tts-status--error .tts-status-dot {
    background: #ef4444;
}
@keyframes tts-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}
body.dark .tts-status {
    background: var(--bg-soft-dark, #1e293b);
    color: var(--text-color-dark, #94a3b8);
}
body.dark .tts-status--speaking { background: #2e1065; color: #c4b5fd; }
body.dark .tts-status--paused { background: #422006; color: #fcd34d; }
body.dark .tts-status--done { background: #064e3b; color: #6ee7b7; }
body.dark .tts-status--error { background: #450a0a; color: #fca5a5; }

/* ====== 复制按钮（与清空按钮并列） ====== */
.card-header-right-btn-copy {
    border: none;
    background: transparent;
    color: var(--text-muted, #6b7280);
    font-size: 14px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s;
}
.card-header-right-btn-copy:hover:not(:disabled) {
    background: var(--bg-soft, #f1f5f9);
    color: #7c3aed;
}
.card-header-right-btn-copy:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
body.dark .card-header-right-btn-copy:hover:not(:disabled) {
    background: var(--bg-soft-dark, #1e293b);
    color: #c4b5fd;
}

/* ====== 不支持语音合成提示 ====== */
.tts-unsupported {
    padding: 12px 14px;
    border-radius: 8px;
    background: #fef2f2;
    color: #b91c1c;
    font-size: 13px;
    line-height: 1.6;
    border: 1px solid #fecaca;
}
body.dark .tts-unsupported {
    background: #450a0a;
    color: #fca5a5;
    border-color: #7f1d1d;
}

/* ====== 停止按钮 ====== */
.btn-ghost {
    border: 1px solid var(--border-color, #d1d5db);
    background: var(--bg-white, #fff);
    color: var(--text-color, #374151);
    border-radius: var(--radius, 8px);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-ghost:hover:not(:disabled) {
    border-color: #ef4444;
    color: #ef4444;
    background: #fef2f2;
}
.btn-ghost:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}
body.dark .btn-ghost {
    background: var(--bg-soft-dark, #1e293b);
    color: var(--text-color-dark, #cbd5e1);
    border-color: var(--border-color-dark, #334155);
}
body.dark .btn-ghost:hover:not(:disabled) {
    border-color: #f87171;
    color: #f87171;
    background: #450a0a;
}

/* ====== 参数项说明文字（基础样式） ====== */
.setting-hint {
    display: block;
    margin-top: 8px;
    font-size: 12.5px;
    color: var(--text-muted, #6b7280);
    line-height: 1.6;
}

/* ====== 所选语音缺失（系统未安装语音包）警告 ====== */
.setting-hint--warn {
    display: block;
    margin-top: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    background: #fff7ed;
    color: #c2410c;
    font-size: 12.5px;
    line-height: 1.6;
    border: 1px solid #fed7aa;
}
body.dark .setting-hint--warn {
    background: #422006;
    color: #fcd34d;
    border-color: #7c2d12;
}

/* ====== 在线语音提示 ====== */
.setting-hint--info {
    display: block;
    margin-top: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    background: #eff6ff;
    color: #1e40af;
    font-size: 12.5px;
    line-height: 1.6;
    border: 1px solid #bfdbfe;
}
body.dark .setting-hint--info {
    background: #172554;
    color: #93c5fd;
    border-color: #1e3a8a;
}

/* ====== 卡片头部居中数量统计（参考 yinpintiaozhengyinliang） ====== */
.header-center {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    min-width: 0;
}

.header-count {
    font-size: 13px;
    color: #8b5cf6;
    background: #f5f3ff;
    padding: 3px 12px;
    border-radius: 12px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

body.dark .header-count {
    background: #2e1065;
    color: #c4b5fd;
}
