/* ═══ 全局隐藏滚动条（保留滚动/触摸滑动能力，仅去掉视觉滚动条）═══ */
html, body, * {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
html::-webkit-scrollbar,
body::-webkit-scrollbar,
*::-webkit-scrollbar {
  width: 0 !important;
  height: 0 !important;
  display: none !important;
  background: transparent;
}

/* ============================================================
   voice-editor.css — 可复用音色/音频编辑器组件样式（voice-editor.js）
   ---------------------------------------------------------------------
   与 voice-editor.js 配套。所有主题变量均带回退值（深色主题），
   宿主页面定义了同名变量（--bg2/--text/--accent 等）时自动跟随宿主主题。
   ============================================================ */

.ve-root { width: 100%; }
.ve-subnav { display: flex; gap: 2px; background: var(--bg2, #141222); border-radius: var(--radius, 12px); padding: 4px; margin-bottom: 20px; width: fit-content; }
.ve-subnav-item { padding: 8px 18px; border-radius: var(--radius-sm, 8px); font-size: 0.85rem; font-weight: 500; color: var(--text2, rgba(245,243,255,.65)); cursor: pointer; transition: all var(--transition, .2s); user-select: none; white-space: nowrap; }
.ve-subnav-item:hover { color: var(--text, #f5f3ff); background: rgba(255,255,255,0.04); }
.ve-subnav-item.active { color: var(--text, #f5f3ff); background: var(--bg-card, #1e1a34); font-weight: 600; box-shadow: 0 1px 4px rgba(0,0,0,0.3); }

.ve-panel { min-height: 120px; }

.ve-upload { border: 2px dashed var(--border, rgba(167,139,250,.22)); border-radius: var(--radius-lg, 16px); padding: 40px 20px; text-align: center; cursor: pointer; transition: all var(--transition, .2s); color: var(--text2, rgba(245,243,255,.65)); }
.ve-upload:hover { border-color: var(--accent, #a78bfa); color: var(--accent, #a78bfa); }
.ve-upload svg { margin: 0 auto; display: block; }
.ve-upload-text { font-size: 0.95rem; margin: 12px 0 4px; color: var(--text, #f5f3ff); }
.ve-upload-hint { font-size: 0.78rem; color: var(--text3, rgba(245,243,255,.45)); }

.ve-record { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 10px 0; }
.ve-record-hint { width: 100%; max-width: 680px; background: rgba(139,92,246,0.06); border: 1px solid rgba(139,92,246,0.15); border-radius: 12px; padding: 16px 20px; text-align: center; }
.ve-record-label { font-size: 0.85rem; color: var(--text2, rgba(245,243,255,.65)); margin-bottom: 8px; }
.ve-record-text { font-size: 0.9rem; color: var(--text, #f5f3ff); line-height: 1.6; }
.ve-record-status { font-size: 0.85rem; color: var(--text2, rgba(245,243,255,.65)); }
.ve-record-status.recording { color: var(--danger, #f87171); font-weight: 600; }

.ve-editor { margin-top: 20px; margin-bottom: 20px; background: var(--bg2, #141222); border: 1px solid var(--border, rgba(167,139,250,.22)); border-radius: var(--radius-lg, 16px); overflow: hidden; }
.ve-empty { margin-top: 20px; padding: 40px 20px; background: var(--bg2, #141222); border: 1px dashed var(--border, rgba(167,139,250,.22)); border-radius: var(--radius-lg, 16px); text-align: center; color: var(--text2, rgba(245,243,255,.65)); font-size: 0.9rem; }
.ve-editor-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--border, rgba(167,139,250,.22)); }
.ve-editor-title { font-size: 0.85rem; font-weight: 600; color: var(--text, #f5f3ff); }
.ve-canvas-wrap { padding: 12px; background: var(--bg, #0a0a12); }
.ve-canvas { width: 100%; height: 120px; border-radius: var(--radius-sm, 8px); background: rgba(0,0,0,0.3); touch-action: none; }
.ve-time { text-align: center; font-size: 13px; color: var(--text2, rgba(245,243,255,.65)); margin-top: 6px; font-variant-numeric: tabular-nums; }
.ve-controls { display: flex; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--border, rgba(167,139,250,.22)); flex-wrap: wrap; }
.ve-actions { display: flex; gap: 8px; align-items: center; justify-content: center; padding: 12px 16px; border-top: 1px solid var(--border, rgba(167,139,250,.22)); flex-wrap: wrap; }
.ve-transcript-block { padding: 12px 16px; border-top: 1px solid var(--border, rgba(167,139,250,.22)); }
.ve-transcript-label { font-size: 0.78rem; color: var(--text3, rgba(245,243,255,.45)); margin-bottom: 6px; }
.ve-transcript { font-size: 0.85rem; color: var(--text2, rgba(245,243,255,.65)); background: rgba(255,255,255,0.05); padding: 8px 12px; border-radius: 6px; border: 1px solid rgba(255,255,255,0.1); }

.ve-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 18px; border-radius: var(--radius-sm, 8px); border: 1px solid var(--border, rgba(167,139,250,.22)); background: var(--bg-card, #1e1a34); color: var(--text, #f5f3ff); font-size: 0.85rem; font-weight: 500; cursor: pointer; transition: all var(--transition, .2s); }
.ve-btn:hover { border-color: var(--accent, #a78bfa); }
.ve-btn--sm { padding: 6px 14px; font-size: 0.8rem; }
.ve-btn--ghost { background: transparent; }
.ve-btn--primary { background: var(--accent, #a78bfa); border-color: var(--accent, #a78bfa); color: #fff; }
.ve-btn--primary:hover { opacity: 0.9; }
.ve-btn--record { min-width: 160px; padding: 12px 28px; font-size: 1rem; border-radius: var(--radius-lg, 16px); }
.ve-btn--record.danger { background: var(--danger-bg, rgba(248,113,113,.12)); color: var(--danger, #f87171); border-color: rgba(255,107,107,0.3); }
.ve-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.ve-btn--busy { position: relative; color: var(--text2, rgba(245,243,255,.65)); }
.ve-btn--busy::after {
  content: ''; position: absolute; right: 8px; top: 50%; width: 10px; height: 10px;
  margin-top: -5px; border: 2px solid var(--text3, rgba(245,243,255,.45)); border-top-color: var(--accent, #a78bfa);
  border-radius: 50%; animation: ve-busy-spin 0.8s linear infinite;
}
@keyframes ve-busy-spin { to { transform: rotate(360deg); } }

.ve-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.55); z-index: 100000; display: flex; align-items: center; justify-content: center; }
.ve-modal { background: var(--bg2, #141222); border: 1px solid var(--border, rgba(167,139,250,.22)); border-radius: 16px; padding: 24px; width: 460px; max-width: 92vw; max-height: 86vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,0.5); }
.ve-modal-title { font-size: 1.05rem; font-weight: 700; color: var(--text, #f5f3ff); margin-bottom: 16px; }
.ve-modal-body { color: var(--text2, rgba(245,243,255,.65)); font-size: 0.9rem; margin-bottom: 18px; }
.ve-modal-actions { display: flex; justify-content: flex-end; gap: 10px; }
.ve-field { margin-bottom: 12px; }
.ve-field label { display: block; font-size: 0.8rem; color: var(--text2, rgba(245,243,255,.65)); margin-bottom: 6px; }
.ve-input { width: 100%; box-sizing: border-box; padding: 9px 12px; border-radius: var(--radius-sm, 8px); border: 1px solid var(--border, rgba(167,139,250,.22)); background: var(--bg, #0a0a12); color: var(--text, #f5f3ff); font-size: 0.9rem; }
.ve-input--area { min-height: 60px; resize: vertical; }
.ve-tags { display: flex; gap: 8px; }
.ve-tag { padding: 6px 18px; border-radius: 14px; font-size: 0.85rem; cursor: pointer; background: rgba(255,255,255,0.06); color: var(--text2, rgba(245,243,255,.65)); border: 1px solid rgba(255,255,255,0.1); user-select: none; }
.ve-tag.active { background: var(--accent, #a78bfa); color: #fff; border-color: transparent; }

.ve-toast { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%) scale(0.95); background: rgba(0,0,0,0.82); color: #fff; padding: 12px 22px; border-radius: 10px; font-size: 0.9rem; z-index: 100001; opacity: 0; transition: all 0.3s; pointer-events: none; max-width: 80vw; text-align: center; }
.ve-toast--show { opacity: 1; transform: translate(-50%, -50%) scale(1); }

@media (max-width: 600px) {
  .ve-subnav { width: 100%; }
  .ve-subnav-item { flex: 1; text-align: center; padding: 8px 4px; font-size: 0.8rem; }
  .ve-modal { width: 92vw; }
}

/* ── 音频编辑器（无 tab 新布局） ─────────────────────────── */
.ve-editor-head-actions { display: flex; gap: 8px; align-items: center; }
.ve-upload-zone { border: 2px dashed var(--border, rgba(167,139,250,.22)); border-radius: var(--radius, 12px); padding: 40px 20px; cursor: pointer; transition: all var(--transition, .2s); color: var(--text2, rgba(245,243,255,.65)); margin: 16px; }
.ve-upload-zone:hover { border-color: var(--accent, #a78bfa); color: var(--accent, #a78bfa); }
.ve-upload-inner { text-align: center; }
.ve-upload-inner svg { margin: 0 auto; display: block; }

/* 录制按钮录制中状态 */
.ve-btn[data-record-btn="1"].recording { background: var(--danger-bg, rgba(248,113,113,.12)); color: var(--danger, #f87171); border-color: rgba(255,107,107,0.3); }

/* 录制提示条 */
.ve-record-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: rgba(139,92,246,0.08); border: 1px solid rgba(139,92,246,0.2); border-radius: var(--radius, 12px); padding: 10px 16px; margin-bottom: 12px; }
.ve-record-bar-info { flex: 1; min-width: 0; }
.ve-record-bar-label { font-size: 0.8rem; color: var(--text2, rgba(245,243,255,.65)); }
.ve-record-bar-text { font-size: 0.88rem; color: var(--text, #f5f3ff); line-height: 1.5; }
.ve-btn--record-stop { color: var(--danger, #f87171); border-color: rgba(255,107,107,0.3); white-space: nowrap; }

/* ── 右栏飘窗（保存音色表单） ─────────────────────────── */
.ve-side-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 100000; }
.ve-side-sheet { position: fixed; right: 0; top: 0; bottom: 0; width: 420px; max-width: 90vw; background: var(--bg2, #141222); border-left: 1px solid var(--border, rgba(167,139,250,.22)); box-shadow: -8px 0 32px rgba(0,0,0,0.3); display: flex; flex-direction: column; animation: ve-slide-in 0.3s ease; }
@keyframes ve-slide-in { from { transform: translateX(100%); } to { transform: translateX(0); } }
.ve-side-sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border, rgba(167,139,250,.22)); }
.ve-side-sheet-title { font-size: 1rem; font-weight: 700; color: var(--text, #f5f3ff); }
.ve-side-sheet-close { background: none; border: none; color: var(--text2, rgba(245,243,255,.65)); font-size: 1.2rem; cursor: pointer; padding: 4px 8px; border-radius: 6px; }
.ve-side-sheet-close:hover { background: rgba(255,255,255,0.06); color: var(--text, #f5f3ff); }
.ve-side-sheet-body { flex: 1; overflow-y: auto; padding: 20px; }
.ve-side-sheet-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 20px; border-top: 1px solid var(--border, rgba(167,139,250,.22)); }

/* Emoji 选择器 */
.ve-emoji-grid { display: flex; flex-wrap: wrap; gap: 6px; max-height: 180px; overflow-y: auto; padding: 4px; border: 1px solid var(--border, rgba(167,139,250,.22)); border-radius: var(--radius-sm, 8px); }
.ve-emoji-item { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 8px; font-size: 18px; cursor: pointer; background: rgba(255,255,255,0.04); border: 1px solid transparent; transition: all 0.15s; }
.ve-emoji-item:hover { background: rgba(255,255,255,0.1); }
.ve-emoji-item.active { background: var(--accent, #a78bfa); border-color: transparent; }

@media (max-width: 600px) {
  .ve-side-sheet { width: 100vw; }
  .ve-record-bar { flex-direction: column; align-items: flex-start; gap: 8px; }
  .ve-btn--record-stop { align-self: flex-end; }
}
