:root {
    --main: #2563eb;
    --bg: #0f172a;
    --card: #1e293b;
    --border: #334155;
    --text: #e2e8f0;
    --muted: #94a3b8;
  }
  * { box-sizing: border-box; }
  body {
    margin: 0; background: var(--bg); color: var(--text);
    font-family: "Microsoft YaHei", system-ui, sans-serif;
  }
  html.dark { color-scheme: dark; }
  .app { max-width: 1500px; margin: 0 auto; padding: 16px; }
  .topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 20px; background: linear-gradient(135deg,#1e293b,#172554);
    border: 1px solid var(--border); border-radius: 12px; margin-bottom: 16px;
  }
  .topbar h1 { font-size: 20px; margin: 0; color: #fff; letter-spacing: 1px; }
  .topbar .sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
  .topbar .userinfo { display: flex; gap: 12px; align-items: center; font-size: 13px; color: var(--muted); }
  .grid { display: grid; grid-template-columns: 320px 1fr 340px; gap: 16px; }
  @media (max-width: 1100px) { .grid { grid-template-columns: 1fr; } }
  .card {
    background: var(--card); border: 1px solid var(--border);
    border-radius: 12px; padding: 16px; margin-bottom: 16px;
  }
  .card h3 { margin: 0 0 12px; font-size: 15px; color: #fff; display: flex; align-items: center; gap: 8px; }
  .card h3::before { content: ""; width: 4px; height: 16px; background: var(--main); border-radius: 2px; }
  .row { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
  .muted { color: var(--muted); font-size: 12px; }
  .live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #ef4444; margin-right: 6px; }
  .live-dot.on { background: #22c55e; box-shadow: 0 0 8px #22c55e; animation: pulse 1.2s infinite; }
  @keyframes pulse { 50% { opacity: .4; } }
  /* 分类标签 */
  .cat-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
  .cat-tab {
    border: 1px solid var(--border); background: transparent; color: var(--text);
    padding: 6px 12px; border-radius: 8px; cursor: pointer; font-size: 13px; position: relative;
  }
  .cat-tab.active { border-color: var(--main); background: rgba(37,99,235,.15); color: #fff; }
  .cat-tab .cnt { color: var(--muted); font-size: 11px; margin-left: 4px; }
  .event-list { max-height: 480px; overflow-y: auto; }
  .event-item {
    display: flex; gap: 10px; padding: 8px 10px; border-bottom: 1px solid rgba(51,65,85,.4);
    font-size: 13px; align-items: flex-start;
  }
  .event-tag { flex-shrink: 0; font-size: 11px; padding: 2px 8px; border-radius: 6px; color: #fff; margin-top: 2px; }
  .et-Chat{background:#4caf50}.et-Gift{background:#ff9800}.et-Like{background:#2196f3}
  .et-EnterRoom{background:#9c27b0}.et-Follow{background:#00bcd4}
  .event-name { color: #fff; font-weight: 600; margin-right: 4px; }
  .event-text { color: var(--muted); word-break: break-all; }
  /* 播报 */
  .speak-status { display: flex; align-items: center; gap: 10px; padding: 12px; background: #0b1220; border-radius: 10px; }
  .speak-badge { padding: 2px 10px; border-radius: 6px; font-size: 12px; background: var(--main); color: #fff; }
  .speak-badge.assist { background: #8b5cf6; }
  .speak-text { font-size: 14px; color: var(--text); flex: 1; min-width: 0; }
  .queue-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; font-size: 12px; color: var(--muted); border-bottom: 1px solid rgba(51,65,85,.3); }
  .queue-item .qb { width: 6px; height: 6px; border-radius: 50%; }
  .qb-main{background:var(--main)} .qb-assist{background:#8b5cf6}
  /* 配置 */
  .tpl-item { margin-bottom: 10px; }
  .tpl-item label { font-size: 12px; color: var(--muted); display: block; margin-bottom: 4px; }
  .voice-check { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 8px; font-size: 13px; }
  .voice-check .lbl { display: flex; align-items: center; gap: 6px; }
  /* ===== 音色分工新布局 ===== */
  .role-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 16px; background: rgba(255,255,255,0.02);
    border: 1px solid var(--border); border-radius: 10px;
    transition: all .15s;
  }
  .role-row:hover { border-color: var(--main); background: rgba(37,99,235,.06); }
  .role-left { display: flex; align-items: center; gap: 12px; }
  .role-emoji { font-size: 20px; }
  .role-name { font-size: 14px; font-weight: 500; color: #e2e8f0; }
  .role-right { display: flex; align-items: center; gap: 8px; }
  .role-indicator {
    font-size: 12px; padding: 3px 10px; border-radius: 20px;
    font-weight: 500;
  }
  .role-indicator.main { background: rgba(37,99,235,.2); color: #60a5fa; border: 1px solid rgba(37,99,235,.4); }
  .role-indicator.assist { background: rgba(16,185,129,.2); color: #34d399; border: 1px solid rgba(16,185,129,.4); }
  /* ========== 登录/注册页（Glassmorphism 玻璃拟态 · CodePen 风） ========== */
  .login-wrap {
    position: fixed; inset: 0; display: flex;
    align-items: center; justify-content: center;
    overflow: hidden; z-index: 100;
    /* CodePen DivineBlow 原始渐变背景 */
    background: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab);
    background-size: 400% 400%;
    animation: gradient 12s ease infinite;
  }
  @keyframes gradient {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
  }

  /* 动态背景层 */
  .bg-layer { position: absolute; inset: 0; z-index: 0; }

  /* 保留但调亮 blob（叠在 CodePen 渐变之上，增加层次） */
  .bg-blob {
    position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.35;
    animation: blobFloat 12s ease-in-out infinite;
  }
  .blob-1 {
    width: 520px; height: 520px; background: radial-gradient(circle, rgba(238,119,82,0.8), transparent 70%);
    top: -10%; left: -5%; animation-duration: 14s;
  }
  .blob-2 {
    width: 420px; height: 420px; background: radial-gradient(circle, rgba(231,60,126,0.7), transparent 70%);
    bottom: -8%; right: -5%; animation-delay: 3s; animation-duration: 16s;
  }
  .blob-3 {
    width: 320px; height: 320px; background: radial-gradient(circle, rgba(35,166,213,0.6), transparent 70%);
    top: 45%; left: 55%; animation-delay: 6s; animation-duration: 18s; opacity: 0.3;
  }
  @keyframes blobFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(40px, -30px) scale(1.08); }
    66% { transform: translate(-30px, 20px) scale(0.95); }
  }

  /* 🎯 CodePen 风浮动装饰方块 (原 DivineBlow .square) */
  .cp-box { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
  .cp-square {
    position: absolute;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    box-shadow: 0 25px 45px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 15px;
    animation: square 10s linear infinite;
    animation-delay: calc(-1s * var(--i));
  }
  @keyframes square {
    0%, 100% { transform: translateY(-20px) rotate(0deg); opacity: 0.7; }
    50%      { transform: translateY(20px) rotate(5deg); opacity: 1; }
  }
  /* 6 个方块位置 —— 围绕 glass-card 散开 */
  .cp-square:nth-child(1) { width: 90px;  height: 90px;  top: 8%;   left: 8%;  }
  .cp-square:nth-child(2) { width: 140px; height: 140px; top: 20%;  right: 10%; z-index: 2; }
  .cp-square:nth-child(3) { width: 60px;  height: 60px;  top: 55%;  left: 5%;  z-index: 2; }
  .cp-square:nth-child(4) { width: 50px;  height: 50px;  bottom: 15%; right: 8%; }
  .cp-square:nth-child(5) { width: 70px;  height: 70px;  bottom: 25%; left: 15%; }
  .cp-square:nth-child(6) { width: 110px; height: 110px; top: 70%;  right: 15%; z-index: 2; }

  /* 玻璃拟态卡片（更透明 · CodePen 风 + ::after 内描边） */
  .glass-card {
    position: relative; z-index: 2;
    width: 440px; max-width: calc(100vw - 32px);
    padding: 44px 40px 32px;
    background: rgba(255, 255, 255, 0.085);
    backdrop-filter: blur(22px) saturate(1.5);
    -webkit-backdrop-filter: blur(22px) saturate(1.5);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 20px;
    box-shadow:
      0 25px 45px rgba(0, 0, 0, 0.25),
      0 0 0 1px rgba(255, 255, 255, 0.06) inset;
    animation: cardAppear 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  }
  /* CodePen 特色 —— 内层细细的玻璃描边 */
  .glass-card::after {
    content: "";
    position: absolute;
    inset: 6px;
    border-radius: 14px;
    pointer-events: none;
    border: 1px solid rgba(255, 255, 255, 0.08);
  }
  @keyframes cardAppear {
    from { opacity: 0; transform: translateY(24px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
  }

  /* 品牌头部（CodePen 风白色系） */
  .glass-header { text-align: center; margin-bottom: 28px; }
  .glass-logo {
    width: 64px; height: 64px; margin: 0 auto 16px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 28px;
    background: linear-gradient(135deg, rgba(255,255,255,0.35), rgba(255,255,255,0.12));
    backdrop-filter: blur(10px);
    box-shadow:
      0 8px 32px rgba(0, 0, 0, 0.25),
      inset 0 1px 0 rgba(255,255,255,0.4);
    border: 1px solid rgba(255,255,255,0.3);
    animation: logoPulse 4s ease-in-out infinite;
  }
  @keyframes logoPulse {
    0%, 100% { box-shadow: 0 8px 32px rgba(0,0,0,0.25), inset 0 1px 0 rgba(255,255,255,0.4); }
    50% { box-shadow: 0 8px 48px rgba(255,255,255,0.2), inset 0 1px 0 rgba(255,255,255,0.5); }
  }
  .glass-title {
    font-size: 24px; font-weight: 700; margin: 0 0 6px;
    color: #ffffff;
    letter-spacing: 1px;
    text-shadow: 0 2px 12px rgba(0,0,0,0.2);
  }
  .glass-slogan {
    font-size: 12px; color: rgba(255, 255, 255, 0.75); margin: 0;
    letter-spacing: 1.5px;
  }

  /* 切换器 */
  .glass-switch {
    position: relative; display: flex;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 14px; padding: 4px;
    margin-bottom: 28px;
    backdrop-filter: blur(5px);
  }
  .switch-btn {
    flex: 1; padding: 10px 0; border: none; background: transparent;
    color: rgba(255,255,255,0.7); font-size: 14px; font-weight: 500; letter-spacing: 2px;
    cursor: pointer; border-radius: 10px; position: relative; z-index: 1;
    transition: color .25s;
  }
  .switch-btn.active { color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,0.2); }
  .switch-indicator {
    position: absolute; top: 4px; left: 4px;
    width: calc(50% - 4px); height: calc(100% - 8px);
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px; z-index: 0;
    transition: transform .35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
  }
  .switch-indicator.reg { transform: translateX(100%); }

  /* 表单 */
  .glass-form { display: flex; flex-direction: column; gap: 18px; }
  .field { display: flex; flex-direction: column; gap: 6px; }
  .field label {
    font-size: 12px; font-weight: 500; color: rgba(255, 255, 255, 0.85);
    padding-left: 2px; letter-spacing: 0.5px;
  }
  .field-optional { color: rgba(255,255,255,0.5); font-weight: 400; }
  .field-input { position: relative; }
  .f-icon {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    font-size: 15px; z-index: 2; pointer-events: none; opacity: 0.9;
  }

  /* 输入框（CodePen 风半透明白 —— 必须压过 Element Plus dark 模式） */
  html.dark .glass-input .el-input__wrapper,
  .glass-input .el-input__wrapper {
    background: rgba(255,255,255,0.12) !important;
    background-color: rgba(255,255,255,0.12) !important;
    background-image: none !important;
    border: 1px solid rgba(255,255,255,0.2) !important;
    border-radius: 14px !important;
    padding-left: 42px !important;
    height: 46px !important;
    box-shadow: none !important;
    outline: none !important;
    backdrop-filter: blur(4px);
    transition: all .25s !important;
  }
  html.dark .glass-input .el-input__wrapper:hover,
  .glass-input .el-input__wrapper:hover {
    border-color: rgba(255,255,255,0.35) !important;
    background: rgba(255,255,255,0.16) !important;
    background-color: rgba(255,255,255,0.16) !important;
  }
  html.dark .glass-input .el-input__wrapper.is-focus,
  .glass-input .el-input__wrapper.is-focus {
    border-color: rgba(255,255,255,0.5) !important;
    background: rgba(255,255,255,0.22) !important;
    background-color: rgba(255,255,255,0.22) !important;
    box-shadow: 0 0 0 3px rgba(255,255,255,0.15) !important;
  }
  html.dark .glass-input .el-input__inner,
  .glass-input .el-input__inner {
    color: #ffffff !important; font-size: 14px !important;
    background: transparent !important;
  }
  html.dark .glass-input .el-input__inner::placeholder,
  .glass-input .el-input__inner::placeholder { color: rgba(255,255,255,0.55) !important; }
  html.dark .glass-input .el-input__password,
  .glass-input .el-input__password { color: rgba(255,255,255,0.7) !important; }

  /* Turnstile */
  .turnstile-box { margin: 2px 0 -4px; display: flex; justify-content: center; }

  /* 提交按钮 */
  .glass-submit {
    width: 100%; height: 50px; margin-top: 8px;
    border: none; border-radius: 14px;
    font-size: 15px; font-weight: 600; letter-spacing: 4px;
    color: #fff; cursor: pointer;
    background: linear-gradient(135deg, #3b82f6, #6366f1, #8b5cf6);
    box-shadow:
      0 8px 28px rgba(59,130,246,0.4),
      inset 0 1px 0 rgba(255,255,255,0.2);
    transition: all .25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative; overflow: hidden;
  }
  .glass-submit::before {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.15), transparent 50%);
    opacity: 0; transition: opacity .25s;
  }
  .glass-submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow:
      0 14px 40px rgba(59,130,246,0.55),
      inset 0 1px 0 rgba(255,255,255,0.25);
  }
  .glass-submit:hover:not(:disabled)::before { opacity: 1; }
  .glass-submit:active:not(:disabled) { transform: translateY(0); }
  .glass-submit:disabled { opacity: 0.7; cursor: not-allowed; }

  /* 底部 */
  .glass-footer {
    margin-top: 28px; padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.15);
    text-align: center; font-size: 11px;
    color: rgba(255, 255, 255, 0.65);
    letter-spacing: 0.5px;
  }

  /* 响应式 */
  @media (max-width: 520px) {
    .glass-card { padding: 36px 24px 28px; border-radius: 18px; }
    .glass-title { font-size: 20px; }
    .glass-logo { width: 52px; height: 52px; font-size: 22px; }
    .cp-square:nth-child(2), .cp-square:nth-child(6) { display: none; }
  }
  .section-label { font-size: 12px; color: var(--muted); margin: 14px 0 8px; text-transform: uppercase; letter-spacing: 1px; }
  ::-webkit-scrollbar { width: 8px; } ::-webkit-scrollbar-thumb { background: #334155; border-radius: 4px; }

  /* ===== 商业化音色卡片 ===== */
  .voice-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px; margin-top: 10px;
  }
  .voice-card {
    background: #0b1220; border: 1px solid var(--border); border-radius: 10px;
    padding: 10px 12px; transition: all .15s; position: relative;
  }
  .voice-card:hover { border-color: var(--main); transform: translateY(-1px); box-shadow: 0 2px 8px rgba(37,99,235,.15); }
  .voice-card.selected { border-color: var(--main); background: rgba(37,99,235,.1); }
  .voice-card.is-cloned { border-color: #ff6b6b; }
  .voice-card-inner { display: flex; flex-direction: column; gap: 6px; }
  .voice-card .el-button { pointer-events: auto !important; position: relative; z-index: 3; }
  .voice-card .el-button.el-button--link { color: #38bdf8 !important; }
  /* 原生 button — 避免 Element Plus 事件拦截 */
  .voice-card .vb {
    background: transparent; border: 1px solid #2563eb; color: #60a5fa;
    padding: 2px 10px; border-radius: 6px; font-size: 12px; cursor: pointer;
    width: auto; height: auto; min-height: 20px; line-height: 1.4;
    pointer-events: auto !important; position: relative; z-index: 10;
    display: inline-flex; align-items: center; gap: 4px;
  }
  .voice-card .vb:hover { background: rgba(37,99,235,.2); border-color: #60a5fa; color: #fff; }
  .voice-card .vb-warn { border-color: #f59e0b; color: #fbbf24; }
  .voice-card .vb-warn:hover { background: rgba(245,158,11,.2); color: #fff; }
  .voice-card .vb-play:hover { box-shadow: 0 0 8px rgba(37,99,235,.4); }
  .voice-avatar {
    width: 32px; height: 32px; border-radius: 50%; display: inline-flex;
    align-items: center; justify-content: center; color: #fff; font-size: 14px;
    margin-bottom: 4px;
  }
  .voice-label { font-size: 13px; font-weight: 600; color: #fff; }
  .voice-desc { font-size: 11px; color: var(--muted); line-height: 1.4; }
  .voice-check { position: absolute; top: 8px; right: 10px; font-size: 12px; z-index: 2; }
  h4 { margin: 4px 0; font-size: 13px; color: #cbd5e1; }

  /* ===== 侧边栏布局 ===== */
  .root-layout { display: flex; min-height: calc(100vh - 100px); gap: 16px; }
  .side-nav {
    width: 210px; flex: none;
    background: linear-gradient(180deg, #111c33, #0f172a);
    border: 1px solid var(--border); border-radius: 12px;
    padding: 14px 10px; position: sticky; top: 16px; height: fit-content;
  }
  .side-nav .nav-title { font-size: 11px; color: #64748b; letter-spacing: 1px; padding: 8px 12px 6px; text-transform: uppercase; }
  .nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 11px 14px; margin-bottom: 4px; border-radius: 9px;
    color: var(--muted); cursor: pointer; font-size: 13px;
    border: 1px solid transparent; transition: all .15s;
  }
  .nav-item:hover { color: #fff; background: rgba(37,99,235,.08); }
  .nav-item.active {
    color: #fff; background: linear-gradient(90deg, rgba(37,99,235,.25), rgba(37,99,235,.06));
    border-color: rgba(59,130,246,.35); box-shadow: inset 3px 0 0 var(--main);
  }
  .nav-item svg { width: 17px; height: 17px; flex: none; }
  .nav-item .badge { margin-left: auto; font-size: 11px; padding: 1px 7px; border-radius: 10px; background: #26334d; color: #94a3b8; }
  .nav-item .badge.live { background: #ef4444; color: #fff; animation: pulse 1.5s infinite; }
  .side-footer { margin-top: 14px; padding: 10px 12px; font-size: 11px; color: #475569; text-align: center; border-top: 1px solid #1e293b; }
  .main-area { flex: 1; min-width: 0; }
  .page-section { animation: fadeIn .2s ease; }
  @keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
  @media (max-width: 1100px) { .root-layout { flex-direction: column; } .side-nav { width: 100%; position: static; } }
  /* 📌 话术库左右分栏 */
  .script-panel { display: flex; gap: 14px; min-height: 300px; }
  .script-panel .col-left { flex: 0 0 40%; display: flex; flex-direction: column; min-width: 0; }
  .script-panel .col-right { flex: 1; display: flex; flex-direction: column; min-width: 0; }
  .script-search { margin-bottom: 8px; }
  /* 拖拽排序的分段卡片 */
  .seg-list { display: flex; flex-direction: column; gap: 6px; }
  .seg-item {
    display: flex; align-items: flex-start; gap: 8px;
    padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px;
    font-size: 12px; background: rgba(245,158,11,0.03);
    cursor: grab; transition: all .15s; user-select: none;
  }
  .seg-item:hover { border-color: var(--main); background: rgba(37,99,235,.06); }
  .seg-item.dragging { opacity: 0.4; cursor: grabbing; transform: scale(0.98); }
  .seg-item.drag-over { border-color: #22c55e; background: rgba(34,197,94,.1); }
  .seg-handle { color: var(--muted); cursor: grab; padding: 2px 4px; font-size: 14px; }
  .seg-handle:active { cursor: grabbing; }
  .seg-idx { color: #f59e0b; font-weight: 700; flex-shrink: 0; min-width: 32px; }
  .seg-text { flex: 1; min-width: 0; color: var(--text); line-height: 1.55; word-break: break-word; }
  .seg-len { color: var(--muted); font-size: 11px; flex-shrink: 0; align-self: center; }

  /* ========== v2 顶部栏 ========== */
  .topbar-v2 {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 24px; background: linear-gradient(135deg,#1e293b,#172554);
    border: 1px solid var(--border); border-radius: 12px; margin-bottom: 16px;
  }
  .topbar-v2 h1 { font-size: 18px; margin: 0; color: #fff; letter-spacing: 1px; }
  .tb-left { display: flex; align-items: center; gap: 12px; }
  .tb-mode {
    font-size: 12px; padding: 3px 10px; border-radius: 12px;
    background: rgba(37,99,235,.2); color: #60a5fa; border: 1px solid rgba(59,130,246,.35);
  }
  .tb-center { flex: 1; text-align: center; }
  .tb-status { font-size: 13px; font-weight: 500; }
  .tb-status.live { color: #22c55e; }
  .tb-status.idle { color: var(--muted); }
  .tb-right { display: flex; gap: 16px; align-items: center; font-size: 13px; }

  /* ========== 用户信息卡片组 ========== */
  .user-info-group { display: flex; gap: 10px; align-items: center; }
  .uif-chip {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 12px;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 10px;
    transition: all .2s;
  }
  .uif-chip:hover { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.15); }
  .uif-icon { font-size: 16px; line-height: 1; }
  .uif-text { display: flex; flex-direction: column; line-height: 1.2; }
  .uif-label { font-size: 10px; color: #64748b; letter-spacing: .5px; }
  .uif-value { font-size: 13px; color: #e2e8f0; font-weight: 600; }
  /* 时长卡：剩余<24h 警告色 */
  .uif-time.uif-warn { background: rgba(239,68,68,.12); border-color: rgba(239,68,68,.35); }
  .uif-time.uif-warn .uif-value { color: #f87171; }
  .uif-time.uif-danger { background: rgba(239,68,68,.2); border-color: rgba(239,68,68,.5); animation: uifPulse 1.5s infinite; }
  .uif-time.uif-danger .uif-value { color: #f87171; }
  @keyframes uifPulse { 0%,100% { opacity: 1; } 50% { opacity: .6; } }
  /* 点数卡：渐变点缀 */
  .uif-points { background: linear-gradient(135deg, rgba(59,130,246,.12), rgba(139,92,246,.12)); border-color: rgba(99,102,241,.3); }
  .uif-points .uif-value { color: #c4b5fd; }

  /* ========== 用户下拉按钮 ========== */
  .uif-user-btn {
    display: flex; align-items: center; gap: 8px;
    padding: 5px 12px 5px 5px;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 24px;
    cursor: pointer;
    transition: all .2s;
  }
  .uif-user-btn:hover { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.2); }
  .uif-avatar {
    width: 28px; height: 28px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700; color: #fff;
    flex: none;
  }
  .uif-name { font-size: 13px; color: #e2e8f0; font-weight: 500; }
  .uif-caret { font-size: 10px; color: #64748b; margin-left: 2px; }

  /* ========== v2 侧边栏 ========== */
  .side-nav-v2 {
    width: 180px; flex: none;
    background: linear-gradient(180deg, #111c33, #0f172a);
    border: 1px solid var(--border); border-radius: 12px;
    padding: 14px 10px; position: sticky; top: 16px; height: fit-content;
    display: flex; flex-direction: column; gap: 4px;
  }
  .nav-item-v2 {
    display: flex; align-items: center; gap: 10px;
    padding: 11px 14px; margin-bottom: 2px; border-radius: 9px;
    color: var(--muted); cursor: pointer; font-size: 13px;
    border: 1px solid transparent; transition: all .15s;
  }
  .nav-item-v2:hover { color: #fff; background: rgba(37,99,235,.08); }
  .nav-item-v2.active {
    color: #fff; background: linear-gradient(90deg, rgba(37,99,235,.25), rgba(37,99,235,.06));
    border-color: rgba(59,130,246,.35); box-shadow: inset 3px 0 0 var(--main);
  }
  .nav-item-v2 .nav-ico { font-size: 16px; }
  .nav-item-v2 .badge { margin-left: auto; font-size: 11px; padding: 1px 7px; border-radius: 10px; background: #26334d; color: #94a3b8; }
  .nav-item-v2 .badge.live { background: #ef4444; color: #fff; animation: pulse 1.5s infinite; }

  /* ========== 配置向导步骤条 ========== */
  .wizard-steps {
    display: flex; gap: 12px; margin-bottom: 16px;
    padding: 12px 16px; background: var(--card);
    border: 1px solid var(--border); border-radius: 10px;
  }
  .wizard-step {
    flex: 1; display: flex; align-items: center; gap: 8px;
    font-size: 13px; color: var(--muted); position: relative;
  }
  .wizard-step span:first-child {
    width: 26px; height: 26px; border-radius: 50%;
    background: #334155; color: #94a3b8;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 600; font-size: 12px; flex-shrink: 0;
  }
  .wizard-step.active { color: var(--text); }
  .wizard-step.active span:first-child {
    background: var(--main); color: #fff;
    box-shadow: 0 0 10px rgba(37,99,235,.4);
  }

  /* ========== 音色选择下拉 ========== */
  .speaker-select {
    width: 100%; padding: 8px 12px; font-size: 13px;
    background: #0f172a; color: var(--text);
    border: 1px solid var(--border); border-radius: 8px;
    outline: none; transition: border-color .15s;
  }
  .speaker-select:focus { border-color: var(--main); }
  .speaker-select option { background: #1e293b; }

  /* ========== 互动规则行 ========== */
  .rule-row {
    display: flex; align-items: center; gap: 8px;
    font-size: 13px; color: var(--text); cursor: pointer;
  }

  /* ========== 分段预览 ========== */
  .seg-preview {
    margin-top: 12px; padding: 10px 14px;
    background: #0b1220; border: 1px solid var(--border); border-radius: 8px;
    max-height: 200px; overflow-y: auto;
  }
  .seg-item {
    display: flex; align-items: flex-start; gap: 8px;
    padding: 4px 0; font-size: 13px; line-height: 1.5;
  }
  .seg-num {
    display: inline-flex; align-items: center; justify-content: center;
    width: 22px; height: 22px; border-radius: 50%;
    background: rgba(37,99,235,.2); color: #60a5fa;
    font-size: 11px; font-weight: 600; flex-shrink: 0;
  }
  .seg-more { color: var(--muted); font-size: 12px; padding: 6px 0; text-align: center; border-top: 1px solid rgba(51,65,85,.4); }

  /* ========== precheck 检测结果 ========== */
  .check-grid {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
    margin-top: 8px;
  }
  .check-item {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 12px; background: #0b1220;
    border: 1px solid var(--border); border-radius: 8px;
    font-size: 12px;
  }
  .check-item strong { color: var(--text); font-weight: 500; min-width: 70px; }
  .check-item .muted { flex: 1; }

  /* ========== 监控页 ========== */
  .monitor-card { border-left: 3px solid var(--main); }
  .monitor-card:nth-of-type(2) { border-left-color: #8b5cf6; }
  .monitor-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
  .monitor-text {
    font-size: 15px; color: #fff; line-height: 1.6;
    padding: 14px 16px; background: #0b1220;
    border-radius: 8px; min-height: 60px;
    border: 1px solid var(--border);
  }
  .monitor-queue { margin-top: 8px; font-size: 12px; color: var(--muted); }

  /* ========== 事件流 ========== */
  .event-stream { max-height: 400px; overflow-y: auto; }
  .event-stream .event-item {
    border-bottom: 1px solid rgba(51,65,85,.3);
    padding: 8px 4px;
  }
  .event-type {
    display: inline-block; font-size: 11px; padding: 2px 8px;
    border-radius: 6px; color: #fff; margin-right: 8px;
    background: #26334d;
  }

  /* ========================================================
     📱 手机 H5 响应式补丁 —— @media 768px / 480px / 360px
     ======================================================== */

  /* 禁止整个页面横向滚动 */
  html, body { overflow-x: hidden; }

  @media (max-width: 768px) {
    .app { padding: 8px; max-width: 100%; }

    /* Topbar 横向改纵向 */
    .topbar-v2 {
      flex-direction: column; gap: 8px;
      padding: 10px 12px;
    }
    .topbar-v2 .topbar-right { width: 100%; justify-content: flex-end; }
    .topbar-v2 h1 { font-size: 16px; letter-spacing: 0; }

    /* Wizard steps 缩小 */
    .wizard-steps { gap: 4px; flex-wrap: wrap; }
    .wizard-step {
      font-size: 11px; padding: 4px 8px; gap: 4px;
    }
    .wizard-step span {
      width: 20px; height: 20px; font-size: 10px;
    }

    /* Card padding 减小 */
    .card { padding: 12px; margin-bottom: 12px; border-radius: 10px; }
    .card h3 { font-size: 14px; }

    /* Script panel 两栏改单栏 */
    .script-panel { flex-direction: column; gap: 10px; min-height: auto; }
    .script-panel .col-left,
    .script-panel .col-right { flex: 1 1 auto; min-width: 0; }

    /* Grid 三栏改单栏 */
    .grid { grid-template-columns: 1fr; gap: 10px; }

    /* 按钮改大（手指友好） */
    .el-button { min-height: 40px; font-size: 14px; }

    /* 登录玻璃卡 */
    .glass-card { width: 100%; max-width: 400px; padding: 20px 16px; }
    .glass-title { font-size: 20px; }
    .glass-slogan { font-size: 12px; }

    /* 监控卡 */
    .monitor-text { font-size: 14px; padding: 10px 12px; }
    .event-stream { max-height: 250px; }

    /* Script 文本区 */
    .seg-text { font-size: 14px; }

    /* el-row 里的 col 间距 */
    .el-row { --el-row-gutter-x: 8px; }

    /* 表格横向滚动 */
    .el-table { font-size: 12px; }

    /* 输入框 */
    .el-input__wrapper, .el-textarea__inner { font-size: 14px; }
  }

  @media (max-width: 480px) {
    .app { padding: 6px; }

    .wizard-steps { justify-content: center; }
    .wizard-step { font-size: 10px; padding: 3px 6px; }
    .wizard-step span { width: 18px; height: 18px; font-size: 9px; }

    .card { padding: 10px; border-radius: 8px; }
    .card h3 { font-size: 13px; }

    .topbar-v2 h1 { font-size: 15px; }
    .topbar-v2 .topbar-right { font-size: 12px; }

    .glass-card { padding: 16px 12px; border-radius: 16px; }
    .glass-logo { width: 48px; height: 48px; font-size: 20px; }
    .glass-title { font-size: 18px; }

    /* 按钮更扁 */
    .el-button { min-height: 38px; padding: 8px 14px; font-size: 13px; }

    /* el-input-number 在手机上变宽 */
    .el-input-number { width: 100px !important; }

    /* 事件流 */
    .event-stream { max-height: 200px; }

    /* 隐藏次要装饰 */
    .bg-blob { opacity: 0.3; }
  }

  @media (max-width: 360px) {
    .wizard-step { font-size: 9px; padding: 2px 4px; gap: 2px; }
    .wizard-step span { width: 16px; height: 16px; font-size: 8px; }

    .card { padding: 8px; }

    /* 开关/按钮更紧凑 */
    .el-switch { --el-switch-height: 22px; --el-switch-width: 42px; }
  }

  /* iOS Safari 安全区 + 禁止双击缩放 */
  @supports (-webkit-touch-callout: none) {
    body {
      padding-bottom: env(safe-area-inset-bottom);
      padding-top: env(safe-area-inset-top);
    }
  }

  /* 横屏优化 */
  @media (max-height: 500px) and (orientation: landscape) {
    .app { padding: 6px; }
    .card { margin-bottom: 8px; }
    .wizard-steps { display: none; } /* 横屏隐藏步骤条，给内容更多空间 */
  }
