/* 声音 › 试听台（.vs-*），复用 style.css 的主题变量 */
.vs { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.vs > .card { margin: 0; border-radius: 14px; padding: 20px 22px; }
:root[data-theme="light"] .vs > .card { box-shadow: 0 1px 2px rgba(20, 24, 32, .04), 0 6px 20px rgba(20, 24, 32, .04); }
.vs > .vs-out { position: sticky; top: 8px; max-height: calc(100vh - 140px); display: flex; flex-direction: column; }
#vResults { overflow: auto; margin: 0 -6px; padding: 0 6px 4px; }
.vs-h { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.vs-h h2 { margin: 0; }
.vs-presets { margin-left: auto; }
.vs-presets button, .vs-styles button { font-size: 12px; padding: 3px 10px; }

/* 文本 */
.vs-text { position: relative; border: 1px solid var(--line-2); border-radius: 12px; background: var(--bg-3); transition: border-color .15s, box-shadow .15s; }
.vs-text:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.vs-text textarea { width: 100%; border: 0 !important; background: transparent !important; box-shadow: none !important; resize: vertical; min-height: 104px;
  padding: 14px 16px 6px; font-size: 15px; line-height: 1.75; color: var(--ink); outline: none; }
.vs-tmeta { display: flex; justify-content: space-between; padding: 0 14px 9px; font-size: 12px; color: var(--dim); }
.vs-tmeta #vEst { color: var(--muted); }

/* 读音修正 */
.vs-fix { margin-top: 10px; border-radius: 10px; }
.vs-fix summary { cursor: pointer; font-size: 13px; color: var(--ink); display: flex; align-items: center; gap: 8px; padding: 6px 2px; list-style: none; }
.vs-fix summary::-webkit-details-marker { display: none; }
.vs-fix summary::before { content: "▸"; color: var(--dim); font-size: 11px; transition: transform .15s; }
.vs-fix[open] summary::before { transform: rotate(90deg); }
.vs-fix summary .muted { font-size: 12px; margin-left: 4px; }
.vs-n:not(:empty) { background: var(--accent); color: #fff; border-radius: 999px; font-size: 11px; min-width: 18px; height: 18px; line-height: 18px; text-align: center; padding: 0 5px; }
.vs-fixl { padding: 6px 0 2px 18px; display: flex; flex-direction: column; gap: 6px; }
.vs-fixr { display: grid; grid-template-columns: 1fr auto 1fr auto; gap: 8px; align-items: center; }
.vs-fixr input { height: 32px; }
.vs-fixr > span { color: var(--dim); }
.vs-fixa { display: flex; gap: 10px; align-items: center; font-size: 12px; }

/* 分区 */
.vs-sec { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--line); }
.vs-sec-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.vs-sec-h h3 { margin: 0; font-size: 13.5px; font-weight: 650; color: var(--ink); }
.vs-seg { display: inline-flex; background: var(--bg-3); border: 1px solid var(--line-2); border-radius: 9px; padding: 2px; gap: 2px; }
.vs-seg button { border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 12.5px; padding: 5px 12px; border-radius: 7px; cursor: pointer; transition: all .15s; }
.vs-seg button:hover { color: var(--ink); }
.vs-seg button.on { background: var(--bg-2); color: var(--ink); font-weight: 600; box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.vs-seg.sm button { padding: 4px 11px; }

/* 自动：角色卡 */
.vs-roles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.vs-role { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 12px 14px; border-radius: 12px; cursor: pointer;
  border: 1.5px solid var(--line); background: var(--bg-2); color: var(--ink); font: inherit; transition: border-color .15s, background .15s; min-width: 0; }
.vs-role:hover { border-color: var(--line-2); background: var(--bg-3); }
.vs-role.on { border-color: var(--accent); background: var(--accent-soft); }
.vs-role b { font-size: 13.5px; }
.vs-role > span { font-size: 12px; color: var(--muted); }
.vs-role em { font-style: normal; font-size: 11.5px; color: var(--muted); margin-top: 6px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vs-role em .mono { color: var(--ink); }
.vs-f { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.vs-f .lb { font-size: 12.5px; color: var(--muted); }
.vs-f .lb b { color: var(--accent); font-weight: 650; margin-left: 4px; }
.vs-f select, .vs-f input[type=text] { height: 40px; }

/* 指定模型：通道 */
.vs-lanes { display: flex; flex-direction: column; gap: 8px; }
.vs-lane { display: grid; grid-template-columns: 26px minmax(0, 1.4fr) minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.vs-lt { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; font-weight: 700; font-size: 12px; background: var(--accent-soft); color: var(--accent); flex: none; }
.vs-lt.sm { width: 20px; height: 20px; font-size: 11px; border-radius: 6px; }
.vs-pick { display: flex; align-items: center; gap: 10px; min-width: 0; height: 52px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-2);
  background: var(--bg-3); color: var(--ink); font: inherit; text-align: left; cursor: pointer; transition: border-color .15s, background .15s; }
.vs-pick:hover:not(:disabled) { border-color: var(--accent); }
.vs-pick:disabled { opacity: .5; cursor: not-allowed; }
.vs-pick > span:not(.vs-caps):not(.vs-chev) { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.vs-pick small { font-size: 11px; color: var(--muted); line-height: 1.2; }
.vs-pick b { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vs-pick .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--dim); flex: none; }
.vs-pick .dot.on { background: var(--keep); box-shadow: 0 0 0 3px var(--keep-soft); }
.vs-pick .ic { width: 16px; height: 16px; color: var(--accent); flex: none; }
.vs-caps { display: flex; gap: 4px; flex-wrap: nowrap; overflow: hidden; flex: 0 1 auto; min-width: 0; }
.vs-chev { color: var(--dim); font-size: 11px; flex: none; }
.cap.dim { background: var(--bg-4); color: var(--muted); }
.cap.warn { background: var(--warn-soft); color: var(--warn-ink); }
.vs-add { display: flex; align-items: center; justify-content: center; gap: 6px; height: 42px; border-radius: 10px; border: 1.5px dashed var(--line-2);
  background: transparent; color: var(--ink); font: inherit; font-size: 13px; cursor: pointer; margin-left: 34px; transition: all .15s; }
.vs-add:hover { border-color: var(--accent); background: var(--accent-soft); }
.vs-add .ic { width: 14px; height: 14px; }
.vs-add .muted { font-size: 12px; }

/* 表达 */
.vs-expr { display: grid; grid-template-columns: minmax(0, 1.3fr) auto; gap: 16px; align-items: end; }
.vs-range { display: flex; align-items: center; gap: 10px; height: 40px; font-size: 12px; color: var(--dim); }
.vs-range input[type=range] { flex: 1; accent-color: var(--accent); }
#vInst.dim { opacity: .55; }
.vs-styles { margin-top: 8px; }

/* 生成 */
.vs-go { display: flex; align-items: center; gap: 12px; margin-top: 20px; flex-wrap: wrap; }
.vs-go .btn.lg { height: 44px; padding: 0 22px; font-size: 14.5px; border-radius: 11px; font-weight: 600; gap: 8px; }
.vs-kbd { font-size: 11.5px; color: var(--dim); border: 1px solid var(--line-2); border-radius: 6px; padding: 2px 7px; }
.vs-hint { margin: 12px 0 0; font-size: 12px; }

/* 结果 */
.vs-out-tools { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.vs-run { margin-bottom: 16px; }
.vs-rh { display: flex; gap: 10px; align-items: baseline; justify-content: space-between; font-size: 12px; margin: 0 2px 8px; }
.vs-rt { color: var(--ink); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.vs-rh .muted { flex: none; }
.vs-items { display: flex; flex-direction: column; gap: 8px; }
.vs-item { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--bg-2); transition: border-color .15s; animation: vsIn .2s ease; }
.vs-item:hover { border-color: var(--line-2); }
.vs-item.fav { border-color: color-mix(in srgb, var(--warn) 55%, var(--line)); }
.vs-item.bad { border-color: var(--cut-soft); background: color-mix(in srgb, var(--cut) 5%, var(--bg-2)); }
.vs-item .err { margin: 8px 0 0; }
@keyframes vsIn { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
.vs-ih { display: flex; align-items: center; gap: 8px; min-width: 0; }
.vs-ih > * { flex: none; }
.vs-ih .vs-mdl { flex: 0 1 auto; min-width: 40px; }
.vs-ih .vs-vn { flex: 0 0 auto; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vs-prov { font-size: 12.5px; font-weight: 650; }
.vs-mdl { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vs-vn { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--ink); background: var(--bg-3); border-radius: 999px; padding: 1px 9px 1px 6px; }
.vs-vn .ic { width: 12px; height: 12px; color: var(--accent); }
.vs-acts { margin-left: auto; display: flex; gap: 2px; opacity: .55; transition: opacity .15s; }
.vs-item:hover .vs-acts, .vs-item.fav .vs-acts { opacity: 1; }
.vs-ib { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 7px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 14px; text-decoration: none; }
.vs-ib:hover { background: var(--bg-3); color: var(--ink); }
.vs-ib.on { color: var(--warn); }
.vs-ib svg.ic { width: 16px; height: 16px; } .vs-ib.on svg.ic { fill: currentColor; }
.vs-ib .ic { width: 15px; height: 15px; }
.vs-item audio { width: 100%; height: 36px; margin-top: 10px; }
.vs-words { margin-top: 8px; font-size: 14px; line-height: 1.9; color: var(--muted); }
.vs-words span { cursor: pointer; border-radius: 4px; padding: 1px 0; transition: color .08s, background .08s; }
.vs-words span:hover { color: var(--ink); }
.vs-words span.past { color: var(--ink); }
.vs-words span.on { color: #fff; background: var(--accent); padding: 1px 2px; }
.vs-stats { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 8px; font-size: 11.5px; color: var(--muted); }
.vs-stats b { color: var(--ink); font-weight: 600; }
.vs-item.pending .vs-skel { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.vs-skel span { height: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--bg-3), var(--bg-4), var(--bg-3)); background-size: 200% 100%; animation: vsSh 1.2s linear infinite; }
.vs-skel span:first-child { height: 34px; }
.vs-skel span:last-child { width: 60%; }
@keyframes vsSh { to { background-position: -200% 0; } }

/* 音色选择弹窗 */
.vs-vlist { max-height: 52vh; overflow: auto; border: 1px solid var(--line); border-radius: 10px; margin-top: 10px; }
.vs-vgrp { position: sticky; top: 0; z-index: 1; font-size: 11.5px; font-weight: 600; color: var(--muted); background: var(--bg-3); padding: 6px 12px; border-bottom: 1px solid var(--line); }
.vs-vrow { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.vs-vrow:last-child { border-bottom: 0; }
.vs-vrow:hover { background: var(--bg-3); }
.vs-vrow.cur { background: var(--accent-soft); }
.vs-vb { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.vs-vb b { font-size: 13.5px; }
.vs-vb .muted { flex-basis: 100%; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vs-vb .mono { font-size: 11px; color: var(--dim); }
.vs-av, .vs-play { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none; font-size: 13px; font-weight: 650; }
.vs-av { background: var(--bg-4); color: var(--muted); }
.vs-av.female { background: color-mix(in srgb, #ff7ab6 18%, var(--bg-3)); color: #e2589b; }
.vs-av.male { background: color-mix(in srgb, #4fa3ff 18%, var(--bg-3)); color: #3b8be6; }
.vs-play { border: 0; background: var(--accent-soft); color: var(--accent); cursor: pointer; }
.vs-play .ic { width: 14px; height: 14px; }
.vs-play.playing { background: var(--accent); color: #fff; animation: vsPulse 1s ease infinite; }
@keyframes vsPulse { 50% { box-shadow: 0 0 0 5px var(--accent-soft); } }
.pk-row.cur { background: var(--accent-soft); }

@media (max-width: 1100px) {
  .vs { grid-template-columns: minmax(0, 1fr); }
  .vs > .vs-out { position: static; max-height: none; }
}
@media (max-width: 640px) {
  .vs-lane { grid-template-columns: 24px minmax(0, 1fr) auto; }
  .vs-lane .vs-pv { grid-column: 2; }
  .vs-caps { display: none; }
  .vs-expr { grid-template-columns: minmax(0, 1fr); }
  .vs-presets { margin-left: 0; }
}
