/* ===== 耀发家政AI 视频创作工作室 - 样式 ===== */

:root {
    --studio-primary: #8b5cf6;
    --studio-primary-dark: #7c3aed;
    --studio-primary-light: #a78bfa;
    --studio-primary-glow: rgba(139, 92, 246, 0.4);
    --studio-accent: #ec4899;
    --studio-bg: #1a1530;
    --studio-bg-darker: #0f0c1f;
    --studio-bg-card: rgba(255, 255, 255, 0.04);
    --studio-border: rgba(139, 92, 246, 0.2);
    --studio-border-active: rgba(139, 92, 246, 0.6);
    --studio-text: #f3f4f6;
    --studio-text-muted: #9ca3af;
}

body {
    background: var(--studio-bg-darker);
    overflow-y: auto;
    height: auto;
    min-height: 100vh;
}

html {
    overflow-y: auto;
}

.studio-container {
    height: auto;
    min-height: 100vh;
    padding-bottom: 100px;
}

/* 顶部导航 */
.studio-header {
    display: none !important;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: rgba(15, 12, 31, 0.6);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--studio-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left .logo-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
}

.studio-header .header-logo {
    background: linear-gradient(135deg, var(--studio-primary), var(--studio-accent));
}

.header-actions {
    display: flex;
    gap: 8px;
}

.header-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--studio-bg-card);
    border: 1px solid var(--studio-border);
    border-radius: 8px;
    color: var(--studio-text);
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.header-btn:hover {
    background: rgba(139, 92, 246, 0.1);
    border-color: var(--studio-border-active);
}

.header-btn.active {
    background: linear-gradient(135deg, var(--studio-primary), var(--studio-primary-dark));
    border-color: transparent;
}

/* 工作流指示器 */
.workflow-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 16px 24px;
    background: rgba(15, 12, 31, 0.4);
    border-bottom: 1px solid var(--studio-border);
    flex-wrap: wrap;
}

.workflow-step {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--studio-bg-card);
    border: 1px solid var(--studio-border);
    border-radius: 999px;
    color: var(--studio-text-muted);
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
}

.workflow-step span {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--studio-bg);
    border-radius: 50%;
    font-weight: 600;
    font-size: 12px;
}

.workflow-step.active {
    background: linear-gradient(135deg, var(--studio-primary), var(--studio-primary-dark));
    color: white;
    border-color: transparent;
}

.workflow-step.active span {
    background: rgba(255, 255, 255, 0.2);
}

.workflow-step.completed {
    background: rgba(139, 92, 246, 0.15);
    color: var(--studio-primary-light);
    border-color: var(--studio-primary);
}

.workflow-arrow {
    color: var(--studio-text-muted);
    font-size: 14px;
}

/* ============== YaofaAI.自媒体工作台 入口 ============== */
/* 嵌入式入口：放在 1.提取文案 卡片的正文第一行，作为该卡的内嵌快捷入口。
   连接 F:\yaofaAI\python-modules\douyinchaiji\douyin-yaofaAI（8780）。 */
.yaofa-ai-inline {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    margin-bottom: 12px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.18) 0%, rgba(236, 72, 153, 0.18) 100%);
    border: 1px solid rgba(139, 92, 246, 0.35);
    flex-wrap: wrap;
}

.yaofa-ai-inline-text {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 1 1 auto;
}

.yaofa-ai-inline-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 24px;
    padding: 0 8px;
    border-radius: 6px;
    background: linear-gradient(135deg, var(--studio-primary, #8b5cf6), var(--studio-primary-dark, #6d28d9));
    color: #fff;
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 0.4px;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.35);
    white-space: nowrap;
    flex-shrink: 0;
}

.yaofa-ai-inline-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--studio-text, #f3f0ff);
    line-height: 1.3;
    white-space: nowrap;
}

.yaofa-ai-inline-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 500;
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.06);
    color: var(--studio-text-muted, #a59cc8);
    transition: var(--transition, all 0.2s ease);
    white-space: nowrap;
    flex-shrink: 0;
}

.yaofa-ai-inline-badge::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 4px currentColor;
    opacity: 0.85;
}

/* 状态：检测中 / 未启动 / 运行中 / 错误 */
.yaofa-ai-inline-badge.status-checking { color: #cbd5e1; }
.yaofa-ai-inline-badge.status-offline  { color: #f87171; background: rgba(248, 113, 113, 0.12); border-color: rgba(248, 113, 113, 0.35); }
.yaofa-ai-inline-badge.status-online   { color: #34d399; background: rgba(52, 211, 153, 0.12); border-color: rgba(52, 211, 153, 0.35); }
.yaofa-ai-inline-badge.status-error    { color: #fbbf24; background: rgba(251, 191, 36, 0.12); border-color: rgba(251, 191, 36, 0.35); }

.yaofa-ai-inline-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    border-radius: 6px;
    border: none;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    background: linear-gradient(135deg, var(--studio-primary, #8b5cf6), var(--studio-primary-dark, #6d28d9));
    color: #fff;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.35);
    transition: var(--transition, all 0.2s ease);
    white-space: nowrap;
    flex-shrink: 0;
}

.yaofa-ai-inline-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(139, 92, 246, 0.5);
}

.yaofa-ai-inline-btn:active {
    transform: translateY(0);
}

.yaofa-ai-inline-btn:disabled {
    cursor: not-allowed;
    opacity: 0.6;
    transform: none;
    box-shadow: none;
}

.yaofa-ai-inline-refresh {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    border: 1px solid rgba(139, 92, 246, 0.35);
    background: transparent;
    color: var(--studio-text-muted, #a59cc8);
    cursor: pointer;
    font-size: 13px;
    line-height: 1;
    padding: 0;
    transition: var(--transition, all 0.2s ease);
    flex-shrink: 0;
}

.yaofa-ai-inline-refresh:hover {
    color: var(--studio-primary, #8b5cf6);
    background: rgba(139, 92, 246, 0.12);
}

.yaofa-ai-inline-restart {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid rgba(251, 113, 133, 0.35);
    background: rgba(251, 113, 133, 0.08);
    color: #fda4af;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    transition: var(--transition, all 0.2s ease);
    white-space: nowrap;
    flex-shrink: 0;
}

.yaofa-ai-inline-restart:hover {
    background: rgba(251, 113, 133, 0.18);
    color: #fecaca;
}

.yaofa-ai-inline-restart:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.yaofa-ai-inline-refresh.spinning,
.yaofa-ai-inline-restart.spinning {
    animation: yaofaSpin 0.9s linear infinite;
}

@keyframes yaofaSpin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* 主工作区 */
.studio-main {
    padding: 24px;
}

.studio-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.studio-card {
    background: var(--studio-bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--studio-border);
    border-radius: 16px;
    padding: 18px;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.studio-card:hover {
    border-color: var(--studio-border-active);
    box-shadow: 0 8px 30px rgba(139, 92, 246, 0.15);
}

.studio-card.large {
    grid-row: span 2;
}

/* 「原文案」「改写内容」两个 textarea 自适应高度：
   跟随 JS 根据内容动态撑高，禁用手动改大小和滚动条；
   保留一个略小的初始高度（80px ≈ 3 行），空状态不显得突兀。 */
#originalScript,
#rewrittenScript {
    min-height: 80px;
    resize: none;
    overflow-y: hidden;
}

.studio-card .card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.card-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--studio-primary), var(--studio-primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.card-icon svg {
    width: 16px;
    height: 16px;
    color: white;
}

.card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--studio-text);
    margin: 0;
    flex: 1;
}

.help-btn {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(139, 92, 246, 0.2);
    border: none;
    color: var(--studio-primary-light);
    font-size: 11px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.help-btn:hover {
    background: var(--studio-primary);
    color: white;
}

.card-link {
    color: var(--studio-primary-light);
    font-size: 12px;
    text-decoration: none;
    transition: var(--transition);
}

.card-link:hover {
    color: var(--studio-primary);
}

/* 表单元素 */
.card-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

.form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 4px;
}

.form-label {
    font-size: 12px;
    color: var(--studio-text-muted);
    font-weight: 500;
}

.form-hint {
    font-size: 11px;
    color: var(--studio-text-muted);
    opacity: 0.7;
}

.word-count {
    font-size: 11px;
    color: var(--studio-text-muted);
    background: var(--studio-bg-card);
    padding: 2px 8px;
    border-radius: 4px;
}

/* 输入框 */
.input-field {
    width: 100%;
    padding: 8px 12px;
    background: var(--studio-bg);
    border: 1px solid var(--studio-border);
    border-radius: 8px;
    color: var(--studio-text);
    font-size: 13px;
    transition: var(--transition);
    outline: none;
    font-family: inherit;
}

.input-field:focus {
    border-color: var(--studio-primary);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

.input-field::placeholder {
    color: rgba(156, 163, 175, 0.5);
}

.input-field[readonly] {
    background: rgba(15, 12, 31, 0.6);
    cursor: not-allowed;
}

.select-field {
    width: 100%;
    padding: 8px 12px;
    background: var(--studio-bg);
    border: 1px solid var(--studio-border);
    border-radius: 8px;
    color: var(--studio-text);
    font-size: 13px;
    cursor: pointer;
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

.select-field:focus {
    border-color: var(--studio-primary);
}

.textarea-field {
    width: 100%;
    padding: 10px 12px;
    background: var(--studio-bg);
    border: 1px solid var(--studio-border);
    border-radius: 8px;
    color: var(--studio-text);
    font-size: 13px;
    line-height: 1.6;
    resize: vertical;
    min-height: 100px;
    outline: none;
    font-family: inherit;
    transition: var(--transition);
}

.textarea-field:focus {
    border-color: var(--studio-primary);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

.textarea-field::placeholder {
    color: rgba(156, 163, 175, 0.5);
}

/* 视频信息展示框 */
.video-info-box {
    margin-top: 10px;
    padding: 10px 12px;
    background: rgba(139, 92, 246, 0.08);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 8px;
    font-size: 12px;
    animation: fadeIn 0.3s ease;
}

.video-info-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}
.video-info-row:last-child {
    margin-bottom: 0;
}

.video-info-label {
    color: rgba(156, 163, 175, 0.8);
    white-space: nowrap;
    flex-shrink: 0;
}

.video-info-value {
    color: var(--studio-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.video-info-tag {
    display: inline-block;
    padding: 2px 8px;
    background: rgba(139, 92, 246, 0.2);
    color: var(--studio-primary);
    border-radius: 4px;
    font-weight: 600;
    font-size: 11px;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 按钮 */
.btn-primary-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 18px;
    background: linear-gradient(135deg, var(--studio-primary), var(--studio-primary-dark));
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-primary-action:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px var(--studio-primary-glow);
}

.btn-primary-action:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-primary-action.full-width {
    width: 100%;
}

.btn-large {
    padding: 14px 32px;
    font-size: 15px;
    border-radius: 12px;
}

.paste-btn {
    padding: 2px 10px;
    background: var(--studio-bg-card);
    border: 1px solid var(--studio-border);
    border-radius: 4px;
    color: var(--studio-text-muted);
    font-size: 11px;
    cursor: pointer;
    transition: var(--transition);
}

.paste-btn:hover {
    color: var(--studio-primary-light);
    border-color: var(--studio-primary);
}

.ghost-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--studio-bg);
    border: 1px solid var(--studio-border);
    border-radius: 8px;
    color: var(--studio-text);
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition);
}

.ghost-btn:hover {
    background: rgba(139, 92, 246, 0.1);
    border-color: var(--studio-primary);
}

.ghost-btn.flex-1 {
    flex: 1;
}

.ghost-btn-small {
    padding: 4px 10px;
    background: var(--studio-bg-card);
    border: 1px solid var(--studio-border);
    border-radius: 6px;
    color: var(--studio-text-muted);
    font-size: 11px;
    cursor: pointer;
    transition: var(--transition);
}

.ghost-btn-small:hover {
    color: var(--studio-primary-light);
    border-color: var(--studio-primary);
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    background: var(--studio-bg);
    border: 1px solid var(--studio-border);
    border-radius: 6px;
    color: var(--studio-text-muted);
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
    font-size: 11px;
}

.icon-btn:hover {
    background: rgba(139, 92, 246, 0.1);
    border-color: var(--studio-primary);
    color: var(--studio-primary-light);
}

.icon-btn.ai-icon {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(236, 72, 153, 0.2));
    color: var(--studio-primary-light);
}

.icon-btn svg {
    width: 14px;
    height: 14px;
}

.info-btn {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--studio-bg);
    border: 1px solid var(--studio-border);
    color: var(--studio-text-muted);
    font-size: 10px;
    cursor: pointer;
    flex-shrink: 0;
}

/* 布局工具 */
.input-with-btn {
    display: flex;
    gap: 8px;
}

.input-with-btn .input-field {
    flex: 1;
}

.select-with-icon {
    display: flex;
    gap: 6px;
    align-items: center;
}

.select-with-icon .select-field {
    flex: 1;
}

.file-input-row {
    display: flex;
    gap: 6px;
    align-items: center;
}

.file-input-row .input-field {
    flex: 1;
}

.dual-input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.dual-input-col {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* 滑块 */
.slider-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.slider-row .form-label {
    flex-shrink: 0;
    min-width: 32px;
}

.slider-container {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.slider {
    flex: 1;
    appearance: none;
    height: 4px;
    background: var(--studio-bg);
    border-radius: 999px;
    outline: none;
    cursor: pointer;
}

.slider::-webkit-slider-thumb {
    appearance: none;
    width: 16px;
    height: 16px;
    background: var(--studio-primary);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px var(--studio-primary-glow);
}

.slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: var(--studio-primary);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.slider-value {
    font-size: 11px;
    color: var(--studio-primary-light);
    font-weight: 600;
    min-width: 24px;
    text-align: right;
}

.dual-slider-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.slider-col {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dual-btn-row {
    display: flex;
    gap: 8px;
}

/* 开关 */
.switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--studio-bg);
    border: 1px solid var(--studio-border);
    border-radius: 999px;
    transition: var(--transition);
}

.switch-slider::before {
    content: "";
    position: absolute;
    width: 14px;
    height: 14px;
    left: 2px;
    top: 2px;
    background: var(--studio-text-muted);
    border-radius: 50%;
    transition: var(--transition);
}

.switch input:checked + .switch-slider {
    background: var(--studio-primary);
    border-color: var(--studio-primary);
}

.switch input:checked + .switch-slider::before {
    transform: translateX(16px);
    background: white;
}

.subtitle-toggle-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.toggle-text {
    font-size: 12px;
    color: var(--studio-text-muted);
}

/* 结果区域 */
.result-box {
    padding: 16px;
    background: var(--studio-bg);
    border: 1px dashed var(--studio-border);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 80px;
    text-align: center;
    position: relative;
    transition: var(--transition);
}

.result-box.has-content {
    border-style: solid;
    border-color: var(--studio-primary);
    background: rgba(139, 92, 246, 0.05);
}

.result-icon {
    width: 24px;
    height: 24px;
    color: var(--studio-text-muted);
    opacity: 0.5;
}

.result-text {
    font-size: 12px;
    color: var(--studio-text-muted);
}

.result-hint {
    font-size: 10px;
    color: rgba(156, 163, 175, 0.5);
}

.result-box audio, .result-box video {
    width: 100%;
    max-width: 280px;
    border-radius: 8px;
    margin-top: 8px;
}

.play-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--studio-primary);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.play-btn svg {
    width: 12px;
    height: 12px;
}

.cover-result {
    min-height: 120px;
}

.cover-result img {
    width: 100%;
    max-width: 200px;
    border-radius: 8px;
}

/* 视频剪辑卡片 */
.video-card-body {
    flex-direction: row;
    gap: 16px;
}

.video-form-side {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.video-preview {
    width: 180px;
    background: var(--studio-bg);
    border: 1px dashed var(--studio-border);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    text-align: center;
    padding: 16px;
}

.video-preview video {
    width: 100%;
    border-radius: 6px;
}

.preview-icon {
    width: 32px;
    height: 32px;
    color: var(--studio-text-muted);
    opacity: 0.4;
}

.preview-text {
    font-size: 12px;
    color: var(--studio-text-muted);
}

.preview-hint {
    font-size: 10px;
    color: rgba(156, 163, 175, 0.5);
}

/* 封面模板选择 */
.cover-templates {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.cover-template {
    padding: 8px 10px;
    background: var(--studio-bg);
    border: 1px solid var(--studio-border);
    border-radius: 6px;
    color: var(--studio-text-muted);
    font-size: 11px;
    cursor: pointer;
    text-align: center;
    transition: var(--transition);
}

.cover-template:hover {
    border-color: var(--studio-primary);
    color: var(--studio-text);
}

.cover-template.active {
    background: rgba(139, 92, 246, 0.2);
    border-color: var(--studio-primary);
    color: var(--studio-primary-light);
}

/* 数字人网格 */
.dh-card {
    border: 2px solid transparent;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 9/12;
    position: relative;
    cursor: pointer;
    transition: border-color 0.15s, transform 0.1s;
}
.dh-card:hover {
    border-color: rgba(108, 132, 255, 0.5);
}
.dh-card.active {
    border-color: var(--studio-primary, #4f7cff);
    box-shadow: 0 0 0 2px rgba(79, 124, 255, 0.3);
}
/* 用户上传的卡片在 hover 时给微弱提示（鼠标形状仍为 pointer） */
.dh-card[data-user-upload="1"] {
    cursor: context-menu;
}

/* 卡片底部名称条（不再用 inline style） */
.dh-card .dh-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    font-size: 11px;
    padding: 2px 4px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dh-card .dh-name .dh-name-hint {
    color: rgba(255, 255, 255, 0.55);
    font-weight: normal;
    margin-left: 2px;
}

/* 发布选项 */
.publish-mode-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.radio-card {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    background: var(--studio-bg);
    border: 1px solid var(--studio-border);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.radio-card input {
    display: none;
}

.radio-card .radio-text {
    font-size: 12px;
    color: var(--studio-text-muted);
}

.radio-card:has(input:checked) {
    background: rgba(139, 92, 246, 0.2);
    border-color: var(--studio-primary);
}

.radio-card:has(input:checked) .radio-text {
    color: var(--studio-primary-light);
}

.schedule-time-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* ===== 发布账号多选列表 ===== */
.publish-account-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.publish-account-actions {
    display: flex;
    gap: 12px;
}

.link-btn {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    font-family: inherit;
    font-size: 12px;
    color: var(--studio-primary-light);
    cursor: pointer;
    transition: var(--transition);
}

.link-btn:hover {
    color: var(--studio-primary);
    text-decoration: underline;
}

.publish-account-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(158px, 1fr));
    gap: 6px;
}

.publish-account-empty {
    grid-column: 1 / -1;
    font-size: 12px;
    color: var(--studio-text-muted);
    padding: 10px 12px;
    background: var(--studio-bg);
    border: 1px dashed var(--studio-border);
    border-radius: 8px;
}

.publish-account-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: var(--studio-bg);
    border: 1px solid var(--studio-border);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    min-width: 0;
}

.publish-account-item:hover {
    border-color: var(--studio-border-active);
}

.publish-account-item.is-checked {
    background: rgba(139, 92, 246, 0.18);
    border-color: var(--studio-primary);
}

.publish-account-item.is-disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.publish-account-item input {
    display: none;
}

.publish-account-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex: 0 0 auto;
}

.publish-account-main {
    flex: 1;
    min-width: 0;
}

.publish-account-name {
    font-size: 12px;
    color: var(--studio-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.publish-account-sub {
    font-size: 11px;
    color: var(--studio-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.publish-account-badge {
    font-size: 10px;
    line-height: 16px;
    padding: 0 5px;
    border-radius: 4px;
    flex: 0 0 auto;
    white-space: nowrap;
}

.publish-badge-ok {
    color: #6ee7b7;
    background: rgba(16, 185, 129, 0.15);
}

.publish-badge-warn {
    color: #fcd34d;
    background: rgba(245, 158, 11, 0.15);
}

.publish-badge-off {
    color: var(--studio-text-muted);
    background: rgba(255, 255, 255, 0.06);
}

/* 发布结果分平台明细 */
.publish-result-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    margin-top: 4px;
}

.publish-result-ok {
    color: #6ee7b7;
}

.publish-result-fail {
    color: #fcd34d;
}

.publish-result-reason {
    font-size: 11px;
    color: var(--studio-text-muted);
}

/* 账号管理弹窗 */
.publish-mgr-mask {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 999;
}

.publish-mgr {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(620px, 92vw);
    max-height: 82vh;
    overflow-y: auto;
    z-index: 1000;
    background: var(--studio-bg);
    border: 1px solid var(--studio-border);
    border-radius: 12px;
    padding: 16px 18px;
}

.publish-mgr-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.publish-mgr-title {
    font-size: 14px;
    color: var(--studio-text);
}

.publish-mgr-close {
    background: none;
    border: none;
    color: var(--studio-text-muted);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
}

.publish-mgr-row {
    display: grid;
    grid-template-columns: 96px 1fr;
    gap: 8px 10px;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--studio-border);
}

.publish-mgr-label {
    font-size: 12px;
    color: var(--studio-text-muted);
}

.publish-mgr-foot {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 14px;
}

.publish-mgr-tip {
    font-size: 11px;
    color: var(--studio-text-muted);
    line-height: 1.6;
    margin-top: 10px;
}


/* 底部一键处理 */
.quick-action {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 50;
}

.quick-action .btn-primary-action {
    box-shadow: 0 10px 30px var(--studio-primary-glow);
}

/* Loading 状态 */
.studio-card.loading {
    opacity: 0.85;
    pointer-events: none;
}

.studio-card.loading::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(139, 92, 246, 0.05);
    border-radius: 16px;
}

/* 按钮加载旋转动画 */
.btn-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-right: 6px;
    vertical-align: -2px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: btn-spin 0.8s linear infinite;
}

@keyframes btn-spin {
    to { transform: rotate(360deg); }
}

.btn-primary-action:disabled {
    opacity: 0.75;
    cursor: not-allowed;
}

/* 生成中提示文字呼吸效果 */
.generating-hint {
    animation: generating-pulse 1.6s ease-in-out infinite;
}

@keyframes generating-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.55; }
}

.studio-card {
    position: relative;
}

/* 响应式 */
@media (max-width: 1200px) {
    .studio-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .studio-card.large {
        grid-row: span 1;
        grid-column: span 2;
    }
    .video-card-body {
        flex-direction: column;
    }
    .video-preview {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .studio-grid {
        grid-template-columns: 1fr;
    }
    .studio-card.large {
        grid-column: span 1;
    }
    .dual-input-row, .dual-slider-row {
        grid-template-columns: 1fr;
    }
    .workflow-bar {
        padding: 12px;
        font-size: 12px;
    }
    .workflow-step {
        padding: 6px 10px;
        font-size: 11px;
    }
    .workflow-arrow {
        font-size: 12px;
    }
}


/* ============================================
   声音管理模态框
   ============================================ */
.voice-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.voice-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.voice-modal-container {
    position: relative;
    width: 95vw;
    max-width: 1400px;
    height: 92vh;
    max-height: 900px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f1729 100%);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(168, 85, 247, 0.2);
}

.voice-modal-header {
    padding: 20px 32px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
}

.voice-modal-title {
    font-size: 22px;
    font-weight: 600;
    color: #fff;
    margin: 0 0 4px 0;
    background: linear-gradient(135deg, #a855f7 0%, #ec4899 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.voice-modal-subtitle {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    margin: 0;
}

.voice-modal-close {
    position: absolute;
    top: 20px;
    right: 24px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.voice-modal-close:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: rotate(90deg);
}

.voice-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 32px 32px;
}

.voice-modal-body::-webkit-scrollbar {
    width: 8px;
}
.voice-modal-body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.04);
}
.voice-modal-body::-webkit-scrollbar-thumb {
    background: rgba(168, 85, 247, 0.3);
    border-radius: 4px;
}
.voice-modal-body::-webkit-scrollbar-thumb:hover {
    background: rgba(168, 85, 247, 0.5);
}

/* 顶部双栏布局 */
.voice-top-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

/* 通用面板 */
.voice-panel {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    overflow: hidden;
}

.voice-panel-header {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    gap: 12px;
}

.voice-panel-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.voice-panel-icon svg {
    width: 20px;
    height: 20px;
}

.voice-panel-icon.train {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: #fff;
}

.voice-panel-icon.synth {
    background: linear-gradient(135deg, #ec4899 0%, #f43f5e 100%);
    color: #fff;
}

.voice-panel-info {
    flex: 1;
    min-width: 0;
}

.voice-panel-title {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    line-height: 1.3;
}

.voice-panel-desc {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 2px;
}

.voice-help-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.voice-help-btn:hover {
    border-color: rgba(168, 85, 247, 0.5);
    color: #a855f7;
}

.voice-panel-body {
    padding: 16px 20px 20px;
}

/* 标签页 */
.voice-tabs {
    display: flex;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 16px;
}

.voice-tab {
    padding: 8px 16px;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    font-size: 13px;
    position: relative;
    transition: color 0.2s;
}

.voice-tab.active {
    color: #a855f7;
    font-weight: 500;
}

.voice-tab.active::after {
    content: "";
    position: absolute;
    bottom: -1px;
    left: 16px;
    right: 16px;
    height: 2px;
    background: linear-gradient(90deg, #a855f7 0%, #ec4899 100%);
    border-radius: 1px;
}

.voice-tab-content {
    display: none;
}

.voice-tab-content.active {
    display: block;
}

/* 表单元素 */
.voice-form-label {
    display: block;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 8px;
    font-weight: 500;
}

.voice-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.voice-input-wrap .voice-input-icon {
    position: absolute;
    left: 12px;
    width: 14px;
    height: 14px;
    color: rgba(255, 255, 255, 0.5);
    z-index: 1;
}

.voice-input {
    width: 100%;
    padding: 10px 12px 10px 36px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    font-size: 13px;
    outline: none;
    transition: all 0.2s;
}

.voice-input:focus {
    border-color: rgba(168, 85, 247, 0.5);
    background: rgba(168, 85, 247, 0.06);
}

.voice-input::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

.voice-input-hint {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 6px;
}

.voice-select-wrap {
    position: relative;
}

.voice-select {
    width: 100%;
    padding: 10px 36px 10px 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    font-size: 13px;
    outline: none;
    appearance: none;
    cursor: pointer;
    transition: all 0.2s;
}

.voice-select:focus {
    border-color: rgba(168, 85, 247, 0.5);
}

.voice-select option {
    background: #1a1a2e;
    color: #fff;
}

.voice-select-arrow {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    color: rgba(255, 255, 255, 0.5);
    pointer-events: none;
}

.voice-textarea {
    width: 100%;
    padding: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    font-size: 13px;
    font-family: inherit;
    outline: none;
    resize: vertical;
    min-height: 100px;
    transition: all 0.2s;
}

.voice-textarea:focus {
    border-color: rgba(168, 85, 247, 0.5);
}

.voice-textarea::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

.voice-char-counter {
    text-align: right;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 4px;
}

/* 拖拽上传区 */
.voice-dropzone {
    border: 2px dashed rgba(168, 85, 247, 0.3);
    border-radius: 12px;
    padding: 32px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: rgba(168, 85, 247, 0.02);
}

.voice-dropzone:hover,
.voice-dropzone.dragover {
    border-color: rgba(168, 85, 247, 0.6);
    background: rgba(168, 85, 247, 0.06);
}

.voice-dropzone-icon {
    width: 32px;
    height: 32px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 10px;
}

.voice-dropzone-title {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 6px;
}

.voice-dropzone-hint {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.45);
    margin-top: 3px;
}

.voice-file-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding: 8px 12px;
    background: rgba(168, 85, 247, 0.08);
    border-radius: 6px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.85);
}

.voice-file-meta {
    color: rgba(255, 255, 255, 0.5);
    margin-left: auto;
}

/* 波形 */
.voice-waveform-section {
    margin-top: 16px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
}

.voice-waveform-title {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 8px;
    font-weight: 500;
}

.voice-waveform-tip {
    display: flex;
    gap: 6px;
    padding: 8px 10px;
    background: rgba(251, 191, 36, 0.06);
    border: 1px solid rgba(251, 191, 36, 0.2);
    border-radius: 6px;
    font-size: 11px;
    color: #fbbf24;
    margin-bottom: 10px;
    line-height: 1.5;
}

.voice-tip-icon {
    flex-shrink: 0;
}

.voice-waveform-box {
    margin-top: 8px;
}

.voice-waveform-canvas {
    position: relative;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.1) 100%);
    border-radius: 6px;
    overflow: hidden;
    height: 80px;
}

.voice-waveform-canvas canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.voice-waveform-overlay {
    position: absolute;
    top: 0;
    bottom: 0;
    border: 2px solid #a855f7;
    border-radius: 4px;
    background: rgba(168, 85, 247, 0.1);
    cursor: move;
    pointer-events: auto;
}

.voice-waveform-handle {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 30px;
    background: #a855f7;
    border-radius: 3px;
    cursor: ew-resize;
    box-shadow: 0 0 8px rgba(168, 85, 247, 0.6);
}

.voice-waveform-handle.left { left: -5px; }
.voice-waveform-handle.right { right: -5px; }

.voice-waveform-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
}

.voice-preview-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
    border: none;
    border-radius: 6px;
    color: #fff;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.voice-preview-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.voice-waveform-duration {
    flex: 1;
    text-align: center;
    padding: 6px 14px;
    background: rgba(34, 197, 94, 0.08);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 6px;
    font-size: 12px;
    color: #22c55e;
}

/* 声音名称行 */
.voice-name-row {
    margin-top: 16px;
}

.voice-train-btn {
    width: 100%;
    margin-top: 16px;
    padding: 12px;
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #ec4899 100%);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.voice-train-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(168, 85, 247, 0.4);
}

.voice-train-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 录音区 */
.voice-record-box {
    text-align: center;
    padding: 40px 20px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
}

.voice-record-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 16px;
    background: linear-gradient(135deg, #a855f7 0%, #ec4899 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    transition: all 0.3s;
}

.voice-record-icon svg {
    width: 40px;
    height: 40px;
}

.voice-record-icon.recording {
    animation: pulse-recording 1s ease-in-out infinite;
}

@keyframes pulse-recording {
    0%, 100% { box-shadow: 0 0 0 0 rgba(168, 85, 247, 0.7); }
    50% { box-shadow: 0 0 0 16px rgba(168, 85, 247, 0); }
}

.voice-record-title {
    font-size: 15px;
    color: #fff;
    margin-bottom: 4px;
}

.voice-record-desc {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 16px;
}

.voice-record-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    background: linear-gradient(135deg, #a855f7 0%, #ec4899 100%);
    border: none;
    border-radius: 24px;
    color: #fff;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.voice-record-dot {
    width: 10px;
    height: 10px;
    background: #fff;
    border-radius: 50%;
}

.voice-record-dot.recording {
    background: #ef4444;
    animation: blink 1s ease-in-out infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.voice-record-time {
    margin-top: 16px;
    font-size: 24px;
    font-weight: 600;
    color: #a855f7;
    font-family: 'Courier New', monospace;
}

.voice-after-record {
    margin-top: 20px;
}

/* 提示消息 */
.voice-train-msgs {
    margin-top: 12px;
}

.voice-msg {
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
}

.voice-msg-info {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #60a5fa;
}

.voice-msg-success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #22c55e;
}

.voice-msg-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
}

.voice-msg-warn {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #fbbf24;
}

/* 参数设置 */
.voice-params-box {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 14px;
    margin-top: 16px;
}

.voice-params-title {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 12px;
    font-weight: 500;
}

.voice-slider-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.voice-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    background: linear-gradient(90deg, #a855f7 0%, #ec4899 50%, #6b7280 100%);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.voice-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.voice-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.voice-slider-value {
    min-width: 32px;
    text-align: center;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.85);
    font-family: monospace;
}

.voice-synth-result {
    margin-top: 16px;
    padding: 12px;
    background: rgba(168, 85, 247, 0.06);
    border-radius: 8px;
}

.voice-synth-info {
    margin-top: 8px;
    text-align: center;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

.voice-synth-result audio {
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.3);
}

/* 声音库 */
.voice-library-section {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 20px;
}

.voice-library-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.voice-library-info {
    flex: 1;
}

.voice-library-title {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 4px;
}

.voice-library-desc {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
}

.voice-refresh-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.voice-refresh-btn:hover {
    background: rgba(168, 85, 247, 0.15);
    border-color: rgba(168, 85, 247, 0.4);
}

.voice-refresh-btn svg {
    width: 14px;
    height: 14px;
}

.voice-library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}

.voice-library-empty {
    text-align: center;
    padding: 60px 20px;
    color: rgba(255, 255, 255, 0.5);
}

.voice-library-empty svg {
    margin-bottom: 12px;
    opacity: 0.5;
}

.voice-library-empty-title {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 6px;
}

.voice-library-empty-desc {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
}

.voice-library-error {
    text-align: center;
    padding: 30px 20px;
    color: rgba(239, 68, 68, 0.8);
    font-size: 13px;
}

/* 声音卡片 */
.voice-card {
    position: relative;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.08) 0%, rgba(236, 72, 153, 0.05) 100%);
    border: 1px solid rgba(168, 85, 247, 0.2);
    border-radius: 10px;
    padding: 14px;
    transition: all 0.2s;
    overflow: hidden;
}

.voice-card:hover {
    transform: translateY(-2px);
    border-color: rgba(168, 85, 247, 0.5);
    box-shadow: 0 8px 24px rgba(168, 85, 247, 0.15);
}

.voice-card-icon {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #a855f7 0%, #ec4899 100%);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    margin-bottom: 8px;
}

.voice-card-icon svg {
    width: 16px;
    height: 16px;
}

.voice-card-actions {
    position: absolute;
    top: 14px;
    right: 14px;
    display: flex;
    gap: 6px;
}

.voice-card-action-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.voice-card-action-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.voice-card-action-btn svg {
    width: 12px;
    height: 12px;
}

.voice-card-name {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 4px;
    padding-right: 30px;
}

.voice-card-desc {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.4;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 30px;
}

.voice-card-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 8px;
}

.voice-card-size { color: rgba(168, 85, 247, 0.8); }
.voice-card-date { flex: 1; }

.voice-card-buttons {
    display: flex;
    gap: 4px;
    margin-left: auto;
}

.voice-card-icon-btn {
    width: 22px;
    height: 22px;
    border-radius: 4px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.voice-card-icon-btn svg {
    width: 12px;
    height: 12px;
}

.voice-card-icon-btn.edit {
    color: rgba(59, 130, 246, 0.7);
}

.voice-card-icon-btn.edit:hover {
    color: #60a5fa;
    background: rgba(59, 130, 246, 0.1);
}

.voice-card-icon-btn.delete {
    color: rgba(239, 68, 68, 0.7);
}

.voice-card-icon-btn.delete:hover {
    color: #f87171;
    background: rgba(239, 68, 68, 0.1);
}

/* 编辑模态框 */
.voice-edit-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
}

.voice-edit-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.voice-edit-container {
    position: relative;
    width: 90%;
    max-width: 480px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.voice-edit-header {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.voice-edit-title {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
}

.voice-edit-body {
    padding: 20px;
}

.voice-edit-footer {
    padding: 12px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.voice-btn-secondary,
.voice-btn-primary {
    padding: 8px 18px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.voice-btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.85);
}

.voice-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
}

.voice-btn-primary {
    background: linear-gradient(135deg, #a855f7 0%, #ec4899 100%);
    color: #fff;
}

.voice-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.4);
}

/* 响应式 */
@media (max-width: 980px) {
    .voice-top-row {
        grid-template-columns: 1fr;
    }
    .voice-modal-container {
        width: 98vw;
        height: 96vh;
    }
    .voice-library-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
}

/* ========== 模块5 耀发爆款云剪 — 云剪功能入口（合并进卡片） ========== */
.card-icon-cloud {
    background: linear-gradient(135deg, #ff4458 0%, #8b5cf6 100%) !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(255, 68, 88, 0.35);
}

.cloud-features {
    background: linear-gradient(135deg, rgba(255, 68, 88, 0.08) 0%, rgba(139, 92, 246, 0.08) 100%);
    border: 1px solid rgba(255, 68, 88, 0.25);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 4px;
}
.cloud-features-title {
    font-size: 13px;
    font-weight: 700;
    color: #ff4458;
    margin-bottom: 10px;
    letter-spacing: 0.5px;
}
.cloud-features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}
.cloud-feature-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 10px 6px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(0, 0, 0, 0.06);
    text-decoration: none;
    transition: all 0.2s;
}
.cloud-feature-item:hover {
    transform: translateY(-2px);
    border-color: #ff4458;
    box-shadow: 0 6px 14px rgba(255, 68, 88, 0.2);
}
.cloud-feature-icon { font-size: 20px; line-height: 1; }
.cloud-feature-name {
    font-size: 11px;
    font-weight: 600;
    color: #333;
    margin-top: 2px;
    white-space: nowrap;
}
.cloud-feature-desc {
    font-size: 9px;
    color: #999;
    white-space: nowrap;
}

.cloud-divider {
    display: flex;
    align-items: center;
    margin: 14px 0 10px;
}
.cloud-divider::before,
.cloud-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(0, 0, 0, 0.1);
}
.cloud-divider span {
    padding: 0 10px;
    font-size: 11px;
    color: #999;
    letter-spacing: 1px;
}

@media (max-width: 768px) {
    .cloud-features-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; }
    .cloud-feature-item { padding: 8px 4px; }
    .cloud-feature-name { font-size: 10px; }
    .cloud-feature-desc { display: none; }
}
/* ============ Cookies 配置横幅与弹窗 ============ */
.cookies-banner {
    display: flex; align-items: center; gap: 8px;
    margin: 10px 0 4px;
    padding: 8px 12px;
    border-radius: 8px;
    background: rgba(255, 159, 64, 0.12);
    border: 1px solid rgba(255, 159, 64, 0.35);
    color: #ffb98c;
    font-size: 13px; cursor: pointer;
    transition: all 0.2s;
}
.cookies-banner:hover { background: rgba(255, 159, 64, 0.2); }
.cookies-banner.is-configured {
    background: rgba(72, 199, 142, 0.12);
    border-color: rgba(72, 199, 142, 0.4);
    color: #88e2b6;
}
.cookies-banner.is-loading { color: #9aa6c4; cursor: default; }
.cookies-icon { font-size: 16px; }
.cookies-text { flex: 1; }
.cookies-action {
    padding: 2px 10px; border-radius: 4px;
    background: rgba(255, 159, 64, 0.25);
    font-size: 12px; font-weight: 600;
}
.cookies-banner.is-configured .cookies-action { background: rgba(72, 199, 142, 0.25); }

.cookies-modal {
    /* 2026-09-21 层级加固：原为 9999，与 .dh-context-menu / .toast 同级，
       且低于动态创建的 .dh-confirm-overlay(99999) / #_confirmDialog(99999)，
       一旦那两者残留就会整屏盖住弹窗并吞掉全部点击。这里抬到最高，
       与遮罩/卡片一并显式分层，彻底消除"靠 DOM 顺序决定谁在上面"的隐患。 */
    position: fixed; inset: 0; z-index: 100000;
    display: flex; align-items: center; justify-content: center;
}
.cookies-modal-mask {
    position: absolute; inset: 0; z-index: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}
.cookies-modal-card {
    position: relative; z-index: 1;
    width: 92%; max-width: 620px;
    max-height: 88vh; overflow-y: auto;
    background: linear-gradient(135deg, #1a1d3a, #13152e);
    border: 1px solid rgba(120, 140, 220, 0.3);
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    color: #e4e8f7;
}
.cookies-modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px; border-bottom: 1px solid rgba(120, 140, 220, 0.2);
}
.cookies-modal-title { font-size: 16px; font-weight: 600; }
.cookies-modal-close {
    background: none; border: none; color: #9aa6c4;
    font-size: 22px; cursor: pointer; line-height: 1;
    padding: 0 6px;
}
.cookies-modal-close:hover { color: #ff6b6b; }
.cookies-modal-body { padding: 18px 20px; }
.cookies-modal-footer {
    display: flex; gap: 10px; justify-content: flex-end;
    padding: 14px 20px; border-top: 1px solid rgba(120, 140, 220, 0.2);
}
.cookies-guide {
    background: rgba(120, 140, 220, 0.08);
    border-radius: 8px; padding: 12px 14px; margin-bottom: 14px;
    border: 1px solid rgba(120, 140, 220, 0.15);
}
.cookies-guide-title { font-weight: 600; margin-bottom: 6px; color: #ffd5a8; font-size: 13px; }
.cookies-steps { margin: 0; padding-left: 22px; font-size: 13px; line-height: 1.85; color: #c8d0e6; }
.cookies-steps code { background: rgba(255,255,255,0.1); padding: 1px 5px; border-radius: 3px; }
.cookies-row { margin-bottom: 12px; }
.cookies-label { display: block; font-size: 13px; color: #9aa6c4; margin-bottom: 6px; }
.cookies-textarea {
    width: 100%; box-sizing: border-box;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(120, 140, 220, 0.3);
    border-radius: 6px; color: #e4e8f7;
    padding: 10px 12px; font-family: "Cascadia Code", Consolas, monospace;
    font-size: 12px; resize: vertical;
}
.cookies-textarea:focus { outline: none; border-color: #6c84ff; }
.cookies-row-flex { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cookies-or { color: #9aa6c4; font-size: 13px; }
.cookies-file-btn {
    display: inline-block; padding: 6px 14px;
    background: rgba(120, 140, 220, 0.2);
    border: 1px dashed rgba(120, 140, 220, 0.4);
    border-radius: 6px; cursor: pointer; font-size: 13px;
    color: #b6c0e0; transition: all 0.2s;
}
.cookies-file-btn:hover { background: rgba(120, 140, 220, 0.32); }
.cookies-file-name { color: #88e2b6; font-size: 12px; }
.cookies-current {
    margin-top: 10px; padding: 8px 12px; border-radius: 6px;
    background: rgba(120, 140, 220, 0.1);
    border-left: 3px solid #6c84ff;
    font-size: 12px; color: #b6c0e0; line-height: 1.6;
}
.cookies-current.empty { color: #ffb98c; border-left-color: #ff9f40; }
.cookies-btn-primary, .cookies-btn-secondary, .cookies-btn-danger {
    padding: 7px 16px; border-radius: 6px; cursor: pointer;
    font-size: 13px; border: 1px solid transparent; transition: all 0.2s;
}
.cookies-btn-primary { background: linear-gradient(135deg, #6c84ff, #4a5fdb); color: #fff; }
.cookies-btn-primary:hover { filter: brightness(1.1); }
.cookies-btn-secondary { background: transparent; color: #9aa6c4; border-color: rgba(120,140,220,0.3); }
.cookies-btn-secondary:hover { background: rgba(120, 140, 220, 0.1); }
.cookies-btn-danger { background: transparent; color: #ff6b6b; border-color: rgba(255, 107, 107, 0.3); }
.cookies-btn-danger:hover { background: rgba(255, 107, 107, 0.1); }

/* 数字人清除确认弹层 */
.dh-confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: dhFadeIn 0.18s ease;
    backdrop-filter: blur(2px);
}
.dh-confirm-box {
    background: #1c2030;
    color: #e6e8f0;
    border-radius: 12px;
    width: 380px;
    max-width: 92vw;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(120, 140, 220, 0.25);
    overflow: hidden;
    animation: dhSlideUp 0.2s ease;
}
.dh-confirm-header {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(120, 140, 220, 0.15);
    display: flex;
    align-items: center;
    gap: 10px;
}
.dh-confirm-icon { font-size: 20px; }
.dh-confirm-title {
    font-size: 15px;
    font-weight: 600;
    color: #f0f2fa;
    word-break: break-all;
}
.dh-confirm-body {
    padding: 14px 16px 8px;
}
.dh-confirm-hint {
    font-size: 12px;
    color: #9aa6c4;
    margin: 0 0 10px;
}
.dh-confirm-opt {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
    background: rgba(120, 140, 220, 0.08);
    border: 1px solid rgba(120, 140, 220, 0.25);
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 8px;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s, border-color 0.15s, transform 0.08s;
    color: #e6e8f0;
    font-family: inherit;
}
.dh-confirm-opt:hover {
    background: rgba(120, 140, 220, 0.15);
    border-color: rgba(120, 140, 220, 0.4);
    transform: translateY(-1px);
}
.dh-confirm-opt:active { transform: translateY(0); }
.dh-confirm-opt-icon {
    font-size: 22px;
    line-height: 1.2;
    flex-shrink: 0;
}
.dh-confirm-opt-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}
.dh-confirm-opt-title {
    font-size: 13px;
    font-weight: 600;
    color: #f0f2fa;
}
.dh-confirm-opt-desc {
    font-size: 11.5px;
    color: #9aa6c4;
    line-height: 1.4;
}
.dh-confirm-opt-desc b {
    color: #fff;
    font-weight: 600;
}
.dh-confirm-opt-photo { border-color: rgba(102, 153, 255, 0.4); }
.dh-confirm-opt-photo:hover { background: rgba(102, 153, 255, 0.15); border-color: rgba(102, 153, 255, 0.6); }
.dh-confirm-opt-full { border-color: rgba(255, 107, 107, 0.4); }
.dh-confirm-opt-full:hover { background: rgba(255, 107, 107, 0.15); border-color: rgba(255, 107, 107, 0.6); }
.dh-confirm-actions {
    padding: 8px 16px 14px;
    display: flex;
    justify-content: flex-end;
}
.dh-confirm-cancel {
    background: transparent;
    border: 1px solid rgba(120, 140, 220, 0.3);
    color: #9aa6c4;
    padding: 6px 18px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-family: inherit;
    transition: background 0.15s;
}
.dh-confirm-cancel:hover { background: rgba(120, 140, 220, 0.15); color: #f0f2fa; }

/* 主操作红色按钮（统一确认清除用的危险按钮） */
.dh-confirm-danger {
    background: rgba(220, 38, 38, 0.92);
    color: white;
    border: 1px solid rgba(255, 107, 107, 0.5);
    padding: 7px 18px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    transition: background 0.15s, transform 0.05s;
}
.dh-confirm-danger:hover { background: #dc2626; }
.dh-confirm-danger:active { transform: translateY(1px); }
.dh-confirm-cancel {
    background: transparent;
    color: var(--studio-text-secondary, #a3b1cc);
    border: 1px solid rgba(120, 140, 220, 0.25);
    padding: 7px 18px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-family: inherit;
    transition: background 0.15s;
}
@keyframes dhFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes dhSlideUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

/* ==================== 数字人卡片右键菜单 ==================== */
.dh-context-menu {
    position: fixed;
    z-index: 9999;
    min-width: 220px;
    max-width: 320px;
    background: rgba(28, 30, 50, 0.96);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(108, 132, 255, 0.3);
    border-radius: 10px;
    padding: 6px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    animation: dhCtxFadeIn 0.12s ease-out;
    font-family: inherit;
}
@keyframes dhCtxFadeIn {
    from { opacity: 0; transform: translateY(-4px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.dh-context-menu .dh-ctx-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 12px;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    text-align: left;
    font-family: inherit;
    color: #f0f2fa;
    transition: background 0.1s;
}
.dh-context-menu .dh-ctx-item:hover {
    background: rgba(108, 132, 255, 0.15);
}
.dh-context-menu .dh-ctx-danger {
    color: #ff8a8a;
}
.dh-context-menu .dh-ctx-danger:hover {
    background: rgba(220, 38, 38, 0.2);
    color: #ffd2d2;
}
.dh-context-menu .dh-ctx-icon {
    font-size: 15px;
    line-height: 1;
    flex-shrink: 0;
}
.dh-context-menu .dh-ctx-text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dh-context-menu .dh-ctx-hint {
    padding: 6px 12px 4px 12px;
    font-size: 11px;
    color: rgba(160, 170, 200, 0.65);
    border-top: 1px solid rgba(108, 132, 255, 0.12);
    margin-top: 4px;
}

/* ===================================================================
   CosyVoice3 声音克隆面板 —— 专业网格布局（手绘稿 v2）
   第一行 4 列：语种+模式 | 流式+速度+种子 | 合成文本 | 操作步骤
   后续行 2 列：prompt文本|选择音频 / instruct文本|录制音频 / 前端|生成
   =================================================================== */

/* 面板容器 —— 列宽用变量维护，下方 2 列与上方 3 列共用同一条垂直分界线 */
.cosy-panel {
    display: flex;
    flex-direction: column;
    gap: 5px;
    --cosy-c1: 152px;   /* 第一行列1：语种 + 推理模式 */
    --cosy-c2: 144px;   /* 第一行列2：流式 / 速度 / 种子 */
    --cosy-gap: 6px;
    /* 下方行的左列宽度 = 列1 + 列2 + 间距，使右列左边界与文本框列严格对齐 */
    --cosy-left: calc(var(--cosy-c1) + var(--cosy-c2) + var(--cosy-gap));
}

/* ===== 第一行：3列网格（等高对齐） ===== */
.cosy-row1 {
    display: grid;
    grid-template-columns: var(--cosy-c1) var(--cosy-c2) 1fr;
    gap: var(--cosy-gap);
    margin-bottom: 2px;
    align-items: stretch;
}

/* 三列统一：纵向 flex，内部控件撑满 → 网格等高对齐 */
.cosy-r1c1,
.cosy-r1c2,
.cosy-r1c3 {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

/* 通用：撑满剩余高度 */
.cosy-flex-1 { flex: 1; min-height: 0; }

/* 列1：模式组撑满，3 个单选项均分高度 */
.cosy-r1c1 .cosy-mode-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.cosy-r1c1 .cosy-radio {
    flex: 1;
    justify-content: center;
}

/* 列2：三个控件垂直均匀分布（保持自然高度，不空旷） */
.cosy-r1c2 {
    justify-content: space-between;
}

/* 列3：合成文本框最大化（撑满整列剩余空间） */
.cosy-r1c3 .cosy-text-main {
    flex: 1;
    min-height: 172px;
}

/* ===== 第二~四行：2列网格（左列宽度 = 上方两列之和，右列与文本框列左对齐） ===== */
.cosy-row2 {
    display: grid;
    grid-template-columns: var(--cosy-left) 1fr;
    gap: var(--cosy-gap);
    margin-bottom: 3px;
    align-items: stretch;
}
.cosy-row-last { margin-bottom: 0; margin-top: 2px; }
.cosy-half { display: flex; flex-direction: column; gap: 3px; min-width: 0; }

/* 第二行右侧：按钮区撑满并垂直居中，文件名贴底 */
.cosy-half .cosy-audio-row {
    flex: 1;
    align-items: center;
}

/* 第二、三行的文本框撑满剩余高度（上方 chips/label 固定） */
.cosy-row2 .cosy-textarea {
    flex: 1;
    min-height: 40px;
}

/* 第三行右侧：录制区撑满，内容垂直居中 */
.cosy-half .cosy-record-row {
    flex: 1;
}

/* 第四行：左侧开关撑满居中，右侧按钮撑满 */
.cosy-switch-cell .cosy-switch-row { flex: 1; }
.cosy-generate-cell { display: flex; align-items: stretch; }
.cosy-generate-cell .cosy-generate-btn { flex: 1; }

/* ===== 共享基础组件 ===== */

/* 紧凑文本域 */
.cosy-textarea {
    width: 100%;
    padding: 6px 9px;
    background: var(--studio-bg);
    border: 1px solid var(--studio-border);
    border-radius: 7px;
    color: var(--studio-text);
    font-size: 12px;
    line-height: 1.5;
    outline: none;
    resize: vertical;
    font-family: inherit;
}
.cosy-textarea:focus { border-color: var(--studio-primary); box-shadow: 0 0 0 2px rgba(139,92,246,.1); }
.cosy-textarea::placeholder { color: rgba(156, 163, 175, 0.45); }

/* 合成文本主输入框：更高、字号略大 */
.cosy-text-main {
    min-height: 132px;
    font-size: 12.5px;
    line-height: 1.65;
    padding: 8px 10px;
}

/* 紧凑单行输入 */
.cosy-input {
    width: 100%;
    padding: 6px 9px;
    background: var(--studio-bg);
    border: 1px solid var(--studio-border);
    border-radius: 7px;
    color: var(--studio-text);
    font-size: 11px;
    outline: none;
    font-family: inherit;
}
.cosy-input:focus { border-color: var(--studio-primary); }
.cosy-input::placeholder { color: rgba(156, 163, 175, 0.45); }

/* 下拉框 */
.cosy-select {
    width: 100%;
    font-size: 11px;
    padding: 5px 8px;
}

/* 推理模式单选组（纵向排列） */
.cosy-mode-group {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.cosy-radio {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 7px;
    background: var(--studio-bg);
    border: 1px solid var(--studio-border);
    border-radius: 5px;
    cursor: pointer;
    font-size: 10.5px;
    color: var(--studio-text-muted);
    transition: all 0.15s;
    user-select: none;
}
.cosy-radio:hover { border-color: var(--studio-border-active); }
.cosy-radio input { display: none; }
.cosy-radio span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cosy-radio input:checked + span { color: #fff; }
.cosy-radio:has(input:checked) {
    background: linear-gradient(135deg, var(--studio-primary), var(--studio-primary-dark));
    border-color: transparent;
    color: #fff;
}

/* 开关行 */
.cosy-switch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 5px 8px;
    background: var(--studio-bg);
    border: 1px solid var(--studio-border);
    border-radius: 6px;
}
.cosy-switch {
    position: relative;
    width: 30px;
    height: 17px;
    flex-shrink: 0;
}
.cosy-switch input { opacity: 0; width: 0; height: 0; }
.cosy-slider {
    position: absolute;
    inset: 0;
    background: rgba(156, 163, 175, 0.3);
    border-radius: 9px;
    cursor: pointer;
    transition: 0.25s;
}
.cosy-slider::before {
    content: '';
    position: absolute;
    width: 13px;
    height: 13px;
    left: 2px;
    bottom: 2px;
    background: #9ca3af;
    border-radius: 50%;
    transition: 0.25s;
}
.cosy-switch input:checked + .cosy-slider { background: var(--studio-primary); }
.cosy-switch input:checked + .cosy-slider::before { transform: translateX(13px); background: #fff; }

/* 滑块行 */
.cosy-slider-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    background: var(--studio-bg);
    border: 1px solid var(--studio-border);
    border-radius: 6px;
    min-width: 0;
}
.cosy-range { flex: 1; min-width: 36px; appearance: none; height: 3px; background: var(--studio-bg-darker); border-radius: 999px; outline: none; cursor: pointer; }
.cosy-range::-webkit-slider-thumb { appearance: none; width: 14px; height: 14px; background: var(--studio-primary); border-radius: 50%; cursor: pointer; }
.cosy-range::-moz-range-thumb { width: 14px; height: 14px; background: var(--studio-primary); border-radius: 50%; border: none; cursor: pointer; }
.cosy-val {
    font-size: 10.5px;
    color: var(--studio-primary-light);
    font-family: 'SF Mono', Consolas, monospace;
    min-width: 22px;
    text-align: right;
    flex-shrink: 0;
}

/* 种子输入 */
.cosy-seed-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 5px 8px;
    background: var(--studio-bg);
    border: 1px solid var(--studio-border);
    border-radius: 6px;
}
.cosy-input-sm {
    width: 54px;
    padding: 3px 5px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--studio-border);
    border-radius: 4px;
    color: var(--studio-text);
    font-size: 10.5px;
    font-family: 'SF Mono', Consolas, monospace;
    text-align: center;
    outline: none;
    flex-shrink: 0;
}
.cosy-input-sm:focus { border-color: var(--studio-primary); }

/* 音频操作按钮行 */
.cosy-audio-row {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}
.cosy-mini-btn {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 4px 8px;
    background: var(--studio-bg);
    border: 1px solid var(--studio-border);
    border-radius: 5px;
    color: var(--studio-text-muted);
    font-size: 10.5px;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}
.cosy-mini-btn:hover:not(:disabled) {
    border-color: var(--studio-primary);
    color: var(--studio-text);
}
.cosy-mini-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.cosy-audio-name {
    font-size: 10px;
    color: var(--studio-text-muted);
    opacity: 0.75;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 录制行（紧凑横排 —— 比原来的独立大区域省约 60px 高度） */
.cosy-record-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 8px;
    background: var(--studio-bg);
    border: 1px solid var(--studio-border);
    border-radius: 7px;
}
.cosy-record-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 14px;
    background: linear-gradient(135deg, var(--studio-primary), var(--studio-primary-dark));
    border: none;
    border-radius: 14px;
    color: #fff;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}
.cosy-record-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px var(--studio-primary-glow); }
.cosy-record-btn.recording {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    animation: cosy-pulse 1.5s infinite;
}
.cosy-record-hint {
    font-size: 9.5px;
    color: var(--studio-text-muted);
    opacity: 0.55;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
@keyframes cosy-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.3); }
    50% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
}

/* ===== 3S极速复刻 · 录音转写联动区 ===== */
.cosy-rec-transcript {
    margin-top: 7px;
    padding: 7px 9px 8px;
    background: linear-gradient(180deg, rgba(251, 191, 36, 0.07), rgba(251, 191, 36, 0.03));
    border: 1px solid rgba(251, 191, 36, 0.28);
    border-radius: 7px;
    transition: border-color 0.2s, background 0.2s;
}
/* 已填写 → 转为柔和绿色，暗示"这一步已完成" */
.cosy-rec-transcript.filled {
    background: linear-gradient(180deg, rgba(16, 185, 129, 0.07), rgba(16, 185, 129, 0.03));
    border-color: rgba(16, 185, 129, 0.3);
}
/* 3S极速复刻未填 → 琥珀色高亮提醒 */
.cosy-rec-transcript.warn {
    border-color: rgba(251, 191, 36, 0.75);
    background: linear-gradient(180deg, rgba(251, 191, 36, 0.14), rgba(251, 191, 36, 0.05));
}
.cosy-rec-transcript-tip {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 500;
    color: #b45309;
    margin-bottom: 5px;
}
.cosy-rec-transcript.filled .cosy-rec-transcript-tip { color: #047857; }
.cosy-rec-transcript-tip svg { flex-shrink: 0; }
.cosy-rec-transcript .cosy-textarea {
    background: rgba(255, 255, 255, 0.72);
    font-size: 11px;
    min-height: 42px;
}
.cosy-required {
    font-size: 10px;
    font-weight: 400;
    color: #b45309;
    opacity: 0.9;
}
.cosy-required.hidden { display: none; }

/* Instruct 快捷芯片 */
.cosy-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
}
.cosy-chip {
    padding: 2px 7px;
    background: rgba(139, 92, 246, 0.08);
    border: 1px solid var(--studio-border);
    border-radius: 10px;
    color: var(--studio-text-muted);
    font-size: 10px;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}
.cosy-chip:hover {
    border-color: var(--studio-primary);
    color: var(--studio-primary-light);
    background: rgba(139, 92, 246, 0.15);
}

/* 生成按钮（更大更醒目） */
.cosy-generate-btn {
    width: 100%;
    padding: 12px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 1px;
    border-radius: 10px;
    gap: 8px;
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.25);
}
.cosy-generate-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(139, 92, 246, 0.45);
}
.cosy-generate-btn svg { width: 17px; height: 17px; }

/* 卡片内 label 与间距微调 */
.studio-card[data-card="voice"] .form-label {
    display: block;
    margin-bottom: 2px;
    font-size: 11px;
}
.studio-card[data-card="voice"] .card-body {
    gap: 0;
}

/* ============================================================
   参考音音色：男声 / 女声 按钮 + 参考音选择弹窗（2026-09-21 新增）
   入口在「推理模式选择」下方；点击弹出对应性别的参考音列表。
   ============================================================ */
.cosy-gender-row {
    display: flex;
    gap: 8px;
}
.cosy-gender-btn {
    flex: 1 1 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 10px;
    font-size: 12px;
    font-weight: 600;
    color: #c8d0e6;
    background: rgba(120, 140, 220, 0.10);
    border: 1px solid rgba(120, 140, 220, 0.28);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.18s ease;
    white-space: nowrap;
}
.cosy-gender-btn:hover {
    color: #fff;
    background: rgba(139, 92, 246, 0.22);
    border-color: rgba(139, 92, 246, 0.55);
}
.cosy-gender-btn.is-active {
    color: #fff;
    background: linear-gradient(135deg, #8b5cf6, #6d4aff);
    border-color: rgba(167, 139, 250, 0.85);
    box-shadow: 0 3px 12px rgba(139, 92, 246, 0.35);
}
.cosy-gender-icon { font-size: 14px; line-height: 1; }

.cosy-gender-picked {
    margin-top: 6px;
    font-size: 11px;
    color: #7f8aa6;
    line-height: 1.5;
    word-break: break-all;
}
.cosy-gender-picked.has-voice { color: #ffb98c; }

/* ---------- 选择弹窗 ---------- */
.cosy-gender-modal {
    position: fixed; inset: 0; z-index: 100000;
    display: flex; align-items: center; justify-content: center;
}
.cosy-gender-mask {
    position: absolute; inset: 0; z-index: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}
.cosy-gender-card {
    position: relative; z-index: 1;
    display: flex;
    flex-direction: column;
    width: 94%; max-width: 760px;
    max-height: 82vh;
    background: linear-gradient(135deg, #1a1d3a, #13152e);
    border: 1px solid rgba(120, 140, 220, 0.3);
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
    color: #e4e8f7;
    overflow: hidden;
}
.cosy-gender-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid rgba(120, 140, 220, 0.2);
}
.cosy-gender-title { font-size: 15px; font-weight: 600; }
.cosy-gender-close {
    background: none; border: none; color: #9aa6c4;
    font-size: 22px; line-height: 1; padding: 0 6px; cursor: pointer;
}
.cosy-gender-close:hover { color: #ff6b6b; }

.cosy-gender-toolbar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px; flex-wrap: wrap;
    padding: 10px 20px 0;
}
.cosy-gender-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.cosy-gender-chip {
    padding: 3px 10px;
    font-size: 11px;
    color: #a9b3cc;
    background: rgba(120, 140, 220, 0.10);
    border: 1px solid rgba(120, 140, 220, 0.22);
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.16s ease;
}
.cosy-gender-chip:hover { color: #fff; border-color: rgba(139, 92, 246, 0.5); }
.cosy-gender-chip.is-active {
    color: #fff;
    background: rgba(139, 92, 246, 0.32);
    border-color: rgba(167, 139, 250, 0.7);
}
.cosy-gender-count { font-size: 11px; color: #7f8aa6; }

.cosy-gender-list {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 12px 20px 4px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.cosy-gender-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px;
    background: rgba(120, 140, 220, 0.07);
    border: 1px solid rgba(120, 140, 220, 0.18);
    border-radius: 10px;
    transition: all 0.16s ease;
}
.cosy-gender-item:hover { border-color: rgba(139, 92, 246, 0.45); }
.cosy-gender-item.is-selected {
    background: rgba(139, 92, 246, 0.18);
    border-color: rgba(167, 139, 250, 0.75);
}
.cosy-gender-item.is-missing { background: rgba(255, 159, 64, 0.06); }

.cosy-gender-item-main { flex: 1 1 auto; min-width: 0; }
.cosy-gender-item-name {
    font-size: 13px; font-weight: 600; color: #e4e8f7;
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.cosy-gender-item-meta {
    margin-top: 3px;
    font-size: 11px; color: #8b96b3;
    display: flex; gap: 8px; flex-wrap: wrap;
}
.cosy-gender-item-text {
    margin-top: 4px;
    font-size: 11px; color: #6f7a96;
    line-height: 1.5;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cosy-gender-tag {
    padding: 1px 7px; border-radius: 999px;
    font-size: 10px; font-weight: 600; line-height: 1.6;
}
.cosy-gender-tag.ok   { background: rgba(72, 199, 142, 0.18); color: #88e2b6; }
.cosy-gender-tag.miss { background: rgba(255, 159, 64, 0.18); color: #ffb98c; }

.cosy-gender-item-actions { display: flex; gap: 6px; flex-shrink: 0; }
.cosy-gender-item-actions .cosy-mini-btn { padding: 5px 10px; font-size: 11px; }
.cosy-gender-item-actions .cosy-mini-btn.primary {
    background: rgba(139, 92, 246, 0.28);
    border-color: rgba(167, 139, 250, 0.55);
    color: #fff;
}
/* 删除：用柔和的红，示意可破坏操作但不刺眼 */
.cosy-gender-item-actions .cosy-mini-btn.danger {
    background: rgba(239, 108, 108, 0.10);
    border-color: rgba(239, 108, 108, 0.34);
    color: #f2a3a3;
}
.cosy-gender-item-actions .cosy-mini-btn.danger:hover {
    background: rgba(239, 108, 108, 0.22);
    border-color: rgba(239, 108, 108, 0.6);
    color: #ffd0d0;
}
.cosy-gender-item-actions .cosy-mini-btn:disabled { opacity: 0.45; cursor: not-allowed; }

.cosy-gender-footer {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px;
    padding: 12px 20px;
    border-top: 1px solid rgba(120, 140, 220, 0.2);
}
.cosy-gender-hint { font-size: 11px; color: #8b96b3; line-height: 1.5; }
.cosy-gender-empty {
    padding: 26px 10px;
    text-align: center;
    font-size: 12px;
    color: #8b96b3;
    line-height: 1.9;
}

@media (max-width: 768px) {
    .cosy-gender-item { flex-wrap: wrap; }
    .cosy-gender-item-actions { width: 100%; justify-content: flex-end; }
}

/* 响应式：窄屏时网格塌缩，上下对齐关系自动失效 */
@media (max-width: 1100px) {
    .cosy-panel { --cosy-left: 1fr; }
    .cosy-row1 {
        grid-template-columns: 1fr 1fr;
    }
    .cosy-r1c3 { grid-column: span 2; }
    .cosy-row2 { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .cosy-row1 { grid-template-columns: 1fr; }
    .cosy-r1c3 { grid-column: auto; }
}

/* ============================================================
   动作与表情（motionModule）
   ============================================================ */

/* 启用开关 */
.motion-switch {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    user-select: none;
}
.motion-switch input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--studio-primary);
    cursor: pointer;
}
.motion-switch-text {
    font-size: 12px;
    color: var(--studio-primary-light);
}

/* 标签胶囊 */
.motion-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}
.motion-chip {
    padding: 3px 10px;
    font-size: 12px;
    border-radius: 999px;
    border: 1px solid rgba(139, 92, 246, 0.35);
    background: rgba(139, 92, 246, 0.06);
    color: #555;
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
}
.motion-chip:hover {
    border-color: var(--studio-primary);
    background: rgba(139, 92, 246, 0.14);
}
.motion-chip.active {
    background: var(--studio-primary);
    border-color: var(--studio-primary);
    color: #fff;
}

/* 说明条 */
.motion-tip {
    font-size: 12px;
    line-height: 1.7;
    color: #666;
    background: rgba(139, 92, 246, 0.07);
    border-left: 3px solid var(--studio-primary);
    border-radius: 6px;
    padding: 8px 12px;
    margin-bottom: 14px;
}

/* 素材列表项 */
.motion-asset-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 10px;
    border: 1px solid #eee;
    border-radius: 8px;
    margin-bottom: 6px;
    font-size: 13px;
}
.motion-asset-item .motion-asset-main { flex: 1; min-width: 0; }
.motion-asset-item .motion-asset-name {
    font-weight: 500;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.motion-asset-item .motion-asset-meta {
    font-size: 11px;
    color: #999;
    margin-top: 2px;
}
.motion-asset-del {
    border: none;
    background: transparent;
    color: #c00;
    cursor: pointer;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 4px;
}
.motion-asset-del:hover { background: rgba(204, 0, 0, 0.08); }

.motion-asset-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-end;
    flex-shrink: 0;
}
.motion-asset-play {
    border: 1px solid #2f9e44;
    background: #eafaf0;
    color: #2f9e44;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    padding: 3px 12px;
    white-space: nowrap;
    transition: background .15s;
}
.motion-asset-play:hover { background: #d4f3e0; }
.motion-asset-preview { margin-top: 8px; width: 100%; }

/* 动作面板状态文字（库空/模块离线）：从 12px 红字 → 14px 琥珀色卡片 */
.motion-status-warn {
    display: block;
    font-size: 14px !important;
    line-height: 1.65;
    color: #7c5c00 !important;
    background: #fff7e0;
    border: 1px solid #f3d28a;
    border-radius: 8px;
    padding: 8px 12px;
    margin-top: 6px;
    margin-bottom: 12px;
}
.motion-status-warn strong { color: #8a6600; }

/* 数字人卡片缩略图与空态 */
.dh-card { background: #2a2a3e; }  /* 兜底色，防止空态露父容器蓝 */
.dh-card .dh-cover-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
    display: block;
}
.dh-card .dh-cover-empty {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f5f5f7;
    color: #b0b0b5;
    border-radius: 6px;
    gap: 4px;
}
.dh-card .dh-cover-empty-icon { font-size: 32px; line-height: 1; }
.dh-card .dh-cover-empty-text { font-size: 11px; }

/* ===== 深链定位高亮 =====
   从 8765 首页右上角模块导航跳转过来（/studio?m=extract 等）时，
   目标卡片短暂发光，让用户一眼确认落在哪张卡片上。
   用琥珀色而非红色，避免被误读为报错。 */
.studio-card.deeplink-flash {
    box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.55), 0 0 28px rgba(251, 191, 36, 0.25);
    transition: box-shadow 0.45s ease;
}

/* ==================== 2026-11-23 改版：单步骤聚焦模式 ====================
   用户反馈三列网格"乱七八糟不知所措"：改为一次只显示当前步骤的卡片，
   全宽居中（max 1150px），其余卡片隐藏；点击顶部步骤条 switchStep(n) 切换。 */
.studio-grid {
    grid-template-columns: 1fr;
    max-width: 1150px;
    margin: 0 auto;
}

.studio-grid .studio-card {
    display: none;
}

.studio-grid .studio-card.step-active {
    display: flex;
}

/* 步骤条可点击 */
.workflow-step {
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.workflow-step:hover {
    color: var(--studio-primary-light);
    transform: translateY(-1px);
}

/* 步骤 1 卡片：反推 + 提取 双按钮行 */
.reverse-btn-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
    margin-top: 10px;
}

.reverse-btn-row .btn-primary-action {
    flex: 1.2;
}

.reverse-btn-row .ghost-btn {
    flex: 1;
}

/* ==================== 反推提示词结果区 ==================== */
.reverse-box {
    margin-top: 14px;
    border-top: 1px dashed var(--studio-border);
    padding-top: 12px;
}

.reverse-summary {
    background: rgba(251, 191, 36, 0.08);           /* 琥珀柔和底 */
    border: 1px solid rgba(251, 191, 36, 0.25);
    border-radius: 10px;
    padding: 10px 14px;
    color: #fcd34d;
    font-size: 13px;
    line-height: 1.6;
    margin-bottom: 12px;
}

.reverse-shots {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

@media (max-width: 900px) {
    .reverse-shots { grid-template-columns: 1fr; }
}

.shot-card {
    background: var(--studio-bg-card);
    border: 1px solid var(--studio-border);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.shot-thumb {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
    background: rgba(0, 0, 0, 0.3);
}

.shot-info {
    padding: 10px 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.shot-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.shot-no {
    font-size: 13px;
    font-weight: 600;
    color: var(--studio-primary-light);
}

.shot-copy-btn {
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid var(--studio-border-active);
    color: var(--studio-primary-light);
    border-radius: 6px;
    padding: 3px 10px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.shot-copy-btn:hover {
    background: rgba(139, 92, 246, 0.3);
}

.shot-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.shot-tag {
    font-size: 11px;
    padding: 2px 7px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--studio-text-muted);
}

.shot-tag b {
    color: var(--studio-text);
    font-weight: 500;
}

.shot-prompt {
    font-size: 12.5px;
    line-height: 1.7;
    color: var(--studio-text);
    background: rgba(139, 92, 246, 0.08);
    border-left: 3px solid var(--studio-primary);
    border-radius: 6px;
    padding: 8px 10px;
}

.shot-label {
    font-size: 11px;
    color: var(--studio-text-muted);
    margin-top: 2px;
}

.reverse-negative {
    margin-top: 12px;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 12.5px;
    line-height: 1.7;
    color: #fca5a5;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.reverse-negative .shot-copy-btn {
    flex-shrink: 0;
    margin-top: 2px;
}

.reverse-loading {
    text-align: center;
    padding: 30px 0;
    color: var(--studio-text-muted);
    font-size: 13px;
}

.reverse-loading .spin {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid var(--studio-border);
    border-top-color: var(--studio-primary);
    border-radius: 50%;
    animation: yaofaSpin 0.9s linear infinite;
    vertical-align: middle;
    margin-right: 10px;
}

/* ============================================================
 * 浅色主题适配层（2026-11-23 用户反馈：米白页面底 vs 深色输入框反差太刺眼）
 * style.css 末尾已有官网米黄覆盖层（--bg-base:#F9F2E4 / 焦糖金 #C99447），
 * 本层把 --studio-* 变量整体切到同一色板，并修复少量硬编码深色；
 * 同时统一放大字号（对齐 style.css 的全局放大层）。
 * 删除本段即可整体回滚到深色主题。
 * ============================================================ */
:root {
    --studio-bg: #FDF6E7;            /* 输入框底：比页面底稍亮的暖白 */
    --studio-bg-darker: #F9F2E4;     /* 页面底：官网米黄 */
    --studio-bg-card: #FDFAF2;       /* 卡片底 */
    --studio-border: #E7DDC7;
    --studio-border-active: #C99447;
    --studio-text: #333333;
    --studio-text-muted: #7A7261;
    --studio-primary: #C99447;
    --studio-primary-dark: #A97833;
    --studio-primary-light: #A97833;
    --studio-primary-glow: rgba(201, 148, 71, 0.25);
    --studio-accent: #627890;
}

body {
    background: var(--studio-bg-darker);
    color: var(--studio-text);
}

/* ---- 硬编码深色修复 ---- */
.workflow-bar {
    background: rgba(253, 250, 242, 0.88);
    border-bottom: 1px solid var(--studio-border);
    backdrop-filter: blur(10px);
}
.input-field[readonly] { background: #F6EEDD; color: var(--studio-text-muted); }
.input-field::placeholder, .textarea-field::placeholder, .cosy-textarea::placeholder { color: #B3A78F; }
.input-field:focus, .textarea-field:focus, .select-field:focus, .cosy-textarea:focus { box-shadow: 0 0 0 3px rgba(201, 148, 71, 0.15); }
.studio-card:hover { box-shadow: 0 8px 30px rgba(201, 148, 71, 0.12); }
.workflow-step.completed { background: #F6E9CE; color: #A97833; border-color: #C99447; }
.workflow-step.active span { background: rgba(255, 255, 255, 0.28); }
.workflow-arrow { color: #B3A78F; }
.help-btn { background: rgba(201, 148, 71, 0.15); }
.video-info-box { background: rgba(201, 148, 71, 0.07); border-color: rgba(201, 148, 71, 0.25); }
.cosy-input-sm { background: #FDF6E7; color: #333; }
.cosy-chip { background: #F6E9CE; }
.cookies-banner { background: #F6E9CE; border: 1px solid #E3C88E; color: #8A6D1F; }
.cookies-action { background: #C99447; color: #fff; }
.yaofa-ai-inline { background: linear-gradient(135deg, #FDF3DF 0%, #F6E9CE 100%); border-color: #E3C88E; }
.yaofa-ai-inline-badge.status-checking { color: #8C8578; }
.yaofa-ai-inline-badge.status-offline  { color: #C04438; background: rgba(192, 68, 56, 0.10); border-color: rgba(192, 68, 56, 0.35); }
.yaofa-ai-inline-badge.status-online   { color: #2E9E6B; background: rgba(46, 158, 107, 0.10); border-color: rgba(46, 158, 107, 0.35); }
.yaofa-ai-inline-badge.status-error    { color: #B45309; background: rgba(180, 83, 9, 0.10); border-color: rgba(180, 83, 9, 0.35); }

/* 反推结果区（镜头卡）配色 */
.shot-card { background: #FDFAF2; }
.shot-tag { background: #F6E9CE; border-color: #E7DDC7; color: #7A7261; }
.shot-tag b { color: #333333; }
.shot-prompt { background: #FDF6E7; border-left-color: #C99447; color: #333333; }
.shot-copy-btn { background: #F6E9CE; border-color: #C99447; color: #A97833; }
.shot-copy-btn:hover { background: #EFD9AC; }
.reverse-summary { background: #F6E9CE; border-color: #E3C88E; color: #8A6D1F; }
.reverse-negative { background: #FBECEC; border-color: #E8BDBD; color: #A0433A; }
.reverse-loading { color: #7A7261; }

/* 弹窗容器（音频/照片/素材库/cookies/发布账号）改浅色底 */
.voice-modal-container, .cookies-modal-card, .publish-mgr {
    background: #FDFAF2;
    color: #333333;
    border: 1px solid #E7DDC7;
}
.voice-modal-header, .cookies-modal-header, .publish-mgr-header { color: #333333; }
.voice-modal-subtitle { color: #8C8578; }
.voice-modal-close, .cookies-modal-close, .publish-mgr-close { color: #8C8578; }

/* ============================================================
 * 字号统一放大（2026-11-23 用户反馈：部分文字太小、7 个步骤按钮看不清）
 * 与 style.css 全局放大层对齐；.input-field 用 !important 压过
 * style.css 里对聊天页设的 28px，保证整页字号协调。
 * ============================================================ */
.workflow-step { font-size: 16px; padding: 9px 16px; gap: 9px; }
.workflow-step span { width: 24px; height: 24px; font-size: 14px; }
.workflow-arrow { font-size: 16px; }

.card-title { font-size: 19px; }
.card-icon { width: 34px; height: 34px; }
.card-icon svg { width: 18px; height: 18px; }
.help-btn { width: 22px; height: 22px; font-size: 14px; }

.form-label { font-size: 16px; }
.form-hint { font-size: 14px; opacity: 0.9; }
.word-count { font-size: 13px; }
.paste-btn { font-size: 13px; padding: 4px 12px; }
.ghost-btn-small { font-size: 13px; padding: 5px 12px; }

.input-field, .textarea-field, .select-field {
    font-size: 17px !important;
    line-height: 1.5;
    padding: 10px 14px;
}
.cosy-textarea { font-size: 16px; }
.cosy-text-main { font-size: 17px; }

.btn-primary-action { font-size: 16px; padding: 11px 20px; }
.btn-large { font-size: 18px; padding: 15px 34px; }
.ghost-btn { font-size: 16px; padding: 10px 16px; }
.result-text { font-size: 15px; }
.result-hint { font-size: 13px; }

/* 反推结果区字号 */
.reverse-summary { font-size: 15px; }
.reverse-negative { font-size: 14.5px; }
.shot-no { font-size: 15px; }
.shot-tag { font-size: 13px; }
.shot-prompt { font-size: 14px; line-height: 1.75; }
.shot-label { font-size: 12.5px; }
.shot-copy-btn { font-size: 13px; padding: 4px 12px; }
.reverse-loading { font-size: 15px; }

/* ============================================================
 * 布局收紧（2026-11-23 用户反馈：两侧与下方留白太多）
 * 卡片加宽填满屏宽；内容间距加大后下方空洞感减轻。
 * ============================================================ */
.studio-main { padding: 20px 28px; }
.studio-grid { max-width: 1500px; }
.studio-card { padding: 22px 26px; }
.card-body { gap: 12px; }
.studio-card .textarea-field { min-height: 170px; }

/* ---- 下方留白收紧：卡片纵向撑满剩余视口（2026-11-23 第二轮） ---- */
.studio-main {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 220px);
}
.studio-grid { flex: 1; display: flex; flex-direction: column; }
.studio-grid .studio-card.step-active { flex: 1; }
.studio-card.step-active { display: flex; flex-direction: column; }
.studio-card .card-body { flex: 1; }
.studio-card .card-body > .textarea-field:last-of-type { flex: 0 0 auto; }
.input-field::placeholder { color: #A69A82 !important; }
.textarea-field::placeholder { color: #A69A82 !important; }
/* 修复：flex 纵向容器中 auto margin 会取消 stretch，grid 收缩到内容宽度 */
.studio-grid { margin: 0; width: 100%; }
