/* ============================================================
   Voice — 语音合成/音色克隆/音色设计页面样式
   ============================================================ */

/* --- 语音合成：全屏布局 --- */
.voice-main {
  padding:0 !important; display:flex; flex-direction:column;
  height:100vh; overflow:hidden;
  max-width:none !important;
}
/* 防止页面加载时左侧内容卡一下 */
.voice-workspace-inner {
  opacity:0; animation:voice-fadeIn 0.15s ease 0.05s forwards;
}
@keyframes voice-fadeIn {
  to { opacity:1; }
}

/* --- 音色克隆/设计：全屏导航 + 居中卡片 --- */
.voice-page-main {
  /* 导航栏需要占满全屏宽度，不被 max-width 限制 */
  padding:0 !important;
  max-width:none !important;
  display:flex;
  flex-direction:column;
}

/* 居中内容区 */
.voice-page-content {
  max-width:720px;
  margin:0 auto;
  padding:28px 36px 60px;
  width:100%;
  flex:1;
}

/* 页面标题 */
.voice-page-content .page-header {
  margin-bottom:28px;
}
.voice-page-content .page-title {
  font-size:22px;
  font-weight:700;
  color:var(--text-1);
  margin:0;
}

/* --- 语音卡片（克隆/设计页面用） --- */
.voice-card {
  background:var(--bg-card);
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:22px 24px;
  margin-bottom:20px;
  box-shadow:var(--shadow-sm);
}
.voice-card-title {
  font-size:13px; font-weight:600; color:var(--text-2);
  margin-bottom:16px;
  text-transform:uppercase; letter-spacing:0.04em;
}

/* --- 内联播放器 --- */
.audio-player-inline {
  display:none;
  align-items:center;
  gap:12px;
  padding:16px 20px;
  background:var(--bg-card);
  border:1px solid var(--border);
  border-radius:12px;
}
.audio-player-inline.visible {
  display:flex;
}
.audio-player-inline audio {
  flex:1;
  height:40px;
}
.audio-player-inline .download-btn {
  flex-shrink:0;
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:8px 14px;
  border-radius:8px;
  border:1px solid var(--border);
  background:var(--bg-input);
  color:var(--text-2);
  font-size:13px;
  cursor:pointer;
  transition:all 0.15s;
  font-family:inherit;
}
.audio-player-inline .download-btn:hover {
  border-color:var(--primary);
  color:var(--primary);
}

/* --- 顶部子页面导航栏 --- */
.subnav-bar {
  display:flex; align-items:center; gap:8px;
  padding:10px 20px;
  border-bottom:1px solid var(--border);
  flex-shrink:0;
  background:var(--bg-card);
}
.subnav-back {
  display:flex; align-items:center; gap:4px;
  font-size:13px; color:var(--text-3); text-decoration:none;
  transition:color 0.15s; white-space:nowrap;
}
.subnav-back:hover { color:var(--primary); }
.subnav-back svg { flex-shrink:0; }
.subnav-divider {
  width:1px; height:16px; background:var(--border); flex-shrink:0;
}
.subnav-switcher { position:relative; }
.subnav-current {
  display:flex; align-items:center; gap:4px;
  padding:4px 10px; border-radius:6px; border:none;
  background:transparent; color:var(--text-1);
  font-size:13px; font-weight:500; cursor:pointer;
  transition:background 0.15s; font-family:inherit;
}
.subnav-current:hover { background:var(--bg-hover); }
.subnav-current svg { transition:transform 0.15s; }
.subnav-switcher.open .subnav-current svg { transform:rotate(180deg); }
.subnav-dropdown {
  position:absolute; top:calc(100% + 4px); left:0;
  min-width:160px; padding:4px;
  background:var(--bg-card); border:1px solid var(--border);
  border-radius:8px; box-shadow:0 4px 16px rgba(0,0,0,0.08);
  display:none; z-index:50;
}
.subnav-switcher.open .subnav-dropdown { display:block; }
.subnav-dropdown-item {
  display:block; padding:8px 12px; border-radius:6px;
  font-size:13px; color:var(--text-2); text-decoration:none;
  transition:all 0.12s;
}
.subnav-dropdown-item:hover { background:var(--bg-hover); color:var(--text-1); }

/* --- 工作区 --- */
.voice-workspace {
  flex:1; display:flex; flex-direction:column; min-height:0;
  background:var(--bg-card);
}
.voice-workspace-inner {
  flex:1; display:flex; min-height:0;
}

/* --- 左侧：文本输入区 --- */
.voice-left-panel {
  flex:1; display:flex; flex-direction:column;
  min-width:0; padding:24px 32px;
  overflow:hidden;
}
.voice-text-area {
  flex:1; display:flex; flex-direction:column;
  min-height:0; background:var(--bg-input);
  border:1px solid var(--border); border-radius:12px;
  padding:16px 20px;
  position:relative;
}
.voice-text-input {
  flex:1; min-height:0; resize:none;
  border:none; outline:none; background:transparent;
  color:var(--text-1); font-size:15px; line-height:1.8;
  font-family:inherit;
}
.voice-text-input::placeholder { color:var(--text-3); }
.voice-text-footer {
  display:flex; justify-content:space-between; align-items:center;
  padding-top:12px; border-top:1px solid var(--border);
  margin-top:12px; flex-shrink:0;
}

/* --- 日志面板（右下角浮层） --- */
.voice-log-panel {
  position:absolute;
  bottom:12px;
  right:16px;
  z-index:10;
  width:260px;
  border-radius:10px;
  border:1px solid var(--border);
  background:var(--bg-card);
  box-shadow:0 4px 20px rgba(0,0,0,0.06);
  opacity:0.6;
  transition:opacity 0.2s;
  overflow:hidden;
}
.voice-log-panel:hover { opacity:0.95; }
.voice-log-title {
  padding:5px 10px;
  display:flex; align-items:center; justify-content:space-between;
  cursor:pointer; font-size:11px; color:var(--text-3); font-weight:500;
  user-select:none;
}
.voice-log-title svg { width:12px; height:12px; transition:transform 0.15s; }
.voice-log-title.open svg { transform:rotate(180deg); }
.voice-log-content {
  display:none;
  max-height:90px; overflow-y:auto;
  padding:0 10px 6px;
  font-family:'SF Mono','Menlo','Consolas',monospace;
  font-size:10px; line-height:1.6; color:var(--text-3);
}
.voice-log-content.open { display:block; }
.voice-log-content::-webkit-scrollbar { width:4px; }
.voice-log-content::-webkit-scrollbar-track { background:transparent; }
.voice-log-content::-webkit-scrollbar-thumb { background:var(--border); border-radius:4px; }
.voice-log-content .log-line { white-space:pre-wrap; word-break:break-all; }
.voice-log-content .log-line.error { color:var(--error); }
.voice-log-content .log-line.success { color:var(--success); }
.voice-log-content .log-line.warn { color:#d97706; }

/* --- 右侧：设置面板 --- */
.voice-right-panel {
  width:360px; flex-shrink:0; display:flex; flex-direction:column;
  border-left:1px solid var(--border);
  background:var(--bg-card);
}
.voice-settings-scroll {
  flex:1; overflow-y:auto; padding:20px;
}
.voice-setting-section {
  padding-bottom:18px; margin-bottom:18px;
  border-bottom:1px solid var(--border);
}
.voice-setting-section:last-child {
  border-bottom:none; margin-bottom:0; padding-bottom:0;
}
.voice-setting-title {
  font-size:12px; font-weight:600; color:var(--text-3);
  letter-spacing:0.3px; margin-bottom:10px;
}

/* --- 音色克隆/设计快捷入口 --- */
.voice-voice-links {
  display:flex; gap:8px; margin-top:12px;
}
.voice-voice-link {
  flex:1; display:flex; align-items:center; justify-content:center; gap:6px;
  padding:8px 12px; border-radius:8px;
  border:1px dashed var(--border);
  background:var(--bg-input);
  color:var(--text-3); font-size:12px;
  text-decoration:none; cursor:pointer;
  transition:all 0.15s;
}
.voice-voice-link:hover {
  border-color:var(--primary);
  color:var(--primary);
  background:var(--primary-bg);
}
.voice-voice-link svg { flex-shrink:0; }

/* --- 播放器紧凑条（合成完成后显示在底部，不遮挡内容） --- */
.voice-player-bar {
  display:none;
  align-items:center;
  gap:12px;
  padding:8px 16px;
  background:var(--bg-card);
  border-top:1px solid var(--border);
  flex-shrink:0;
}
.voice-player-bar.visible { display:flex; }
.voice-player-bar audio {
  flex:1; height:32px; min-width:0;
}
.voice-player-bar .download-btn {
  flex-shrink:0;
  display:inline-flex; align-items:center; gap:4px;
  padding:5px 12px; border-radius:6px;
  border:1px solid var(--border);
  background:var(--bg-input); color:var(--text-2);
  font-size:12px; cursor:pointer;
  transition:all 0.15s; font-family:inherit;
}
.voice-player-bar .download-btn:hover {
  border-color:var(--primary); color:var(--primary);
}

/* --- 响应式 --- */
@media (max-width:768px) {
  .voice-workspace { flex-direction:column; }
  .voice-right-panel { width:100%; border-left:none; border-top:1px solid var(--border); }
  .voice-left-panel { padding:16px; }
  .voice-player-bar { left:16px; right:16px; }
}
