/* ============================================================
   RVC Sound Clone — 样式表
   视觉语言与 image-metadata-cleaner 保持一致：深色单一主题、液态金属背景、
   深色玻璃面板（rgba(13,14,18,.62) + 白色 9% 描边 + backdrop-blur 16px）、
   22px 圆角卡片、近白主 CTA、白字加文字阴影保证可读性。
   内嵌表面统一用白色低透明度叠加（而非黑色），与清除器站一致。
   ============================================================ */

:root {
  /* 底色与玻璃（与 image-metadata-cleaner 同值） */
  --bg: #0a0a0c;
  --glass: rgba(13, 14, 18, 0.62);
  --glass-strong: rgba(16, 17, 22, 0.82);
  --glass-soft: rgba(13, 14, 18, 0.45);
  --line: rgba(255, 255, 255, 0.09);
  --line-soft: rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 255, 255, 0.16);
  --fill: rgba(255, 255, 255, 0.05);

  /* 文字 */
  --ink: #f2f3f6;
  --ink-dim: rgba(233, 236, 242, 0.66);
  --ink-faint: rgba(233, 236, 242, 0.42);
  --ink-ghost: rgba(233, 236, 242, 0.30);

  /* 功能色（与 image-metadata-cleaner 同值） */
  --ok: #3ddc97;
  --warn: #ffce5c;
  --err: #ff7a7a;
  --ok-soft: rgba(61, 220, 151, 0.12);
  --warn-soft: rgba(255, 206, 92, 0.12);
  --err-soft: rgba(255, 122, 122, 0.12);

  /* 圆角：radius-lg 22 / md 14 / sm 9 */
  --r-3xl: 22px;
  --r-2xl: 14px;
  --r-lg: 9px;

  /* 阴影：文字阴影压在液态金属高光上，卡片阴影制造悬浮感 */
  --t-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
  --t-shadow-sm: 0 1px 8px rgba(0, 0, 0, 0.45);
  /* 投影外扩 ≈ blur/2 + offset = 18px，小于卡片间距(18-20px)，相邻卡片阴影不粘连 */
  --card-shadow: 0 8px 20px rgba(0, 0, 0, 0.42);
  --card-shadow-hi: 0 10px 24px rgba(0, 0, 0, 0.5);
  --shadow-toast: 0 12px 32px rgba(0, 0, 0, 0.45);

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Helvetica Neue", "Segoe UI", Roboto, sans-serif;
  --mono: "SF Mono", "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  --topbar-h: 60px;
}

* { box-sizing: border-box; }

/* 滚动条 */
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 99px;
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--ink-faint); background-clip: content-box; }

html, body { margin: 0; padding: 0; min-height: 100%; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* RGB 正弦波背景：fixed 画布，内容全部压在玻璃面板上。
   高度用 lvh（大视口）而不是 100%：移动端地址栏收放会让视口高度变化，
   用 100% 时画布随之重算尺寸、波形被拉伸跳动，看着就像背景在滑；
   lvh 取两种状态中的较大值，可见区域始终稳定。不支持的浏览器回落到 100%。 */
#bgShader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  height: 100lvh;
  z-index: -2;
  display: block;
  pointer-events: none;
}
/* WebGL 不可用时露出底层渐变：近黑底 + 极淡冷色，与波场观感一致 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -3;
  background:
    radial-gradient(1100px 620px at 14% -8%, rgba(90, 120, 170, 0.12), transparent 62%),
    radial-gradient(900px 520px at 92% 4%, rgba(150, 130, 190, 0.09), transparent 60%),
    #0a0a0c;
}

/* 全站链接一律不带下划线（悬停也不加），与 image-metadata-cleaner 一致 */
a, a:hover, a:focus, a:active { color: var(--ink); text-decoration: none; }
a:hover { color: #ffffff; }
::selection { background: rgba(255, 255, 255, 0.28); }

/* ---------------- 启动遮罩 ---------------- */
.boot {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: rgba(10, 10, 12, 0.92);
  backdrop-filter: blur(6px);
  transition: opacity 0.35s ease, visibility 0.35s ease;
}
.boot.hidden { opacity: 0; visibility: hidden; }
.boot-text { color: var(--ink-dim); margin: 0; font-size: 13px; text-shadow: var(--t-shadow-sm); }
.boot-bar {
  width: 190px; height: 3px; border-radius: 99px;
  background: var(--fill); overflow: hidden;
}
.boot-bar span {
  display: block; width: 40%; height: 100%; border-radius: 99px;
  background: rgba(255, 255, 255, 0.85);
  animation: slide 1.15s ease-in-out infinite;
}
@keyframes slide { 0% { transform: translateX(-110%); } 100% { transform: translateX(260%); } }

/* ---------------- 顶栏（对齐个人站：fixed + bg-black/50 + blur-md） ---------------- */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 70;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 24px;
  background: rgba(10, 10, 12, 0.55);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.brand-text strong { font-size: 15px; font-weight: 650; letter-spacing: 0.2px; }
.brand-text strong .dot { color: rgba(255, 255, 255, 0.6); }
.brand-text small { font-size: 11px; color: var(--ink-faint); letter-spacing: 0.02em; }

.engine-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 12px;
  border-radius: var(--r-lg);
  background: var(--fill);
  border: 1px solid var(--line);
  font-size: 12px;
  color: var(--ink-dim);
  max-width: 42vw;
  cursor: pointer;
  transition: background 0.16s ease;
}
.engine-chip:hover { background: rgba(255, 255, 255, 0.16); }
.engine-chip .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--ink-ghost); flex: none;
}
.engine-chip.ok .dot { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.engine-chip.warn .dot { background: var(--warn); box-shadow: 0 0 8px var(--warn); }
.engine-chip.err .dot { background: var(--err); box-shadow: 0 0 8px var(--err); }
.engine-chip span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
/* 图标/文字按钮：与清除器站同型（34px、10px 圆角、4% 白底、9% 描边） */
.icon-btn {
  display: inline-grid;
  place-items: center;
  gap: 6px;
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink-dim);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.1); color: var(--ink); text-decoration: none; }
.icon-btn svg { width: 17px; height: 17px; }

/* ---------------- 布局 ---------------- */
.shell {
  display: grid;
  grid-template-columns: 208px minmax(0, 1fr);
  gap: 22px;
  max-width: 1440px;
  margin: 0 auto;
  padding: calc(var(--topbar-h) + 22px) 24px 64px;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: calc(var(--topbar-h) + 22px);
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px;
  border-radius: var(--r-3xl);
  background: var(--glass);
  border: 1px solid var(--line);
  backdrop-filter: blur(16px);
  box-shadow: var(--card-shadow);
}
.sidebar a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--r-lg);
  color: var(--ink-dim);
  font-size: 13px;
  font-weight: 500;
  transition: background 0.16s ease, color 0.16s ease;
}
.sidebar a:hover { background: rgba(255, 255, 255, 0.10); color: var(--ink); text-decoration: none; }
.sidebar a.active {
  background: rgba(255, 255, 255, 0.1);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}
.sidebar-foot { margin-top: 8px; padding: 8px 12px 2px; border-top: 1px solid var(--line-soft); }

.view { min-width: 0; display: flex; flex-direction: column; gap: 20px; }

/* 内容块入场：opacity + y:30 上浮。延迟不写死 nth-child——四个视图的挂载结构
   不一样（help 整页裹在 .doc 里、convert 多套一层 .grid、models 套两层），
   按 .view > * 猜层级只能命中外壳，卡片本身一动不动的。改由 app.js 的
   staggerEnter() 按 DOM 顺序把延迟写进 --enter-delay，并打上 .enter。
   只标路由初始渲染出来的块，交互中动态加进来的卡片不会突然淡入。 */
.view .enter { animation: rise 0.5s cubic-bezier(0.2, 0.8, 0.3, 1) both; animation-delay: var(--enter-delay, 0s); }
@keyframes rise { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: none; } }

/* ---------------- 卡片：rounded-3xl 玻璃 ---------------- */
/* 卡片投影刻意收敛：外扩 ≈ blur/2 + offset = 14px，小于 18px 的卡片间距，
   相邻卡片的阴影不会互相粘连（液态金属背景上尤其明显） */
.card {
  position: relative;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--r-3xl);
  padding: 22px;
  backdrop-filter: blur(16px);
  box-shadow: var(--card-shadow);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.card:hover { border-color: var(--line-strong); box-shadow: var(--card-shadow-hi); }

.card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.01em;
  text-shadow: var(--t-shadow-sm);
}
.card-title .num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px; height: 24px;
  border-radius: var(--r-lg);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  font-size: 12px; font-weight: 700;
  font-variant-numeric: tabular-nums;
  flex: none;
}
.card-sub { margin: 0 0 14px; color: var(--ink-dim); font-size: 12.5px; }

h1.page-title {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 2px 0 6px;
  text-shadow: var(--t-shadow);
}
p.lead { margin: 0; color: var(--ink-dim); text-shadow: var(--t-shadow-sm); }

.grid { display: grid; gap: 18px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.convert { grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); align-items: stretch; }
/* 第一张卡与右侧参数卡等高：内部改为纵向 flex，队列区吃掉剩余高度，
   否则卡片下方会空出一块，页面右下角显得稀 */
.grid.convert > .card-fill { display: flex; flex-direction: column; }
.grid.convert > .card-fill > .file-list { flex: 1 1 auto; min-height: 168px; }
.grid.convert > .card-fill > .file-list > .empty-state { flex: 1; align-content: center; }
/* 转换结果卡横跨整行：给波形留出宽度 */
.grid.convert > .card-wide { grid-column: 1 / -1; }

/* 参数卡内部横向排布：目标音色 | 快速预设 并排 */
.param-inline { display: flex; flex-wrap: wrap; gap: 12px 22px; align-items: flex-start; }
/* 基准宽度之和要小于一行可用宽度，否则两个块会被挤到两行 */
.param-inline > .field-block { flex: 1 1 200px; min-width: 0; }
.param-inline > .field-block:last-child { flex: 1.4 1 230px; }

/* 五个参数滑块横向并排，宽屏一行放下，窄屏自动换行 */
.sliders-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  gap: 12px 18px;
}
.sliders-row .slider-row { min-width: 0; }

.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.tight { gap: 6px; }
.muted { color: var(--ink-dim); }
.faint { color: var(--ink-faint); font-size: 12px; }
.mono { font-family: var(--mono); font-size: 12px; }
.hidden { display: none !important; }

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 36px;
  padding: 0 15px;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink-dim);
  font: inherit;
  font-size: 13.5px;
  font-weight: 550;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, transform 0.12s ease, opacity 0.15s ease;
  white-space: nowrap;
}
.btn:hover:not(:disabled) { background: rgba(255, 255, 255, 0.1); color: var(--ink); }
.btn:active:not(:disabled) { transform: scale(0.98); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
/* 主 CTA：近白底深色字，与 image-metadata-cleaner 的 .btn-primary 一致 */
.btn.primary {
  border-color: transparent;
  background: #f2f3f6;
  color: #0a0a0c;
  font-weight: 600;
}
.btn.primary:hover:not(:disabled) { background: #ffffff; }
.btn.danger { border-color: rgba(255, 122, 122, 0.4); color: var(--err); }
.btn.danger:hover:not(:disabled) { background: var(--err-soft); }
.btn.ghost { border-color: var(--line); color: var(--ink-dim); }
.btn.ghost:hover:not(:disabled) { color: var(--ink); }
.btn.sm { height: 30px; padding: 0 11px; font-size: 12px; }
.btn.lg { height: 46px; padding: 0 24px; font-size: 14.5px; border-radius: var(--r-2xl); }
.btn.block { width: 100%; }
.btn[aria-pressed="true"] {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--line-strong);
  color: var(--ink);
}

select,
input[type="text"],
input[type="number"],
input[type="url"],
input[type="search"] {
  height: 36px;
  padding: 0 12px;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
  font: inherit;
  font-size: 13.5px;
  width: 100%;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}
select:focus, input:focus, textarea:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.55);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.12);
}
select { cursor: pointer; }
option { background: #14151a; color: var(--ink); }

label.field { display: block; }
label.field > .label,
.field-label {
  display: block;
  font-size: 12px;
  color: var(--ink-dim);
  margin-bottom: 6px;
  font-weight: 500;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 22px;
  background: transparent;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 4px; border-radius: 99px; background: rgba(255, 255, 255, 0.22);
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 15px; height: 15px; margin-top: -6px;
  border-radius: 50%;
  background: #f4f5f7;
  border: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}
input[type="range"]::-moz-range-track { height: 4px; border-radius: 99px; background: rgba(255, 255, 255, 0.22); }
input[type="range"]::-moz-range-thumb { width: 13px; height: 13px; border-radius: 50%; background: #f4f5f7; border: none; }

/* 滑块行 */
.slider-row { display: grid; gap: 2px; }
.slider-head { display: flex; align-items: baseline; gap: 8px; }
.slider-head .name { font-size: 12.5px; color: var(--ink-dim); font-weight: 500; }
.slider-head .val { margin-left: auto; font-family: var(--mono); font-size: 12px; color: var(--ink); }
.slider-hint { font-size: 11.5px; color: var(--ink-ghost); margin-bottom: 2px; }

/* ---------------- 上传 / 拖拽 ---------------- */
.dropzone {
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--r-2xl);
  padding: clamp(26px, 6vw, 46px) 20px;
  text-align: center;
  color: var(--ink-dim);
  background: rgba(255, 255, 255, 0.025);
  transition: border-color 0.18s ease, background 0.18s ease;
  cursor: pointer;
}
.dropzone:hover, .dropzone.drag {
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
}
/* 图标盒：与清除器站 .dz-icon 同型（52px 圆角方块） */
.dropzone .dz-icon {
  width: 52px; height: 52px;
  border-radius: 16px;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  color: #e8ebf1;
  font-size: 24px; line-height: 1;
  margin: 0 auto 10px;
}
.dropzone strong { color: var(--ink); font-weight: 600; }
.dropzone small { display: block; margin-top: 4px; font-size: 11.5px; color: var(--ink-ghost); }

/* ---------------- 录音器 ---------------- */
.recorder {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--r-2xl);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}
/* 录音按钮：白底圆形图标按钮，文字放在旁边的 .rec-label，避免溢出圆形 */
.rec-btn {
  width: 46px; height: 46px;
  min-width: 46px;
  flex: none;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: #f2f3f6;
  color: #0a0a0c;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
  transition: transform 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}
.rec-btn:hover { transform: scale(1.06); background: #ffffff; }
.rec-btn:active { transform: scale(0.97); }
.rec-btn.recording {
  background: #f2f3f6;
  color: #0a0a0c;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.18), 0 6px 20px rgba(0, 0, 0, 0.45);
  animation: pulse-rec 1.4s ease-in-out infinite;
}
@keyframes pulse-rec {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.35), 0 6px 20px rgba(0, 0, 0, 0.45); }
  50% { box-shadow: 0 0 0 9px rgba(255, 255, 255, 0), 0 6px 20px rgba(0, 0, 0, 0.45); }
}
/* 按钮右侧：状态文字在上、计时在下，再下面是电平条 */
.rec-head {
  display: flex; align-items: baseline; gap: 8px;
  margin-bottom: 6px;
}
.rec-label {
  font-size: 13px; font-weight: 600; color: var(--ink);
  text-shadow: var(--t-shadow-sm);
}
.meter { flex: 1; min-width: 0; }
.meter-track { height: 5px; border-radius: 99px; background: rgba(255, 255, 255, 0.18); overflow: hidden; }
.meter canvas { display: block; width: 100%; height: 18px; margin-top: 5px; }
.meter-fill {
  height: 100%; width: 0%; border-radius: 99px;
  background: #f2f3f6;
  transition: width 0.07s linear;
}
.rec-time { font-family: var(--mono); font-size: 12.5px; color: var(--ink-dim); margin-left: auto; }
/* 逼近最长时长：最后 10 秒转告红色，提示马上会自动停 */
.rec-time.warn { color: var(--warn); }

/* ---------------- 波形 / 播放器 ---------------- */
.wave {
  position: relative;
  width: 100%;
  height: 96px;
  border-radius: var(--r-2xl);
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--line);
  overflow: hidden;
}
.wave canvas { display: block; width: 100%; height: 100%; }
.wave .playhead { position: absolute; top: 0; bottom: 0; width: 2px; background: #f2f3f6; left: 0; pointer-events: none; }
.wave-empty {
  display: flex; align-items: center; justify-content: center;
  height: 100%; color: var(--ink-ghost); font-size: 12.5px;
}

.player { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.play-btn {
  width: 40px; height: 40px; border-radius: 50%;
  border: none; cursor: pointer; flex: none;
  background: #f2f3f6; color: #0a0a0c;
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform 0.16s ease, background 0.16s ease;
}
.play-btn:hover { transform: scale(1.06); background: #ffffff; }
.player .time { font-family: var(--mono); font-size: 12px; color: var(--ink-dim); }

/* ---------------- 文件列表 ---------------- */
.file-list { display: flex; flex-direction: column; gap: 7px; margin-top: 12px; }
.file-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 11px; border-radius: var(--r-2xl);
  background: rgba(255, 255, 255, 0.028);
  border: 1px solid var(--line);
  transition: border-color 0.16s ease, background 0.16s ease;
}
.file-item:hover { border-color: var(--line-strong); }
.file-item.selected { border-color: rgba(255, 255, 255, 0.5); background: rgba(255, 255, 255, 0.10); }
.file-item .fi-body {
  flex: 1; min-width: 0; cursor: pointer; text-align: left;
  background: none; border: none; color: inherit; font: inherit; padding: 0;
}
.file-item .fi-play {
  width: 26px; height: 26px; border-radius: 50%;
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.05);
  color: var(--ink-dim); display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; flex: none; font-size: 11px; transition: 0.16s ease;
}
.file-item .fi-play:hover { color: var(--ink); background: rgba(255, 255, 255, 0.12); }
.file-item .fi-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; }
.file-item .fi-meta { font-family: var(--mono); font-size: 11px; color: var(--ink-ghost); }
.file-item .fi-dur { font-family: var(--mono); font-size: 11.5px; color: var(--ink-dim); }

/* ---------------- 表格 ---------------- */
.table-wrap { overflow-x: auto; border-radius: var(--r-2xl); border: 1px solid var(--line); }
/* 标签行与表格之间留出距离，避免视觉上粘连成一块 */
.row.tight + .table-wrap { margin-top: 12px; }
table.data { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.data th {
  text-align: left; padding: 10px 14px; white-space: nowrap;
  background: rgba(255, 255, 255, 0.05); color: var(--ink-dim); font-weight: 600;
  border-bottom: 1px solid var(--line);
}
table.data td { padding: 10px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
table.data tr:last-child td { border-bottom: none; }
table.data tbody tr:hover { background: rgba(255, 255, 255, 0.06); }
table.data td.mono, table.data th.mono { font-variant-numeric: tabular-nums; }

/* ---------------- 徽章 / 提示 ---------------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: 999px;
  background: var(--fill); border: 1px solid var(--line);
  color: var(--ink-dim); font-size: 11px; white-space: nowrap; font-weight: 500;
}
.badge.ok { background: var(--ok-soft); color: #8ff0c6; border-color: rgba(61, 220, 151, 0.35); }
.badge.warn { background: var(--warn-soft); color: #ffd98a; border-color: rgba(255, 206, 92, 0.35); }
.badge.err { background: var(--err-soft); color: #ffb3b3; border-color: rgba(255, 122, 122, 0.4); }
.badge.brand { background: rgba(255, 255, 255, 0.1); color: var(--ink); border-color: var(--line-strong); }

.notice {
  display: flex; gap: 10px;
  padding: 12px 14px; border-radius: var(--r-2xl);
  background: rgba(255, 255, 255, 0.028); border: 1px solid var(--line);
  font-size: 12.5px; color: var(--ink-dim);
}
.notice .ico { flex: none; font-size: 15px; line-height: 1.4; }
.notice.info { border-color: var(--line-strong); background: rgba(255, 255, 255, 0.06); }
.notice.warn { border-color: rgba(255, 206, 92, 0.35); background: var(--warn-soft); }
.notice.err { border-color: rgba(255, 122, 122, 0.4); background: var(--err-soft); }
.notice strong { color: var(--ink); }

/* ---------- 卡片内纵向节奏 ---------- */
/* 1) 标题行（.row）与紧随的内容之间：12px。
      不设这条时，卡片标题和下面第一块内容是 0 间距，肉眼看着贴边 */
.card > .row + * { margin-top: 12px; }

/* 2) 卡片内 加粗标题 与说明文字 */
.card > strong + .faint,
.card > strong + p { margin-top: 6px; }

/* 2b) 参数卡：目标音色行 与 滑块行 之间 */
.card > .param-inline + .sliders-row { margin-top: 16px; }

/* 3) 提示/表格/拖拽区 紧跟按钮时，避免「警告条 + 大按钮」贴在一起 */
.card > .notice + .btn,
.card > .notice + .row,
.card > .table-wrap + .btn,
.card > .dropzone + .btn,
.card > .kbd-hints + .btn,
.card > .empty-state + .btn { margin-top: 14px; }

.progress { height: 5px; border-radius: 99px; background: rgba(255, 255, 255, 0.16); overflow: hidden; }
.progress > span { display: block; height: 100%; width: 0%; border-radius: 99px; background: #f2f3f6; transition: width 0.2s ease; }
.progress.indeterminate > span { width: 30%; animation: indet 1.1s ease-in-out infinite; }
@keyframes indet { 0% { margin-left: -32%; } 100% { margin-left: 100%; } }

.spinner {
  width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-top-color: currentColor;
  animation: spin 0.75s linear infinite;
  display: inline-block; vertical-align: -2px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------- Toast ---------------- */
.toasts {
  position: fixed; right: 20px; bottom: 20px; z-index: 120;
  display: flex; flex-direction: column; gap: 8px; max-width: min(360px, 86vw);
}
.toast {
  display: flex; gap: 9px; align-items: flex-start;
  padding: 9px 16px; border-radius: 12px;
  background: var(--glass-strong);
  border: 1px solid var(--line-strong);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow-toast);
  font-size: 13px;
  animation: toast-in 0.22s ease;
}
.toast.out { animation: toast-out 0.25s ease forwards; }
.toast .t-ico { flex: none; font-weight: 700; }
.toast.ok .t-ico { color: var(--ok); }
.toast.err .t-ico { color: var(--err); }
.toast.warn .t-ico { color: var(--warn); }
.toast .t-body { flex: 1; min-width: 0; }
.toast .t-title { font-weight: 650; color: var(--ink); }
.toast .t-msg { color: var(--ink-dim); word-break: break-word; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px) scale(0.97); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(20px); } }

/* ---------------- 模态框 ---------------- */
.modal-root:empty { display: none; }
.modal-backdrop {
  position: fixed; inset: 0; z-index: 130;
  background: rgba(8, 9, 13, 0.7);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: fade 0.18s ease;
}
@keyframes fade { from { opacity: 0; } }
.modal {
  width: min(560px, 100%); max-height: 86vh; overflow: auto;
  background: rgba(16, 17, 22, 0.92);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-3xl);
  box-shadow: var(--shadow-toast);
  backdrop-filter: blur(18px);
  animation: modal-in 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
@keyframes modal-in { from { opacity: 0; transform: translateY(14px) scale(0.97); } }
.modal-head {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: rgba(16, 17, 22, 0.92);
}
.modal-head h3 { margin: 0; font-size: 15px; font-weight: 650; }
.modal-body { padding: 20px; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; }

/* ---------------- 骨架屏 ---------------- */
.skeleton-card {
  height: 150px; border-radius: var(--r-3xl);
  background: linear-gradient(90deg, rgba(255,255,255,0.05) 25%, rgba(255,255,255,0.12) 37%, rgba(255,255,255,0.05) 63%);
  background-size: 400% 100%;
  animation: skel 1.3s ease infinite;
  border: 1px solid var(--line);
}
@keyframes skel { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

/* ---------------- 预设 chips ---------------- */
.presets { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; }
.preset {
  display: inline-flex; align-items: center; gap: 5px;
  height: 28px; padding: 0 12px;
  border-radius: 999px;
  border: 1px dashed var(--line-strong);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink-dim);
  font: inherit; font-size: 12px; font-weight: 500;
  cursor: pointer; transition: 0.16s ease;
}
.preset:hover { border-style: solid; border-color: rgba(255,255,255,0.3); background: rgba(255,255,255,0.08); color: var(--ink); }
.preset.active {
  border-style: solid; border-color: transparent;
  background: #f2f3f6; color: #0a0a0c; font-weight: 600;
}

/* ---------------- 空状态 ---------------- */
.empty-state {
  display: grid; justify-items: center; gap: 6px;
  padding: 28px 16px;
  border-radius: var(--r-2xl);
  border: 1px dashed var(--line-strong);
  color: var(--ink-ghost);
  text-align: center; font-size: 12.5px;
}
.empty-state .es-icon { font-size: 22px; opacity: 0.75; }
.empty-state strong { color: var(--ink-dim); font-weight: 600; }

/* ---------------- 快捷键提示 ---------------- */
.kbd-hints {
  display: flex; flex-wrap: wrap; gap: 12px;
  margin: 12px 0; padding-top: 12px;
  border-top: 1px dashed var(--line);
  font-size: 11.5px; color: var(--ink-ghost);
}
.kbd-hints kbd {
  font-family: var(--mono); font-size: 11px;
  border: 1px solid var(--line-strong); border-bottom-width: 2px;
  border-radius: 5px; padding: 1px 6px; background: rgba(255,255,255,0.05); color: var(--ink-dim);
}

/* ---------------- 模型明细 ---------------- */
.file-detail { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.file-detail .chip {
  font-family: var(--mono); font-size: 11px;
  padding: 2px 9px; border-radius: 8px;
  background: rgba(255,255,255,0.05); border: 1px solid var(--line);
  color: var(--ink-dim);
}
.file-detail .chip.ok { color: #8ff0c6; border-color: rgba(61,220,151,0.35); }

/* ---------------- 帮助页步骤条 ---------------- */
.steps-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 6px 0 8px; }
.step-card {
  padding: 14px;
  border-radius: var(--r-2xl);
  border: 1px solid var(--line);
  background: var(--glass-soft);
  backdrop-filter: blur(14px);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.step-card:hover { transform: translateY(-2px); border-color: var(--line-strong); box-shadow: var(--card-shadow); }
.step-card .sc-num { font-family: var(--mono); font-size: 11px; color: var(--ink-faint); letter-spacing: 0.08em; }
.step-card .sc-title { font-weight: 650; font-size: 13px; margin: 3px 0 4px; }
.step-card .sc-desc { font-size: 12px; color: var(--ink-dim); }

/* ---------------- 文档 ---------------- */
.doc h2 { font-size: 16px; margin: 24px 0 8px; font-weight: 650; text-shadow: var(--t-shadow-sm); }
.doc h3 { font-size: 13.5px; margin: 16px 0 6px; color: var(--ink); }
.doc p, .doc li { color: var(--ink-dim); font-size: 13px; }
.doc ul { margin: 6px 0; padding-left: 20px; }
.doc code {
  font-family: var(--mono); font-size: 12px;
  background: rgba(255,255,255,0.05); padding: 2px 6px; border-radius: 5px; color: var(--ink);
  border: 1px solid var(--line);
}
.doc pre {
  background: rgba(255,255,255,0.04); border: 1px solid var(--line);
  border-radius: var(--r-2xl); padding: 14px 16px; overflow: auto;
  font-size: 12px; line-height: 1.55;
}
.doc pre code { background: none; padding: 0; border: none; }
.doc kbd {
  font-family: var(--mono); font-size: 11.5px;
  border: 1px solid var(--line-strong); border-bottom-width: 2px;
  border-radius: 5px; padding: 1px 6px; background: rgba(255,255,255,0.05); color: var(--ink);
}
.anchor-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 4px; }
.anchor-list a {
  padding: 4px 11px; border-radius: 999px; font-size: 12px;
  background: rgba(255,255,255,0.04); border: 1px solid var(--line); color: var(--ink-dim);
  transition: 0.16s ease;
}
.anchor-list a:hover { color: var(--ink); border-color: var(--line-strong); text-decoration: none; background: rgba(255,255,255,0.08); }

/* ---------------- 404 ---------------- */
.page-404 { display: grid; place-items: center; min-height: 100vh; text-align: center; }
.wrap-404 { display: grid; gap: 10px; justify-items: center; }
.wrap-404 h1 { font-size: 56px; margin: 0; letter-spacing: 2px; font-weight: 700; }
.wrap-404 p { color: var(--ink-dim); margin: 0 0 8px; }

.noscript {
  position: fixed; inset: auto 0 0 0; padding: 12px; text-align: center;
  background: var(--err); color: #fff; font-size: 13px; z-index: 200;
}

/* ---------------- 响应式 ---------------- */
@media (max-width: 1080px) {
  .grid.convert { grid-template-columns: minmax(0, 1fr); }
  .steps-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); padding: calc(var(--topbar-h) + 14px) 14px 48px; }
  .sidebar { position: static; flex-direction: row; overflow-x: auto; gap: 6px; padding: 8px; border-radius: var(--r-2xl); }
  .sidebar a { flex: none; }
  .sidebar-foot { display: none; }
  .brand-text small { display: none; }
  .grid.cols-2 { grid-template-columns: minmax(0, 1fr); }
  .engine-chip { display: none; }
  .topbar { padding: 0 14px; }
  /* 移动端把面板模糊从 16px 降到 6px：全屏 shader + 高模糊在手机 GPU 上很贵，
     滚动时会卡；面板本身 62% 的深色底已保证文字可读 */
  .card, .step-card, .sidebar {
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .view .enter { animation: none; }
}
