
/* 图标基础样式：MingCute 图标，数据见 icons.py，渲染见 renderIcons() */
[data-icon] { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
/*
  颜色层级规范：
  --bg       : 页面底层背景（米黄）
  --surface  : 一级容器/面板/侧边栏/工作台外壳（暖白）
  --input-bg : 二级内容卡/输入框/按钮（纯白）
  --line     : 容器与控件的分隔线
*/
:root {
  /* ===== 颜色系统（见 design.md 第 2 节）=====
     中性色「暖米」：同一色相，0 最亮、900 最深；桃色：同一色相，400 只做 logo / 进度 / 焦点，文字用 600 / 700。
     组件里只引用这些变量或下面的语义变量，不再直接写色值。 */
  --n-0: #ffffff;
  --n-25: #fffcf6;
  --n-50: #fbf7f1;
  --n-75: #f8f2e7;
  --n-100: #f3ede2;
  --n-150: #ece5db;
  --n-200: #e2dcd1;
  --n-300: #d0cabf;
  --n-400: #a8a49c;
  --n-500: #8a867e;
  --n-600: #6f6b64;
  --n-700: #575550;
  --n-800: #373531;
  --n-900: #1c1a16;
  --p-50: #fff3f0;
  --p-100: #ffe6df;
  --p-150: #ffdbd0;
  --p-200: #ffccbd;
  --p-300: #ffab96;
  --p-400: #f18064;
  --p-500: #db6548;
  --p-600: #c84127;
  --p-700: #ab331c;
  --p-800: #79311f;
  --p-900: #572317;
  --n-25-rgb: 255, 252, 246;
  --n-50-rgb: 251, 247, 241;
  --n-200-rgb: 226, 220, 209;
  --n-800-rgb: 55, 53, 49;
  --n-900-rgb: 28, 26, 22;
  --p-50-rgb: 255, 243, 240;
  --p-200-rgb: 255, 204, 189;
  --p-600-rgb: 200, 65, 39;
  /* 语义：状态与层级 */
  --color-hover: var(--n-75);
  --color-op-1: var(--n-100);
  --color-op-2: var(--n-150);
  --color-op-3: var(--n-200);
  --color-divider: var(--n-150);
  --color-border-strong: var(--n-300);
  --color-placeholder: var(--n-400);
  --color-subtle: var(--n-500);
  --color-selected: var(--p-50);
  --color-selected-fill: var(--p-100);
  --color-selected-fill-hover: var(--p-150);
  --color-selected-on-fill: var(--p-700);
  --color-bg: var(--n-50);
  --color-surface: var(--n-25);
  --color-surface-raised: #ffffff;
  --color-foreground: var(--n-900);
  --color-muted: var(--n-600);
  --color-border: var(--n-200);
  --color-brand: var(--p-400);
  --color-brand-hover: var(--p-500);
  --color-action-primary: var(--p-600);
  --color-action-primary-hover: var(--p-700);
  --color-brand-soft: var(--p-50);
  --color-brand-border: var(--p-200);
  --color-success: #4d8f5a;
  --color-success-soft: #eaf7ed;
  --color-warning: #d97706;
  --color-warning-soft: #fffbeb;
  --color-danger: #dc2626;
  --color-danger-soft: #fee2e2;
  --color-wechat-pay: #07c160;
  --color-female: #d0527c;
  --color-male: #3d7fb0;
  --bg: var(--color-bg);
  --fg: var(--color-foreground);
  --muted: var(--color-muted);
  --line: var(--color-border);
  --surface: var(--color-surface);
  --input-bg: var(--color-surface-raised);
  --accent: var(--color-brand);
  --accent-rgb: 241, 128, 100;
  --accent-light: var(--color-brand-border);
  --accent-dark: var(--color-brand-hover);
  --accent-soft: var(--color-brand-soft);
  --secondary: #a8d8b0;
  --secondary-soft: var(--color-success-soft);
  --danger: var(--color-danger);
  --danger-soft: var(--color-danger-soft);
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-pill: 999px;
  --radius-circle: 50%;
  --radius: var(--radius-sm);
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 28px;
  --space-8: 32px;
  --space-10: 40px;
  --shadow-sm: 0 1px 3px rgba(var(--n-900-rgb),0.08);
  --shadow-md: 0 10px 26px rgba(var(--n-900-rgb),0.08);
  --shadow-lg: 0 20px 60px rgba(var(--n-900-rgb),0.14);
  --shadow: var(--shadow-sm);
  --ease-standard: cubic-bezier(.2,.75,.25,1);
  --ease-soft: cubic-bezier(.22,.61,.36,1);
  --voice-expand-collapse-duration: 0.36s;
  --voice-expand-collapse-ease: cubic-bezier(0.16, 1, 0.3, 1);
  --z-header: 100;
  --z-sidebar-trigger: 95;
  --z-sidebar: 120;
  --z-overlay: 180;
  --z-modal: 220;
  --z-toast: 300;
  --app-header-height: 56px;
  --app-sidebar-edge-gap: 8px;
  --app-content-gap: 12px;
  --app-page-top-gap: var(--app-sidebar-edge-gap);
  --app-page-bottom-gap: var(--app-content-gap);
  --workbench-sticky-gap: 8px;
  --workbench-panel-height: 600px;
  --workbench-card-padding: var(--space-6);
  --workbench-section-gap: 16px;
  --workbench-field-gap: 16px;
  --workbench-control-height: 40px;
  --workbench-control-sm-height: 32px;
  --workbench-textarea-height: 88px;
  --workbench-primary-input-height: 140px;
  --workbench-upload-height: 160px;
  --danger-hover: #b91c1c;
  --danger-rgb: 220,38,38;
  --radius-workbench-tab: 11px;
  --radius-feedback: 14px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; overflow-y: scroll; scrollbar-gutter: stable; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
    'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
body.voice-sidebar-lock {
  overflow: hidden;
}
body.tour-lock {
  overflow: hidden;
}

/* ===== 图标尺寸工具类 ===== */
.icon-xs { width: 12px; height: 12px; }
.icon-sm { width: 14px; height: 14px; }
.icon-md { width: 16px; height: 16px; }
.icon-lg { width: 20px; height: 20px; }
.icon-xl { width: 24px; height: 24px; }
.icon-2xl { width: 32px; height: 32px; }
.icon-3xl { width: 48px; height: 48px; }

/* ===== 通用辅助类 ===== */
.required-mark { color: var(--accent); }
.field-hint { font-size: 12px; color: var(--muted); margin-top: 6px; }
.design-example-link { color: var(--accent); cursor: pointer; display: inline-flex; align-items: center; gap: 3px; }
.modal-actions-row { margin-top: 10px; display: flex; gap: 8px; }
.ip-mascot {
  display: inline-block;
  width: 56px;
  height: 56px;
  object-fit: contain;
  flex: 0 0 auto;
  filter: drop-shadow(0 8px 14px rgba(var(--accent-rgb),0.13));
}
.ip-mascot-sm {
  width: 32px;
  height: 32px;
}
.ip-mascot-md {
  width: 48px;
  height: 48px;
}
.ip-mascot-lg {
  width: 72px;
  height: 72px;
}

/* ===== 新手引导浮窗（onboarding tour） ===== */
.tour-overlay {
  position: fixed;
  inset: 0;
  z-index: 250;
  background: rgba(20, 14, 12, 0.55);
  transition: clip-path 0.32s var(--ease-soft);
}
.tour-spotlight {
  position: fixed;
  z-index: 251;
  border-radius: 14px;
  outline: 2px solid rgba(var(--accent-rgb), 0.95);
  outline-offset: 3px;
  pointer-events: none;
  transition: top 0.32s var(--ease-soft), left 0.32s var(--ease-soft),
    width 0.32s var(--ease-soft), height 0.32s var(--ease-soft);
}
.tour-spotlight.hidden { display: none; }
.tour-popover {
  position: fixed;
  z-index: 252;
  width: min(360px, calc(100vw - 32px));
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 16px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.28s var(--ease-soft), transform 0.28s var(--ease-soft),
    top 0.32s var(--ease-soft), left 0.32s var(--ease-soft);
}
.tour-popover.is-visible { opacity: 1; transform: translateY(0); }
.tour-popover.is-intro {
  width: min(460px, calc(100vw - 32px));
  display: block;
  padding: 24px 22px 18px;
  text-align: center;
  overflow: hidden;
}
.tour-popover.is-intro::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 104px;
  background: linear-gradient(180deg, rgba(var(--accent-rgb), 0.14), rgba(var(--accent-rgb), 0));
  pointer-events: none;
}
.tour-popover .tour-mascot {
  width: 52px;
  height: 52px;
  object-fit: contain;
  flex: 0 0 auto;
  filter: drop-shadow(0 6px 12px rgba(var(--accent-rgb), 0.18));
}
.tour-popover.is-intro .tour-mascot {
  position: relative;
  z-index: 1;
  display: block;
  width: 112px;
  height: 112px;
  margin: -2px auto 10px;
  filter: drop-shadow(0 14px 24px rgba(var(--accent-rgb), 0.22));
  animation: tour-hello-bounce 2.8s var(--ease-soft) infinite;
}
.tour-pop-body { flex: 1; min-width: 0; }
.tour-pop-kicker { display: none; }
.tour-popover.is-intro .tour-pop-kicker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 600;
}
.tour-pop-title { font-size: 15px; font-weight: 600; color: var(--fg); margin-bottom: 4px; }
.tour-pop-text { font-size: 13px; color: var(--muted); line-height: 1.6; margin-bottom: 14px; }
.tour-popover.is-intro .tour-pop-title {
  font-size: 22px;
  line-height: 1.28;
  margin-bottom: 8px;
}
.tour-popover.is-intro .tour-pop-text {
  max-width: 340px;
  margin: 0 auto 14px;
  color: var(--fg);
  font-size: 14px;
}
.tour-intro-chips {
  display: none;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin: 0 0 16px;
}
.tour-popover.is-intro .tour-intro-chips { display: flex; }
.tour-intro-chip {
  padding: 4px 9px;
  border: 1px solid rgba(var(--n-200-rgb),0.9);
  border-radius: var(--radius-pill);
  background: rgba(255,255,255,0.66);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}
.tour-pop-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tour-popover.is-intro .tour-pop-footer { justify-content: center; }
.tour-popover.is-intro .tour-dots { position: absolute; left: 18px; bottom: 18px; }
.tour-dots { display: flex; gap: 5px; align-items: center; }
.tour-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--line); transition: all 0.25s var(--ease-soft); }
.tour-dot.active { width: 16px; border-radius: 3px; background: var(--accent); }
.tour-actions { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.tour-skip {
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
}
.tour-skip:hover { color: var(--fg); }
.tour-next {
  background: var(--color-action-primary);
  color: #fff;
  border: none;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
}
.tour-next:hover { background: var(--color-action-primary-hover); }
.tour-next:active { transform: scale(0.97); }
.tour-arrow {
  position: absolute;
  width: 12px;
  height: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  transform: rotate(45deg);
  display: none;
}
.tour-popover.place-bottom .tour-arrow {
  display: block;
  top: -7px;
  border-right: none;
  border-bottom: none;
}
.tour-popover.place-top .tour-arrow {
  display: block;
  bottom: -7px;
  border-left: none;
  border-top: none;
}
@keyframes tour-hello-bounce {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  45% { transform: translateY(-6px) rotate(2deg); }
}
@media (max-width: 640px) {
  .tour-popover { width: calc(100vw - 24px); }
  .tour-popover.is-intro {
    width: calc(100vw - 24px);
    padding: 22px 16px 18px;
  }
  .tour-popover.is-intro .tour-mascot { width: 96px; height: 96px; }
  .tour-popover.is-intro .tour-pop-title { font-size: 20px; }
}
.ip-state-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
}

/* ===== 导航栏 ===== */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: var(--z-header);
  background: rgba(var(--n-50-rgb),0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  padding: 0 24px;
  height: var(--app-header-height);
  display: flex; align-items: center; justify-content: space-between;
}
.navbar-brand {
  font-size: 18px; font-weight: 600; letter-spacing: 0;
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--fg);
}
.navbar-brand .brand-logo {
  width: 28px; height: 28px;
  border-radius: var(--radius-sm);
  display: block;
  object-fit: contain;
  flex-shrink: 0;
}
.brand-wordmark {
  display: inline-block;
  color: var(--accent);
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}
.brand-wordmark .brand-ai-text {
  display: inline-block;
  font-size: 1.08em;
  line-height: 1;
  transform: translateY(0.5px);
}
.navbar-right { display: flex; align-items: center; gap: 12px; }
@media (max-width: 480px) {
  .navbar { padding: 0 12px; }
  .navbar-right { gap: 8px; }
  .user-menu-btn { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .user-menu-btn span { max-width: 100px; overflow: hidden; text-overflow: ellipsis; }
  /* 积分气泡文字过长时单行省略，避免换行挤压 logo */
  .credits-badge { max-width: 46vw; white-space: nowrap; overflow: hidden; }
  .credits-badge #nav-credits-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
}

/* ===== 音色库侧边栏 ===== */
.voice-sidebar {
  position: fixed;
  top: calc(var(--app-header-height) + var(--app-sidebar-edge-gap));
  left: var(--app-sidebar-edge-gap);
  bottom: var(--app-sidebar-edge-gap);
  width: 272px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  z-index: var(--z-sidebar);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.voice-sidebar.is-library-flying,
.voice-sidebar.is-library-expanded {
  position: fixed;
  margin: 0;
  transition: none !important;
  transform: none !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  z-index: calc(var(--z-sidebar) + 1);
}
/* 宽高动画期间锁住列表宽度，卡片不再跟着每一帧重排 */
.voice-sidebar.is-library-animating {
  contain: layout paint;
}
.voice-sidebar.is-library-animating #voice-sidebar-list,
.voice-sidebar.is-library-animating #voice-library-list {
  right: auto;
  contain: layout style paint;
}
.voice-sidebar-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
  min-height: 52px;
}
.voice-sidebar-header h3 {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
}
.voice-sidebar-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.voice-sidebar-expand {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: all .2s;
}
.voice-sidebar-expand:hover {
  background: var(--surface);
  color: var(--fg);
}
.voice-sidebar-expand { position: relative; }
.voice-sidebar-expand .icon-expand,
.voice-sidebar-expand .icon-shrink {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
.voice-sidebar-expand .icon-shrink { opacity: 0; }
.voice-sidebar-search.voice-search-field {
  /* 标题行里的弹性项：紧凑时被挤到几乎为零且透明，展开过程中随面板变宽自然出现，标题行其余元素不移位 */
  position: relative;
  flex: 0 1 240px;
  min-width: 0;
  width: auto;
  max-width: 240px;
  height: 32px;
  margin: 0 auto 0 12px;
  opacity: 0;
  pointer-events: none;
}
.voice-sidebar-search .voice-search-box {
  max-width: none;
  height: 32px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--vp-op-1);
  font-size: 13px;
}
.voice-sidebar-search .voice-search-box:focus {
  border: none;
  background: var(--input-bg);
  box-shadow: 0 0 0 2px var(--accent-soft), 0 0 0 1px var(--accent-light) inset;
}.voice-sidebar-body {
  position: relative;
  flex: 1;
  min-height: 0;
}
.voice-sidebar-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 12px;
}
.voice-sidebar-body > .voice-sidebar-list {
  position: absolute;
  inset: 0;
}
#voice-library-list {
  display: grid;
  grid-template-columns: repeat(var(--library-cols, 3), minmax(0, 1fr));
  gap: 10px;
  align-content: start;
  padding: 8px 12px 16px;
  opacity: 0;
  pointer-events: none;
}
#voice-library-list .voice-sidebar-item { margin-bottom: 0; }
#voice-library-list .voice-sidebar-empty { grid-column: 1 / -1; }
.voice-sidebar-list.sidebar-tab-leaving {
  pointer-events: none;
  animation: workbenchPanelFadeOut 80ms ease both;
}
.voice-sidebar-list.sidebar-tab-entering {
  will-change: opacity, transform;
}
.voice-sidebar-item {
  background: var(--input-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  margin-bottom: 6px;
  cursor: pointer;
  transition: border-color .2s, box-shadow .2s;
}
.voice-sidebar-item.is-deleting {
  overflow: hidden;
  pointer-events: none;
  border-color: var(--danger-soft);
}
.voice-sidebar-item:hover {
  border-color: var(--accent-light);
  box-shadow: var(--shadow);
}
.voice-sidebar-item.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.voice-sidebar-item-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 4px;
  min-height: 22px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.voice-sidebar-item-name .voice-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.voice-sidebar-item-name .voice-tag {
  font-size: 11px;
  font-weight: 400;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 1px 6px;
  border-radius: var(--radius-xs);
  white-space: nowrap;
  flex-shrink: 0;
}
.voice-sidebar-item-name .voice-gender-tag {
  font-size: 11px;
  font-weight: 500;
  padding: 0 6px;
  border-radius: var(--radius-xs);
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 18px;
  border: 1px solid transparent;
}
.voice-sidebar-item-name .voice-gender-tag.is-female {
  color: #c98698;
  background: #fff6f7;
  border-color: #f6e0e4;
}
.voice-sidebar-item-name .voice-gender-tag.is-male {
  color: #7a9db8;
  background: #f5f9fc;
  border-color: #e1ebf3;
}
.voice-fav-btn {
  margin-left: auto;
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.voice-fav-btn:hover {
  background: var(--accent-soft);
  color: var(--accent);
}
.voice-fav-btn.is-fav {
  color: var(--accent);
  background: transparent;
}
.voice-sidebar-item-name .voice-name-actions {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.voice-sidebar-item-name .voice-rename-btn,
.voice-sidebar-item-name .voice-delete-btn {
  width: 20px;
  height: 20px;
  border-radius: var(--radius-xs);
  border: none;
  background: none;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  line-height: 1;
  padding: 0;
  transition: all .15s;
}
.voice-sidebar-item-name .voice-rename-btn:hover {
  background: var(--accent-soft);
  color: var(--accent);
}
.voice-sidebar-item-name .voice-delete-btn:hover {
  background: var(--danger-soft);
  color: var(--danger);
}
.voice-sidebar-item-name .voice-name-input {
  min-width: 0;
  flex: 1;
  font-size: 14px;
  font-family: inherit;
  font-weight: 600;
  color: var(--fg);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 2px 6px;
  outline: none;
  background: var(--input-bg);
}
.voice-sidebar-item-desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  /* 固定两行高，一行描述也占位，卡片高度和右下角按钮才不会跟着变 */
  height: 3em;
  min-height: 3em;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.voice-sidebar-item-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: wrap;
}
.voice-sidebar-item-meta {
  font-size: 11px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}
.voice-lang-meta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  white-space: nowrap;
}
.voice-lang-preview {
  white-space: nowrap;
}
.voice-lang-dot,
.voice-lang-meta > span:last-of-type {
  flex-shrink: 0;
}
.voice-lang-info {
  width: 16px;
  height: 16px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.voice-lang-info:hover,
.voice-lang-info.is-open {
  color: var(--accent);
  background: var(--accent-soft);
}
.voice-lang-popover {
  position: fixed;
  z-index: 160;
  padding: 10px 12px;
  background: var(--surface);
  color: var(--fg);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 12px;
  line-height: 1.55;
}
.voice-lang-popover strong {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
}
.voice-lang-popover p {
  margin: 0;
  color: var(--muted);
}
.voice-sidebar-item-btns {
  display: flex;
  gap: 6px;
  margin-left: auto;
}
.voice-sidebar-item-btns button {
  padding: 4px 6px;
  font-size: 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: inherit;
  border: none;
  transition: all .2s;
  white-space: nowrap;
}
.voice-sidebar-item-btns .preview-play-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--input-bg);
  color: var(--fg);
  border: 1px solid var(--line);
}
.voice-sidebar-item-btns .preview-play-btn .play-icon {
  color: var(--muted);
}
.voice-sidebar-item-btns .preview-play-btn:hover {
  background: var(--input-bg);
  border-color: var(--accent);
  color: var(--accent);
}
.voice-sidebar-item-btns .preview-play-btn:hover .play-icon {
  color: var(--accent);
}
.voice-sidebar-item-btns .preview-play-btn.playing {
  background: var(--accent-soft);
  border-color: var(--accent-light);
  color: var(--accent);
}
.voice-sidebar-item-btns .btn-use {
  background: var(--color-action-primary);
  color: #fff;
}
.voice-sidebar-item-btns .btn-use:hover {
  background: var(--color-action-primary-hover);
}
/* ===== 音色库紧凑面板（侧栏常态）=====
   一级面板只保留标题行 + 列表；来源切换、性别/分类筛选收进二级菜单。
   放大模式（is-library-flying / is-library-expanded）仍使用原有整行标签与分类条。
   状态规范：米色 = 正在操作（悬停/按下/菜单打开）；浅桃底 + 橘红字 = 当前选择（选中/生效/播放中）。 */
.voice-sidebar {
  --vp-op-1: var(--n-100);
  --vp-op-2: var(--n-150);
  --vp-op-3: var(--n-200);
  --vp-row-hover: var(--n-75);
  --vp-on-sel: var(--p-100);
  --vp-on-sel-hover: var(--p-150);
  --vp-current: var(--color-action-primary);
}
.voice-source-btn,
.voice-filter-btn {
  border: none;
  background: transparent;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: background-color .15s, transform .1s;
}
.voice-source-btn {
  gap: 3px;
  height: 28px;
  margin: 0 0 0 8px;
  padding: 0 6px 0 9px;
  color: var(--muted);
  font-size: 13px;
}
.voice-filter-btn {
  position: relative;
  width: 32px;
  height: 32px;
  color: var(--muted);
}
.voice-source-btn:hover,
.voice-filter-btn:hover { background: var(--vp-op-1); color: var(--fg); }
.voice-source-btn:active,
.voice-filter-btn:active { background: var(--vp-op-2); transform: scale(.96); }
.voice-source-btn[aria-expanded="true"],
.voice-filter-btn[aria-expanded="true"] { background: var(--vp-op-1); color: var(--fg); }
.voice-filter-btn[hidden] { display: none; }
.voice-filter-dot {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  border: 1.5px solid var(--surface);
}
.voice-filter-dot[hidden] { display: none; }
#voice-filter-active {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 12px 12px 20px;
  font-size: 12px;
  flex-shrink: 0;
}
#voice-filter-active[hidden] { display: none; }
.voice-filter-pill {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--vp-current);
  font-weight: 500;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.voice-filter-clear {
  margin-left: auto;
  height: 24px;
  padding: 0 8px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
}
.voice-filter-clear:hover { background: var(--vp-op-1); color: var(--fg); }
.voice-pop {
  position: absolute;
  z-index: 5;
  top: 52px;
  background: var(--input-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 32px rgba(60, 40, 20, .14);
}
.voice-pop[hidden] { display: none; }
.voice-source-menu { width: 176px; padding: 6px; }
.voice-source-menu button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 36px;
  padding: 0 12px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--fg);
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
}
.voice-source-menu button span:last-child { font-size: 12px; color: var(--muted); font-weight: 400; }
.voice-source-menu button:hover { background: var(--vp-op-1); }
.voice-source-menu button:active { background: var(--vp-op-2); }
.voice-source-menu button.is-current,
.voice-source-menu button.is-current:hover {
  background: var(--accent-soft);
  color: var(--vp-current);
  font-weight: 600;
}
.voice-source-menu button.is-current span:last-child { color: var(--vp-current); }
.voice-filter-menu { left: 8px; right: 8px; padding: 16px; }
.voice-filter-menu h4 { margin: 0 0 8px; font-size: 12px; font-weight: 500; color: var(--muted); }
.voice-filter-section { margin-bottom: 16px; }
.voice-filter-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.voice-filter-opt {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 32px;
  padding: 0 10px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--vp-op-1);
  color: var(--fg);
  font-family: inherit;
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .15s, transform .1s;
}
/* 性别三项等分一行，避免窄面板下「男声」掉到第二行 */
.voice-filter-menu .voice-filter-section:first-child .voice-filter-opts { flex-wrap: nowrap; }
.voice-filter-menu .voice-filter-section:first-child .voice-filter-opt {
  flex: 1 1 0;
  min-width: 0;
  justify-content: center;
  padding: 0 4px;
}
.voice-filter-opt:hover { background: var(--vp-op-2); }
.voice-filter-opt:active { background: var(--vp-op-3); transform: scale(.97); }
.voice-filter-opt.is-current,
.voice-filter-opt.is-current:hover {
  background: var(--accent-soft);
  color: var(--vp-current);
  font-weight: 600;
}
.voice-filter-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  font-size: 13px;
  color: var(--muted);
}
.voice-filter-foot button {
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 13px;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.voice-filter-foot button:hover { background: var(--vp-op-1); color: var(--fg); }
.voice-source-btn:focus-visible,
.voice-filter-btn:focus-visible,
.voice-filter-opt:focus-visible,
.voice-source-menu button:focus-visible,
.voice-filter-clear:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* 性别：默认仍显示文字标签；紧凑面板内改为图标 */
.voice-gender-tag svg { display: none; }
.btn-use .use-active { display: none; }
.voice-sidebar-item.selected .btn-use .use-idle { display: none; }
.voice-sidebar-item.selected .btn-use .use-active { display: inline; }
/* 标题行：紧凑与展开两种状态共用，展开/收起动画中不发生任何跳变 */
.voice-sidebar .voice-sidebar-header {
  justify-content: flex-start;
  padding: 16px 12px 12px 20px;
}
.voice-sidebar .voice-sidebar-header h3 {
  font-size: 16px;
  color: var(--fg);
  gap: 8px;
  flex-shrink: 0;
}
.voice-sidebar .voice-sidebar-header h3 [data-icon] { color: var(--muted); }
.voice-sidebar .voice-source-btn,
.voice-sidebar .voice-sidebar-header-actions { flex-shrink: 0; }
.voice-sidebar .voice-sidebar-expand {
  width: 32px;
  height: 32px;
}
.voice-sidebar .voice-sidebar-expand:hover { background: var(--vp-op-1); }
.voice-sidebar .voice-sidebar-expand:active { background: var(--vp-op-2); }
/* 列表滚动后才出现的标题分隔线 */
.voice-sidebar-body::before {
  content: '';
  position: absolute;
  z-index: 1;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--line);
  opacity: 0;
  transition: opacity .15s;
  pointer-events: none;
}
.voice-sidebar.is-list-scrolled:not(.is-library-flying):not(.is-library-expanded) .voice-sidebar-body::before { opacity: 1; }
/* 音色行：无描边、无分隔线，靠留白分组 */
#voice-sidebar-list {
  padding: 0 8px 8px;
  /* 隐藏滚动条但保留滚动；是否滚动过由标题下的分隔线提示 */
  scrollbar-width: none;
  -ms-overflow-style: none;
}
#voice-sidebar-list::-webkit-scrollbar { display: none; }
#voice-sidebar-list.is-morphing .voice-sidebar-item { width: var(--vl-item-w); }
/* 位移途中卡片会互相穿过：给不透明底色，看起来是卡片从彼此上方滑过，而不是文字叠在一起 */
.is-morph-target .voice-sidebar-item:not(.selected) { background: var(--surface); }
/* 间隔线：位移开始时随卡片淡出，落位后再渐显，而不是瞬间消失/出现 */
:is(#voice-sidebar-list, #voice-library-list) .voice-sidebar-item::before { transition: opacity .28s ease; }
.is-morph-target .voice-sidebar-item::before { opacity: 0; transition-duration: .12s; }
/* 行间细线：面板内唯一的一种线，只起分隔作用；选中/悬停行自带底色块，其上下不画线 */
#voice-sidebar-list .voice-sidebar-item + .voice-sidebar-item::before {
  content: '';
  position: absolute;
  left: 12px;
  right: 12px;
  top: -3px;
  height: 1px;
  background: var(--n-150);
  pointer-events: none;
}
#voice-sidebar-list .voice-sidebar-item.selected::before,
#voice-sidebar-list .voice-sidebar-item.selected + .voice-sidebar-item::before,
#voice-sidebar-list .voice-sidebar-item:hover::before,
#voice-sidebar-list .voice-sidebar-item:hover + .voice-sidebar-item::before { display: none; }
:is(#voice-sidebar-list, #voice-library-list) .voice-sidebar-item {
  position: relative;
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  padding: 14px 12px;
  margin-bottom: 4px;
  transition: background-color .15s;
}
:is(#voice-sidebar-list, #voice-library-list) .voice-sidebar-item:hover {
  background: var(--vp-row-hover);
  box-shadow: none;
}
:is(#voice-sidebar-list, #voice-library-list) .voice-sidebar-item.selected,
:is(#voice-sidebar-list, #voice-library-list) .voice-sidebar-item.selected:hover { background: var(--accent-soft); }
:is(#voice-sidebar-list, #voice-library-list) .voice-sidebar-item.is-deleting { background: var(--danger-soft); }
:is(#voice-sidebar-list, #voice-library-list) .voice-sidebar-item-name {
  font-size: 15px;
  line-height: 22px;
  margin-bottom: 2px;
  gap: 6px;
}
:is(#voice-sidebar-list, #voice-library-list) .voice-sidebar-item-name .voice-gender-tag,
:is(#voice-sidebar-list, #voice-library-list) .voice-sidebar-item-name .voice-gender-tag.is-female,
:is(#voice-sidebar-list, #voice-library-list) .voice-sidebar-item-name .voice-gender-tag.is-male {
  display: inline-flex;
  padding: 0;
  border: none;
  background: transparent;
  line-height: 1;
}
:is(#voice-sidebar-list, #voice-library-list) .voice-gender-tag svg { display: block; }
:is(#voice-sidebar-list, #voice-library-list) .voice-gender-tag .voice-gender-text { display: none; }
:is(#voice-sidebar-list, #voice-library-list) .voice-gender-tag.is-female { color: var(--color-female); }
:is(#voice-sidebar-list, #voice-library-list) .voice-gender-tag.is-male { color: var(--color-male); }
:is(#voice-sidebar-list, #voice-library-list) .voice-sidebar-item-desc {
  /* 单行描述：系统音色文案已控制在一行内；用户自建音色的长描述以省略号收尾，悬停看全文 */
  display: block;
  font-size: 13px;
  line-height: 20px;
  height: 20px;
  min-height: 20px;
  margin-bottom: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  -webkit-line-clamp: unset;
}
:is(#voice-sidebar-list, #voice-library-list) .voice-sidebar-item-meta {
  font-size: 12px;
  flex: 1 1 auto;
  min-width: 0;
}
/* 语言标注与按钮永远同一行：较长的语种名（如"西班牙语"）不再把按钮挤到下一行 */
:is(#voice-sidebar-list, #voice-library-list) .voice-sidebar-item-actions { flex-wrap: nowrap; }
:is(#voice-sidebar-list, #voice-library-list) .voice-sidebar-item-btns { flex-shrink: 0; }
:is(#voice-sidebar-list, #voice-library-list) .voice-lang-meta {
  position: relative;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 1;
}
/* "支持语种"提示改由整段语言标注触发，不再单独占一个图标的位置 */
:is(#voice-sidebar-list, #voice-library-list) .voice-lang-info {
  position: absolute;
  inset: 0;
  width: auto;
  height: auto;
  border-radius: var(--radius-xs);
  opacity: 0;
  cursor: help;
}
:is(#voice-sidebar-list, #voice-library-list) .voice-lang-meta:has(.voice-lang-info):hover,
:is(#voice-sidebar-list, #voice-library-list) .voice-lang-meta:has(.voice-lang-info.is-open) {
  color: var(--fg);
  text-decoration: underline dotted;
  text-underline-offset: 3px;
}
:is(#voice-sidebar-list, #voice-library-list) .voice-sidebar-item-btns { gap: 8px; }
:is(#voice-sidebar-list, #voice-library-list) .voice-sidebar-item-btns button {
  min-height: 28px;
  padding: 0 10px;
  font-size: 12px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--vp-op-1);
  color: var(--fg);
  transition: background-color .15s, transform .1s;
}
:is(#voice-sidebar-list, #voice-library-list) .voice-sidebar-item-btns button:hover { background: var(--vp-op-2); color: var(--fg); }
:is(#voice-sidebar-list, #voice-library-list) .voice-sidebar-item-btns button:active { background: var(--vp-op-3); transform: scale(.97); }
:is(#voice-sidebar-list, #voice-library-list) .voice-sidebar-item-btns .preview-play-btn .play-icon,
:is(#voice-sidebar-list, #voice-library-list) .voice-sidebar-item-btns .preview-play-btn:hover .play-icon { color: inherit; }
/* 按钮永远比所在行的底色深一档 */
:is(#voice-sidebar-list, #voice-library-list) .voice-sidebar-item:hover .voice-sidebar-item-btns button { background: var(--vp-op-2); }
:is(#voice-sidebar-list, #voice-library-list) .voice-sidebar-item:hover .voice-sidebar-item-btns button:hover { background: var(--vp-op-3); }
:is(#voice-sidebar-list, #voice-library-list) .voice-sidebar-item.selected .voice-sidebar-item-btns button { background: var(--vp-on-sel); }
:is(#voice-sidebar-list, #voice-library-list) .voice-sidebar-item.selected .voice-sidebar-item-btns button:hover { background: var(--vp-on-sel-hover); }
/* 当前选择：播放中 / 使用中 */
:is(#voice-sidebar-list, #voice-library-list) .voice-sidebar-item-btns .preview-play-btn.playing,
:is(#voice-sidebar-list, #voice-library-list) .voice-sidebar-item:hover .voice-sidebar-item-btns .preview-play-btn.playing {
  background: var(--accent-soft);
  color: var(--vp-current);
  font-weight: 600;
}
:is(#voice-sidebar-list, #voice-library-list) .voice-sidebar-item.selected .voice-sidebar-item-btns .preview-play-btn.playing { background: var(--vp-on-sel); color: var(--color-selected-on-fill); }
:is(#voice-sidebar-list, #voice-library-list) .voice-sidebar-item.selected .voice-sidebar-item-btns .btn-use,
:is(#voice-sidebar-list, #voice-library-list) .voice-sidebar-item.selected .voice-sidebar-item-btns .btn-use:hover,
:is(#voice-sidebar-list, #voice-library-list) .voice-sidebar-item.selected .voice-sidebar-item-btns .btn-use:active {
  background: var(--vp-on-sel);
  /* 浅桃按钮底上用深一档的橘红，保证 4.5:1 */
  color: var(--color-selected-on-fill);
  font-weight: 600;
  cursor: default;
  transform: none;
}
@media (hover: hover) {
  :is(#voice-sidebar-list, #voice-library-list) .voice-fav-btn:not(.is-fav) { opacity: 0; transition: opacity .15s; }
  :is(#voice-sidebar-list, #voice-library-list) .voice-sidebar-item:hover .voice-fav-btn,
  :is(#voice-sidebar-list, #voice-library-list) .voice-fav-btn:focus-visible { opacity: 1; }
}
/* 展开状态：沿用同一套行样式，网格里固定两行描述高度以保持按钮对齐 */
#voice-library-list {
  gap: 4px 8px;
  padding: 0 8px 16px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
#voice-library-list::-webkit-scrollbar { display: none; }
/* 网格同一行的卡片等高，按钮行贴底对齐；描述不再固定占两行 */
#voice-library-list .voice-sidebar-item {
  display: flex;
  flex-direction: column;
  margin-bottom: 0;
}
#voice-library-list .voice-sidebar-item-actions { margin-top: auto; }
/* 展开网格：与紧凑列表同样的行间细线，从第二行起画在卡片上方 */
#voice-library-list[data-cols="1"] .voice-sidebar-item:nth-child(n+2)::before,
#voice-library-list[data-cols="2"] .voice-sidebar-item:nth-child(n+3)::before,
#voice-library-list[data-cols="3"] .voice-sidebar-item:nth-child(n+4)::before {
  content: '';
  position: absolute;
  left: 12px;
  right: 12px;
  top: -3px;
  height: 1px;
  background: var(--n-150);
  pointer-events: none;
}
#voice-library-list .voice-sidebar-item.selected::before,
#voice-library-list .voice-sidebar-item:hover::before { display: none; }
/* 展开状态下筛选菜单不再横跨整个面板，贴右侧对齐 */
.voice-sidebar.is-library-flying .voice-filter-menu,
.voice-sidebar.is-library-expanded .voice-filter-menu { left: auto; right: 8px; width: 320px; }
/* 二级菜单开合动效：从触发按钮下方轻微放大淡入 */
.voice-pop {
  opacity: 0;
  transform: translateY(-6px) scale(.97);
  transition: opacity .14s ease, transform .18s cubic-bezier(.2, .8, .2, 1);
  will-change: opacity, transform;
}
.voice-pop.is-open { opacity: 1; transform: none; }
.voice-source-menu { transform-origin: 24px top; }
.voice-filter-menu { transform-origin: calc(100% - 44px) top; }
@media (prefers-reduced-motion: reduce) {
  .voice-pop { transition: none; transform: none; }
}
@media (pointer: coarse) {
  .voice-source-btn,
  .voice-filter-btn,
  .voice-filter-opt,
  .voice-filter-clear,
  .voice-source-menu button { min-height: 44px; min-width: 44px; }
}
.voice-sidebar-empty {
  text-align: center;
  padding: 38px 16px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.voice-sidebar-empty .ip-mascot { margin-bottom: 2px; }

.voice-library-backdrop {
  position: fixed;
  top: var(--app-header-height);
  right: 0;
  bottom: 0;
  left: 0;
  z-index: calc(var(--z-sidebar) - 10);
  background: transparent;
  pointer-events: none;
}
.voice-sidebar-overlay {
  position: fixed;
  inset: 0;
  z-index: calc(var(--z-sidebar) - 1);
  display: none;
  background: rgba(var(--n-900-rgb),0.28);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 180ms ease;
}
.voice-sidebar-overlay.active {
  display: block;
  opacity: 1;
}
/* 音色库固定在左侧：主内容让出「左边距 8px + 音色库宽度 + 间隙 16px」，窗口变宽变窄都由这里的断点负责 */
.main.has-sidebar {
  margin-left: 296px;
}
@media (max-width: 1024px) {
  .voice-sidebar { width: 240px; }
  .main.has-sidebar { margin-left: 264px; }
}
@media (max-width: 900px) {
  .voice-sidebar { width: 260px; }
  .main.has-sidebar { margin-left: 284px; }
}
@media (max-width: 640px) {
  /* 手机上导航固定在顶部、不占位置，而音色库是页面里第一个元素：把导航高度留在页面顶部，音色库才不会钻到导航底下 */
  body { padding-top: var(--app-header-height); }
  .voice-sidebar {
    position: relative;
    display: flex;
    top: auto;
    left: auto;
    right: auto;
    bottom: auto;
    width: auto;
    max-width: none;
    height: min(520px, 62vh);
    margin: 8px 12px 0;
    opacity: 1;
    pointer-events: auto;
    transform: none;
    /* 层级低于导航，往上滚时从导航下面穿过；放大后的音色库另有更高层级 */
    z-index: calc(var(--z-header) - 1);
  }
  .voice-sidebar.open {
    left: auto;
    right: auto;
    transform: none;
    opacity: 1;
  }
  .main.has-sidebar { margin-left: 0; }
  .container { padding: 24px 16px; }
  .design-box { padding: 20px; }
  .section-title { font-size: 17px; }
}

.credits-badge {
  background: var(--accent-light); color: var(--accent);
  padding: 4px 12px; border: 0; border-radius: var(--radius-xl);
  font: inherit; font-size: 13px; font-weight: 500; cursor: pointer;
  transition: all .2s;
  display: inline-flex; align-items: center; gap: 4px;
}
.credits-badge:hover { background: var(--color-action-primary); color: white; }
.credits-badge:focus-visible { outline: 2px solid var(--color-action-primary); outline-offset: 3px; }
.user-menu { position: relative; }
.user-menu-btn {
  background: none; border: none; cursor: pointer;
  font-size: 14px; color: var(--fg); padding: 4px 8px;
  display: flex; align-items: center; gap: 6px;
}
.user-dropdown {
  position: absolute; right: 0; top: 40px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  min-width: 200px; display: none; overflow: hidden;
  padding: 4px 0;
}
.user-dropdown.active { display: block; }
.user-dropdown button {
  width: 100%; padding: 10px 16px; border: none; background: none;
  text-align: left; cursor: pointer; font-size: 14px;
  display: flex; align-items: center; gap: 8px;
  color: var(--fg);
}
.user-dropdown button:hover { background: var(--bg); }
.user-dropdown .dropdown-email {
  padding: 8px 16px; font-size: 12px; color: var(--muted);
  border-bottom: 1px solid var(--line);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  pointer-events: none;
}
.user-dropdown .dropdown-divider {
  height: 1px; background: var(--line); margin: 4px 0;
}
.credit-log-table-wrap { max-height: 360px; overflow-y: auto; }
.credit-log-table td { padding: 8px 6px; border-bottom: 1px solid var(--n-100); }
.credit-log-table td.amount-positive { color: #16a34a; font-weight: 500; }
.credit-log-table td.amount-negative { color: var(--danger); font-weight: 500; }
.credit-log-table tbody tr:hover { background: var(--bg); }
.credit-log-table thead th { position: sticky; top: 0; background: var(--surface); }
.btn-primary {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 8px 18px; background: var(--color-action-primary); color: white;
  border: none; border-radius: var(--radius); font-size: 14px;
  cursor: pointer; font-weight: 500;
  transition: background-color .16s var(--ease-soft), box-shadow .16s var(--ease-soft), transform .16s var(--ease-soft), opacity .16s var(--ease-soft);
}
.btn-primary:hover:not(:disabled) {
  background: var(--color-action-primary-hover);
  box-shadow: 0 8px 18px rgba(var(--accent-rgb),0.22);
  transform: translateY(-1px);
}
.btn-primary:active:not(:disabled) {
  transform: scale(0.98);
  box-shadow: 0 4px 10px rgba(var(--accent-rgb),0.18);
}
.btn-primary:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb),0.18);
}
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; transform: none; }
.btn-primary[aria-busy="true"] { opacity: 1; cursor: wait; }
.btn-ghost {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 8px 18px; background: transparent; color: var(--fg);
  border: 1px solid var(--line); border-radius: var(--radius);
  font-size: 14px; cursor: pointer;
  transition: background-color .16s var(--ease-soft), border-color .16s var(--ease-soft), color .16s var(--ease-soft), transform .16s var(--ease-soft), box-shadow .16s var(--ease-soft);
}
.btn-ghost:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}
.btn-ghost:active:not(:disabled) {
  transform: scale(0.98);
}
.btn-ghost:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb),0.14);
}
.btn-ghost:disabled { opacity: 0.5; cursor: not-allowed; }
.preview-play-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
}
.preview-play-btn .play-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 12px;
  height: 12px;
  color: var(--muted);
  transition: color .2s;
}
.preview-play-btn .play-icon svg {
  width: 100%;
  height: 100%;
}
.preview-play-btn:hover .play-icon {
  color: var(--accent);
}
.preview-play-btn:hover {
  background: var(--bg);
}
.preview-play-btn.playing {
  background: var(--accent-soft);
  color: var(--accent);
}
.preview-play-btn.playing .play-icon {
  color: var(--accent);
  animation: play-pulse 1.2s ease-in-out infinite;
}
@keyframes play-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.15); }
}

@keyframes fade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.btn-danger {
  padding: 8px 18px; background: var(--danger); color: white;
  border: none; border-radius: var(--radius); font-size: 14px;
  cursor: pointer; font-weight: 500;
  transition: background-color .16s var(--ease-soft), transform .16s var(--ease-soft), box-shadow .16s var(--ease-soft), opacity .16s var(--ease-soft);
}
.btn-danger:hover:not(:disabled) {
  background: var(--danger-hover);
  box-shadow: 0 8px 18px rgba(var(--danger-rgb),0.18);
  transform: translateY(-1px);
}
.btn-danger:active:not(:disabled) {
  transform: scale(0.98);
}
.btn-danger:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--danger-soft);
}
.btn-danger:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; transform: none; }

/* ===== 主容器 ===== */
.main {
  padding-top: var(--app-header-height);
  flex: 1;
  display: flex;
  flex-direction: column;
  transform-origin: 50% var(--app-header-height);
}
@media (max-width: 640px) {
  /* 导航高度已经留在页面顶部（见音色库侧边栏的手机样式），这里只补 4px，和容器自带的 8px 凑成音色库到标签栏的 12px */
  .main { padding-top: 4px; }
}
.container {
  width: 100%; max-width: 960px; margin: 0 auto; padding: 40px 24px;
}
.container.workbench {
  --workbench-stack-gap: var(--app-content-gap);
  --workbench-panel-gap: var(--app-content-gap);
  max-width: 1180px;
  padding: var(--app-page-top-gap) var(--app-content-gap) var(--app-page-bottom-gap);
}
@media (min-width: 1920px) {
  .container.workbench { max-width: 1280px; }
}
@media (min-width: 2560px) {
  .container.workbench { max-width: 1400px; }
}

/* ===== 已登录工作台 ===== */
.workbench {
  display: flex;
  flex-direction: column;
  gap: var(--workbench-stack-gap);
}

/* 工作台标签导航 */
.workbench-nav {
  display: flex;
  gap: 6px;
  margin: 0;
  padding: 6px;
  border: 1px solid rgba(var(--n-200-rgb),0.88);
  border-radius: var(--radius-lg);
  position: sticky;
  top: calc(var(--app-header-height) + var(--workbench-sticky-gap));
  background: rgba(var(--n-50-rgb),0.92);
  box-shadow: 0 10px 30px rgba(var(--n-900-rgb),0.06);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 80;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.workbench-nav::-webkit-scrollbar { display: none; }
.workbench-nav button {
  background: none;
  border: 1px solid transparent;
  border-radius: var(--radius-workbench-tab);
  padding: 10px 16px;
  font-family: inherit;
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
  position: relative;
  transition: color .2s, background .2s, border-color .2s, box-shadow .2s;
  white-space: nowrap;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
@media (max-width: 640px) {
  .workbench-nav button { padding: 10px 14px; font-size: 13px; }
  /* iOS Safari 聚焦字号小于 16px 的输入框会强制放大页面，移动端统一提到 16px */
  input, textarea, select { font-size: 16px !important; }
}
/* tab 栏溢出时两端渐隐，提示可横向滑动（由 updateWorkbenchNavFade 控制） */
.workbench-nav.nav-scroll-fade {
  --nav-fade-left: 0px;
  --nav-fade-right: 0px;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 var(--nav-fade-left), #000 calc(100% - var(--nav-fade-right)), transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 var(--nav-fade-left), #000 calc(100% - var(--nav-fade-right)), transparent 100%);
}
.workbench-nav button:hover { color: var(--fg); }
.workbench-nav button.active {
  color: var(--fg);
  font-weight: 600;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  text-shadow: 0 1px 0 rgba(255,255,255,0.68);
}

@media (max-width: 720px) {
  :root {
    --app-page-top-gap: var(--app-sidebar-edge-gap);
    --app-page-bottom-gap: var(--app-content-gap);
  }
  .container.workbench {
    --workbench-stack-gap: var(--app-content-gap);
    --workbench-panel-gap: var(--app-content-gap);
  }
}

/* 工作台标签内容 */
.workbench section { display: none; }
.workbench section.active { display: block; }
.workbench section.panel-leaving {
  display: block;
  pointer-events: none;
  animation: workbenchPanelFadeOut 80ms ease both;
}
/* 新面板淡入并上移 6px：透明度 180ms、位移 220ms，曲线和二级菜单一致（WORKBENCH_PANEL_ENTER_MS 到点摘掉类名） */
.workbench section.panel-entering {
  display: block;
  will-change: opacity, transform;
  animation: workbenchPanelFadeIn 180ms cubic-bezier(.2,.8,.2,1) both, workbenchPanelRiseIn 220ms cubic-bezier(.2,.8,.2,1) both;
}
@keyframes workbenchPanelFadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}
@keyframes workbenchPanelFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes workbenchPanelRiseIn {
  from { transform: translateY(6px); }
  to { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .workbench section.panel-leaving,
  .workbench section.panel-entering {
    animation: none;
  }
}

.section-title {
  font-size: 20px; font-weight: 600; margin-bottom: 20px;
  display: flex; align-items: center; gap: 8px;
}

/* 音色设计两栏布局 */
.design-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 380px);
  gap: var(--workbench-panel-gap);
  align-items: stretch;
}
@media (max-width: 900px) {
  .design-layout { grid-template-columns: 1fr; align-items: start; }
  /* 小屏保持表单在上，结果在下 */
}

.design-form-col { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.design-results-col {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
  min-height: var(--workbench-panel-height);
  padding: var(--workbench-card-padding);
  background: rgba(var(--n-25-rgb),0.82);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.design-box {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: var(--workbench-card-padding);
  box-shadow: var(--shadow-md);
  min-height: var(--workbench-panel-height);
  height: auto;
}
.creation-panel-heading,
.creation-results-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--workbench-section-gap);
  margin-bottom: var(--workbench-section-gap);
}
.creation-panel-eyebrow {
  display: block;
  margin-bottom: 5px;
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.creation-panel-heading h2,
.creation-results-heading h2 {
  font-size: 18px;
  line-height: 1.25;
  letter-spacing: 0;
}
.creation-panel-heading p,
.creation-results-heading p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}
@media (max-width: 640px) {
  .design-results-col { padding: 14px; }
  .design-box { padding: 20px; }
  .creation-panel-heading,
  .creation-results-heading {
    flex-direction: column;
    gap: 8px;
  }
}

/* ===== 克隆标签页 ===== */
.clone-box {
  max-width: 500px;
  margin: 0 auto;
}
.clone-upload-area {
  border: 2px dashed var(--line);
  border-radius: var(--radius-lg);
  height: var(--workbench-upload-height);
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background-color .2s;
  margin-bottom: var(--workbench-field-gap);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.clone-upload-area:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.clone-upload-area.drag-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  border-style: solid;
}
.clone-upload-area .upload-icon {
  color: var(--muted);
  margin-bottom: 12px;
}
.clone-upload-area .upload-text {
  font-size: 15px;
  font-weight: 500;
  margin-bottom: 6px;
}
.clone-upload-area .upload-hint {
  font-size: 12px;
  color: var(--muted);
}
.clone-preview {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px;
  background: var(--surface);
  margin-bottom: var(--workbench-field-gap);
}
.clone-preview .clone-audio-info {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}
.clone-preview audio {
  width: 100%;
  height: 36px;
  margin-bottom: 12px;
}
.clone-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 20px;
}
.btn-sm {
  padding: 6px 14px;
  font-size: 13px;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  font-weight: 500;
  transition: all .2s;
}
.field { margin-bottom: var(--workbench-field-gap); }
.field.field-last { margin-bottom: 0; }
.field label {
  display: flex; align-items: center; gap: 4px;
  font-size: 13px; font-weight: 500;
  color: var(--muted); margin-bottom: 6px;
}
.field .error-msg {
  font-size: 12px;
  color: var(--danger);
  margin-top: 4px;
  display: none;
}
.field .error-msg.visible {
  display: block;
}
.field input.error, .field textarea.error, .field select.error {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px var(--danger-soft);
}
.field input, .field textarea, .field select {
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: var(--radius);
  font-size: 15px; font-family: inherit;
  background: var(--input-bg); color: var(--fg); outline: none;
  transition: border-color .15s, box-shadow .15s;
  min-height: var(--workbench-control-height);
}
.field input[type="checkbox"] {
  width: auto; padding: 0; border: none; background: transparent;
}
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field textarea { resize: vertical; height: var(--workbench-textarea-height); min-height: var(--workbench-textarea-height); }
.verification-row {
  display: flex;
  gap: var(--space-2);
  align-items: stretch;
}
.verification-row input {
  flex: 1 1 auto;
}
.verification-row .btn-ghost {
  flex: 0 0 auto;
  padding: 10px 18px;
  line-height: 1.6;
  white-space: nowrap;
}
.btn-full {
  width: 100%;
  justify-content: center;
}
.row-fields { display: grid; grid-template-columns: 1fr 1fr; gap: var(--workbench-field-gap); }
.row-fields .field input,
.row-fields .field select {
  height: var(--workbench-control-height);
  min-height: var(--workbench-control-height);
}
.row-fields .field select {
  appearance: none;
  -webkit-appearance: none;
  border-radius: var(--radius);
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24'%3E%3Cpath fill='%236f6b64' d='m12 13.586l4.95-4.95c.481-.422 1.233-.381 1.573.207c.235.407.139.868-.159 1.207l-5.657 5.657c-.204.179-.429.293-.707.293s-.503-.114-.707-.293L5.636 10.05c-.179-.204-.293-.429-.293-.707c0-.927 1.053-1.281 1.707-.707Z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px 14px;
}
@media (max-width: 640px) { .row-fields { grid-template-columns: 1fr; } }

/* 密码可见性切换 */
.password-field { position: relative; }
.password-field input { padding-right: 40px; }
.password-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-xs);
  transition: color .15s;
}
.password-toggle:hover { color: var(--fg); }
.password-toggle:focus { outline: none; box-shadow: 0 0 0 2px var(--accent-soft); border-radius: var(--radius-xs); }

/* 生成列表 */
.generated-voices,
#synth-audio-list {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  /* 关闭浏览器 scroll anchoring，否则在顶部插入卡片时浏览器会自动补偿 scrollTop，
     与 FLIP 动画 + scrollTo 形成方向冲突造成抖动 */
  overflow-anchor: none;
  padding: 4px 0;
}
.generated-voices:empty::before,
#synth-audio-list:empty::before {
  content: attr(data-empty-label) "\A" attr(data-empty-hint);
  color: var(--muted);
  font-size: 13px;
  white-space: pre-line;
  text-align: center;
  padding: 104px 18px 38px;
  background: var(--surface);
  background-image: url('/static/brand/peach-ip-actions/06-studio-record.png');
  background-repeat: no-repeat;
  background-position: center 28px;
  background-size: 62px 62px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-md);
  line-height: 1.6;
}
.generated-card {
  position: relative;
  background: var(--input-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px;
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
.generated-card:hover {
  border-color: var(--accent-light);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}
.generated-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}
.generated-card h4 {
  font-size: 14px;
  margin-bottom: 4px;
}
.generated-card h4,
.synth-audio-item .audio-voice {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.generated-card-header h4 {
  min-width: 0;
  margin-bottom: 0;
  line-height: 1.35;
}
.generated-card .desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.generated-card .meta {
  display: flex;
  gap: 8px;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 10px;
  align-items: center;
}
.generated-card .generated-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  padding: 3px 8px;
  background: var(--secondary-soft);
  border-radius: var(--radius-pill);
}
.generated-card .generated-status-complete {
  color: var(--color-success);
}
.generated-card .generated-status-loading {
  color: var(--accent);
  background: var(--accent-soft);
}
.generated-card .meta code {
  background: var(--surface);
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  font-size: 11px;
  font-family: 'SF Mono', monospace;
}
.generated-card audio {
  width: 100%;
  height: 32px;
  margin-bottom: 10px;
}
.generated-card .generated-player-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 36px;
  margin-top: 8px;
}
.generated-card .custom-player {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}
.generated-card .custom-player .play-btn {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-circle);
  border: none;
  background: var(--n-100);
  color: var(--fg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: none;
  transition: background-color .15s, transform .1s;
}
.generated-card .custom-player .play-btn:hover { background: var(--n-150); }
.generated-card .custom-player .play-btn:active { background: var(--n-200); transform: scale(0.96); }
.generated-card .custom-player .play-btn [data-icon] { width: 18px; height: 18px; }
.generated-card .custom-player .progress-wrap {
  flex: 1 1 auto;
  min-width: 0;
  height: 36px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
}
.generated-card .custom-player .progress-bar {
  position: relative;
  height: 5px;
  background: var(--line);
  border-radius: var(--radius-pill);
  cursor: pointer;
  overflow: hidden;
}
.generated-card .custom-player .progress-fill {
  position: absolute;
  left: 0; top: 0;
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: var(--radius-pill);
  pointer-events: none;
  transition: width 0.08s linear;
}
.generated-card .custom-player .progress-bar:hover .progress-fill { background: var(--accent-dark); }
.generated-card .custom-player .time-label {
  font-size: 11px;
  line-height: 11px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
}
.generated-card .generated-card-action {
  flex: 0 0 auto;
  min-width: 0;
  height: 32px;
  padding: 0 12px;
  border: none;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  background: var(--n-100);
  color: var(--fg);
  cursor: pointer;
  transition: background-color .15s ease, transform .1s ease, opacity .15s ease;
}
.generated-card .generated-card-action:hover:not(:disabled) {
  background: var(--n-150);
}
.generated-card .generated-card-action:active:not(:disabled) {
  transform: scale(0.97);
}
.generated-card .generated-card-action:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  box-shadow: none;
}
.generated-card .generated-card-action.is-use {
  background: var(--n-100);
  color: var(--fg);
}
.generated-card .saved-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}
.generated-card.saved {
  border-color: var(--accent-light);
  background: var(--accent-soft);
}
/* 生成中加载态卡片（音色设计 / 声音克隆共用） */
.generated-card-loading {
  overflow: hidden;
  pointer-events: none;
  background: var(--input-bg);
}
.generated-card-loading:hover {
  border-color: var(--line);
  box-shadow: none;
  transform: none;
}
/* 保存的音色 */
.voice-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px; margin-bottom: 32px;
}
.voice-card {
  background: var(--input-bg); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px;
  cursor: pointer;
  transition: border-color .2s, box-shadow .2s, transform .2s;
  position: relative;
}
.voice-card.is-deleting {
  overflow: hidden;
  pointer-events: none;
}
.voice-card:hover { border-color: var(--accent-light); box-shadow: var(--shadow); transform: translateY(-1px); }
.voice-card .voice-delete-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: var(--radius-xs);
  background: var(--surface); color: var(--muted);
  cursor: pointer;
  transition: all .2s;
}
.voice-card .voice-delete-icon:hover {
  background: var(--danger-soft); color: var(--danger);
}
.voice-card .voice-edit-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: var(--radius-xs);
  background: var(--surface); color: var(--muted);
  cursor: pointer;
  transition: all .2s;
}
.voice-card .voice-edit-icon:hover {
  background: var(--accent-light); color: var(--accent);
}
.voice-card.selected {
  border-color: var(--accent); background: var(--accent-soft);
}
.voice-card h4 {
  font-size: 15px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.voice-card h4 .voice-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.voice-card h4 .voice-edit-icon-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: var(--radius-xs);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition: all .2s;
  flex-shrink: 0;
}
.voice-card h4 .voice-edit-icon-inline:hover {
  background: var(--accent-light);
  color: var(--accent);
}
.voice-card h4 .voice-name-input {
  font-size: 15px;
  font-family: inherit;
  font-weight: 600;
  color: var(--fg);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 2px 6px;
  outline: none;
  background: var(--input-bg);
  flex: 1;
  min-width: 0;
}
.voice-card p { font-size: 13px; color: var(--muted); line-height: 1.5; }
.voice-card .voice-desc-clamp {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 39px;
}
.voice-desc-wrap { position: relative; }
.voice-desc-wrap[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 10px;
  background: rgba(0,0,0,0.85);
  color: #fff;
  font-size: 12px;
  border-radius: var(--radius-sm);
  white-space: normal;
  max-width: 240px;
  word-break: break-word;
  line-height: 1.5;
  opacity: 0;
  pointer-events: none;
  transition: opacity .1s;
  z-index: 100;
}
.voice-desc-wrap[data-tooltip]:hover::after { opacity: 1; }
.voice-card .voice-meta {
  display: flex; gap: 12px; margin-top: 12px;
  font-size: 12px; color: var(--muted);
  align-items: center;
}
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 56px 24px;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.empty-state .empty-text {
  font-size: 15px;
  font-weight: 600;
  color: var(--fg);
}
.empty-state .empty-hint {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
  max-width: 320px;
}
.empty-state .btn-primary {
  margin-top: 6px;
}
.empty-state .empty-action-btn {
  margin-top: 4px;
}

/* 合成块 */
.synth-box {
  width: 100%;
}
.synth-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 380px);
  gap: var(--workbench-panel-gap);
  align-items: stretch;
  --synth-output-panel-height: var(--workbench-panel-height);
}
.synth-editor-panel {
  min-width: 0;
  align-self: start;
}
.synth-panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--workbench-section-gap);
  margin-bottom: var(--workbench-section-gap);
}
.synth-panel-eyebrow {
  display: block;
  margin-bottom: 5px;
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.synth-panel-heading h2 {
  font-size: 18px;
  line-height: 1.25;
  letter-spacing: 0;
}
.synth-panel-heading p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}
.synth-panel-note {
  flex-shrink: 0;
  color: var(--muted);
  font-size: 12px;
  padding: 5px 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  white-space: nowrap;
}
.synth-output-panel {
  position: sticky;
  top: 132px;
  min-width: 0;
  height: var(--synth-output-panel-height);
  min-height: var(--workbench-panel-height);
  max-height: var(--synth-output-panel-height);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: var(--workbench-card-padding);
  background: rgba(var(--n-25-rgb),0.82);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}
.synth-block {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--workbench-card-padding);
  margin-bottom: 0;
  background: var(--surface);
  box-shadow: var(--shadow-md);
  min-height: var(--workbench-panel-height);
  display: flex;
  flex-direction: column;
}
.synth-block-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: var(--workbench-field-gap);
}
.synth-voice-slot {
  width: 260px;
  max-width: 100%;
  height: 118px;
}
.synth-voice-slot .voice-sidebar-item-actions {
  flex-wrap: nowrap;
  margin-top: auto;
}
.synth-voice-slot .voice-sidebar-item-meta {
  min-width: 0;
}
.synth-voice-slot .synth-voice-card,
.synth-voice-card-empty {
  width: 100%;
  height: 100%;
  margin: 0;
}
.synth-voice-slot .synth-voice-card {
  display: flex;
  flex-direction: column;
}
.synth-voice-slot .voice-sidebar-item-desc {
  flex: 1 1 auto;
  min-height: 0;
  margin-bottom: 8px;
}
.synth-voice-slot .synth-voice-card:focus-visible,
.synth-voice-card-empty:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.synth-voice-card-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 12px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-md);
  background: var(--input-bg);
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.synth-voice-card-empty:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}
@media (max-width: 640px) {
  .synth-voice-slot {
    width: 100%;
    max-width: 280px;
  }
}
.synth-field-label {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}
.synth-text-label {
  margin-top: 0;
}
.synth-block-top-row {
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}
.synth-voice-tabs {
  width: 100%;
  align-items: center;
}
.synth-voice-tabs .synth-voice-search {
  flex: 0 0 auto;
  width: auto;
  max-width: none;
  margin-left: 0;
}
.synth-voice-tabs .synth-voice-search .voice-search-box {
  width: 132px;
  max-width: 132px;
  height: 29px;
  padding: 4px 10px 4px 28px;
  font-size: 13px;
  border-radius: var(--radius);
  background: transparent;
}
.voice-search-field {
  position: relative;
  max-width: 240px;
  width: 100%;
  flex: 0 1 240px;
}
.voice-search-field > i,
.voice-search-field > svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: var(--muted);
  pointer-events: none;
  z-index: 1;
}
.voice-search-box {
  display: block;
  width: 100%;
  max-width: 240px;
  height: var(--workbench-control-sm-height);
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-family: inherit;
  background: var(--input-bg);
  color: var(--fg);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  box-sizing: border-box;
}
.voice-search-field .voice-search-box {
  padding-left: 30px;
}
.voice-search-box:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}
.synth-block-header .synth-voice-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 76px;
  overflow: hidden;
  opacity: 1;
  transition:
    max-height var(--voice-expand-collapse-duration) var(--voice-expand-collapse-ease),
    height 0.28s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.1s ease;
  padding: 2px 0;
  position: relative;
}
.synth-block-header .synth-voice-list.voice-list-animating {
  overflow: hidden;
  pointer-events: none;
}
.synth-block-header .synth-voice-list.voice-list-group-leaving {
  opacity: 0.72;
}
.synth-block-header .synth-voice-list.voice-list-group-swap .synth-voice-item.voice-chip-entering {
  opacity: 0;
  transform: none;
}
.synth-block-header .synth-voice-list.voice-list-group-swap .synth-voice-item.voice-chip-entering.voice-chip-entered {
  opacity: 1;
  transform: none;
  transition-delay: 0ms;
}
@media (max-width: 640px) {
  .synth-block-header .synth-voice-list {
    max-height: 110px;
    gap: 6px;
  }
  .synth-block-header .synth-voice-item {
    padding: 4px 8px;
    font-size: 12px;
    max-width: 130px;
  }
}
/* 底部渐变遮罩：提示还有更多音色 */
.synth-block-header .synth-voice-list.has-mask::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 36px;
  background: linear-gradient(to bottom, rgba(255,255,255,0), white 85%);
  pointer-events: none;
}
.synth-block-header .synth-voice-list.expanded {
  max-height: var(--voice-list-expanded-height, 600px);
}
.synth-block-header .synth-voice-item {
  min-height: var(--workbench-control-sm-height);
  padding: 4px 10px;
  background: var(--input-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
  transition:
    border-color .2s,
    background .2s,
    color .2s,
    box-shadow .2s,
    opacity .2s ease,
    transform .24s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  user-select: none;
  will-change: transform, opacity;
}
.synth-block-header .synth-voice-item:hover {
  border-color: var(--accent);
}
.synth-block-header .synth-voice-item:active {
  transform: scale(0.98);
}
.synth-block-header .synth-voice-item.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  font-weight: 500;
}
.synth-block-header .synth-voice-item.voice-chip-entering {
  opacity: 0;
  transform: translateY(7px) scale(0.985);
}
.synth-block-header .synth-voice-item.voice-chip-entering.voice-chip-entered {
  opacity: 1;
  transform: translateY(0) scale(1);
  transition-delay: var(--voice-enter-delay, 0ms);
}
.synth-block-header .synth-voice-item .ai-icon {
  flex-shrink: 0;
  color: var(--accent);
}
.synth-voice-empty {
  min-height: var(--workbench-control-sm-height);
  padding: 4px 10px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}
.synth-voice-empty a {
  color: var(--accent); cursor: pointer;
  text-decoration: underline;
}
.voice-list-empty {
  transition:
    opacity .2s ease,
    transform .24s cubic-bezier(0.16, 1, 0.3, 1);
}
.voice-list-empty.voice-list-empty-entering {
  opacity: 0;
  transform: translateY(6px);
}
.voice-list-empty.voice-list-empty-entering.voice-list-empty-entered {
  opacity: 1;
  transform: translateY(0);
}
.voice-expand-bar {
  --voice-action-height: var(--workbench-control-sm-height);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-start;
  margin-top: 0;
  max-height: 0;
  opacity: 0;
  transform: translateY(-4px);
  overflow: hidden;
  pointer-events: none;
  position: relative;
  transition:
    max-height .24s cubic-bezier(0.16, 1, 0.3, 1),
    margin-top .24s cubic-bezier(0.16, 1, 0.3, 1),
    opacity .18s ease,
    transform .24s cubic-bezier(0.16, 1, 0.3, 1);
}
.voice-expand-bar.is-visible {
  margin-top: 4px;
  max-height: calc(var(--voice-action-height) + 8px);
  opacity: 1;
  transform: translateY(0);
  overflow: visible;
  pointer-events: auto;
}
.voice-expand-btn {
  height: var(--voice-action-height);
  padding: 4px 10px;
  font-size: 12px;
  line-height: 1;
  color: var(--accent);
  background: var(--input-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all .2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  box-shadow: var(--shadow-sm);
  box-sizing: border-box;
}
.voice-expand-btn:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}
.voice-expand-btn .chevron {
  width: 12px;
  height: 12px;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}
.voice-expand-btn.expanded .chevron {
  transform: rotate(180deg);
}
.voice-search-empty {
  padding: 8px 0;
  font-size: 13px;
  color: var(--muted);
}
.voice-search-empty a {
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
}
.synth-block .synth-text-input {
  width: 100%;
  flex: 1 1 auto;
  padding: 14px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  font-size: 15px;
  font-family: inherit;
  background: var(--input-bg);
  color: var(--fg);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  resize: vertical;
  height: auto;
  min-height: 150px;
  line-height: 1.7;
}
.synth-block .synth-text-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  background: var(--input-bg);
}

/* 语音风格指令控制 */
.synth-instructions-wrap {
  margin: 0 0 var(--workbench-field-gap);
  transform-origin: top left;
  will-change: height, opacity, transform, margin-bottom;
}
.synth-instructions-wrap.is-animating {
  overflow: hidden;
  pointer-events: none;
}

/* 操作区：三个工作台面板统一间距 */
.panel-actions,
.synth-actions {
  display: flex;
  gap: var(--workbench-field-gap);
  align-items: center;
  flex-wrap: wrap;
  flex-shrink: 0;
  margin-top: var(--workbench-field-gap);
}

.synth-audio-item {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 0;
  min-height: 127px;
  padding: 16px;
  position: relative;
  background: var(--input-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.synth-audio-item:hover {
  border-color: var(--accent-light);
}
.synth-audio-item .audio-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.synth-audio-item .audio-title {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.synth-audio-item .audio-voice {
  font-size: 15px;
  font-weight: 600;
  color: var(--fg);
  line-height: 1.3;
}
.synth-audio-item .audio-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}
.synth-audio-item .audio-time {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 500;
  color: var(--color-success);
  white-space: nowrap;
  padding: 3px 8px;
  background: var(--secondary-soft);
  border-radius: var(--radius-pill);
}
.synth-audio-item .audio-meta span {
  position: relative;
}
.synth-audio-item .audio-meta span .text-ellipsis {
  display: block;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.synth-audio-item .audio-meta span[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  z-index: 100;
  max-width: 280px;
  padding: 8px 12px;
  background: rgba(var(--n-900-rgb), 0.92);
  color: #fff;
  font-size: 12px;
  line-height: 1.5;
  border-radius: var(--radius-sm);
  white-space: normal;
  word-break: break-word;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  pointer-events: none;
}
.synth-audio-item .audio-meta span[data-tooltip]:hover::before {
  content: '';
  position: absolute;
  left: 10px;
  top: calc(100% - 2px);
  z-index: 100;
  border-width: 5px;
  border-style: solid;
  border-color: transparent transparent rgba(var(--n-900-rgb), 0.92) transparent;
  pointer-events: none;
}
.synth-audio-item .audio-text {
  font-size: 12px;
  color: var(--muted);
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: right;
}
.synth-audio-item .audio-player-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 36px;
}
.synth-audio-item .custom-player {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}
.synth-audio-item .custom-player .play-btn {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-circle);
  border: none;
  background: var(--n-100);
  color: var(--fg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: none;
  transition: background-color .15s, transform .1s;
}
.synth-audio-item .custom-player .play-btn:hover {
  background: var(--n-150);
}
.synth-audio-item .custom-player .play-btn:active {
  background: var(--n-200);
  transform: scale(0.96);
}
.synth-audio-item .custom-player .play-btn [data-icon] {
  width: 18px;
  height: 18px;
}
.synth-audio-item .custom-player .progress-wrap {
  flex: 1 1 auto;
  min-width: 0;
  height: 36px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
}
.synth-audio-item .custom-player .progress-bar {
  position: relative;
  height: 5px;
  background: var(--line);
  border-radius: var(--radius-pill);
  cursor: pointer;
  overflow: hidden;
}
.synth-audio-item .custom-player .progress-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: var(--radius-pill);
  pointer-events: none;
  transition: width 0.08s linear;
}
.synth-audio-item .custom-player .progress-bar:hover .progress-fill {
  background: var(--accent-dark);
}
.synth-audio-item .custom-player .time-label {
  font-size: 11px;
  line-height: 11px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
}
.synth-audio-item .audio-download {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-circle);
  border: 1px solid var(--line);
  background: var(--input-bg);
  color: var(--fg);
  cursor: pointer;
  transition: all 0.15s ease;
}
.synth-audio-item .audio-download:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}
.synth-audio-item .audio-download [data-icon] {
  width: 16px;
  height: 16px;
}
@keyframes synth-complete-card {
  0% {
    border-color: rgba(var(--accent-rgb), 0.42);
    box-shadow: 0 0 0 rgba(var(--accent-rgb), 0);
  }
  42% {
    border-color: rgba(var(--accent-rgb), 0.5);
    box-shadow: 0 10px 28px rgba(var(--accent-rgb), 0.13), 0 0 0 3px rgba(var(--accent-rgb), 0.09);
  }
  100% {
    border-color: var(--line);
    box-shadow: 0 0 0 rgba(var(--accent-rgb), 0);
  }
}
@keyframes synth-complete-badge {
  0% {
    transform: scale(0.94);
    background: var(--surface);
    color: var(--muted);
  }
  48% {
    transform: scale(1.08);
    background: var(--secondary-soft);
    color: var(--color-success);
  }
  100% {
    transform: scale(1);
    background: var(--secondary-soft);
    color: var(--color-success);
  }
}
@keyframes synth-complete-play {
  0% {
    transform: scale(0.9);
    box-shadow: 0 0 0 rgba(var(--accent-rgb), 0);
  }
  52% {
    transform: scale(1.08);
    box-shadow: 0 8px 22px rgba(var(--accent-rgb), 0.34), 0 0 0 7px rgba(var(--accent-rgb), 0.1);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 5px 14px rgba(var(--accent-rgb), 0.28);
  }
}
/* 调试假卡片：始终显示，不影响正常逻辑 */
/* 历史 Tab */
.utility-page {
  display: flex;
  flex-direction: column;
  gap: var(--workbench-panel-gap);
}
.utility-panel {
  padding: 20px;
  background: rgba(var(--n-25-rgb),0.86);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}
.utility-panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.utility-panel-eyebrow {
  display: block;
  margin-bottom: 5px;
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.utility-panel-heading h2 {
  font-size: 18px;
  line-height: 1.25;
  letter-spacing: 0;
}
.utility-panel-heading p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}
.history-toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  margin-bottom: 18px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}
.history-filter-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.history-search {
  margin-left: auto;
}
.pagination .is-current { background: var(--accent); color: #fff; border-color: var(--accent); }
.history-count {
  margin: 0;
  font-size: 12px; color: var(--muted);
}
.history-filter-btn {
  padding: 5px 14px;
  font-size: 13px;
}
.history-filter-btn.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 500;
}
.synth-voice-tabs .history-filter-btn.is-disabled {
  opacity: 0.55;
}
.feedback-compose {
  margin-bottom: 0;
}
.feedback-compose textarea {
  min-height: 112px;
}
.feedback-compose-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 6px;
}
.feedback-compose-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}
.feedback-list-wrap {
  min-height: 220px;
}
.feedback-list-wrap .generated-card {
  border-radius: var(--radius-feedback);
  box-shadow: 0 10px 26px rgba(var(--n-900-rgb),0.045);
}
.feedback-thread {
  margin-bottom: 16px;
  overflow: hidden;
}
.feedback-replies {
  padding: 12px 16px 16px;
  border-top: 1px solid var(--line);
}
.feedback-comment {
  padding-bottom: 16px;
}
.feedback-comment.is-reply {
  margin-left: 16px;
  margin-top: 10px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-feedback);
}
.feedback-comment.is-mine {
  border-left: 3px solid var(--accent);
  padding-left: 13px;
}
.feedback-comment-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 6px;
}
.feedback-author {
  display: flex;
  align-items: center;
  gap: 8px;
}
.feedback-author-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--fg);
}
.feedback-me-badge {
  background: var(--accent-soft);
  color: var(--accent);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 500;
}
.feedback-time {
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
  font-size: 12px;
}
.feedback-body {
  margin: 0 0 10px 0;
  color: var(--fg);
  font-size: 14px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}
.feedback-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.feedback-loading {
  display: none;
  text-align: center;
  padding: 40px 20px;
}
.feedback-loading p {
  font-size: 13px;
  color: var(--muted);
}
@media (max-width: 700px) {
  .utility-panel {
    padding: 16px;
  }
  .utility-panel-heading,
  .feedback-compose-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .history-search,
  .voice-search-field.history-search,
  .history-search .voice-search-box {
    max-width: none;
    width: 100%;
  }
}

@keyframes pulse-highlight {
  0%, 100% { box-shadow: 0 0 0 0 rgba(var(--p-600-rgb), 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(var(--p-600-rgb), 0); }
}
.pulse-highlight {
  animation: pulse-highlight 1.2s ease-in-out 3;
}
.synth-guide {
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 28px 24px;
  text-align: center;
  margin-bottom: var(--workbench-panel-gap);
}
.synth-guide .guide-icon {
  font-size: 32px;
  margin-bottom: 12px;
}
.synth-guide .guide-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 6px;
}
.synth-guide .guide-desc {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 16px;
  line-height: 1.6;
}
.synth-guide .guide-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.synth-audio-item .audio-text,
.synth-audio-item-loading .audio-text {
  font-size: 12px;
  color: var(--fg);
  margin-top: 2px;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.synth-output-panel .result-area {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.synth-output-panel #synth-audio-list {
  flex: 0 0 auto;
  min-height: 0;
  gap: 8px;
  overflow: visible;
}

.synth-output-panel #synth-audio-list:empty {
  flex: 1 1 auto;
}

@media (max-width: 1100px) {
  .synth-workspace {
    grid-template-columns: 1fr;
  }
  .synth-output-panel {
    position: static;
    height: min(520px, calc(100vh - var(--app-header-height) - 48px));
    min-height: 420px;
    max-height: 520px;
  }
}

@media (max-width: 700px) {
  .synth-output-panel {
    padding: 14px;
  }
  .synth-panel-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }
  .synth-block {
    padding: 20px;
    border-radius: var(--radius-lg);
  }
  .synth-block .synth-text-input {
    min-height: 120px;
  }
  .synth-actions {
    align-items: stretch;
    flex-direction: column;
  }
  .synth-actions .btn-ghost,
  .synth-actions .btn-primary,
  .synth-actions .cost-hint {
    justify-content: center;
    width: 100%;
  }
  .synth-audio-item,
  .synth-audio-item-loading {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .synth-audio-item .audio-label {
    max-width: none;
  }
  .synth-audio-item .custom-player {
    width: 100%;
  }
  .synth-audio-item .audio-actions {
    justify-content: flex-end;
  }
  .synth-audio-item .audio-text,
  .synth-audio-item-loading .audio-text {
    max-width: none;
  }
}

/* 合成中占位卡片 */
.synth-audio-item-loading {
  margin-bottom: 0;
  min-height: 127px;
  background: var(--input-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
}
.synth-audio-item-loading .audio-header,
.synth-audio-item-loading .audio-player-row {
  pointer-events: none;
}
.synth-audio-item-loading .audio-time {
  color: var(--accent);
  background: var(--accent-soft);
}
.synth-audio-item-loading .audio-player-row {
  min-height: 36px;
  height: 36px;
}
.synth-audio-item-transitioning {
  overflow: hidden;
}
.synth-transition-outgoing-row {
  position: absolute;
  z-index: 2;
  margin: 0;
  pointer-events: none;
}
.synth-transition-incoming-row {
  position: relative;
  z-index: 1;
}
.synth-loading-dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-pill);
  background: #fff;
}
.synth-pixel-loader {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0;
}
.synth-dot-field {
  flex: 1 1 auto;
  min-width: 0;
  height: 36px;
  display: grid;
  grid-template-columns: repeat(44, minmax(0, 1fr));
  grid-template-rows: repeat(5, 1fr);
  column-gap: 2px;
  row-gap: 2px;
  align-items: center;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 7%, #000 93%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 7%, #000 93%, transparent 100%);
}
.synth-dot {
  width: 3.2px;
  height: 3.2px;
  justify-self: center;
  align-self: center;
  border-radius: var(--radius-circle);
  background: rgba(var(--accent-rgb), 0.72);
  opacity: 0.34;
  transform: scale(var(--dot-base, 0.55));
  transform-origin: center;
  animation: synth-dot-flow 1.65s ease-in-out infinite;
  animation-delay: var(--dot-delay, 0s);
  will-change: transform, opacity;
}
@keyframes synth-dot-flow {
  0%, 100% {
    opacity: 0.28;
    transform: scale(var(--dot-base, 0.55));
  }
  38% {
    opacity: 0.84;
    transform: scale(var(--dot-peak, 1.65));
  }
  62% {
    opacity: 0.46;
    transform: scale(var(--dot-mid, 0.9));
  }
}
@media (prefers-reduced-motion: reduce) {
  .synth-dot {
    animation: none;
    opacity: 0.5;
    transform: scale(0.9);
  }
}
@keyframes loading-breathe {
  0%, 100% {
    background-color: var(--input-bg);
    border-color: var(--line);
    box-shadow: 0 0 0 rgba(var(--accent-rgb), 0);
  }
  50% {
    background-color: var(--p-50);
    border-color: rgba(var(--accent-rgb), 0.24);
    box-shadow: 0 10px 26px rgba(var(--accent-rgb), 0.08);
  }
}

.cost-hint {
  font-size: 13px;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.result-area {
  margin-top: 24px; padding-top: 24px;
  border-top: 1px solid var(--line); display: none;
}
.result-area.active { display: block; }
.result-area audio { width: 100%; margin-bottom: 12px; }
.result-info {
  font-size: 13px; color: var(--muted);
}

/* ===== 弹窗 ===== */
.modal-overlay {
  position: fixed; inset: 0; z-index: var(--z-modal);
  background:
    radial-gradient(circle at 50% 18%, rgba(var(--accent-rgb),0.14), transparent 36%),
    rgba(var(--n-900-rgb),0.34);
  display: none;
  align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0; transition: opacity .18s ease;
  backdrop-filter: blur(8px);
}
.modal-overlay.active { display: flex; opacity: 1; animation: overlayIn .18s ease; }
.modal-overlay.active .modal { animation: modalIn .22s cubic-bezier(.2,.75,.25,1); }
@keyframes overlayIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn {
  from { opacity: 0; transform: translateY(12px) scale(0.985); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.modal {
  position: relative;
  background: rgba(var(--n-25-rgb),0.96);
  border: 1px solid rgba(var(--n-200-rgb),0.92);
  border-radius: var(--radius-lg);
  width: min(100%, 420px);
  max-height: min(88vh, 760px);
  overflow: hidden;
  box-shadow:
    0 24px 70px rgba(var(--n-900-rgb),0.18),
    0 8px 24px rgba(var(--accent-rgb),0.10);
  color: var(--fg);
}
.modal-header {
  padding: 22px 24px 14px;
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px;
}
.modal-header h3 {
  font-size: 18px;
  line-height: 1.25;
  letter-spacing: 0;
}
.modal-close {
  width: 34px; height: 34px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: color .15s, background .15s, border-color .15s, transform .15s;
}
.modal-close:hover {
  color: var(--fg);
  background: var(--surface);
  border-color: var(--line);
}
.modal-close:active { transform: scale(0.96); }
.modal-close svg,
.modal-close [data-icon] {
  width: 18px;
  height: 18px;
}
.modal-body {
  padding: 10px 24px 24px;
  max-height: calc(min(88vh, 760px) - 136px);
  overflow-y: auto;
}
.modal-footer {
  padding: 14px 24px 20px;
  border-top: 1px solid rgba(var(--n-200-rgb),0.76);
  background: rgba(var(--n-50-rgb),0.58);
  display: flex; justify-content: flex-end; gap: 10px;
  flex-wrap: wrap;
}
.modal-confirm { max-width: 380px; }
.confirm-icon-wrap { display: flex; justify-content: center; margin-bottom: 16px; }
.confirm-icon-wrap .confirm-icon-circle {
  width: 58px; height: 58px;
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, var(--accent-soft), var(--p-50));
  border: 1px solid var(--accent-light);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent);
  box-shadow: 0 10px 24px rgba(var(--accent-rgb),0.14);
}
.confirm-icon-circle .ip-mascot {
  width: 52px;
  height: 52px;
}
.modal-confirm .modal-header { text-align: center; justify-content: center; padding: 24px 24px 4px; }
.modal-confirm .modal-header h3 { font-size: 20px; font-weight: 700; }
.modal-confirm .modal-body { text-align: center; padding-top: 12px; }
.modal-confirm .modal-body p { color: var(--muted); font-size: 14px; line-height: 1.6; white-space: pre-line; }
.modal-confirm .modal-footer {
  justify-content: center;
  padding-top: 0;
  padding-bottom: 24px;
  border-top: none;
  background: transparent;
}
.auth-mascot-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  margin-bottom: 14px;
  border: 1px solid rgba(var(--accent-rgb),0.14);
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(var(--p-50-rgb),0.92), rgba(255,255,255,0.74));
}
.auth-mascot-strip strong {
  display: block;
  color: var(--fg);
  font-size: 14px;
  line-height: 1.35;
}
.auth-mascot-strip span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}
@media (max-width: 640px) {
  .modal-overlay { align-items: flex-end; padding: 12px; }
  .modal {
    width: 100%;
    max-height: calc(100vh - 24px);
    border-radius: var(--radius-lg);
  }
  .modal-header { padding: 20px 18px 12px; }
  .modal-body {
    padding: 8px 18px 20px;
    max-height: calc(100vh - 176px);
  }
  .modal-footer {
    padding: 12px 18px 18px;
    flex-direction: column-reverse;
    align-items: stretch;
  }
  .modal-footer .btn-ghost,
  .modal-footer .btn-primary,
  .modal-footer .btn-danger {
    width: 100%;
    justify-content: center;
  }
  .modal-recharge .modal-body {
    max-height: calc(100vh - 260px);
  }
}

/* 登录/注册 */
.auth-switch {
  text-align: center; font-size: 13px; color: var(--muted);
  margin-top: 16px;
}
.auth-switch a, .auth-switch .auth-switch-link { color: var(--accent); cursor: pointer; }
.auth-switch .auth-switch-link { padding: 0; border: 0; background: none; font: inherit; }
.auth-switch a:hover, .auth-switch .auth-switch-link:hover { text-decoration: underline; }

/* 充值 */
.modal-recharge {
  width: min(100%, 500px);
  max-width: 500px;
}
.modal-recharge .modal-body { padding-top: 4px; }
.recharge-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.recharge-checkout-view {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.recharge-section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  color: var(--fg);
  font-size: 13px;
  font-weight: 700;
}
.recharge-section-title span:last-child {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}
.recharge-hero {
  position: relative;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 10px 14px;
  border: 1px solid rgba(var(--accent-rgb),0.16);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 88% 12%, rgba(var(--p-200-rgb),0.58), transparent 34%),
    linear-gradient(135deg, rgba(var(--p-50-rgb),0.96), rgba(255,255,255,0.78));
  overflow: hidden;
}
.recharge-hero::after {
  content: "";
  position: absolute;
  right: -46px;
  bottom: -68px;
  width: 128px;
  height: 128px;
  border-radius: var(--radius-circle);
  background: rgba(var(--accent-rgb),0.08);
  pointer-events: none;
}
.recharge-hero-copy {
  position: relative;
  z-index: 1;
}
.recharge-hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 3px;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.recharge-hero-title {
  margin: 0;
  color: var(--fg);
  font-size: 15px;
  line-height: 1.28;
  letter-spacing: 0;
}
.recharge-hero-subtitle {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}
.recharge-hero-mascot {
  position: relative;
  z-index: 1;
  width: 52px;
  height: 52px;
  object-fit: contain;
  filter: drop-shadow(0 8px 12px rgba(var(--accent-rgb),0.14));
  justify-self: center;
  grid-column: 1;
  grid-row: 1;
}
.recharge-hero-copy {
  grid-column: 2;
  grid-row: 1;
}
.recharge-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.recharge-option .amount-input {
  width: 3.2ch;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  line-height: inherit;
  outline: none;
  -moz-appearance: textfield;
  appearance: textfield;
}
.recharge-option .amount-input.is-invalid {
  color: var(--danger-hover);
}
.recharge-option .amount-input::-webkit-outer-spin-button,
.recharge-option .amount-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.recharge-option {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px 14px 13px;
  min-height: 112px;
  cursor: pointer;
  background: rgba(255,255,255,0.78);
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  overflow: hidden;
  transition: border-color .2s, background .2s, box-shadow .2s, transform .2s;
}
.recharge-option::after {
  content: "";
  position: absolute;
  inset: auto -22px -42px auto;
  width: 94px;
  height: 94px;
  border-radius: var(--radius-circle);
  background: rgba(var(--accent-rgb),0.05);
  opacity: 0;
  transition: opacity .2s;
}
.recharge-option:hover {
  border-color: var(--accent-light);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.recharge-option.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb),0.10);
}
.recharge-option.selected::after { opacity: 1; }
.recharge-option.recommended {
  border-color: rgba(var(--accent-rgb),0.34);
}
.recharge-option .recharge-option-tag {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  padding: 3px 7px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  box-shadow: 0 6px 14px rgba(var(--accent-rgb),0.22);
}
.recharge-option-info {
  position: relative;
  z-index: 1;
  min-width: 0;
}
.recharge-option-mascot {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  width: 62px;
  height: 62px;
  object-fit: contain;
  margin-left: auto;
  filter: drop-shadow(0 7px 10px rgba(var(--accent-rgb),0.12));
}
.recharge-option.recommended .recharge-option-mascot {
  margin-top: 14px;
}
.recharge-option .amount {
  font-size: 23px;
  font-weight: 800;
  line-height: 1.1;
}
.recharge-option .credits {
  margin-top: 5px;
  color: var(--fg);
  font-size: 14px;
  font-weight: 700;
}
.recharge-option .plan-meta {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.recharge-agreement-note {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}
.recharge-agreement-note a {
  color: var(--accent);
  text-decoration: none;
}
.recharge-agreement-note a:hover { text-decoration: underline; }
.recharge-outage {
  display: none;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--color-warning-soft);
  border: 1px solid rgba(217, 119, 6, 0.22);
  color: var(--fg);
}
.recharge-outage.is-visible { display: flex; }
.recharge-outage [data-icon] {
  width: 18px;
  height: 18px;
  margin-top: 1px;
  color: var(--color-warning);
}
.recharge-outage-copy {
  min-width: 0;
  flex: 1;
}
.recharge-outage-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}
.recharge-qr-area {
  display: none;
  text-align: center;
  padding: 8px 0 2px;
}
.recharge-qr-mascot {
  width: 88px;
  height: 88px;
  object-fit: contain;
  margin: 0 auto 4px;
  filter: drop-shadow(0 10px 16px rgba(var(--accent-rgb),0.15));
}
.recharge-qr-area #recharge-qr-title {
  margin: 0 0 6px;
  color: var(--fg);
  font-size: 15px;
  font-weight: 700;
}
.recharge-qr-copy {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}
#recharge-qr-code {
  display: inline-flex;
  width: 212px;
  height: 212px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
}
#recharge-qr-code img {
  width: 188px;
  height: 188px;
  border-radius: var(--radius-md);
}
#recharge-qr-code canvas {
  width: 188px;
  height: 188px;
  border-radius: var(--radius-md);
}
.qr-loading {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
}
.qr-loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  border-radius: var(--radius-circle);
  animation: qrSpin 1s linear infinite;
}
.qr-loading p,
.qr-error {
  font-size: 13px;
  color: var(--muted);
}
.qr-error {
  color: var(--danger);
}
.recharge-qr-hint {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12px;
}
#recharge-polling-status {
  margin: 6px 0 0;
  color: var(--accent);
  font-size: 12px;
}
.recharge-qr-wrap {
  text-align: center;
  margin-top: 14px;
}
.recharge-qr-wrap img {
  width: 140px;
  height: 140px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  display: inline-block;
  box-shadow: var(--shadow-md);
}
.recharge-qr-wrap p {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}
@media (max-width: 420px) {
  .modal-recharge { max-width: 100%; }
  .modal-recharge .modal-body { padding-bottom: 12px; }
  .recharge-content { gap: 10px; }
  .recharge-checkout-view { gap: 9px; }
  .recharge-hero {
    grid-template-columns: 48px minmax(0, 1fr);
    min-height: 64px;
    padding: 8px 12px;
  }
  .recharge-hero-kicker {
    margin-bottom: 2px;
    font-size: 11px;
  }
  .recharge-hero-title { font-size: 14px; }
  .recharge-hero-subtitle {
    margin-top: 2px;
    font-size: 11px;
    line-height: 1.28;
  }
  .recharge-hero-mascot {
    width: 48px;
    height: 48px;
  }
  .recharge-section-title { font-size: 12px; }
  .recharge-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .recharge-option {
    min-height: 104px;
    align-items: center;
    text-align: left;
    gap: 8px;
    padding: 12px 10px 11px;
  }
  .recharge-option-mascot {
    width: 54px;
    height: 54px;
    transform: none;
  }
  .recharge-option.recommended .recharge-option-mascot { margin-top: 12px; }
  .recharge-option .amount { font-size: 20px; }
  .recharge-option .credits { margin-top: 4px; font-size: 12px; }
  .recharge-option .recharge-option-tag {
    top: 7px;
    right: 7px;
    padding: 2px 6px;
    font-size: 10px;
  }
  .recharge-agreement-note { font-size: 10px; line-height: 1.35; }
  .recharge-outage { padding: 10px 12px; gap: 8px; }
  .recharge-outage-copy p { font-size: 11px; }
}

.char-count {
  display: block; text-align: right;
  font-size: 12px; color: var(--muted); margin-top: 4px;
}
.synth-block .field.field-last {
  position: relative;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.synth-block .field.field-last .char-count {
  position: absolute;
  right: 14px;
  bottom: 10px;
  margin-top: 0;
  padding: 2px 6px;
  background: rgba(255,255,255,0.85);
  border-radius: var(--radius-xs);
  pointer-events: none;
}
.contact-wechat-id {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-md); cursor: pointer;
  font-size: 15px; font-weight: 600; color: var(--fg);
  transition: border-color .15s, background .15s;
  user-select: all;
}
.contact-wechat-id:hover {
  border-color: var(--accent); background: var(--accent-soft);
}
.modal-sm { max-width: 380px; }
.modal-contact { max-width: 360px; }
.modal-body-centered {
  padding: var(--space-6);
  text-align: center;
}
.contact-wechat-block {
  margin-top: var(--space-4);
}
.contact-mascot {
  margin-bottom: 6px;
}
.contact-wechat-label {
  font-size: 14px;
  color: var(--fg);
  margin: 0 0 var(--space-2) 0;
}
.contact-copy-hint {
  font-size: 12px;
  color: var(--accent);
  margin: 6px 0 0 0;
  opacity: 0;
  transition: opacity .2s;
}
.modal-help-text {
  font-size: 12px;
  color: var(--muted);
  margin-top: var(--space-4);
  line-height: 1.6;
}
.modal-help-text-flat {
  margin: 0;
}
.redeem-code-field {
  margin-bottom: var(--space-4);
}
.redeem-code-input {
  text-transform: uppercase;
  font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 16px;
  letter-spacing: 2px;
}
.recharge-submit[disabled] {
  cursor: not-allowed;
}
.char-count.over-limit {
  color: var(--danger); font-weight: 500;
}

/* Spinner */
.spinner {
  display: inline-block; width: 14px; height: 14px;
  border: 2px solid var(--line); border-top-color: var(--accent);
  border-radius: var(--radius-circle); animation: spin 0.8s linear infinite;
  vertical-align: middle; margin-right: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* QR loading spinner */
@keyframes qrSpin { to { transform: rotate(360deg); } }

/* ===== 通知（toast） =====
   外观和弹出菜单同一套：白底、细边、12px 圆角。贴在顶部导航栏正中，不挡工作台（design.md 6.11）。
   动效写在 CSS 里，JS 只加、摘类名；补位用 FLIP。 */
.toast-container {
  position: fixed;
  top: max(calc((var(--app-header-height) - 46px) / 2), env(safe-area-inset-top, 0px));
  left: 50%;
  z-index: var(--z-toast);
  width: min(420px, calc(100vw - 32px));
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  max-width: 100%;
  padding: 12px 16px 12px 12px;
  background: var(--input-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 32px rgba(60, 40, 20, .14);
  color: var(--fg);
  font-size: 14px;
  line-height: 20px;
  pointer-events: auto;
  transition: transform 220ms cubic-bezier(.2,.8,.2,1), opacity 180ms cubic-bezier(.2,.8,.2,1);
}
.toast-icon {
  flex: none;
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-subtle);
}
.toast-icon svg { width: 18px; height: 18px; }
.toast.success .toast-icon { color: var(--color-success); }
.toast.error .toast-icon { color: var(--danger); }
.toast.warning .toast-icon { color: var(--color-warning); }
.toast-text { min-width: 0; overflow-wrap: anywhere; }
/* 通知里的操作是文字按钮：不加描边，悬停铺米色底 */
.toast-action {
  flex: none;
  align-self: center;
  height: 28px;
  margin: -4px -8px -4px 4px;
  padding: 0 8px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-action-primary);
  font: inherit;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 160ms ease, transform 120ms ease;
}
.toast-action:hover { background: var(--color-op-1); }
.toast-action:active { background: var(--color-op-2); transform: scale(.97); }
.toast-action:focus-visible { outline: 2px solid rgba(var(--accent-rgb), .35); outline-offset: 2px; }
/* 进场：淡入 180ms + 从上方移入 8px 220ms；退场 160ms；同一条再次触发时轻按一下 */
.toast.is-entering { animation: toastFadeIn 180ms cubic-bezier(.2,.8,.2,1) backwards, toastDropIn 220ms cubic-bezier(.2,.8,.2,1) backwards; }
.toast.is-leaving { opacity: 0; transform: translateY(-4px); transition: opacity 160ms ease, transform 160ms ease; pointer-events: none; }
.toast.is-bumped { animation: toastBump 180ms cubic-bezier(.2,.8,.2,1); }
@keyframes toastFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes toastDropIn { from { transform: translateY(-8px); } to { transform: none; } }
@keyframes toastBump { from { transform: scale(.97); } to { transform: none; } }
@media (max-width: 640px) {
  .toast-container { width: calc(100vw - 24px); }
}
@media (prefers-reduced-motion: reduce) {
  .toast, .toast.is-leaving { transition: opacity 120ms linear; transform: none; }
  .toast.is-entering { animation: toastFadeIn 120ms linear backwards; }
  .toast.is-bumped { animation: none; }
}

/* ===== 就地提示 =====
   能在控件旁说清楚的错误写在控件旁，不弹通知（design.md 第 8 节）。 */
/* 弹窗：接口返回的原因写在提交按钮上方 */
.modal .form-error { display: none; margin: 0 0 12px; color: var(--danger); font-size: 13px; line-height: 20px; }
.modal .form-error.visible { display: block; }
/* 工作台底栏：红字放在主按钮左边，和复刻的「请先勾选」同一种写法 */
.synth-actions .creation-error { display: none; color: var(--danger); font-size: 13px; line-height: 20px; }
.synth-actions .creation-error.visible { display: inline; }
/* 复刻上传区：格式、大小不对时，说明那一行变成红字 */
.clone-stage.is-error .clone-stage-sub { color: var(--danger); }

/* 留言板响应式 */
@media (max-width: 640px) {
  #feedback-list .generated-card { padding: 12px !important; margin-bottom: 12px !important; }
  #feedback-list .generated-card > div[style*="margin-left:16px"] { margin-left: 8px !important; padding: 10px 12px !important; }
  #feedback-list .generated-card > div[style*="padding:12px 16px 16px"] { padding: 10px 12px 12px !important; }
}

/* ===== 在线客服对话窗 ===== */
.fab-dock {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 1190;
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  gap: 10px;
}
.support-chat-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-circle);
  background: var(--input-bg);
  color: var(--muted);
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  transition: transform 200ms var(--ease-standard), color 200ms var(--ease-standard), border-color 200ms var(--ease-standard), box-shadow 200ms var(--ease-standard);
}
.support-chat-toggle:hover {
  transform: translateY(-2px);
  border-color: var(--accent-light);
  color: var(--accent);
}
.support-chat-toggle[aria-expanded="true"] {
  border-color: var(--accent-light);
  background: var(--accent-soft);
  color: var(--accent);
}
.support-chat-toggle:focus-visible { outline: 3px solid var(--accent-soft); outline-offset: 3px; }
.support-chat-panel {
  position: fixed;
  right: 24px;
  bottom: 80px;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  width: min(360px, calc(100vw - 32px));
  height: min(520px, calc(100vh - 120px));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius-xl) + 2px);
  background: var(--surface);
  box-shadow: 0 18px 50px rgba(var(--n-800-rgb), .16), 0 4px 16px rgba(var(--n-800-rgb), .08);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 200ms var(--ease-standard), transform 200ms var(--ease-standard), visibility 200ms;
}
.support-chat-panel.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}
.support-chat-header {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, var(--accent-soft) 0%, var(--surface) 100%);
}
.support-chat-avatar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--surface);
  color: var(--accent);
  box-shadow: 0 2px 8px rgba(var(--n-800-rgb), .08);
  flex: 0 0 auto;
}
.support-chat-avatar::after {
  content: '';
  position: absolute;
  right: -1px;
  bottom: 0;
  width: 10px;
  height: 10px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: #22c55e;
}
.support-chat-heading { min-width: 0; flex: 1; }
.support-chat-heading h2 { margin: 0; color: var(--fg); font-size: 15px; line-height: 1.35; }
.support-chat-heading p { margin: 2px 0 0; color: var(--muted); font-size: 12px; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.support-chat-actions { display: flex; gap: 4px; align-items: center; flex: 0 0 auto; }
.support-chat-close,
.support-chat-wechat {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background 200ms var(--ease-standard), color 200ms var(--ease-standard);
}
.support-chat-close:hover { background: var(--bg); color: var(--fg); }
.support-chat-wechat:hover { background: var(--accent-soft); color: var(--accent); }
.support-chat-close:focus-visible,
.support-chat-wechat:focus-visible { outline: 3px solid var(--accent-soft); outline-offset: 2px; }
.support-chat-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px;
  background: var(--bg);
}
.support-chat-empty {
  margin: 4px 0;
  padding: 18px;
  border: 1px solid var(--accent-soft);
  border-radius: 18px;
  background: var(--surface);
  color: var(--muted);
  text-align: left;
  font-size: 13px;
  line-height: 1.6;
  box-shadow: 0 4px 14px rgba(var(--n-800-rgb), .05);
}
.support-chat-welcome-title { color: var(--fg); font-size: 14px; font-weight: 600; }
.support-chat-empty p { margin: 5px 0 14px; }
.support-chat-quick-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.support-chat-chip {
  padding: 6px 11px;
  border: 1px solid var(--accent-light);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: background 200ms var(--ease-standard), border-color 200ms var(--ease-standard);
}
.support-chat-chip:hover { border-color: var(--accent); background: var(--surface); }
.support-chat-chip:focus-visible { outline: 3px solid var(--accent-soft); outline-offset: 2px; }
.support-message { display: flex; flex-direction: column; align-items: flex-start; margin-bottom: 12px; }
.support-message.is-user { align-items: flex-end; }
.support-message.is-system { align-items: center; }
.support-message-meta { margin: 0 5px 4px; color: var(--muted); font-size: 11px; line-height: 1.3; }
.support-message-bubble {
  max-width: 86%;
  padding: 9px 12px;
  border: 0;
  border-radius: 16px 16px 16px 5px;
  background: var(--surface);
  color: var(--fg);
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  box-shadow: 0 2px 8px rgba(var(--n-800-rgb), .06);
}
.support-message.is-user .support-message-bubble {
  border-radius: 16px 16px 5px 16px;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 3px 10px rgba(var(--accent-rgb), .16);
}
.support-message.is-system .support-message-bubble { padding: 5px 9px; background: transparent; color: var(--muted); font-size: 12px; box-shadow: none; }
/* 等待回复（design.md 6.12）：正在回复 → 等了 30 秒加说明 → 等了 2 分钟换成微信兜底 */
.support-message.is-entering,
.support-wait-hint.is-entering { animation: supportMessageFade 180ms cubic-bezier(.2,.8,.2,1) backwards, supportMessageRise 220ms cubic-bezier(.2,.8,.2,1) backwards; }
@keyframes supportMessageFade { from { opacity: 0; } }
@keyframes supportMessageRise { from { transform: translateY(6px); } }
/* 三点气泡和一行回复同高，换成真回复时下面不跳 */
.support-chat-typing .support-message-bubble { display: inline-flex; align-items: center; gap: 4px; height: 38px; padding: 0 14px; }
.support-typing-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--color-placeholder); animation: supportTypingDot 1.2s ease-in-out infinite; }
.support-typing-dot:nth-child(2) { animation-delay: .15s; }
.support-typing-dot:nth-child(3) { animation-delay: .3s; }
@keyframes supportTypingDot {
  0%, 60%, 100% { opacity: .35; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-2px); }
}
.support-wait-hint { max-width: 86%; margin: 6px 5px 0; color: var(--muted); font-size: 12px; line-height: 18px; }
/* 系统说明：居中灰字 + 米色「扫码加微信」 */
.support-message.support-chat-note { gap: 8px; margin: 4px 0 12px; }
.support-chat-note-text { max-width: 264px; color: var(--muted); font-size: 12px; line-height: 18px; text-align: center; }
.support-chat-note-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--color-op-1);
  color: var(--fg);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: background-color 160ms ease, transform 120ms ease;
}
.support-chat-note-btn:hover { background: var(--color-op-2); }
.support-chat-note-btn:active { background: var(--color-op-3); transform: scale(.97); }
.support-chat-note-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* 发送失败：气泡不变（调淡后白字对比度不够），下面红字 + 米色「重试」 */
.support-message-failed { display: inline-flex; align-items: center; gap: 6px; margin: 6px 5px 0; color: var(--danger); font-size: 12px; line-height: 18px; }
.support-message-retry {
  height: 24px;
  padding: 0 8px;
  border: 0;
  border-radius: 6px;
  background: var(--color-op-1);
  color: var(--fg);
  font: inherit;
  cursor: pointer;
  transition: background-color 160ms ease, transform 120ms ease;
}
.support-message-retry:hover { background: var(--color-op-2); }
.support-message-retry:active { background: var(--color-op-3); transform: scale(.97); }
.support-message-retry:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (pointer: coarse) {
  .support-chat-note-btn { height: 44px; }
  .support-message-retry { height: 32px; }
}
/* 连不上客服时，头像上的绿点变灰 */
.support-chat-panel.is-offline .support-chat-avatar::after { background: var(--color-placeholder); }
/* 面板关着时回复到了：右下角按钮加桃色圆点 */
.support-chat-toggle { position: relative; }
.support-chat-toggle.has-unread::after {
  content: '';
  position: absolute;
  top: 1px;
  right: 1px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 2px var(--input-bg);
}
@media (prefers-reduced-motion: reduce) {
  .support-message.is-entering,
  .support-wait-hint.is-entering { animation: none; }
  .support-typing-dot { animation: none; opacity: .6; }
}
.support-chat-compose { padding: 12px 14px 10px; border-top: 1px solid var(--line); background: var(--surface); }
.support-chat-input-row { display: flex; align-items: flex-end; gap: 8px; }
.support-chat-input {
  flex: 1;
  min-width: 0;
  height: 42px;
  max-height: 100px;
  resize: none;
  padding: 10px 15px;
  border: 1px solid var(--line);
  border-radius: 22px;
  outline: none;
  background: var(--bg);
  color: var(--fg);
  font: inherit;
  font-size: 13px;
  line-height: 20px;
}
.support-chat-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.support-chat-send {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 50%;
  background: var(--color-action-primary);
  color: #fff;
  cursor: pointer;
  transition: transform 200ms var(--ease-standard), opacity 200ms var(--ease-standard), background 200ms var(--ease-standard);
}
.support-chat-send:hover:not(:disabled) { background: var(--color-action-primary-hover); transform: translateY(-1px); }
.support-chat-send:focus-visible { outline: 3px solid var(--accent-soft); outline-offset: 2px; }
.support-chat-send:disabled { opacity: .5; cursor: not-allowed; }
@media (max-width: 640px) {
  .fab-dock { right: 16px; bottom: 16px; gap: 8px; }
  .support-chat-toggle { width: 40px; height: 40px; }
  .support-chat-panel { right: 16px; bottom: 72px; height: min(520px, calc(100vh - 104px)); }
  .support-chat-messages { padding: 12px; }
  .support-chat-empty { padding: 16px; }
}

.hidden { display: none !important; }

/* ===== 页脚：放在 .container.workbench 内，左右边缘与卡片一致；整体弱化但保持可读（对比度≥3:1） ===== */
.footer{--footer-fg:var(--n-500);margin-top:20px;padding-bottom:64px;font-size:11px;line-height:1.6;color:var(--footer-fg)}
.footer-inner{border-top:1px solid rgba(var(--n-200-rgb),.7);padding-top:14px}
.footer p{margin:0}
.footer-col-title{display:block;color:var(--muted);font-weight:400;font-size:11px;margin-bottom:2px}
.footer-col-links{display:flex;flex-wrap:wrap;gap:0 14px}
.footer-copy{font-size:10px}
.footer-icp{font-size:10px}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.nav-h1{margin:0 0 0 12px;padding-left:12px;border-left:1px solid rgba(0,0,0,.12);font-size:13px;font-weight:500;color:var(--muted);line-height:1.2;white-space:nowrap}
@media (max-width:760px){.nav-h1{display:none}}
.hot-features{margin-top:24px}
.hot-features h2{font-size:12px;font-weight:500;color:var(--muted);margin:0 0 8px}
.hot-features ul{list-style:none;margin:0;padding:0;display:flex;flex-wrap:wrap;gap:8px}
.hot-features a{display:inline-block;padding:4px 10px;border:1px solid rgba(var(--n-200-rgb),.9);border-radius:999px;font-size:12px;color:var(--muted);text-decoration:none;background:rgba(255,255,255,.55)}
.hot-features a:hover{border-color:rgba(0,0,0,.2)}

.footer a,
.footer-links .contact-support-entry {
  color: var(--footer-fg);
  text-decoration: none;
  white-space: nowrap;
  transition: color .15s;
}
.footer a:hover,
.footer-links .contact-support-entry:hover { color: var(--accent); }
.footer-links .contact-support-entry {
  appearance: none;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  line-height: inherit;
  cursor: pointer;
}
.footer-links .contact-support-entry:focus-visible,
.synth-actions .contact-support-entry:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--radius-xs);
}
.synth-actions .contact-support-entry {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  padding: 3px 0;
  border: 0;
  background: none;
  color: var(--muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.6;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: color .15s;
}
.synth-actions .contact-support-entry:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}
@media (max-width:700px) {
  .synth-actions .contact-support-entry {
    align-self: flex-start;
    justify-content: flex-start;
    width: auto;
    margin-left: 0;
  }
}
.footer-links{display:flex;flex-wrap:wrap;gap:2px 16px}
.field-agreement {
  margin-bottom: var(--space-3);
}
.agreement-label {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  line-height: 1.5;
}
.agreement-label input[type="checkbox"] {
  width: 14px;
  height: 14px;
  min-height: 14px;
  margin-top: 3px;
  flex: 0 0 auto;
  align-self: flex-start;
  accent-color: var(--accent);
  box-sizing: border-box;
}
.agreement-label span {
  flex: 1 1 auto;
  min-width: 0;
  display: block;
  overflow-wrap: anywhere;
}
.agreement-label a {
  color: var(--accent);
  text-decoration: none;
}
.agreement-label a:hover {
  text-decoration: underline;
}

/* ===== 全局音量控制悬浮按钮 ===== */
.volume-control {
  position: relative;
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}
.volume-control-btn {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-circle);
  background: var(--input-bg);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--muted);
  transition: all .2s;
}
.volume-control-btn:hover {
  color: var(--accent);
  border-color: var(--accent-light);
}
@media (max-width: 640px) {
  .volume-control-btn { width: 40px; height: 40px; }
}
.volume-panel {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 14px 10px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  opacity: 0;
  transform: translateX(-50%) translateY(10px);
  pointer-events: none;
  transition: all .2s;
  z-index: 1;
}
.volume-control:hover .volume-panel,
.volume-panel.active {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}
.volume-slider-wrap {
  width: 24px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.volume-slider-wrap input[type="range"] {
  position: absolute;
  width: 100px;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--line);
  border-radius: var(--radius-xs);
  outline: none;
  transform: rotate(-90deg);
  transform-origin: center;
}
.volume-slider-wrap input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: var(--radius-circle);
  background: var(--accent);
  cursor: pointer;
}
.volume-slider-wrap input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: var(--radius-circle);
  background: var(--accent);
  cursor: pointer;
  border: none;
}
.volume-value {
  font-size: 11px;
  color: var(--muted);
  min-width: 32px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

@media (pointer: coarse) {
  .modal-close,
  .support-chat-close,
  .support-chat-wechat,
  .support-chat-send,
  .support-chat-toggle,
  .voice-fav-btn,
  .voice-sidebar-item-name .voice-rename-btn,
  .voice-sidebar-item-name .voice-delete-btn,
  .voice-card .voice-delete-icon,
  .voice-card .voice-edit-icon,
  .voice-card h4 .voice-edit-icon-inline,
  .voice-sidebar-expand {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
  }
  .support-chat-chip,
  .voice-sidebar-item-btns button,
  .voice-card .preview-play-btn {
    min-width: 44px;
    min-height: 44px;
  }
  .password-toggle {
    width: 44px;
    height: 44px;
    right: 4px;
    padding: 0;
  }
  .password-field input { padding-right: 52px; }
}


/* ===== 配音合成区：工具条 + 写作画布 + 结果栏 =====
   状态规范同音色库：米色 = 正在操作（悬停/按下/进行中）；浅桃底 + 橘红字 = 当前选择（当前标签、播放中）。
   整个区域只保留「开始合成」一个实心主按钮。 */
.workbench {
  --wb-op-1: var(--n-100);
  --wb-op-2: var(--n-150);
  --wb-op-3: var(--n-200);
  --wb-sep: var(--n-150);
}
/* 功能标签：去掉外框和白底卡片，当前标签用浅桃底 + 橘红字 */
.workbench-nav {
  padding: 4px 0;
  gap: 4px;
  border: none;
  background: var(--bg);
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
/* 切换时不滑动：旧标签的底色和字色淡出、新标签从悬停的米色底直接过渡到浅桃底，160ms 同时完成 */
.workbench-nav button {
  height: 36px;
  padding: 0 14px;
  border: none;
  border-radius: var(--radius-sm);
  transition: color 160ms ease, background-color 160ms ease, transform 120ms ease;
}
.workbench-nav button:hover:not(.active) { background: var(--wb-op-1); color: var(--fg); }
.workbench-nav button:active:not(.active) { background: var(--wb-op-2); transform: scale(.97); }
.workbench-nav button.active {
  /* 标签栏是页面底色，p-50 在上面看不出来，深一档用 p-100，字配 p-700 */
  background: var(--color-selected-fill);
  color: var(--color-selected-on-fill);
  text-shadow: none;
}
@media (prefers-reduced-motion: reduce) {
  .workbench-nav button { transition: none; }
  .workbench-nav button:active:not(.active) { transform: none; }
}

/* 合成面板：上工具条、中画布、下底栏 */
.synth-block { padding: 0; overflow: hidden; }
.synth-block:focus-within { border-color: var(--wb-op-3); }
.synth-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--wb-sep);
}
.synth-toolbar .synth-block-header { flex-direction: row; align-items: center; gap: 8px; margin: 0; }
.synth-toolbar .synth-voice-slot { display: flex; align-items: center; gap: 8px; width: auto; height: auto; }
.synth-toolbar .synth-instructions-wrap { margin: 0; }
.synth-chip,
.synth-toolbar .synth-voice-slot .synth-voice-card,
.synth-toolbar .synth-chip.synth-voice-card-empty {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  width: auto;
  height: 36px;
  margin: 0;
  padding: 0 10px 0 12px;
  border: 1px solid var(--wb-sep);
  border-radius: 10px;
  background: var(--input-bg);
  color: var(--fg);
  font: inherit;
  font-size: 14px;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .15s, border-color .15s;
}
.synth-chip:hover,
.synth-toolbar .synth-chip.synth-voice-card-empty:hover { background: var(--wb-op-1); border-color: var(--wb-sep); color: var(--fg); }
.synth-chip:active { background: var(--wb-op-2); }
.synth-chip:focus-visible,
.synth-chip:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.synth-chip .synth-chip-key { color: var(--muted); font-size: 13px; }
.synth-chip > svg,
.synth-chip > [data-icon] { color: var(--muted); }
.synth-voice-card .voice-name { font-weight: 600; }
.synth-voice-card .voice-tag {
  padding: 1px 6px;
  border-radius: var(--radius-xs);
  background: var(--wb-op-1);
  color: var(--muted);
  font-size: 11px;
}
.synth-voice-card .voice-gender-tag { display: inline-flex; padding: 0; border: none; background: none; }
.synth-voice-card .voice-gender-tag svg { display: block; }
.synth-voice-card .voice-gender-tag .voice-gender-text { display: none; }
.synth-voice-card .voice-gender-tag.is-female { color: var(--color-female); }
.synth-voice-card .voice-gender-tag.is-male { color: var(--color-male); }
.synth-toolbar .synth-chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 36px;
  padding: 0 12px;
  border: none;
  border-radius: 10px;
  background: var(--wb-op-1);
  color: var(--fg);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: background-color .15s, transform .1s;
}
.synth-toolbar .synth-chip-btn .play-icon { color: inherit; display: inline-flex; }
.synth-toolbar .synth-chip-btn:hover { background: var(--wb-op-2); color: var(--fg); border: none; }
.synth-toolbar .synth-chip-btn:active { background: var(--wb-op-3); transform: scale(.97); }
.synth-toolbar .synth-chip-btn.playing,
.synth-toolbar .synth-chip-btn.playing:hover { background: var(--accent-soft); color: var(--color-action-primary); font-weight: 600; }
.synth-style-chip .synth-instructions-preset {
  appearance: none;
  -webkit-appearance: none;
  width: auto;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--fg);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  outline: none;
}
#synth-cost {
  margin-left: auto;
  padding: 0;
  background: none;
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  cursor: default;
}
#synth-cost.over-limit { color: var(--danger); }
.synth-instructions-custom { padding: 12px 16px 0; }
.synth-instructions-custom .synth-instructions-input {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--wb-sep);
  border-radius: 10px;
  background: var(--input-bg);
  color: var(--fg);
  font: inherit;
  font-size: 14px;
  line-height: 1.6;
  resize: none;
}
.synth-instructions-custom .synth-instructions-input:focus { outline: none; border-color: var(--accent-light); box-shadow: 0 0 0 3px var(--accent-soft); }
.synth-block .synth-canvas {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  margin: 0;
}
.synth-text-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.synth-block textarea.synth-text-input,
.synth-block textarea.synth-text-input:focus {
  flex: 1 1 auto;
  min-height: 320px;
  padding: 24px 32px;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  outline: none;
  color: var(--fg);
  font-size: 18px;
  line-height: 1.9;
  resize: none;
}
.synth-block textarea.synth-text-input::placeholder { color: var(--n-400); }
.synth-block .synth-actions {
  gap: 12px;
  margin: 0;
  padding: 14px 16px;
  border-top: 1px solid var(--wb-sep);
}
.synth-block .synth-actions .contact-support-entry { margin-left: 0; margin-right: auto; color: var(--muted); font-size: 13px; }
.synth-block .synth-actions .contact-support-entry:hover { color: var(--fg); }
.synth-block #synth-cancel-btn:disabled { display: none; }
.synth-block #synth-cancel-btn {
  height: 40px;
  padding: 0 16px;
  border: none;
  border-radius: 10px;
  background: var(--wb-op-1);
  color: var(--fg);
}
.synth-block #synth-cancel-btn:hover { background: var(--wb-op-2); }
.synth-block #synth-btn { height: 40px; padding: 0 24px; }

/* 生成结果：行 + 细线，不再是一张张描边卡片；完成状态不再单独标注 */
.synth-output-panel .creation-results-heading h2 { font-size: 16px; }
.synth-output-panel #synth-audio-list { gap: 0; }
.synth-output-panel #synth-audio-list:empty { justify-content: center; padding-bottom: 48px; }
/* 空状态：放大的桃子 + 一句状态说明，整体居中；操作步骤左侧面板已经说明，不再重复 */
.synth-output-panel #synth-audio-list:empty::before {
  content: attr(data-empty-label);
  padding: 104px 0 0;
  border: none;
  background-color: transparent;
  background-position: center 0;
  background-size: 88px 88px;
  font-size: 14px;
  line-height: 1.5;
  white-space: normal;
}
.synth-output-panel .synth-audio-item,
.synth-output-panel .synth-audio-item:hover {
  min-height: 0;
  gap: 10px;
  padding: 14px 4px;
  border: none;
  border-top: 1px solid var(--wb-sep);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  animation: none;
}
.synth-output-panel .synth-audio-item:first-child { border-top: none; }
.synth-output-panel .synth-audio-item .audio-header { align-items: baseline; }
.synth-output-panel .synth-audio-item .audio-title { flex-direction: row; align-items: baseline; gap: 8px; min-width: 0; }
.synth-output-panel .synth-audio-item .audio-voice { flex: none; font-size: 14px; }
.synth-output-panel .synth-audio-item .audio-meta { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 13px; }
.synth-output-panel .synth-audio-item:not(.synth-audio-item-loading) .audio-time { display: none; }
.synth-output-panel .synth-audio-item-loading .audio-time { padding: 0; background: none; color: var(--muted); font-size: 12px; font-weight: 400; }
.synth-output-panel .synth-audio-item .custom-player.is-playing .play-btn { background: var(--accent-soft); color: var(--color-action-primary); }
.synth-output-panel .synth-audio-item .custom-player .progress-bar { height: 4px; background: var(--wb-sep); }
.synth-output-panel .synth-audio-item .audio-download {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--wb-op-1);
}
.synth-output-panel .synth-audio-item .audio-download:hover { border: none; background: var(--wb-op-2); color: var(--fg); }

/* ===== 设计音色 / 复刻声音：与配音合成同一套「工具条 + 正文 + 底栏」 ===== */
.design-box.creation-box {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}
.design-box.creation-box:focus-within { border-color: var(--wb-op-3); }
.creation-chip-select {
  appearance: none;
  -webkit-appearance: none;
  width: auto;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--fg);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  outline: none;
}
.creation-toolbar .creation-cost {
  margin-left: auto;
  padding: 0;
  background: none;
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
  cursor: default;
}
.creation-body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  padding: 24px 32px;
  min-height: 0;
}
.creation-body.creation-body-canvas { padding: 0; }
.creation-body .creation-canvas {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  margin: 0;
}
.creation-body .creation-canvas textarea,
.creation-body .creation-canvas textarea:focus {
  flex: 1 1 auto;
  min-height: 220px;
  padding: 24px 32px;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  outline: none;
  color: var(--fg);
  font-size: 18px;
  line-height: 1.9;
  resize: none;
}
.creation-body .creation-canvas textarea::placeholder { color: var(--n-400); }
/* 设计音色：名称是工具条上的可编辑胶囊 */
.creation-name-chip { cursor: text; }
.creation-name-chip input[type="text"] {
  width: 5em;
  min-width: 4em;
  max-width: 12em;
  height: auto;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  outline: none;
  color: var(--fg);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
}
@supports (field-sizing: content) {
  .creation-name-chip input[type="text"] { width: auto; field-sizing: content; }
}
.creation-name-chip input[type="text"]::placeholder { color: var(--fg); opacity: .5; }
.creation-name-chip > svg,
.creation-name-chip > [data-icon] { color: var(--muted); }
.creation-name-chip:focus-within {
  outline: none;
  background: var(--input-bg);
  border-color: var(--accent-light);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
/* 设计音色：试听台词卡 */
.creation-quote {
  flex: none;
  margin: 0 32px 24px;
  padding: 12px 16px 14px;
  border-radius: 12px;
  background: var(--wb-op-1);
  cursor: text;
  transition: background-color .15s, box-shadow .15s;
}
.creation-quote:hover { background: var(--wb-op-2); }
.creation-quote:focus-within,
.creation-quote:focus-within:hover {
  background: var(--input-bg);
  box-shadow: 0 0 0 1px var(--accent-light) inset, 0 0 0 3px var(--accent-soft);
}
.creation-quote-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
}
.creation-quote-hint { font-variant-numeric: tabular-nums; }
.creation-quote-hint.is-warn { color: var(--danger); }
.creation-quote-head label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  cursor: text;
}
.creation-quote textarea:is(#design-preview, #clone-preview-text) {
  display: block;
  width: 100%;
  height: auto;
  min-height: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  outline: none;
  color: var(--fg);
  font: inherit;
  font-size: 15px;
  line-height: 1.7;
  resize: none;
}
@supports (field-sizing: content) {
  .creation-quote textarea:is(#design-preview, #clone-preview-text) { field-sizing: content; min-height: 1.7em; }
}
.creation-quote textarea:is(#design-preview, #clone-preview-text)::placeholder { color: var(--fg); opacity: .5; }
.creation-actions .creation-example-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-right: auto;
  padding: 6px 0;
  border: none;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.creation-actions .creation-example-btn:hover { color: var(--fg); }
.creation-actions .creation-example-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--radius-xs); }
.creation-actions .btn-primary { height: 40px; padding: 0 24px; }
@media (max-width: 640px) {
  .creation-body { padding: 20px; }
  .creation-body .creation-canvas textarea,
  .creation-body .creation-canvas textarea:focus { padding: 20px; }
  .creation-quote { margin: 0 20px 20px; }
}
.creation-box .creation-actions {
  gap: 12px;
  margin: 0;
  padding: 14px 16px;
  border-top: 1px solid var(--wb-sep);
}
.creation-actions .error-msg { display: none; margin: 4px 0 0 24px; color: var(--danger); font-size: 12px; }
.creation-actions .error-msg.visible { display: block; }
/* ===== 复刻声音：样本区（空态即上传区，无边框；悬停、拖入时才显示底色） ===== */
.clone-stage {
  position: relative;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 240px;
  margin: 16px 32px;
  padding: 24px 16px;
  border: 1.5px dashed transparent;
  border-radius: 12px;
  text-align: center;
  transition: background-color .15s, border-color .15s;
}
.clone-stage.hidden { display: none; }
#clone-upload-area { cursor: pointer; }
#clone-upload-area:hover { background: var(--n-75); }
#clone-upload-area:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.clone-stage.drag-active,
.clone-stage.drag-active:hover { background: var(--accent-soft); border-color: var(--accent-light); }
.clone-stage-icon {
  width: 56px;
  height: 56px;
  margin-bottom: 16px;
  border-radius: 50%;
  background: var(--wb-op-1);
  color: var(--fg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color .15s, color .15s, transform .15s;
}
#clone-upload-area:hover .clone-stage-icon { background: var(--wb-op-2); }
.clone-stage.drag-active .clone-stage-icon { background: var(--p-100); color: var(--color-action-primary); transform: translateY(-2px); }
.clone-stage-title { margin: 0; color: var(--fg); font-size: 16px; font-weight: 600; }
.clone-stage-title .is-drag,
.clone-stage.drag-active .clone-stage-title .is-idle { display: none; }
.clone-stage.drag-active .clone-stage-title .is-drag { display: inline; }
.clone-stage-sub { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.clone-stage-tips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 20px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 12px;
}
.clone-stage-tips li { display: inline-flex; align-items: center; gap: 6px; }
/* 已上传：播放键 + 波形 + 文件信息 */
.clone-sample-inner { width: 100%; max-width: 560px; text-align: left; }
.clone-sample-row { display: flex; align-items: center; gap: 16px; }
.clone-sample-play {
  flex: none;
  width: 48px;
  height: 48px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--wb-op-1);
  color: var(--fg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color .15s, color .15s, transform .1s;
}
.clone-sample-play:hover { background: var(--wb-op-2); }
.clone-sample-play:active { transform: scale(.97); background: var(--wb-op-3); }
.clone-sample-play:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.clone-sample.is-playing .clone-sample-play { background: var(--accent-soft); color: var(--color-action-primary); }
.clone-wave {
  flex: 1 1 auto;
  min-width: 0;
  height: 48px;
  display: flex;
  align-items: center;
  gap: 2px;
  cursor: pointer;
}
.clone-wave i {
  flex: 1 1 0;
  min-width: 2px;
  min-height: 4px;
  border-radius: 2px;
  background: var(--wb-op-3);
  transition: background-color .12s;
}
.clone-wave i.on { background: var(--accent); }
.clone-sample-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  margin-top: 14px;
  padding-left: 64px;
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.clone-sample-meta #clone-file-name {
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--fg);
  font-weight: 500;
}
.clone-sample-meta .clone-duration-warn { color: var(--danger); }
.clone-sample-meta .clone-duration-warn:empty { display: none; }
.clone-sample-meta .clone-duration-warn:not(:empty) ~ #clone-file-size { display: none; }
.clone-sample-acts { display: flex; gap: 8px; margin-left: auto; }
.clone-sample-acts button {
  height: 32px;
  padding: 0 12px;
  border: none;
  border-radius: 8px;
  background: var(--wb-op-1);
  color: var(--fg);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: background-color .15s, transform .1s;
}
.clone-sample-acts button:hover { background: var(--wb-op-2); }
.clone-sample-acts button:active { transform: scale(.97); background: var(--wb-op-3); }
.clone-sample-acts button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* 授权勾选：自绘复选框，勾选后浅桃底 + 橘红勾 */
.creation-actions .clone-consent-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  margin-right: auto;
  min-width: 0;
  font-size: 13px;
}
.clone-consent { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); cursor: pointer; user-select: none; }
.clone-consent:has(input:checked) { color: var(--fg); }
.clone-consent input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  flex: none;
  width: 18px;
  height: 18px;
  margin: 0;
  border: 1.5px solid var(--n-300);
  border-radius: 5px;
  background: var(--input-bg) no-repeat center / 12px 12px;
  cursor: pointer;
  transition: border-color .15s, background-color .15s, box-shadow .15s;
}
.clone-consent:hover input[type="checkbox"] { border-color: var(--n-400); }
.clone-consent input[type="checkbox"]:checked {
  border-color: var(--color-action-primary);
  background-color: var(--accent-soft);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23c84127' d='M9.171 15.365L19.424 5.112c.703-.635 1.769-.588 2.314.235c.403.609.281 1.363-.192 1.886L10.232 18.547c-.17.154-.283.243-.496.33c-.574.233-1.178.074-1.625-.33L2.454 12.89c-.474-.524-.595-1.277-.192-1.886c.544-.823 1.611-.87 2.313-.235Z'/%3E%3C/svg%3E");
}
.clone-consent input[type="checkbox"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.clone-consent input[type="checkbox"][aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 3px var(--color-danger-soft); }
.clone-consent-link { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.clone-consent-link:hover { color: var(--fg); }
.creation-actions .clone-consent-wrap .error-msg { margin: 0; font-size: 13px; }
.creation-actions .clone-consent-wrap .error-msg.visible { display: inline; }
@media (max-width: 640px) {
  .clone-stage { min-height: 220px; margin: 12px 20px; padding: 20px 0; }
  .clone-sample-row { gap: 12px; }
  .clone-sample-meta { padding-left: 0; }
  .creation-actions .clone-consent-wrap { flex: 0 0 auto; width: 100%; }
}

/* 结果：行 + 细线，与配音合成的生成结果一致 */
.design-results-col .creation-results-heading h2 { font-size: 16px; }
.design-results-col .generated-voices { gap: 0; }
.design-results-col .generated-voices:empty { justify-content: center; padding-bottom: 48px; }
.design-results-col .generated-voices:empty::before {
  content: attr(data-empty-label);
  padding: 104px 0 0;
  border: none;
  background-color: transparent;
  background-position: center 0;
  background-size: 88px 88px;
  font-size: 14px;
  line-height: 1.5;
  white-space: normal;
}
.design-results-col .generated-card,
.design-results-col .generated-card:hover,
.design-results-col .generated-card.saved {
  padding: 14px 4px;
  border: none;
  border-top: 1px solid var(--wb-sep);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  transform: none;
}
.design-results-col .generated-card:first-child { border-top: none; }
.design-results-col .generated-card h4 { font-size: 15px; }
.design-results-col .generated-card .saved-badge { margin-left: 0 !important; font-size: 12px; font-weight: 400; }
.design-results-col .generated-card .desc { font-size: 13px; margin: 4px 0 6px; }
.design-results-col .generated-card .generated-status-complete { display: none; }
.design-results-col .generated-card .generated-status-loading { padding: 0; background: none; color: var(--muted); font-weight: 400; font-size: 12px; }
.design-results-col .generated-card .custom-player.is-playing .play-btn { background: var(--accent-soft); color: var(--color-action-primary); }
.design-results-col .generated-card .custom-player .progress-bar { height: 4px; background: var(--wb-sep); }

/* ===== 历史：工具条 + 按天分组的行列表（与生成结果同一套「行 + 细线」） ===== */
#wb-history .history-panel {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}
#wb-history .history-toolbar {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 12px 16px;
  border: none;
  border-bottom: 1px solid var(--wb-sep);
  border-radius: 0;
  background: transparent;
}
#wb-history .history-filter-group { display: flex; flex-wrap: nowrap; gap: 4px; }
#wb-history .history-filter-btn {
  height: 34px;
  padding: 0 14px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--fg);
  font: inherit;
  font-size: 14px;
  font-weight: 400;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .15s, color .15s, transform .1s;
}
#wb-history .history-filter-btn:hover { background: var(--wb-op-1); }
#wb-history .history-filter-btn:active { transform: scale(.97); background: var(--wb-op-2); }
#wb-history .history-filter-btn.active { background: var(--accent-soft); color: var(--color-action-primary); font-weight: 600; }
#wb-history .history-filter-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#wb-history .history-search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 240px;
  max-width: 100%;
  height: 36px;
  margin: 0 0 0 auto;
  padding: 0 12px;
  border-radius: 10px;
  background: var(--wb-op-1);
  color: var(--muted);
  cursor: text;
  transition: background-color .15s, box-shadow .15s;
}
#wb-history .history-search:hover { background: var(--wb-op-2); }
#wb-history .history-search:focus-within { background: var(--input-bg); box-shadow: 0 0 0 1px var(--accent-light) inset, 0 0 0 3px var(--accent-soft); }
#wb-history .history-search input {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  outline: none;
  color: var(--fg);
  font: inherit;
  font-size: 14px;
}
#wb-history .history-search input::placeholder { color: var(--muted); }
#wb-history .history-body { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 420px; }
#wb-history .history-list { flex: 1 1 auto; padding: 8px; }
#wb-history .history-day { padding: 16px 12px 6px; color: var(--muted); font-size: 12px; font-weight: 600; }
#wb-history .history-day:first-child { padding-top: 8px; }
#wb-history .history-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border-radius: 12px;
  transition: background-color .15s;
}
#wb-history .history-row + .history-row::before {
  content: '';
  position: absolute;
  left: 12px;
  right: 12px;
  top: 0;
  height: 1px;
  background: var(--wb-sep);
  transition: opacity .15s;
}
#wb-history .history-row:hover { background: var(--n-75); }
#wb-history .history-row:hover::before,
#wb-history .history-row:hover + .history-row::before { opacity: 0; }
#wb-history .history-play {
  flex: none;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--wb-op-1);
  color: var(--fg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color .15s, color .15s, transform .1s;
}
#wb-history .history-row:hover .history-play { background: var(--wb-op-2); }
#wb-history .history-play:active { transform: scale(.97); }
#wb-history .history-play:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#wb-history .history-row.is-playing .history-play { background: var(--accent-soft); color: var(--color-action-primary); }
#wb-history .history-play:disabled,
#wb-history .history-row:hover .history-play:disabled {
  background: transparent;
  border: 1.5px dashed var(--wb-op-3);
  color: var(--n-300);
  cursor: default;
  transform: none;
}
#wb-history .history-main { flex: 1 1 auto; min-width: 0; }
#wb-history .history-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--fg);
  font-size: 15px;
  line-height: 1.5;
}
#wb-history .history-row.is-expired .history-text { color: var(--muted); }
#wb-history .history-prog {
  display: none;
  height: 3px;
  margin: 8px 0 2px;
  border-radius: 2px;
  background: var(--wb-sep);
  overflow: hidden;
  cursor: pointer;
}
#wb-history .history-row.is-playing .history-prog { display: block; }
#wb-history .history-prog .progress-fill { width: 0; height: 100%; border-radius: inherit; background: var(--accent); }
#wb-history .history-meta {
  display: flex;
  align-items: center;
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
#wb-history .history-meta > * + *::before { content: '·'; margin: 0 6px; color: var(--muted); }
#wb-history .history-meta .history-voice { color: var(--fg); }
#wb-history .history-kind { display: inline-flex; align-items: center; gap: 4px; }
#wb-history .history-meta .time-label { display: none; }
#wb-history .history-row.is-playing .history-meta .time-label { display: inline; }
#wb-history .history-expiring { color: var(--danger); }
#wb-history .history-dl {
  flex: none;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color .15s, color .15s, transform .1s;
}
#wb-history .history-row:hover .history-dl { background: var(--wb-op-2); color: var(--fg); }
#wb-history .history-row .history-dl:hover { background: var(--wb-op-3); }
#wb-history .history-dl:active { transform: scale(.97); }
#wb-history .history-dl:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; color: var(--fg); }
#wb-history .history-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  padding: 12px 16px 12px 20px;
  border-top: 1px solid var(--wb-sep);
}
#wb-history .history-count { margin: 0; color: var(--muted); font-size: 13px; }
#wb-history .history-pages { display: flex; align-items: center; gap: 4px; margin: 0 0 0 auto; }
#wb-history .history-pages button {
  min-width: 32px;
  height: 32px;
  padding: 0 10px;
  border: none;
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
  color: var(--fg);
  font-size: 13px;
}
#wb-history .history-pages button:hover { background: var(--wb-op-1); }
#wb-history .history-pages button.is-current { background: var(--accent-soft); color: var(--color-action-primary); font-weight: 600; }
#wb-history .history-empty {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-height: 420px;
  padding-bottom: 48px;
  color: var(--muted);
  font-size: 14px;
}
#wb-history .history-empty img { width: 88px; height: 88px; }
#wb-history .history-empty-action {
  height: 36px;
  margin-top: -4px;
  padding: 0 16px;
  border: none;
  border-radius: 10px;
  background: var(--wb-op-1);
  color: var(--fg);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  transition: background-color .15s, transform .1s;
}
#wb-history .history-empty-action:hover { background: var(--wb-op-2); }
#wb-history .history-empty-action:active { transform: scale(.97); background: var(--wb-op-3); }
#wb-history .history-empty-action:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (hover: none) {
  #wb-history .history-dl { background: var(--wb-op-1); color: var(--fg); }
}
@media (max-width: 700px) {
  #wb-history .history-toolbar { flex-wrap: wrap; padding: 12px; }
  #wb-history .history-search { width: 100%; margin-left: 0; }
  #wb-history .history-list { padding: 4px; }
  #wb-history .history-day { padding-left: 8px; padding-right: 8px; }
  #wb-history .history-row { gap: 12px; padding: 12px 8px; }
  #wb-history .history-row + .history-row::before { left: 8px; right: 8px; }
  #wb-history .history-meta { flex-wrap: wrap; white-space: normal; }
}

/* ===== 弹窗精修：结构不变，统一间距、字号字重、链接颜色 ===== */
.modal-header { padding: 22px 24px 12px; }
.modal-header h3 { font-size: 18px; font-weight: 600; }
.modal-close { width: 32px; height: 32px; margin-right: -6px; border: none; border-radius: 8px; }
.modal-close:hover { background: var(--vp-op-1, var(--n-100)); border-color: transparent; }
.modal-body { padding: 4px 24px 24px; }
.modal-footer { padding: 14px 24px 18px; gap: 8px; }
.modal-footer .btn-ghost { height: 40px; padding: 0 16px; border-radius: 10px; }
.modal-footer .btn-primary,
.modal-footer .btn-danger { height: 40px; padding: 0 20px; border-radius: 10px; font-weight: 600; }
/* 桃子条：保留，降一点音量 */
.auth-mascot-strip {
  gap: 12px;
  padding: 12px 16px 12px 12px;
  margin-bottom: 20px;
  border-color: rgba(var(--accent-rgb), 0.12);
  background: linear-gradient(135deg, var(--p-50), var(--n-25) 70%);
}
.auth-mascot-strip .ip-mascot { width: 48px; height: 48px; }
.auth-mascot-strip strong { font-size: 15px; font-weight: 600; line-height: 1.4; }
.auth-mascot-strip span { margin-top: 2px; font-size: 13px; line-height: 1.5; }
/* 字段：标签图标缩小调淡；输入框 44px */
.modal .field { margin-bottom: 16px; }
.modal .field label { gap: 6px; margin-bottom: 8px; font-size: 13px; font-weight: 500; color: var(--muted); }
.modal .field label svg,
.modal .field label [data-icon] { width: 14px; height: 14px; opacity: .75; }
.modal .field input:not([type="checkbox"]) { min-height: 44px; padding: 0 14px; border-color: var(--n-200); border-radius: 10px; font-size: 15px; }
.modal .field input::placeholder { color: var(--n-400); }
.modal .field input:focus { border-color: var(--accent-light); box-shadow: 0 0 0 3px var(--accent-soft); }
.modal .password-toggle { color: var(--n-400); }
.modal .password-toggle:hover { color: var(--fg); }
.modal .verification-row .btn-ghost { height: 44px; padding: 0 16px; border-radius: 10px; font-weight: 500; }
.field-label-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.modal .field .field-label-row label { margin-bottom: 0; }
.field-label-row .auth-switch-link {
  padding: 0;
  border: none;
  background: none;
  color: var(--color-action-primary);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.field-label-row .auth-switch-link:hover { text-decoration: underline; text-underline-offset: 2px; }
.field-label-row .auth-switch-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
/* 主按钮与切换链接：链接用深一档的橘红，浅橘对比度不够 */
.modal .btn-primary.btn-full { height: 46px; margin-top: 4px; border-radius: 10px; font-size: 15px; font-weight: 600; }
.auth-switch { margin-top: 16px; font-size: 13px; }
.auth-switch a,
.auth-switch .auth-switch-link,
.modal .agreement-label a,
.recharge-agreement-note a { color: var(--color-action-primary); }
/* 协议勾选：与复刻授权同一个自绘框 */
.modal .field-agreement { margin: 4px 0 16px; }
.modal .agreement-label { display: flex; align-items: center; gap: 8px; font-size: 13px; line-height: 1.5; color: var(--muted); cursor: pointer; }
.modal .agreement-label input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  flex: none;
  width: 18px;
  height: 18px;
  margin: 0;
  border: 1.5px solid var(--n-300);
  border-radius: 5px;
  background: var(--input-bg) no-repeat center / 12px 12px;
  cursor: pointer;
  transition: border-color .15s, background-color .15s, box-shadow .15s;
}
.modal .agreement-label:hover input[type="checkbox"] { border-color: var(--n-400); }
.modal .agreement-label input[type="checkbox"]:checked {
  border-color: var(--color-action-primary);
  background-color: var(--accent-soft);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23c84127' d='M9.171 15.365L19.424 5.112c.703-.635 1.769-.588 2.314.235c.403.609.281 1.363-.192 1.886L10.232 18.547c-.17.154-.283.243-.496.33c-.574.233-1.178.074-1.625-.33L2.454 12.89c-.474-.524-.595-1.277-.192-1.886c.544-.823 1.611-.87 2.313-.235Z'/%3E%3C/svg%3E");
}
.modal .agreement-label input[type="checkbox"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.modal .agreement-label input[type="checkbox"][aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 3px var(--color-danger-soft); }
/* 充值：顶部条与套餐卡片 */
.recharge-checkout-view { gap: 12px; }
.recharge-hero {
  min-height: 0;
  padding: 12px 16px 12px 12px;
  gap: 12px;
  border-color: rgba(var(--accent-rgb), 0.12);
  background: linear-gradient(135deg, var(--p-50), var(--n-25) 70%);
}
.recharge-hero::after,
.recharge-hero-kicker { display: none; }
.recharge-hero-title { font-size: 15px; font-weight: 600; line-height: 1.4; }
.recharge-hero-subtitle { margin-top: 2px; font-size: 13px; line-height: 1.5; }
.recharge-hero-subtitle b { color: var(--fg); font-weight: 600; font-variant-numeric: tabular-nums; }
.recharge-hero-mascot { width: 48px; height: 48px; filter: none; }
.recharge-section-title { margin-top: 4px; font-size: 13px; font-weight: 600; color: var(--muted); }
.recharge-section-title span:last-child { font-size: 12px; font-weight: 400; }
.recharge-grid { gap: 10px; }
.recharge-option { min-height: 92px; padding: 16px; border-color: var(--n-200); border-radius: 12px; background: var(--input-bg); }
.recharge-option:hover { transform: none; box-shadow: none; border-color: var(--n-300); }
.recharge-option::after { display: none; }
.recharge-option.recommended { border-color: var(--n-200); }
.recharge-option.selected { padding: 15.5px; border: 1.5px solid var(--color-action-primary); background: var(--accent-soft); box-shadow: none; }
.recharge-option .amount { font-size: 24px; font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.recharge-option .credits { margin-top: 4px; color: var(--muted); font-size: 14px; font-weight: 500; }
.recharge-option.selected .amount,
.recharge-option.selected .credits { color: var(--color-action-primary); }
.recharge-option .recharge-option-tag {
  top: 10px;
  right: 10px;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--p-100);
  color: var(--color-selected-on-fill);
  font-size: 12px;
  font-weight: 600;
  box-shadow: none;
}
.recharge-option-mascot { width: 52px; height: 52px; filter: none; }
.recharge-option.recommended .recharge-option-mascot { margin-top: 18px; }
@media (max-width: 640px) {
  .modal-header { padding: 20px 18px 10px; }
  .modal-body { padding: 4px 18px 20px; }
  .modal-footer { padding: 12px 18px 18px; }
}
@media (max-width: 420px) {
  .recharge-hero { padding: 10px 12px 10px 10px; }
  .recharge-option { min-height: 88px; padding: 12px; gap: 6px; }
  .recharge-option.selected { padding: 11.5px; }
  .recharge-option .amount { font-size: 22px; }
  .recharge-option .credits { font-size: 13px; white-space: nowrap; }
  .recharge-option-mascot { width: 40px; height: 40px; }
  .recharge-option.recommended .recharge-option-mascot { margin-top: 16px; }
}
/* 右下角的客服、音量按钮层级比弹窗高，弹窗打开时先藏起来，免得压住弹窗底部 */
body:has(.modal-overlay.active) .fab-dock { opacity: 0; visibility: hidden; pointer-events: none; }

/* ===== 顶部导航与页脚精修：结构不变，统一字重、间距、颜色 ===== */
.navbar-right { gap: 8px; }
.credits-badge {
  height: 34px;
  padding: 0 14px;
  gap: 6px;
  border-radius: var(--radius-pill);
  /* 直接压在页面底上，p-50 和页面底几乎同色，所以深一档用 p-100，字配 p-700 */
  background: var(--color-selected-fill);
  color: var(--color-selected-on-fill);
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.credits-badge:hover { background: var(--color-selected-fill-hover); color: var(--color-selected-on-fill); }
.credits-badge svg,
.credits-badge [data-icon] { width: 14px; height: 14px; }
.credits-badge-extra { font-weight: 400; opacity: .95; }
#nav-login-btn { height: 34px; padding: 0 18px; border-radius: 10px; font-weight: 600; }
.user-menu-btn { height: 34px; padding: 0 8px 0 10px; gap: 4px; border-radius: 8px; font-weight: 500; transition: background-color .15s; }
.user-menu-btn .user-menu-caret { width: 14px; height: 14px; color: var(--muted); transition: transform .18s; }
.user-menu-btn:hover,
.user-menu-btn[aria-expanded="true"] { background: var(--color-op-1); }
.user-menu-btn[aria-expanded="true"] .user-menu-caret { transform: rotate(180deg); }
.user-menu-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.user-dropdown {
  top: 42px;
  min-width: 220px;
  padding: 6px;
  border-color: var(--line);
  border-radius: 12px;
  background: var(--input-bg);
  box-shadow: 0 12px 32px rgba(var(--n-800-rgb), .14);
  transform-origin: top right;
}
.user-dropdown.active { animation: userMenuIn .16s cubic-bezier(.2, .8, .2, 1); }
@keyframes userMenuIn { from { opacity: 0; transform: translateY(-6px) scale(.97); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .user-dropdown.active { animation: none; } }
.user-dropdown .dropdown-email { padding: 8px 10px 10px; margin-bottom: 4px; border-bottom-color: var(--color-divider); }
.user-dropdown button { height: 36px; padding: 0 10px; gap: 10px; border-radius: 8px; font-size: 14px; }
.user-dropdown button:hover { background: var(--color-op-1); }
.user-dropdown button svg,
.user-dropdown button [data-icon] { width: 16px; height: 16px; color: var(--muted); }
.user-dropdown .dropdown-divider { margin: 4px 0; background: var(--color-divider); }
.nav-h1 { font-weight: 400; }
@media (max-width: 480px) { .credits-badge-extra { display: none; } }
/* 页脚：只放非关键信息，尽量矮。
   未登录（访客、搜索引擎）：功能、场景、语言三组链接，栏目名和链接排在同一行，桌面三组并成一行、手机每组一行；下面一行是协议、客服、版权和备案。
   已登录：SEO 链接对老用户没用，只留协议那一行。登录状态由 updateUI 写到 .footer.is-signed-in 上。 */
.footer { font-size: 12px; }
.footer-inner { padding-top: 16px; }
.footer-seo { display: flex; flex-wrap: wrap; gap: 6px 36px; }
.footer-col { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.footer-col-title { flex-shrink: 0; margin: 0; font-size: 12px; font-weight: 600; white-space: nowrap; }
.footer-col-links { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.footer-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; }
.footer-seo + .footer-meta { margin-top: 10px; }
/* 版权和备案号是一组，一起换行；页脚够宽时靠右，窄了换到下一行时靠左 */
.footer-inner { container-type: inline-size; }
.footer-owner { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; margin-left: auto; }
@container (max-width: 640px) { .footer-owner { margin-left: 0; } }
.footer-copy,
.footer-icp { font-size: 12px; }
.footer.is-signed-in .footer-seo { display: none; }
.footer.is-signed-in .footer-meta { margin-top: 0; }
.footer a:hover,
.footer-links .contact-support-entry:hover { color: var(--color-action-primary); }
@media (max-width: 640px) {
  .footer-seo { flex-direction: column; gap: 6px; }
  .footer-col { gap: 10px; }
  .footer-col-links { gap: 4px 12px; }
  .footer-seo + .footer-meta { margin-top: 12px; padding-top: 10px; border-top: 1px solid rgba(var(--n-200-rgb), .5); }
  .footer.is-signed-in .footer-meta { margin-top: 0; padding-top: 0; border-top: 0; }
  .footer-links { gap: 2px 14px; }
}
