/* ============================================================
   润石语音工坊 · 黑 / 高级灰 / 淡黄（60-30-10）
   60% 暖纸灰白底 · 30% 墨黑骨架（侧栏/主按钮）· 10% 淡黄点缀
   ============================================================ */
:root {
  --bg: #F6F4EF;             /* 暖纸白（大面积） */
  --card: #FFFFFF;
  --inner: #F5F2EA;
  --border: #E8E4DB;
  --border-2: #D9D4C8;
  --text: #1D1B16;
  --text-2: #57534A;
  --text-dim: #7F7A6E;
  --ink: #17150F;            /* 主黑 */
  --ink-2: #26231C;          /* 黑·悬停 */
  --ink-line: #3A362C;
  --accent: #F5DFA0;         /* 淡黄 */
  --accent-deep: #C9A24B;    /* 蜜金（描边/小元素） */
  --accent-ink: #6B5314;     /* 深金（可读文字/链接） */
  --accent-soft: #FBF4DE;    /* 淡黄·浅底 */
  --ok: #2F6B3C;
  --ok-bg: #E9F1E9;
  --warn: #8A6A1F;
  --warn-bg: #FBF3DC;
  --err: #B3362A;
  --err-bg: #F9E9E7;
  --info: var(--ink);
  --info-bg: var(--accent);
  --gray-bg: #EFEBE2;
  --shadow-sm: 0 1px 2px rgba(29, 27, 22, 0.05);
  --shadow-md: 0 6px 24px rgba(29, 27, 22, 0.09);
  --shadow-lg: 0 16px 48px rgba(29, 27, 22, 0.16);
  --radius: 14px;
}
* { box-sizing: border-box; }
::selection { background: var(--accent); color: var(--ink); }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, "Segoe UI", "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; }
p { margin: 0; }

/* ============================================================ 登录页 */
.auth-wrap {
  display: flex;
  min-height: 100vh;
}
.auth-hero {
  position: relative;
  flex: 1.15;
  display: flex;
  align-items: center;
  justify-content: center;
  background: url("/assets/login-bg.svg") center/cover no-repeat, #15130F;
  overflow: hidden;
}
.hero-content { position: relative; z-index: 2; max-width: 560px; padding: 48px 56px; color: #F3F0E8; }
.hero-brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 17px; font-weight: 700; letter-spacing: 1px;
  background: rgba(245, 223, 160, 0.08);
  border: 1px solid rgba(245, 223, 160, 0.35);
  padding: 8px 18px; border-radius: 999px;
  backdrop-filter: blur(6px);
}
.hero-logo { display: inline-flex; }
.hero-title {
  margin: 34px 0 18px;
  font-size: 42px; line-height: 1.32; font-weight: 800; letter-spacing: 1px; color: #FBF9F4;
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}
.hero-sub { font-size: 15px; line-height: 1.9; color: rgba(243, 240, 232, 0.82); }
.hero-features { list-style: none; margin: 40px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 18px 24px; }
.hero-features li { display: flex; gap: 10px; align-items: flex-start; }
.hero-features b { display: block; font-size: 14px; color: #FBF9F4; }
.hero-features li span:not(.hf-check) { font-size: 12px; color: rgba(243, 240, 232, 0.6); }
.hf-check {
  flex: none; width: 20px; height: 20px; margin-top: 2px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(245, 223, 160, 0.14); border: 1px solid rgba(245, 223, 160, 0.55);
  color: var(--accent);
  border-radius: 50%; font-size: 11px;
}
.hero-cards { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.float-card {
  position: absolute; display: flex; gap: 10px; align-items: center;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(245, 223, 160, 0.22);
  backdrop-filter: blur(8px);
  border-radius: 12px; padding: 10px 14px; color: #F3F0E8;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
  animation: floaty 6s ease-in-out infinite;
}
.float-card b { display: block; font-size: 14px; }
.float-card span { font-size: 12px; color: rgba(243, 240, 232, 0.65); }
.fc-icon { font-size: 19px; }
.fc-a { right: 4%; top: 13%; }
.fc-b { right: 4%; bottom: 9%; animation-delay: 3s; }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
.hero-footer {
  position: absolute; bottom: 22px; left: 0; right: 0; z-index: 2;
  text-align: center; font-size: 12px; color: rgba(243, 240, 232, 0.42);
}

.auth-panel {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  background: #fff; padding: 40px;
}
.auth-card { width: 100%; max-width: 380px; }
.auth-card h2 { font-size: 26px; font-weight: 800; }
.auth-sub { margin: 8px 0 30px; color: var(--text-2); font-size: 13px; }

.field { display: block; margin-bottom: 18px; }
.field-label { display: block; margin-bottom: 7px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.field-box {
  display: flex; align-items: center; gap: 8px;
  background: var(--inner); border: 1.5px solid var(--border);
  border-radius: 10px; padding: 0 12px; transition: 0.15s;
}
.field-box:focus-within { border-color: var(--accent-deep); background: #fff; box-shadow: 0 0 0 3px rgba(201, 162, 75, 0.18); }
.field-box input { flex: 1; background: none; border: none; outline: none; padding: 11px 0; font-size: 14px; color: var(--text); }
.field-icon { flex: none; width: 18px; height: 18px; color: var(--text-dim); }
.pw-toggle { flex: none; background: none; border: none; color: var(--text-dim); cursor: pointer; padding: 4px; display: inline-flex; }
.pw-toggle:hover { color: var(--accent-ink); }
.pw-toggle svg { width: 17px; height: 17px; }
.form-error { color: var(--err); font-size: 13px; min-height: 20px; margin: 2px 0 12px; }
.auth-alt { text-align: center; margin-top: 18px; font-size: 13px; color: var(--text-2); }
.linklike { background: none; border: none; color: var(--accent-ink); font-weight: 600; cursor: pointer; font-size: 13px; padding: 0; }
.linklike:hover { text-decoration: underline; }
.auth-legal { text-align: center; margin-top: 34px; font-size: 12px; color: var(--text-dim); }

/* 矮视口下压缩品牌区留白，避免特性列表贴边裁切 */
@media (max-height: 780px) {
  .hero-content { padding: 32px 48px; }
  .hero-title { font-size: 34px; margin: 24px 0 14px; }
  .hero-features { margin-top: 26px; gap: 14px 22px; }
  .hero-sub { font-size: 14px; }
}

/* ============================================================ 应用框架 */
#app-shell { display: flex; min-height: 100vh; }
#sidebar {
  width: 232px; flex: none;
  background: var(--ink);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 20px 18px; }
.brand-logo {
  flex: none; width: 38px; height: 38px; border-radius: 11px;
  background: var(--accent); display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35);
}
.brand-text b { display: block; font-size: 15px; letter-spacing: 0.5px; color: #FBF9F4; }
.brand-text span { font-size: 11px; color: #8B867A; }

#nav { flex: 1; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; }
#nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 14px; border-radius: 10px;
  color: #B9B4A8; text-decoration: none; font-weight: 500; font-size: 14px;
  position: relative; transition: 0.15s;
}
#nav a svg { width: 18px; height: 18px; }
#nav a:hover { color: #F3F0E8; background: rgba(255, 255, 255, 0.07); }
#nav a.active { color: var(--ink); background: var(--accent); font-weight: 700; }
#nav a.active svg { color: var(--ink); }
#nav a.active::before {
  content: ""; position: absolute; left: -12px; top: 20%; bottom: 20%;
  width: 3px; border-radius: 2px; background: var(--accent-deep);
}
.sidebar-foot { padding: 14px; border-top: 1px solid rgba(255, 255, 255, 0.09); }
.userbox { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  background: var(--accent); color: var(--ink); font-weight: 700; font-size: 14px;
  display: inline-flex; align-items: center; justify-content: center;
}
.user-meta { flex: 1; min-width: 0; }
.user-meta b { display: block; font-size: 13px; color: #FBF9F4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-meta span { font-size: 11px; color: #8B867A; }
.icon-btn {
  background: none; border: 1px solid rgba(255, 255, 255, 0.3); border-radius: 8px;
  width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center;
  color: #CFC9BC; cursor: pointer;
}
.icon-btn:hover { color: #FF9D91; border-color: #FF9D91; background: rgba(179, 54, 42, 0.18); }
.icon-btn svg { width: 15px; height: 15px; }

#main { flex: 1; padding: 28px 32px 60px; max-width: 1160px; min-width: 0; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h2 { font-size: 22px; font-weight: 800; }
.page-head p { margin-top: 6px; color: var(--text-2); font-size: 13px; }
.page-actions select { width: 130px; }

/* ============================================================ 卡片与表单 */
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px; margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}
.card-inner { background: var(--inner); border: 1px solid var(--border); border-radius: 12px; padding: 16px; }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; gap: 10px; flex-wrap: wrap; }
.card-head h3 { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.ch-dot { width: 8px; height: 8px; border-radius: 3px; background: var(--accent-deep); display: inline-block; }

/* 当前选中音色徽标（声音与参数卡片头） */
.selected-voice {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--accent-soft); border: 1px solid var(--accent-deep);
  border-radius: 999px; padding: 4px 12px 4px 5px;
  font-size: 12.5px; font-weight: 600; color: var(--ink);
  max-width: 200px;
}
.selected-voice .sv-avatar {
  width: 22px; height: 22px; border-radius: 50%; flex: none;
  background: var(--accent); color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center;
}
.selected-voice .sv-avatar svg { width: 12px; height: 12px; }
.selected-voice .sv-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.selected-voice .sv-tag {
  font-size: 10px; color: var(--accent-ink); background: #fff;
  border: 1px solid var(--accent-deep); border-radius: 4px; padding: 0 4px; flex: none;
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.hint { color: var(--text-dim); font-size: 12px; font-weight: normal; }
.hint.warn-text { color: var(--warn); }
.mt { margin-top: 16px; }
.mt8 { margin-top: 8px; }

label.lbl { display: flex; justify-content: space-between; align-items: center; margin-bottom: 7px; font-weight: 600; font-size: 13px; color: var(--text); }
input[type=text], input:not([type]), textarea, select {
  width: 100%; padding: 10px 12px;
  background: var(--inner); color: var(--text);
  border: 1.5px solid var(--border); border-radius: 10px;
  font-size: 14px; font-family: inherit; transition: 0.15s;
}
textarea { resize: vertical; line-height: 1.8; background: #fff; }
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--accent-deep); background: #fff;
  box-shadow: 0 0 0 3px rgba(201, 162, 75, 0.18);
}
input[type=range] { width: 100%; accent-color: var(--accent-deep); padding: 0; border: none; background: none; }
input[type=range]:focus { box-shadow: none; }
.range-marks { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-dim); margin-top: 2px; }
input[type=number] { width: 88px; padding: 7px 9px; }
.row { display: flex; align-items: center; }
.row.gap { gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.inline-field { color: var(--text-2); font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }

.seg-control { display: inline-flex; background: var(--inner); border: 1px solid var(--border); border-radius: 10px; padding: 3px; gap: 3px; }
.seg-control button {
  border: none; background: none; padding: 7px 16px; border-radius: 8px;
  font-size: 13px; color: var(--text-2); cursor: pointer; font-family: inherit;
}
.seg-control button.on { background: var(--accent); color: var(--ink); font-weight: 700; box-shadow: var(--shadow-sm); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 18px; border-radius: 10px; border: 1.5px solid var(--border-2);
  background: #fff; color: var(--text); cursor: pointer; font-size: 14px; font-family: inherit;
  transition: 0.15s; box-shadow: var(--shadow-sm);
}
.btn:hover { border-color: var(--ink-line); color: var(--ink); }
.btn.primary {
  background: var(--ink); border: 1.5px solid var(--ink); color: #FBF9F4; font-weight: 600;
  box-shadow: 0 6px 16px rgba(23, 21, 15, 0.28);
}
.btn.primary:hover { background: var(--ink-2); border-color: var(--ink-2); color: #FBF9F4; }
.btn.primary:disabled { opacity: .55; cursor: not-allowed; }
.btn.ghost { background: transparent; box-shadow: none; }
.btn.small { padding: 5px 11px; font-size: 12px; border-radius: 8px; }
.btn.big { padding: 12px 28px; font-size: 15px; border-radius: 12px; }
.btn.block { width: 100%; }
.btn.danger { color: var(--err); border-color: #EED6D2; background: #fff; }
.btn.danger:hover { background: var(--err-bg); border-color: var(--err); }
.btn.accent-btn { background: var(--accent); border-color: var(--accent-deep); color: var(--ink); font-weight: 600; }
.btn.accent-btn:hover { background: #F0D68A; border-color: var(--accent-deep); color: var(--ink); }
.btn-icon { width: 15px; height: 15px; }

/* 自由指令参考提示词 chips */
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 1px solid var(--border-2); background: var(--inner); color: var(--text-2);
  border-radius: 999px; padding: 4px 12px; font-size: 12px; cursor: pointer; font-family: inherit;
  transition: 0.15s;
}
.chip:hover { border-color: var(--accent-deep); color: var(--accent-ink); background: var(--accent-soft); }

/* 多音字规则行（带类型） */
.poly-row { display: grid; grid-template-columns: 64px 1fr 22px 1fr 36px; gap: 6px; margin-bottom: 8px; align-items: center; }
.poly-row select { padding: 6px 4px; font-size: 12px; }
.poly-row .arrow { color: var(--text-dim); text-align: center; }
.poly-row button { background: none; border: none; color: var(--text-dim); cursor: pointer; font-size: 15px; }
.poly-row button:hover { color: var(--err); }

/* 分段预览 */
.seg-preview { max-height: 260px; overflow: auto; display: flex; flex-direction: column; gap: 6px; }
.seg-preview .seg {
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  padding: 9px 13px; font-size: 13px; line-height: 1.7;
}
.seg-preview .seg b { color: var(--accent-ink); margin-right: 8px; }

/* ============================================================ 任务列表 */
.task-item {
  border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 12px;
  background: var(--card); box-shadow: var(--shadow-sm); transition: 0.15s;
}
.task-item:hover { box-shadow: var(--shadow-md); border-color: var(--border-2); }
.t-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.t-title { font-weight: 700; max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14.5px; }
.t-meta { color: var(--text-2); font-size: 12.5px; margin-top: 8px; display: flex; gap: 14px; flex-wrap: wrap; }
.task-item audio { width: 100%; margin-top: 12px; height: 40px; }
.progress { height: 7px; background: var(--gray-bg); border-radius: 4px; overflow: hidden; margin-top: 12px; }
.progress > div { height: 100%; background: var(--ink); border-radius: 4px; transition: width .4s; }
.badge { padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge.queued { background: var(--warn-bg); color: var(--warn); }
.badge.processing { background: var(--accent); color: var(--ink); }
.badge.processing::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; margin-right: 6px; animation: pulse 1.2s infinite; }
.badge.succeeded { background: var(--ok-bg); color: var(--ok); }
.badge.failed { background: var(--err-bg); color: var(--err); }
.badge.canceled { background: var(--gray-bg); color: var(--text-2); }
@keyframes pulse { 50% { opacity: .3; } }
.t-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.t-actions a.btn { text-decoration: none; }
.t-error { color: var(--err); font-size: 12px; margin-top: 8px; word-break: break-all; background: var(--err-bg); border-radius: 8px; padding: 8px 10px; }
.empty {
  color: var(--text-dim); text-align: center; padding: 56px 0;
  background: var(--card); border: 1px dashed var(--border-2); border-radius: var(--radius);
}

/* ============================================================ 音色 */
.voices-grid { align-items: start; }
.drop-zone {
  border: 2px dashed var(--border-2); border-radius: 12px; padding: 30px;
  text-align: center; color: var(--text-dim); cursor: pointer; transition: 0.2s; background: var(--inner);
}
.drop-zone p { margin-top: 8px; font-size: 13px; }
.drop-zone:hover, .drop-zone.dragover { border-color: var(--accent-deep); color: var(--accent-ink); background: var(--accent-soft); }
.voice-item {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  border: 1px solid var(--border); border-radius: 12px; padding: 13px 15px; margin-bottom: 10px;
  background: var(--inner); flex-wrap: wrap; transition: 0.15s;
}
.voice-item:hover { border-color: var(--border-2); background: #fff; }
.v-avatar {
  width: 38px; height: 38px; border-radius: 11px; flex: none;
  background: var(--accent-soft); color: var(--accent-ink);
  display: inline-flex; align-items: center; justify-content: center; font-size: 17px;
}
.voice-item .v-main { flex: 1; min-width: 160px; }
.voice-item .v-name { font-weight: 700; font-size: 14px; }
.voice-item .v-id { color: var(--text-dim); font-size: 11px; margin-top: 2px; word-break: break-all; }

/* ============================================================ toast（黑底金边） */
#toast-wrap { position: fixed; top: 22px; right: 22px; z-index: 100; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--ink); border: 1px solid rgba(245, 223, 160, 0.25); border-left: 3px solid var(--accent-deep);
  color: #F3F0E8; padding: 12px 18px; border-radius: 11px; min-width: 230px; max-width: 380px;
  box-shadow: var(--shadow-lg); animation: slidein .25s ease; font-size: 13.5px;
}
.toast.err { border-left-color: #E07B6E; }
.toast.ok { border-left-color: #7FBF8A; }
@keyframes slidein { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ============================================================ 工坊双栏与音色面板 */
.studio-grid { display: grid; grid-template-columns: 1fr 296px; gap: 18px; align-items: start; }
.studio-main > .card:last-child { margin-bottom: 0; }
.studio-voices { position: sticky; top: 20px; }
.studio-voices > .hint { margin-top: 12px; line-height: 1.7; border-top: 1px solid var(--border); padding-top: 10px; }

/* 筛选器 */
.voice-filter { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.vf-seg { display: flex; background: var(--inner); border: 1px solid var(--border); border-radius: 9px; padding: 2px; gap: 2px; }
.vf-seg button {
  flex: 1; border: none; background: none; padding: 5px 0; border-radius: 7px;
  font-size: 12px; color: var(--text-2); cursor: pointer; font-family: inherit; transition: 0.15s;
}
.vf-seg button:hover { color: var(--ink); }
.vf-seg button.on { background: var(--accent); color: var(--ink); font-weight: 700; box-shadow: var(--shadow-sm); }
.vf-search { position: relative; }
.vf-search svg {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  width: 13px; height: 13px; color: var(--text-dim); pointer-events: none;
}
.vf-search input {
  width: 100%; padding: 7px 10px 7px 29px; font-size: 12.5px;
  background: var(--inner); border: 1.5px solid var(--border); border-radius: 9px;
}
.vf-search input:focus { border-color: var(--accent-deep); background: #fff; box-shadow: 0 0 0 3px rgba(201, 162, 75, 0.15); }

#voice-panel { display: flex; flex-direction: column; gap: 8px; max-height: calc(100vh - 300px); overflow-y: auto; padding-right: 2px; }
#voice-panel::-webkit-scrollbar { width: 5px; }
#voice-panel::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 3px; }
#voice-panel::-webkit-scrollbar-track { background: transparent; }
.vf-empty { text-align: center; color: var(--text-dim); padding: 26px 0; font-size: 12.5px; }

.voice-option {
  position: relative; display: flex; align-items: center; gap: 10px; padding: 9px 10px;
  border: 1.5px solid var(--border); border-radius: 12px; cursor: pointer;
  background: var(--inner); transition: 0.15s; user-select: none;
}
.voice-option::before {
  content: ""; position: absolute; left: -1.5px; top: 22%; bottom: 22%;
  width: 3px; border-radius: 2px; background: transparent; transition: 0.15s;
}
.voice-option:hover { border-color: var(--border-2); background: #fff; transform: translateX(2px); box-shadow: var(--shadow-sm); }
.voice-option.selected { border-color: var(--accent-deep); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent-deep); transform: none; }
.voice-option.selected::before { background: var(--accent-deep); }
.v-avatar-round {
  width: 38px; height: 38px; border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--gray-bg); color: var(--text-2); overflow: hidden;
  box-shadow: inset 0 0 0 1px var(--border);
}
.voice-option.selected .v-avatar-round { background: var(--accent); color: var(--ink); box-shadow: inset 0 0 0 1px var(--accent-deep); }
.v-avatar-round svg { width: 19px; height: 19px; }
.voice-option .vo-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.voice-option .vo-name { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.voice-option .vo-desc { font-size: 11px; color: var(--text-dim); margin-top: 1px; }
.vo-badge {
  font-size: 10px; color: var(--accent-ink); background: #fff;
  border: 1px solid var(--accent-deep); border-radius: 4px; padding: 0 4px; margin-left: 6px; vertical-align: 1px;
}
.voice-option.selected .vo-badge { background: var(--accent); border-color: var(--accent-deep); }
.vo-play {
  flex: none; width: 28px; height: 28px; border-radius: 50%;
  border: 1px solid var(--border-2); background: #fff; cursor: pointer;
  color: var(--text-2); display: inline-flex; align-items: center; justify-content: center;
}
.vo-play:hover { background: var(--ink); color: #fff; border-color: var(--ink); }
.vo-play:disabled { cursor: wait; }
.vo-play svg { width: 12px; height: 12px; }
.vo-play.loading svg { animation: pulse 0.9s infinite; }

/* 用户组管理：左用户列表 + 右组卡片 */
.group-layout { display: grid; grid-template-columns: 240px 1fr; gap: 16px; align-items: stretch; }
.group-user-panel {
  border: 1px solid var(--border); border-radius: 12px; background: var(--inner);
  display: flex; flex-direction: column; overflow: hidden;
}
.group-cards { display: flex; flex-direction: column; gap: 12px; }
.group-card { transition: border-color 0.15s, opacity 0.15s; }
.group-card.active { opacity: 1 !important; }
.group-card:hover { border-color: var(--accent-deep); }
.group-user-panel .panel-head { padding: 10px 12px 6px; font-weight: 600; font-size: 13px; }
.group-user-panel .panel-search { position: relative; padding: 0 10px 8px; }
.group-user-panel .panel-search svg {
  position: absolute; left: 18px; top: 50%; transform: translateY(-50%);
  width: 12px; height: 12px; color: var(--text-dim); pointer-events: none;
}
.group-user-panel .panel-search input { padding: 6px 8px 6px 28px; font-size: 12.5px; }
.group-user-list { flex: 1; overflow-y: auto; padding: 0 8px 8px; }
.group-user-list::-webkit-scrollbar { width: 4px; }
.group-user-list::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 2px; }
.group-user-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px; border-radius: 7px; cursor: pointer; transition: background 0.1s;
}
.group-user-item:hover { background: rgba(255, 255, 255, 0.05); }
.group-user-item.selected { background: var(--accent-soft); }
.group-user-item.in-group { opacity: 0.65; cursor: default; }
.group-user-item.in-group:hover { background: transparent; }
.group-user-item input[type=checkbox] { accent-color: var(--primary); width: 14px; height: 14px; }
.group-user-item input[type=checkbox]:disabled { cursor: not-allowed; }
.group-user-item .gu-name { font-size: 12.5px; flex: 1; }
.group-user-item .gu-tag { font-size: 10px; color: var(--accent-ink); }
.group-member-chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--accent-soft); border: 1px solid var(--accent-deep);
  border-radius: 999px; padding: 3px 10px; font-size: 12px; margin: 2px 6px 2px 0;
}
.group-member-chip .chip-x {
  background: none; border: none; color: var(--text-dim); cursor: pointer;
  font-size: 13px; padding: 0; line-height: 1;
}
.group-member-chip .chip-x:hover { color: var(--err); }

/* 音色共享树形选择器弹窗 */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(15, 17, 23, 0.55);
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(2px);
}
.modal-box {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; padding: 22px; width: 480px; max-width: 92vw;
  max-height: 80vh; display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg);
}
.modal-box h3 { font-size: 16px; margin-bottom: 4px; }
.modal-box .modal-sub { color: var(--text-dim); font-size: 12px; margin-bottom: 14px; }
.modal-search { position: relative; margin-bottom: 12px; }
.modal-search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 13px; height: 13px; color: var(--text-dim); pointer-events: none; }
.modal-search input { padding: 8px 10px 8px 30px; font-size: 13px; }
.modal-tree {
  flex: 1; overflow-y: auto; border: 1px solid var(--border);
  border-radius: 10px; padding: 8px; background: var(--inner);
  min-height: 160px; max-height: 46vh;
}
.modal-tree::-webkit-scrollbar { width: 5px; }
.modal-tree::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 3px; }
.tree-node { user-select: none; }
.tree-branch { padding-left: 0; }
.tree-branch .tree-children { padding-left: 22px; }
.tree-row {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 8px; border-radius: 6px; cursor: pointer;
  transition: background 0.1s;
}
.tree-row:hover { background: rgba(255, 255, 255, 0.06); }
.tree-row.selected { background: var(--accent-soft); }
.tree-row .tree-arrow {
  width: 18px; height: 18px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-dim); font-size: 10px; transition: transform 0.15s;
}
.tree-row .tree-arrow.open { transform: rotate(90deg); }
.tree-row .tree-arrow.leaf { visibility: hidden; }
.tree-row input[type=checkbox] { accent-color: var(--primary); width: 15px; height: 15px; }
.tree-row .tree-label { font-size: 13px; flex: 1; }
.tree-row .tree-label.dim { color: var(--text-dim); font-size: 12px; }
.tree-row .tree-count { color: var(--text-dim); font-size: 11px; }
.tree-children { display: none; }
.tree-children.open { display: block; }
.tree-empty { color: var(--text-dim); text-align: center; padding: 30px 0; font-size: 12.5px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 14px; }

/* 管理后台 */
.mb-small { margin-bottom: 12px; }
.admin-task { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; background: var(--inner); }
.admin-task .at-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.admin-task .at-owner { color: var(--accent-ink); font-weight: 600; font-size: 12px; background: var(--accent-soft); border-radius: 4px; padding: 1px 6px; }
.admin-row { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; background: var(--inner); display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.admin-row .ar-main { flex: 1; min-width: 200px; display: flex; align-items: center; gap: 12px; }
.admin-row .ar-avatar {
  width: 36px; height: 36px; border-radius: 50%; flex: none;
  background: var(--accent-soft); color: var(--accent-ink);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px;
}
.admin-row .ar-title { font-weight: 600; font-size: 13.5px; }
.admin-row .ar-display { font-size: 13px; color: var(--text); }
.admin-row .ar-sub { color: var(--text-dim); font-size: 12px; margin-top: 3px; }
.admin-row .ar-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.tag-admin { color: var(--accent-ink); background: var(--accent-soft); border-radius: 4px; padding: 1px 6px; font-size: 11px; }
.eta-text { color: var(--warn); font-size: 12px; font-weight: 600; }

/* ============================================================ 响应式 */

/* 平板：单列布局，音色面板改为横向滑动条（保持在内容附近可见） */
@media (max-width: 1080px) {
  .grid-2 { grid-template-columns: 1fr; }
  .grid-2 .grid-2 { grid-template-columns: 1fr 1fr; } /* 嵌套的速度/音量保持并排 */
  .studio-grid { grid-template-columns: 1fr; }
  .studio-voices { position: static; }
  #voice-panel {
    flex-direction: row; overflow-x: auto; max-height: none;
    padding: 2px 2px 8px; gap: 8px;
  }
  #voice-panel::-webkit-scrollbar { height: 5px; width: 5px; }
  .voice-option { flex: none; flex-direction: column; width: 90px; padding: 12px 6px 10px; text-align: center; gap: 7px; }
  .voice-option:hover { transform: none; }
  .voice-option .vo-main { align-items: center; }
  .voice-option .vo-name { font-size: 12px; white-space: normal; }
  .vo-badge { margin-left: 0; margin-top: 3px; display: inline-block; }
  .voice-option .vo-desc { display: none; }
  .vo-play { position: absolute; top: 5px; right: 5px; width: 22px; height: 22px; }
  .voice-option::before { left: 20%; right: 20%; top: auto; bottom: -1.5px; width: auto; height: 3px; }
  .vf-empty { width: 100%; }
}

/* 窄屏：登录页变纵向、侧边栏变顶栏 */
@media (max-width: 900px) {
  .auth-wrap { flex-direction: column; }
  .auth-hero { min-height: 320px; flex: none; }
  .hero-title { font-size: 30px; }
  .hero-features { grid-template-columns: 1fr; }
  .float-card { display: none; }
  #app-shell { flex-direction: column; }
  #sidebar { width: 100%; height: auto; position: static; flex-direction: row; align-items: center; gap: 8px; }
  .brand { padding: 12px 14px; }
  .brand-text span { display: none; }
  #nav { flex-direction: row; padding: 8px; }
  #nav a.active::before { display: none; }
  .sidebar-foot { border-top: none; border-left: 1px solid rgba(255, 255, 255, 0.09); padding: 8px 12px; margin-left: auto; }
  .user-meta { display: none; }
  #main { padding: 18px 16px 50px; }
  .t-title { max-width: 100%; }
}

/* 手机：进一步压缩留白与字号 */
@media (max-width: 640px) {
  #main { padding: 14px 12px 40px; }
  .page-head { margin-bottom: 14px; }
  .page-head h2 { font-size: 19px; }
  .card { padding: 16px; border-radius: 12px; }
  .grid-2 .grid-2 { grid-template-columns: 1fr; } /* 速度/音量改为上下排 */
  .studio-actions { gap: 8px; }
  .studio-actions .btn.big { flex: 1; padding: 11px 14px; font-size: 14px; }
  .inline-field { font-size: 12px; }
  input[type=number] { width: 76px; }
  .task-item { padding: 13px 14px; }
  .t-meta { gap: 10px; font-size: 12px; }
  .page-actions select { width: 108px; }
  .auth-panel { padding: 26px 20px; }
  .hero-title { font-size: 26px; }
  .hero-sub br { display: none; }
  .brand-text { display: none; }
  #nav a { padding: 9px 10px; font-size: 13px; gap: 6px; }
  #nav a svg { width: 16px; height: 16px; }
  .voices-grid .card { margin-bottom: 14px; }
}

/* 小屏手机：登录品牌区压缩 */
@media (max-width: 480px) {
  .auth-hero { min-height: 230px; }
  .hero-content { padding: 22px; }
  .hero-title { font-size: 23px; }
  .hero-features { margin-top: 18px; gap: 12px; }
  .hf-check { width: 18px; height: 18px; }
  .auth-card h2 { font-size: 22px; }
  .auth-legal { margin-top: 22px; }
}

/* ============================================================ 宽屏（≥1600）逐档放宽内容宽度，消除大面积空白 */
@media (min-width: 1600px) {
  #main { max-width: 1480px; padding: 32px 40px 60px; }
  .studio-grid { grid-template-columns: 1fr 316px; }
  #voice-panel { max-height: calc(100vh - 320px); }
}

@media (min-width: 2000px) {
  #main { max-width: 1780px; }
  .studio-grid { grid-template-columns: 1fr 332px; }
  .card { padding: 24px; }
  .page-head h2 { font-size: 23px; }
}

@media (min-width: 2400px) {
  #main { max-width: 2080px; padding: 40px 48px 70px; }
  .studio-grid { grid-template-columns: 1fr 348px; gap: 22px; }
  .grid-2 { gap: 20px; }
  .card { padding: 28px; border-radius: 16px; }
  .card-head { margin-bottom: 20px; }
  .card-head h3 { font-size: 16px; }
  label.lbl { margin-bottom: 9px; font-size: 14px; }
  label.lbl.mt, .lbl.mt { margin-top: 22px; }
  #tts-text { min-height: 260px; font-size: 15px; line-height: 2; }
  input[type=text], input:not([type]), select { padding: 12px 14px; font-size: 15px; }
  .btn.big { padding: 14px 34px; font-size: 16px; }
  .poly-row { gap: 10px; margin-bottom: 10px; }
  .page-head h2 { font-size: 25px; }
  .page-head p { font-size: 14px; }
  .v-avatar-round { width: 42px; height: 42px; }
  .v-avatar-round svg { width: 21px; height: 21px; }
  .voice-option { padding: 11px 12px; gap: 12px; }
  .voice-option .vo-name { font-size: 14px; }
  .voice-option .vo-desc { font-size: 12px; }
  #voice-panel { max-height: calc(100vh - 340px); }
  .task-item { padding: 18px 20px; }
  .t-title { font-size: 15.5px; }
}
