:root {
      --bg: #f7f7f8;
      --panel: #ffffff;
      --panel-soft: #f3f4f6;
      --text: #202123;
      --muted: #6b7280;
      --line: #e5e7eb;
      --line-strong: #d1d5db;
      --accent: #10a37f;
      --accent-hover: #0d8f70;
      --accent-soft: #e8f7f2;
      --danger: #c2413b;
      --danger-soft: #fff0ef;
      --warning: #9a6700;
      --warning-soft: #fff8db;
      --info: #2563eb;
      --info-soft: #eff6ff;
      --shadow: 0 1px 2px rgba(0, 0, 0, .05), 0 12px 32px rgba(0, 0, 0, .04);
      --radius: 16px;
      --radius-sm: 10px;
    }

    * { box-sizing: border-box; }
    [hidden] { display: none !important; }

    html { min-height: 100%; background: var(--bg); }
    body {
      min-height: 100vh;
      margin: 0;
      color: var(--text);
      background:
        radial-gradient(circle at 12% -10%, rgba(16, 163, 127, .08), transparent 30rem),
        var(--bg);
      font-family: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
      line-height: 1.5;
    }

    button, input, select, textarea { font: inherit; }
    button { cursor: pointer; }
    button:disabled { cursor: not-allowed; opacity: .55; }

    .topbar {
      position: sticky;
      top: 0;
      z-index: 20;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 16px;
      min-height: 64px;
      padding: 10px clamp(16px, 3vw, 36px);
      border-bottom: 1px solid rgba(229, 231, 235, .9);
      background: rgba(255, 255, 255, .9);
      backdrop-filter: blur(16px);
    }

    .brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
    .brand-mark {
      display: grid;
      place-items: center;
      width: 36px;
      height: 36px;
      flex: 0 0 auto;
      border-radius: 11px;
      color: white;
      background: var(--accent);
      font-weight: 800;
      letter-spacing: -.04em;
    }
    .brand-copy { min-width: 0; }
    .brand-title { margin: 0; font-size: 15px; font-weight: 720; }
    .brand-subtitle { margin: 1px 0 0; color: var(--muted); font-size: 12px; }

    .session-area { display: flex; align-items: center; justify-content: flex-end; gap: 10px; min-width: 0; }
    .session-label {
      max-width: min(42vw, 360px);
      overflow: hidden;
      color: var(--muted);
      font-size: 13px;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .shell { width: min(1500px, 100%); margin: 0 auto; padding: clamp(18px, 3vw, 34px); }

    .center-stage {
      display: grid;
      place-items: center;
      min-height: calc(100vh - 132px);
      padding: 22px 0 50px;
    }

    .auth-card, .gate-card {
      width: min(460px, 100%);
      padding: clamp(24px, 5vw, 38px);
      border: 1px solid var(--line);
      border-radius: 22px;
      background: rgba(255, 255, 255, .96);
      box-shadow: var(--shadow);
    }

    .auth-icon, .gate-icon {
      display: grid;
      place-items: center;
      width: 48px;
      height: 48px;
      margin-bottom: 22px;
      border-radius: 15px;
      color: var(--accent);
      background: var(--accent-soft);
      font-size: 22px;
      font-weight: 800;
    }
    .gate-icon { color: var(--danger); background: var(--danger-soft); }

    h1, h2, h3, p { margin-top: 0; }
    .auth-card h1, .gate-card h1 { margin-bottom: 8px; font-size: clamp(24px, 5vw, 30px); letter-spacing: -.035em; }
    .auth-lead, .gate-lead { margin-bottom: 26px; color: var(--muted); font-size: 14px; }

    .field { display: grid; gap: 7px; margin-bottom: 16px; }
    .field label { color: #374151; font-size: 13px; font-weight: 650; }
    .input, .select {
      width: 100%;
      min-height: 43px;
      padding: 9px 12px;
      border: 1px solid var(--line-strong);
      border-radius: var(--radius-sm);
      outline: 0;
      color: var(--text);
      background: var(--panel);
      transition: border-color .16s ease, box-shadow .16s ease;
    }
    .input:focus, .select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(16, 163, 127, .13); }
    .input::placeholder,
    textarea::placeholder { color: #858b95; opacity: 1; }

    .locked-prompt-list-body { padding: 20px 22px 22px; }
    .locked-prompt-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .locked-prompt-card {
      display: grid;
      align-content: start;
      gap: 10px;
      min-width: 0;
      padding: 16px;
      border: 1px solid var(--line);
      border-radius: 12px;
      background: var(--panel-soft);
    }
    .locked-prompt-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 11px; }
    .locked-prompt-card-title { overflow-wrap: anywhere; color: var(--text); font-size: 15px; line-height: 1.45; }
    .locked-prompt-card p { margin: 0; color: var(--muted); font-size: 11px; }
    .locked-prompt-card .btn { justify-self: end; margin-top: 2px; }
    .locked-prompt-empty { padding-block: 30px; }
    .locked-prompt-body { padding: 20px 22px 22px; }
    .locked-prompt-notice {
      display: grid;
      gap: 4px;
      margin-bottom: 20px;
      padding: 13px 15px;
      border: 1px solid #efd98f;
      border-radius: 11px;
      color: #76520a;
      background: var(--warning-soft);
      font-size: 12px;
    }
    .locked-prompt-notice strong { color: var(--warning); font-size: 13px; }
    .locked-prompt-label {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
    }
    .locked-prompt-label span { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
    .locked-prompt-textarea {
      min-height: 520px;
      resize: vertical;
      font-family: "SFMono-Regular", Consolas, "Liberation Mono", "Microsoft YaHei", monospace;
      font-size: 13px;
      line-height: 1.65;
      white-space: pre-wrap;
    }
    .locked-prompt-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 10px; }

    .check-row { display: flex; align-items: center; gap: 9px; margin: 4px 0 20px; color: var(--muted); font-size: 13px; }
    .check-row input { width: 16px; height: 16px; accent-color: var(--accent); }

    .btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 7px;
      min-height: 38px;
      padding: 8px 13px;
      border: 1px solid var(--line-strong);
      border-radius: 9px;
      color: #374151;
      background: var(--panel);
      font-weight: 650;
      transition: background .15s ease, border-color .15s ease, color .15s ease, transform .15s ease;
    }
    .btn:hover:not(:disabled) { background: var(--panel-soft); }
    .btn:active:not(:disabled) { transform: translateY(1px); }
    .btn.primary { border-color: var(--accent); color: white; background: var(--accent); }
    .btn.primary:hover:not(:disabled) { border-color: var(--accent-hover); background: var(--accent-hover); }
    .btn.danger { border-color: #f2c5c2; color: var(--danger); background: var(--danger-soft); }
    .btn.warning { border-color: #efd98f; color: var(--warning); background: var(--warning-soft); }
    .btn.soft { border-color: #bce8dc; color: #08735b; background: var(--accent-soft); }
    .btn.small { min-height: 31px; padding: 5px 9px; border-radius: 8px; font-size: 12px; }
    .btn.block { width: 100%; }

    .message { min-height: 22px; margin-top: 12px; font-size: 13px; }
    .message.error { color: var(--danger); }
    .message.success { color: #08735b; }

    .dashboard { display: grid; gap: 20px; }
    .dashboard-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
    .dashboard-title h1 { margin-bottom: 5px; font-size: clamp(25px, 4vw, 34px); letter-spacing: -.04em; }
    .dashboard-title p { margin-bottom: 0; color: var(--muted); font-size: 14px; }
    .dashboard-actions { display: flex; align-items: center; gap: 10px; }

    .tabs {
      display: flex;
      gap: 4px;
      padding: 4px;
      overflow-x: auto;
      border: 1px solid var(--line);
      border-radius: 12px;
      background: #eceeef;
      scrollbar-width: none;
    }
    .tabs::-webkit-scrollbar { display: none; }
    .tab {
      flex: 0 0 auto;
      min-height: 36px;
      padding: 7px 15px;
      border: 0;
      border-radius: 9px;
      color: var(--muted);
      background: transparent;
      font-size: 13px;
      font-weight: 680;
    }
    .tab[aria-selected="true"] { color: var(--text); background: white; box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }

    .stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
    .stat-card {
      min-width: 0;
      padding: 17px;
      border: 1px solid var(--line);
      border-radius: var(--radius);
      background: var(--panel);
      box-shadow: 0 1px 2px rgba(0, 0, 0, .025);
    }
    .stat-label { color: var(--muted); font-size: 12px; font-weight: 650; }
    .stat-value { margin-top: 8px; overflow: hidden; font-size: clamp(20px, 2.2vw, 28px); font-weight: 760; letter-spacing: -.04em; text-overflow: ellipsis; white-space: nowrap; }
    .stat-note { margin-top: 4px; color: #9ca3af; font-size: 11px; }

.panel {
      overflow: hidden;
      border: 1px solid var(--line);
      border-radius: var(--radius);
      background: var(--panel);
      box-shadow: 0 1px 2px rgba(0, 0, 0, .025);
}

.section-gap { margin-top: 20px; }
.section-gap-bottom { margin-bottom: 20px; }
.form-actions-top { margin-top: 12px; }
.api-config-body.compact-bottom { padding-bottom: 10px; }
.record-id { color: var(--muted); font-size: 10px; }
.pending-action {
  display: inline-flex;
  align-items: center;
  min-height: 31px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}
.pending-action::before {
  width: 12px;
  height: 12px;
  margin-right: 7px;
  border: 2px solid var(--line-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  content: '';
  animation: pending-spin .7s linear infinite;
}
@keyframes pending-spin { to { transform: rotate(360deg); } }
    .panel-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 16px;
      padding: 17px 18px;
      border-bottom: 1px solid var(--line);
    }
    .panel-title { min-width: 0; }
    .panel-title h2 { margin-bottom: 2px; font-size: 16px; }
    .panel-title p { margin-bottom: 0; color: var(--muted); font-size: 12px; }
    .panel-status { flex: 0 0 auto; color: var(--muted); font-size: 12px; }

    .filters {
      display: grid;
      grid-template-columns: minmax(220px, 1fr) repeat(2, minmax(130px, 180px));
      gap: 10px;
      padding: 14px 18px;
      border-bottom: 1px solid var(--line);
      background: #fbfbfc;
    }
    .filters.two { grid-template-columns: minmax(220px, 1fr) minmax(130px, 190px); }
    .filters .input, .filters .select { min-height: 38px; padding-top: 7px; padding-bottom: 7px; font-size: 13px; }

    .table-wrap { width: 100%; overflow-x: auto; }
    table { width: 100%; border-collapse: collapse; }
    th, td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
    th { color: var(--muted); background: #fbfbfc; font-size: 11px; font-weight: 720; letter-spacing: .02em; white-space: nowrap; }
    td { font-size: 13px; }
    tbody tr:last-child td { border-bottom: 0; }
    tbody tr:hover { background: #fcfcfd; }
    td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

    .identity { display: grid; gap: 2px; min-width: 150px; }
    .identity strong { overflow-wrap: anywhere; font-size: 13px; }
    .identity span { color: var(--muted); font-size: 11px; }

    .badge {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      min-height: 24px;
      padding: 3px 8px;
      border-radius: 999px;
      color: #4b5563;
      background: #eef0f2;
      font-size: 11px;
      font-weight: 680;
      white-space: nowrap;
    }
    .badge.ok { color: #08735b; background: var(--accent-soft); }
    .badge.warn { color: var(--warning); background: var(--warning-soft); }
    .badge.bad { color: var(--danger); background: var(--danger-soft); }
    .badge.info { color: var(--info); background: var(--info-soft); }
    .badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }

    .feature-list, .action-list { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
    .record-visibility-button { min-width: 74px; justify-content: center; white-space: nowrap; }
    .feature {
      display: inline-flex;
      align-items: center;
      min-height: 24px;
      padding: 3px 8px;
      border: 1px solid var(--line);
      border-radius: 999px;
      color: #9ca3af;
      background: white;
      font-size: 11px;
      white-space: nowrap;
    }
    .feature.on { border-color: #bce8dc; color: #08735b; background: var(--accent-soft); }

    .registration-settings-body { padding: 18px; }
    .registration-settings-row {
      display: grid;
      grid-template-columns: minmax(200px, 280px) minmax(270px, 1fr) auto;
      align-items: end;
      gap: 10px;
    }
    .registration-settings-row .field { margin-bottom: 0; }
    .feishu-route-row {
      grid-template-columns: minmax(240px, 360px) minmax(280px, 1fr) auto;
      align-items: center;
    }
    .feishu-route-row .security-note { margin: 0; }

    .toggle-setting {
      display: flex;
      align-items: center;
      gap: 11px;
      min-height: 43px;
      padding: 8px 11px;
      border: 1px solid var(--line);
      border-radius: var(--radius-sm);
      background: var(--panel-soft);
      cursor: pointer;
    }
    .toggle-setting > input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; }
    .toggle-track { position: relative; width: 38px; height: 22px; flex: 0 0 auto; border-radius: 99px; background: #cfd3d8; transition: background .16s ease; }
    .toggle-track span { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: white; box-shadow: 0 1px 4px rgba(0, 0, 0, .2); transition: transform .16s ease; }
    .toggle-setting > input:checked + .toggle-track { background: var(--accent); }
    .toggle-setting > input:checked + .toggle-track span { transform: translateX(16px); }
    .toggle-setting > input:focus-visible + .toggle-track { outline: 3px solid rgba(16, 163, 127, .18); outline-offset: 2px; }
    .toggle-copy { display: grid; min-width: 0; }
    .toggle-copy strong { color: #374151; font-size: 12px; }
    .toggle-copy small { color: var(--muted); font-size: 10px; line-height: 1.45; }

    .wallet-stack { display: grid; gap: 2px; min-width: 112px; }
    .wallet-stack strong { color: #08735b; font-variant-numeric: tabular-nums; }
    .wallet-stack span { color: var(--muted); font-size: 10px; white-space: nowrap; }
    .muted-line { margin-top: 4px; color: var(--muted); font-size: 10px; }

    .empty {
      padding: 44px 20px;
      color: var(--muted);
      text-align: center;
      font-size: 13px;
    }

    .api-config-body { padding: 20px; }
    .api-meta-grid {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 10px;
      margin-bottom: 20px;
    }
    .api-meta-item { min-width: 0; padding: 13px; border-radius: 11px; background: var(--panel-soft); }
    .api-meta-item span { display: block; color: var(--muted); font-size: 10px; }
    .api-meta-item strong { display: block; margin-top: 5px; overflow-wrap: anywhere; font-size: 14px; }
    .api-provider-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .api-provider-card {
      position: relative;
      overflow: hidden;
      padding: 14px;
      border: 1px solid var(--line);
      border-radius: 12px;
      background: linear-gradient(180deg, #fff 0%, #fbfbfc 100%);
      box-shadow: 0 8px 24px rgba(17, 24, 39, .035);
    }
    .api-provider-card::before { position: absolute; inset: 0 0 auto; height: 3px; background: var(--provider-accent, #111827); content: ""; }
    .api-provider-card.is-new { border-color: #9fdccc; background: linear-gradient(180deg, #fbfffe 0%, #f4fdf9 100%); box-shadow: 0 10px 30px rgba(16, 163, 127, .08); }
    .provider-openai { --provider-accent: #111827; }
    .provider-anthropic { --provider-accent: #c46f3c; }
    .provider-gemini { --provider-accent: linear-gradient(90deg, #4b83f5, #8a65d8); }
    .provider-xai { --provider-accent: #111827; }
    .provider-deepseek { --provider-accent: #3568f4; }
    .api-provider-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 11px; }
    .api-provider-head h3 { margin: 0; font-size: 14px; }
    .api-provider-head p { margin: 2px 0 0; color: var(--muted); font-size: 11px; }
    .provider-identity { display: flex; align-items: center; gap: 10px; min-width: 0; }
    .provider-identity > div { min-width: 0; }
    .provider-icon {
      display: inline-grid;
      place-items: center;
      width: 34px;
      height: 34px;
      flex: 0 0 auto;
      border: 1px solid rgba(17, 24, 39, .08);
      border-radius: 10px;
      color: #4a4d50;
      background: #fff;
      box-shadow: 0 6px 16px rgba(17, 24, 39, .08);
    }
    .provider-icon svg { width: 21px; height: 21px; }
    .provider-icon .provider-brand-image { display: block; width: 23px; height: 23px; object-fit: contain; }
    .provider-icon-anthropic { color: #d97757; }
    .provider-icon-xai { color: #42464a; }
    .provider-icon-deepseek { color: #3568f4; background: #fff; }
    .provider-gemini .provider-icon,
    .provider-icon-gemini { color: #4a4d50; background: #fff; }
    .provider-image2 { color: #0b7860; background: #e8faf4; }
    .provider-key-state {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      min-height: 42px;
      margin-bottom: 12px;
      padding: 9px 11px;
      border: 1px solid var(--line);
      border-radius: 10px;
      background: var(--panel-soft);
    }
    .provider-key-state span { color: var(--muted); font-size: 10px; }
    .provider-key-state strong { overflow-wrap: anywhere; font-size: 12px; font-variant-numeric: tabular-nums; text-align: right; }
    .api-provider-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; align-items: start; }
    .api-provider-fields .field { min-width: 0; margin-bottom: 0; }
    .api-provider-fields .field > span { display: block; margin-bottom: 6px; color: #374151; font-size: 12px; font-weight: 650; }
    .api-provider-fields .field.wide { grid-column: 1 / -1; }
    .api-provider-fields .field small { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; line-height: 1.45; }
    .provider-enabled-toggle { margin-top: 10px; }
    .api-provider-empty { padding-block: 30px; }
    .image2-key-state { max-width: 520px; }
    .preset-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 16px;
      margin: 14px 0;
      padding: 13px 14px;
      border: 1px solid #bce8dc;
      border-radius: 12px;
      background: var(--accent-soft);
    }
    .preset-row > div { display: grid; min-width: 0; gap: 3px; }
    .preset-row strong { color: #08735b; font-size: 12px; }
    .preset-row span { color: var(--muted); font-size: 10px; line-height: 1.5; }
    .preset-row .btn { flex: 0 0 auto; }
    .api-secret-row { display: grid; grid-template-columns: 1fr; gap: 9px; align-items: end; }
    .api-secret-row .field { margin-bottom: 0; }
    .api-secret-row .field small {
      display: block;
      margin-top: 5px;
      color: var(--muted);
      font-size: 10px;
      line-height: 1.45;
    }
    .provider-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
    .provider-actions .btn { flex: 0 0 auto; }
    .provider-model-pricing { margin: 12px 0; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
    .provider-model-pricing > strong { display: block; margin-bottom: 7px; font-size: 11px; }
    .provider-model-pricing.is-empty { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); }
    .provider-model-pricing.is-empty > strong { margin: 0; color: var(--text); }
    .provider-model-pricing.is-empty > span { font-size: 10px; }
    .provider-model-price-list { display: grid; gap: 7px; }
    .provider-model-price-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 7px; border-top: 1px solid var(--line); }
    .provider-model-price-row:first-child { padding-top: 0; border-top: 0; }
    .provider-model-price-row > div { min-width: 0; }
    .provider-model-price-row span, .provider-model-price-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .provider-model-price-row span { font-size: 11px; font-weight: 750; }
    .provider-model-price-row small { margin-top: 2px; color: var(--muted); font-size: 9px; font-variant-numeric: tabular-nums; }
    .provider-model-price-row .provider-model-final-cost { color: var(--text); font-weight: 700; }
    .provider-model-price-row .btn { flex: 0 0 auto; }
    .image2-config-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .image2-config-grid .field { margin-bottom: 0; }
    .image2-config-grid .wide { grid-column: 1 / -1; }
    .model-catalog-body { padding: 0 20px; }
    .model-editor {
      margin: 0 0 14px;
      padding: 16px;
      border: 1px solid #cfe9e2;
      border-radius: 14px;
      background: #f8fffc;
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9);
    }
    .model-editor-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
    .model-editor-head h3 { margin: 0; font-size: 16px; }
    .model-editor-head p { margin: 4px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
    .model-editor-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 11px; }
    .model-editor-grid .field { margin-bottom: 0; }
    .model-enabled-toggle { max-width: 430px; margin-top: 12px; }
    .model-editor-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
    .model-cost-preview {
      display: grid;
      grid-template-columns: auto minmax(0, 1fr) auto;
      align-items: center;
      gap: 10px 18px;
      margin-top: 14px;
      padding: 12px 14px;
      border: 1px solid #bce8dc;
      border-radius: 12px;
      color: #08735b;
      background: var(--accent-soft);
      font-size: 11px;
      font-variant-numeric: tabular-nums;
      line-height: 1.55;
    }
    .model-cost-preview-title { color: inherit; font-size: 11px; font-weight: 780; white-space: nowrap; }
    .model-cost-preview-values { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
    .model-cost-preview-value { display: inline-flex; align-items: baseline; gap: 5px; padding: 5px 8px; border: 1px solid currentColor; border-color: color-mix(in srgb, currentColor 20%, transparent); border-radius: 8px; background: rgba(255, 255, 255, .58); }
    .model-cost-preview-value span { opacity: .76; font-size: 9px; font-weight: 700; }
    .model-cost-preview-value strong { color: inherit; font-size: 12px; }
    .model-cost-preview-value small { opacity: .72; font-size: 9px; }
    .model-cost-preview-rate { margin: 0; opacity: .82; font-size: 9px; text-align: right; white-space: nowrap; }
    .model-cost-preview.is-empty { display: block; }
    .model-cost-preview.warn { border-color: #efd98f; color: var(--warning); background: var(--warning-soft); }
    .model-api-list-body { padding: 20px; }
    .model-api-list { display: grid; gap: 12px; }
    .model-api-row {
      position: relative;
      display: grid;
      grid-template-columns: minmax(240px, 1fr) minmax(460px, 1.8fr) auto;
      align-items: center;
      gap: 18px;
      min-width: 0;
      padding: 16px;
      overflow: hidden;
      border: 1px solid var(--line);
      border-radius: 14px;
      background: linear-gradient(180deg, #fff 0%, #fcfcfd 100%);
      box-shadow: 0 7px 22px rgba(17, 24, 39, .035);
    }
    .model-api-row::before { position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--provider-accent, #111827); content: ""; }
    .model-api-row-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
    .model-api-row-main .provider-icon { width: 38px; height: 38px; border-radius: 11px; box-shadow: none; }
    .model-api-identity { min-width: 0; }
    .model-api-name-label { margin-bottom: 3px; color: var(--muted); font-size: 9px; font-weight: 750; letter-spacing: .035em; }
    .model-api-title { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; min-width: 0; }
    .model-api-title h3 { max-width: 100%; margin: 0; overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
    .model-api-identity p { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px; margin: 4px 0 0; overflow: hidden; color: var(--muted); font-size: 11px; }
    .model-api-identity p span { color: #687386; font-size: 10px; font-weight: 700; white-space: nowrap; }
    .model-api-identity p code { overflow: hidden; color: var(--text); font-family: inherit; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
    .model-api-facts { display: grid; grid-template-columns: minmax(110px, 1fr) minmax(110px, 1fr) minmax(92px, .8fr) minmax(80px, .65fr); gap: 8px 13px; min-width: 0; margin: 0; }
    .model-api-facts > div { min-width: 0; }
    .model-api-facts .wide { grid-column: 1 / -1; }
    .model-api-facts dt { color: var(--muted); font-size: 10px; }
    .model-api-facts dd { margin: 2px 0 0; overflow: hidden; font-size: 11px; font-variant-numeric: tabular-nums; font-weight: 680; text-overflow: ellipsis; white-space: nowrap; }
    .model-api-actions { display: grid; gap: 7px; min-width: 76px; }
    .model-api-actions .btn { width: 100%; }
    .model-api-editor { padding: 20px; }
    .model-editor-section {
      padding: 16px;
      border: 1px solid var(--line);
      border-radius: 14px;
      background: #fff;
    }
    .model-editor-section-spaced { margin-top: 14px; }
    .model-editor-section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
    .model-editor-section-head > div { display: grid; gap: 3px; min-width: 0; }
    .model-editor-section-head > div > strong { color: var(--text); font-size: 14px; }
    .model-editor-section-head > div > span { color: var(--muted); font-size: 10px; line-height: 1.45; }
    .model-fallback-section { margin-top: 14px; border-color: #d9d4f5; background: linear-gradient(180deg, #fdfcff 0%, #faf9ff 100%); }
    .model-fallback-head { align-items: center; }
    .fallback-api-toggle { max-width: 360px; margin: 0; background: rgba(255, 255, 255, .72); }
    .fallback-api-key-summary { margin-bottom: 14px; }
    .fallback-api-fields { transition: opacity .16s ease; }
    .fallback-api-fields[aria-disabled="true"] { opacity: .5; }
    .model-editor-subsection-title { display: grid; gap: 3px; margin: 17px 0 11px; padding-top: 15px; border-top: 1px solid rgba(91, 70, 163, .14); }
    .model-editor-subsection-title strong { color: var(--text); font-size: 12px; }
    .model-editor-subsection-title span { color: var(--muted); font-size: 10px; line-height: 1.45; }
    .fallback-cost-preview { border-color: #d9d4f5; color: #5b46a3; background: #f3f0ff; }
    .fallback-cost-preview.warn { border-color: #efd98f; color: var(--warning); background: var(--warning-soft); }
    .model-editor-eyebrow { margin-bottom: 4px !important; color: var(--accent) !important; font-size: 10px !important; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; }
    .model-api-key-summary {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 14px;
      margin-bottom: 18px;
      padding: 13px 14px;
      border: 1px solid var(--line);
      border-radius: 12px;
      background: var(--panel-soft);
    }
    .model-api-key-summary.fallback-api-key-summary { background: rgba(255, 255, 255, .72); }
    .model-api-key-summary > div { display: grid; min-width: 0; gap: 3px; }
    .model-api-key-summary span { color: var(--muted); font-size: 10px; }
    .model-api-key-summary strong { overflow-wrap: anywhere; font-size: 13px; font-variant-numeric: tabular-nums; }
    .model-api-editor .model-editor-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .model-api-editor .model-identity-grid,
    .model-api-editor .model-billing-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .model-api-editor .model-route-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .model-api-editor .model-editor-grid .wide { grid-column: 1 / -1; }
    .model-api-editor .field small { display: block; color: var(--muted); font-size: 10px; line-height: 1.45; }
    .model-api-editor input[readonly] { color: #687386; background: #f4f6f8; cursor: not-allowed; }
    .recharge-idempotency-note { margin-top: -3px; }
    .model-table { min-width: 1080px; }
    .model-provider { display: flex; align-items: center; gap: 8px; min-width: 170px; }
    .model-provider .provider-icon { width: 28px; height: 28px; border-radius: 8px; box-shadow: none; }
    .model-provider .provider-icon svg { width: 15px; height: 15px; }
    .model-provider .provider-icon .provider-brand-image { width: 17px; height: 17px; }
    .model-provider-copy { display: grid; min-width: 0; }
    .model-provider-copy strong { font-size: 12px; }
    .model-provider-copy span { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
    .model-billing { display: grid; gap: 2px; min-width: 120px; }
    .model-billing strong { font-size: 11px; font-variant-numeric: tabular-nums; }
    .model-billing span { color: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; }
    .history-lock { display: inline-flex; align-items: center; gap: 5px; color: var(--warning); font-size: 10px; font-weight: 700; line-height: 1.4; }
    .history-lock::before { content: "●"; font-size: 7px; }
    .pending-action { color: var(--warning); font-size: 11px; font-weight: 700; }
    .security-note { margin: 12px 0 0; color: var(--muted); font-size: 11px; line-height: 1.65; }
    .test-actions { display: flex; align-items: center; gap: 10px; }

    .loading-line {
      height: 3px;
      overflow: hidden;
      background: transparent;
    }
    .loading-line::after {
      display: block;
      width: 35%;
      height: 100%;
      border-radius: 99px;
      background: var(--accent);
      content: "";
      animation: loading 1.2s ease-in-out infinite;
    }
    @keyframes loading { from { transform: translateX(-120%); } to { transform: translateX(400%); } }

    body.modal-open { overflow: hidden; }
    .modal-backdrop {
      position: fixed;
      inset: 0;
      z-index: 40;
      display: grid;
      place-items: center;
      padding: 18px;
      background: rgba(17, 24, 39, .46);
      backdrop-filter: blur(4px);
    }
    .modal-card {
      width: min(520px, 100%);
      max-height: calc(100vh - 36px);
      overflow-y: auto;
      border: 1px solid var(--line);
      border-radius: 20px;
      background: white;
      box-shadow: 0 24px 70px rgba(0, 0, 0, .2);
    }
    .modal-head {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 18px;
      padding: 20px 22px 16px;
      border-bottom: 1px solid var(--line);
    }
    .modal-head h2 { margin-bottom: 3px; font-size: 19px; }
    .modal-head p { margin-bottom: 0; color: var(--muted); font-size: 12px; }
    .modal-close { flex: 0 0 auto; width: 34px; min-height: 34px; padding: 0; font-size: 19px; }
    .modal-body { padding: 20px 22px 8px; }
    .wallet-preview {
      display: grid;
      grid-template-columns: repeat(5, minmax(0, 1fr));
      gap: 8px;
      margin-bottom: 20px;
    }
    .wallet-preview-item { min-width: 0; padding: 11px; border-radius: 10px; background: var(--panel-soft); }
    .wallet-preview-item span { display: block; color: var(--muted); font-size: 10px; }
    .wallet-preview-item strong { display: block; margin-top: 4px; overflow: hidden; font-size: 15px; font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; }
    .modal-actions { display: flex; justify-content: flex-end; gap: 9px; padding: 12px 22px 22px; }
    .usage-detail-card { width: min(980px, 100%); }
    .usage-detail-body {
      display: grid;
      gap: 18px;
      padding-bottom: 10px;
    }
    .usage-detail-section { min-width: 0; }
    .usage-detail-heading {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      margin-bottom: 7px;
    }
    .usage-detail-heading h3 { margin: 0; font-size: 14px; }
    .usage-detail-heading span { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
    .usage-detail-section pre {
      min-height: 112px;
      max-height: min(34vh, 360px);
      margin: 0;
      padding: 13px 14px;
      overflow: auto;
      border: 1px solid var(--line);
      border-radius: 10px;
      color: #27303f;
      background: #f8fafc;
      font-family: "SFMono-Regular", Consolas, "Liberation Mono", "Microsoft YaHei", monospace;
      font-size: 12px;
      line-height: 1.6;
      overflow-wrap: anywhere;
      white-space: pre-wrap;
    }
    .usage-attachment-list {
      display: grid;
      gap: 6px;
      margin: 0;
      padding: 0;
      list-style: none;
    }
    .usage-attachment-list li {
      padding: 8px 10px;
      border: 1px solid var(--line);
      border-radius: 9px;
      color: #374151;
      background: var(--panel-soft);
      font-size: 12px;
      overflow-wrap: anywhere;
    }
    .usage-detail-error {
      padding: 10px 12px;
      border: 1px solid #f2c5c2;
      border-radius: 9px;
      color: var(--danger);
      background: var(--danger-soft);
      font-size: 12px;
      white-space: pre-wrap;
    }

    .toast-region {
      position: fixed;
      right: 18px;
      bottom: 18px;
      z-index: 50;
      display: grid;
      gap: 8px;
      width: min(380px, calc(100vw - 36px));
      pointer-events: none;
    }
    .toast {
      padding: 11px 13px;
      border: 1px solid var(--line);
      border-radius: 11px;
      color: #374151;
      background: white;
      box-shadow: var(--shadow);
      font-size: 13px;
      animation: toast-in .18s ease-out;
    }
    .toast.error { border-color: #f2c5c2; color: var(--danger); background: #fffafa; }
    .toast.success { border-color: #bce8dc; color: #08735b; background: #f8fffc; }
    @keyframes toast-in { from { opacity: 0; transform: translateY(6px); } }

    .sr-only {
      position: absolute;
      width: 1px;
      height: 1px;
      padding: 0;
      margin: -1px;
      overflow: hidden;
      clip: rect(0, 0, 0, 0);
      white-space: nowrap;
      border: 0;
    }

    @media (max-width: 1180px) {
      .stats-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
      .api-provider-list { grid-template-columns: 1fr; }
      .model-editor-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      .model-api-row { grid-template-columns: minmax(240px, .9fr) minmax(420px, 1.6fr); }
      .model-api-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; }
      .model-api-actions .btn { width: auto; }
      .model-api-editor .model-editor-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    }

    @media (max-width: 760px) {
      .topbar { align-items: flex-start; padding: 10px 14px; }
      .brand-subtitle { display: none; }
      .session-area { flex-direction: column; align-items: flex-end; gap: 5px; }
      .session-label { max-width: 48vw; font-size: 11px; }
      .session-area .btn { min-height: 30px; padding: 4px 9px; font-size: 12px; }
      .shell { padding: 16px 12px 28px; }
      .dashboard-head { align-items: stretch; flex-direction: column; }
      .dashboard-actions { justify-content: space-between; }
      .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
      .stat-card { padding: 14px; border-radius: 13px; }
      .filters, .filters.two { grid-template-columns: 1fr; padding: 12px; }
      .panel-head { align-items: flex-start; flex-direction: column; padding: 14px; }
      .panel-head .test-actions { width: 100%; flex-wrap: wrap; justify-content: space-between; }
      .panel-head .test-actions .btn { flex: 0 0 auto; white-space: nowrap; }

      table, thead, tbody, tr, th, td { display: block; }
      thead { display: none; }
      tbody { padding: 0 12px 12px; }
      tbody tr {
        display: grid;
        gap: 0;
        margin-top: 12px;
        padding: 8px 12px;
        border: 1px solid var(--line);
        border-radius: 12px;
        background: white;
      }
      tbody tr:hover { background: white; }
      td, td.num {
        display: grid;
        grid-template-columns: minmax(92px, 34%) 1fr;
        align-items: start;
        gap: 10px;
        min-height: 38px;
        padding: 9px 0;
        border-bottom: 1px dashed var(--line);
        text-align: left;
        white-space: normal;
      }
      td:last-child { border-bottom: 0; }
      td::before { color: var(--muted); content: attr(data-label); font-size: 11px; font-weight: 700; }
      .identity { min-width: 0; }
      .action-list, .feature-list { justify-content: flex-start; }
      .empty { margin: 12px 0 0; }
      .wallet-preview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      .api-meta-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      .api-provider-list { grid-template-columns: 1fr; }
      .api-provider-fields { grid-template-columns: 1fr; }
      .api-provider-fields .field.wide { grid-column: auto; }
      .api-secret-row { grid-template-columns: 1fr; }
      .provider-actions { display: grid; grid-template-columns: 1fr; }
      .provider-actions .btn { width: 100%; }
      .provider-model-price-row { align-items: stretch; flex-direction: column; }
      .provider-model-price-row .btn { width: 100%; }
      .preset-row { align-items: stretch; flex-direction: column; }
      .preset-row .btn { width: 100%; }
      .image2-config-grid { grid-template-columns: 1fr; }
      .image2-config-grid .wide { grid-column: auto; }
      .registration-settings-row { grid-template-columns: 1fr; }
      .registration-settings-row .btn { width: 100%; }
      .locked-prompt-list-body { padding: 14px; }
      .locked-prompt-list { grid-template-columns: 1fr; }
      .locked-prompt-body { padding: 14px; }
      .locked-prompt-textarea { min-height: 420px; }
      .locked-prompt-actions { display: grid; grid-template-columns: 1fr; }
      .locked-prompt-actions .btn { width: 100%; }
      .usage-detail-card { max-height: calc(100vh - 20px); }
      .usage-detail-section pre { max-height: 31vh; }
      .model-catalog-body { padding: 0 14px; }
      .model-editor-grid { grid-template-columns: 1fr; }
      .model-editor-actions { display: grid; grid-template-columns: 1fr; }
      .model-editor-actions .btn { width: 100%; }
      .model-table { min-width: 0; }
      .model-api-list-body, .model-api-editor { padding: 14px; }
      .model-api-row { grid-template-columns: 1fr; gap: 14px; padding: 14px; }
      .model-api-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      .model-api-facts .wide { grid-column: 1 / -1; }
      .model-api-actions { grid-column: auto; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
      .model-api-actions .btn { width: 100%; }
      .model-api-editor .model-editor-grid { grid-template-columns: 1fr; }
      .model-api-editor .model-editor-grid .wide { grid-column: auto; }
      .model-editor-section { padding: 13px; }
      .model-cost-preview { grid-template-columns: 1fr; gap: 8px; }
      .model-cost-preview-rate { text-align: left; white-space: normal; }
      .model-fallback-head { align-items: stretch; flex-direction: column; }
      .fallback-api-toggle { max-width: none; }
      .model-api-key-summary { align-items: stretch; flex-direction: column; }
      .model-api-key-summary .btn { width: 100%; }
    }

    @media (max-width: 420px) {
      .stats-grid { grid-template-columns: 1fr; }
      .dashboard-actions { align-items: stretch; flex-direction: column; }
      .dashboard-actions .btn { width: 100%; }
      .tab { padding-inline: 12px; }
      td, td.num { grid-template-columns: 82px 1fr; }
    }

    /* Dubbing workbench */
    .dubbing-workbench,
    .dubbing-voice-modal,
    .dubbing-project-modal,
    .dubbing-config-panel {
      --dubbing-accent: #f05a17;
      --dubbing-accent-hover: #d94d10;
      --dubbing-accent-soft: #fff5ef;
    }
    .dubbing-workbench {
      display: grid;
      grid-template-columns: minmax(280px, 320px) minmax(0, 1fr);
      gap: 16px;
      min-height: 620px;
    }
    .dubbing-sidebar,
    .dubbing-main {
      min-width: 0;
      border: 1px solid var(--line);
      border-radius: 14px;
      background: rgba(255, 255, 255, .98);
      box-shadow: 0 8px 28px rgba(17, 24, 39, .035);
    }
    .dubbing-sidebar {
      display: flex;
      flex-direction: column;
      padding: 16px 12px 14px;
    }
    .dubbing-sidebar-head,
    .dubbing-main-head {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 14px;
    }
    .dubbing-sidebar-head {
      margin: 0 4px 12px;
      padding: 2px 5px 14px;
      border-bottom: 1px solid var(--line);
    }
    .dubbing-sidebar-head h2,
    .dubbing-main-head h2 {
      margin: 0;
      letter-spacing: -.035em;
    }
    .dubbing-sidebar-head h2 { font-size: 18px; }
    .dubbing-kicker {
      margin: 0 0 3px;
      color: #a65730;
      font-size: 12px;
      font-weight: 800;
      letter-spacing: .12em;
      text-transform: uppercase;
    }
    .dubbing-project-list {
      display: grid;
      align-content: start;
      gap: 8px;
      flex: 1 1 auto;
      min-height: 0;
      padding-right: 4px;
      overflow-y: auto;
      overscroll-behavior: contain;
      scrollbar-gutter: stable;
      scrollbar-color: #d17a4c #f4f1ef;
      scrollbar-width: auto;
    }
    .dubbing-project-list::-webkit-scrollbar { width: 12px; }
    .dubbing-project-list::-webkit-scrollbar-track {
      border-radius: 999px;
      background: #f4f1ef;
    }
    .dubbing-project-list::-webkit-scrollbar-thumb {
      min-height: 48px;
      border: 3px solid #f4f1ef;
      border-radius: 999px;
      background: #d17a4c;
    }
    .dubbing-project-list::-webkit-scrollbar-thumb:hover { background: #b95f31; }
    .dubbing-project {
      overflow: hidden;
      border: 1px solid transparent;
      border-radius: 13px;
      background: #fff;
    }
    .dubbing-project.open {
      border-color: #eadfd8;
      background: #fdfcfb;
    }
    .dubbing-project.archived {
      border-color: #e2e4e8;
      background: #f7f7f8;
    }
    .dubbing-project-toggle {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      align-items: center;
      gap: 8px;
      width: 100%;
      min-height: 54px;
      padding: 10px;
      color: var(--text);
      background: transparent;
    }
    .dubbing-project-toggle:hover { background: #f8f8f8; }
    .project-disclosure {
      display: grid;
      grid-template-columns: 24px minmax(0, 1fr) auto auto;
      align-items: center;
      gap: 8px;
      min-width: 0;
      padding: 0;
      border: 0;
      color: inherit;
      background: transparent;
      text-align: left;
    }
    .project-chevron {
      position: relative;
      display: grid;
      place-items: center;
      width: 24px;
      height: 24px;
      border-radius: 8px;
      background: #f0f1f3;
      transition: background .16s ease;
    }
    .project-chevron::before {
      width: 7px;
      height: 7px;
      border-right: 2px solid #6c727c;
      border-bottom: 2px solid #6c727c;
      content: "";
      transform: rotate(-45deg);
      transition: transform .16s ease;
    }
    .dubbing-project.open .project-chevron { background: #fff0e7; }
    .dubbing-project.open .project-chevron::before { transform: rotate(45deg) translate(-1px, -1px); }
    .project-title {
      overflow: hidden;
      font-size: 15px;
      font-weight: 750;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .project-voice-count {
      color: var(--muted);
      font-size: 12px;
      white-space: nowrap;
    }
    .project-archive-badge {
      padding: 3px 7px;
      border-radius: 999px;
      color: #626873;
      background: #e8eaed;
      font-size: 11px;
      font-weight: 720;
      white-space: nowrap;
    }
    .project-settings {
      display: grid;
      place-items: center;
      width: 28px;
      height: 28px;
      padding: 0;
      border: 0;
      border-radius: 8px;
      color: #6b7280;
      background: transparent;
      font-size: 16px;
    }
    .project-settings:hover { color: #222; background: #eee; }
    .dubbing-voice-list {
      display: grid;
      gap: 4px;
      padding: 0 7px 8px;
    }
    .dubbing-voice {
      display: grid;
      grid-template-columns: 40px minmax(0, 1fr) auto;
      align-items: center;
      gap: 9px;
      min-height: 60px;
      width: 100%;
      padding: 9px 10px;
      border: 1px solid transparent;
      border-radius: 11px;
      color: var(--text);
      background: transparent;
      text-align: left;
    }
    .dubbing-voice:hover { background: #f5f5f5; }
    .dubbing-voice.selected {
      border-color: #f0cdbb;
      background: var(--dubbing-accent-soft);
      box-shadow: inset 3px 0 0 var(--dubbing-accent);
    }
    .voice-avatar {
      display: grid;
      place-items: center;
      width: 40px;
      height: 40px;
      flex: 0 0 auto;
      border-radius: 50%;
      color: #7b3f21;
      background: linear-gradient(145deg, #f6c6aa, #f2e0d5);
      font-size: 12px;
      font-weight: 800;
    }
    .dubbing-voice-copy {
      min-width: 0;
      display: grid;
      gap: 2px;
    }
    .dubbing-voice-copy strong {
      overflow: hidden;
      font-size: 14px;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .dubbing-voice-copy span {
      overflow: hidden;
      color: var(--muted);
      font-size: 13px;
      line-height: 1.35;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .voice-select-mark { color: var(--dubbing-accent); font-size: 15px; font-weight: 800; }
    .new-voice-button {
      min-height: 46px;
      margin: 4px 0 0;
      border: 1px dashed #cfc8c3;
      border-radius: 11px;
      color: #4b4f55;
      background: white;
      font-size: 13px;
      font-weight: 700;
    }
    .new-voice-button:hover { border-color: var(--dubbing-accent); color: var(--dubbing-accent-hover); background: var(--dubbing-accent-soft); }
    .dubbing-sidebar-note {
      margin: 10px 8px 0;
      color: #93979f;
      font-size: 12px;
      line-height: 1.55;
      text-align: center;
    }
    .dubbing-empty {
      display: grid;
      place-items: center;
      gap: 4px;
      min-height: 220px;
      padding: 24px;
      color: var(--muted);
      text-align: center;
    }
    .dubbing-empty strong { color: #4b5563; font-size: 14px; }
    .dubbing-empty span { font-size: 13px; }
    .dubbing-empty.compact { min-height: 58px; padding: 12px; }

    .dubbing-main { padding: clamp(22px, 2.4vw, 30px); }
    .dubbing-main-head { margin-bottom: 18px; }
    .dubbing-main-head h2 { margin-bottom: 4px; font-size: clamp(24px, 3vw, 31px); }
    .dubbing-main-head > div > p:last-child { margin: 0; color: var(--muted); font-size: 15px; }
    .dubbing-wallet {
      display: grid;
      gap: 1px;
      min-width: 138px;
      padding: 10px 14px;
      border: 1px solid var(--line);
      border-radius: 11px;
      text-align: right;
      white-space: nowrap;
    }
    .dubbing-wallet span { color: var(--muted); font-size: 12px; }
    .dubbing-wallet strong { font-size: 15px; font-variant-numeric: tabular-nums; }
    .dubbing-form {
      display: grid;
      gap: 12px;
    }
    .selected-voice-card {
      display: grid;
      grid-template-columns: 48px minmax(0, 1fr) auto;
      align-items: center;
      gap: 12px;
      min-height: 74px;
      padding: 11px 15px;
      border: 1px solid var(--line);
      border-radius: 13px;
      background: #fff;
    }
    .selected-voice-card .voice-avatar { width: 42px; height: 42px; background: linear-gradient(145deg, #e99d70, #f3cfb8); color: white; font-size: 14px; }
    .selected-voice-copy { display: grid; gap: 2px; min-width: 0; }
    .selected-voice-copy span { color: var(--muted); font-size: 12px; }
    .selected-voice-copy strong { overflow: hidden; font-size: 16px; text-overflow: ellipsis; white-space: nowrap; }
    .selected-voice-copy small { overflow: hidden; color: #707680; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
    .selected-voice-copy .selected-voice-owner { color: #9a5c3b; }
    .selected-voice-tools {
      display: flex;
      align-items: center;
      justify-content: flex-end;
      gap: 7px;
      flex-wrap: wrap;
      max-width: 260px;
    }
    .voice-source-badge,
    .model-pill {
      padding: 5px 9px;
      border-radius: 999px;
      font-size: 12px;
      font-weight: 750;
      white-space: nowrap;
    }
    .voice-source-badge { color: #9d4c21; background: #fff0e7; }
    .model-pill { color: #4b5563; background: #f2f3f5; }
    .dubbing-field {
      padding: 13px 16px 11px;
      border: 1px solid var(--line);
      border-radius: 13px;
      background: white;
      transition: border-color .16s ease, box-shadow .16s ease;
    }
    .dubbing-field:focus-within {
      border-color: #e9ab89;
      box-shadow: 0 0 0 3px rgba(240, 90, 23, .08);
    }
    .dubbing-label-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      margin-bottom: 7px;
    }
    .dubbing-label-row label { font-size: 14px; font-weight: 760; }
    .dubbing-label-row span { color: #858991; font-size: 12px; font-variant-numeric: tabular-nums; }
    .dubbing-field textarea {
      width: 100%;
      min-height: 72px;
      padding: 0;
      resize: vertical;
      border: 0;
      outline: 0;
      color: var(--text);
      background: transparent;
      font-size: 16px;
      line-height: 1.7;
    }
    .dubbing-submit-row {
      display: flex;
      align-items: center;
      justify-content: flex-end;
      gap: 18px;
    }
    .dubbing-cost { display: grid; gap: 2px; text-align: right; }
    .dubbing-cost span { color: var(--muted); font-size: 12px; }
    .dubbing-cost strong { font-size: 14px; font-variant-numeric: tabular-nums; }
    .btn.dubbing-primary {
      min-height: 46px;
      padding: 10px 22px;
      border-color: var(--dubbing-accent);
      color: white;
      background: var(--dubbing-accent);
      font-size: 15px;
      box-shadow: 0 5px 16px rgba(240, 90, 23, .16);
    }
    .btn.dubbing-primary:hover:not(:disabled) { border-color: var(--dubbing-accent-hover); background: var(--dubbing-accent-hover); }
    .dubbing-result {
      display: grid;
      grid-template-columns: minmax(150px, .7fr) minmax(220px, 1.4fr) auto auto;
      align-items: center;
      gap: 14px;
      margin-top: 16px;
      padding: 13px 15px;
      border: 1px solid #eadfd8;
      border-radius: 13px;
      background: #fdfbf9;
    }
    .result-play { display: flex; align-items: center; gap: 9px; min-width: 0; }
    .result-status-badge {
      display: inline-flex;
      flex: 0 0 auto;
      align-items: center;
      justify-content: center;
      min-height: 29px;
      padding: 5px 9px;
      border: 1px solid #b9dfd2;
      border-radius: 999px;
      color: #16785c;
      background: #eaf7f2;
      font-size: 12px;
      font-weight: 800;
      white-space: nowrap;
    }
    .result-play div { display: grid; min-width: 0; }
    .result-play strong { font-size: 14px; }
    .result-play div > span { color: var(--muted); font-size: 12px; }
    .dubbing-result audio { width: 100%; min-width: 0; height: 36px; }

    .voice-create-tabs {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 4px;
      margin: 0 22px;
      padding: 4px;
      border-radius: 11px;
      background: #f0f1f2;
    }
    .voice-create-tabs button {
      min-height: 36px;
      border: 0;
      border-radius: 8px;
      color: var(--muted);
      background: transparent;
      font-size: 12px;
      font-weight: 720;
    }
    .voice-create-tabs button.active { color: #8b3d18; background: white; box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
    .dubbing-voice-modal { width: min(720px, 100%); max-height: calc(100vh - 36px); overflow-y: auto; }
    .dubbing-project-modal { width: min(620px, 100%); max-height: calc(100vh - 36px); overflow-y: auto; }
    .voice-design-intro {
      display: grid;
      grid-template-columns: 40px minmax(0, 1fr) auto;
      align-items: center;
      gap: 11px;
      margin-bottom: 18px;
      padding: 12px;
      border: 1px solid #f0ded4;
      border-radius: 12px;
      background: var(--dubbing-accent-soft);
    }
    .voice-design-symbol {
      display: grid;
      place-items: center;
      width: 38px;
      height: 38px;
      border-radius: 50%;
      color: white;
      background: #e77c43;
      font-size: 12px;
      font-weight: 800;
    }
    .voice-design-intro div { display: grid; gap: 2px; }
    .voice-design-intro strong { font-size: 14px; }
    .voice-design-intro p { margin: 0; color: #765f54; font-size: 13px; line-height: 1.55; }
    .voice-design-price { color: #9f471b; font-size: 13px; font-weight: 750; white-space: nowrap; }
    .voice-modal-textarea { min-height: 112px; resize: vertical; }
    .voice-modal-textarea.short { min-height: 78px; }
    .voice-design-candidates {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 10px;
      margin: 16px 0;
    }
    .voice-candidate {
      display: grid;
      gap: 9px;
      padding: 12px;
      border: 1px solid var(--line);
      border-radius: 12px;
      background: #fff;
      cursor: pointer;
    }
    .voice-candidate.selected { border-color: #e99d70; box-shadow: 0 0 0 3px rgba(240, 90, 23, .08); }
    .voice-candidate-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
    .voice-candidate-head strong { font-size: 13px; }
    .voice-candidate-head input { accent-color: var(--dubbing-accent); }
    .voice-candidate audio { width: 100%; height: 34px; }
    .voice-candidate small { color: var(--muted); font-size: 12px; }
    .voice-rights-check { margin-bottom: 0; }
    .modal-actions.embedded { padding: 12px 0 14px; }
    .project-archive-setting { margin: 4px 0 16px; }
    .voice-edit-modal { width: min(580px, 100%); }
    .voice-edit-actions { align-items: center; }
    .modal-action-spacer { flex: 1 1 auto; }
    .dubbing-usage-badge { color: #9f471b; background: #fff0e7; }
    .usage-ledger-label { color: #6b7280; font-size: 12px; font-weight: 650; }
    .dubbing-config-grid {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 12px;
    }
    .dubbing-config-grid .field { margin: 0; }
    .dubbing-config-grid .wide { grid-column: span 2; }
    .provider-fish { color: white; background: linear-gradient(145deg, #f08b53, #d34b11); font-size: 13px; font-weight: 800; }

    .dubbing-admin-head-actions {
      display: flex;
      align-items: stretch;
      gap: 10px;
    }
    .dubbing-admin-head-actions .btn {
      min-height: 100%;
      white-space: nowrap;
    }
    .dubbing-admin-stats {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 10px;
      margin-bottom: 14px;
    }
    .dubbing-admin-stats article {
      display: grid;
      gap: 3px;
      min-height: 82px;
      padding: 14px 15px;
      border: 1px solid var(--line);
      border-radius: 12px;
      background: #fafafa;
    }
    .dubbing-admin-stats span {
      color: var(--muted);
      font-size: 12px;
    }
    .dubbing-admin-stats strong {
      align-self: end;
      font-size: 22px;
      letter-spacing: -.035em;
    }
    .dubbing-admin-stats strong.ready { color: #08735b; font-size: 17px; }
    .dubbing-admin-stats strong.not-ready { color: var(--danger); font-size: 17px; }
    .dubbing-admin-selected-voice { margin-bottom: 14px; }
    .dubbing-admin-workbench .dubbing-sidebar { max-height: min(760px, calc(100vh - 150px)); }
    .dubbing-admin-launch {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 18px;
      padding: 19px 20px;
      border: 1px solid #f0ded4;
      border-radius: 13px;
      background: var(--dubbing-accent-soft);
    }
    .dubbing-admin-launch h3 { margin: 0 0 4px; font-size: 16px; }
    .dubbing-admin-launch p { margin: 0; color: #806a5e; font-size: 13px; }
    .dubbing-admin-launch .btn { flex: 0 0 auto; white-space: nowrap; }

    @media (max-width: 980px) {
      .dubbing-workbench { grid-template-columns: minmax(230px, 290px) minmax(0, 1fr); }
      .dubbing-result { grid-template-columns: 1fr auto; }
      .dubbing-result audio { grid-column: 1 / -1; grid-row: 2; }
      .dubbing-config-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      .dubbing-admin-head-actions { align-items: stretch; flex-direction: column; }
      .dubbing-admin-head-actions .dubbing-wallet { text-align: left; }
      .dubbing-admin-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    }

    @media (max-width: 760px) {
      .dubbing-workbench { grid-template-columns: 1fr; min-height: 0; }
      .dubbing-sidebar { max-height: none; }
      .dubbing-project-list { max-height: 330px; overflow-y: auto; }
      .dubbing-main { padding: 18px 14px; }
      .dubbing-main-head { align-items: stretch; flex-direction: column; }
      .dubbing-wallet { align-self: flex-start; text-align: left; }
      .selected-voice-card { grid-template-columns: 42px minmax(0, 1fr); }
      .selected-voice-tools { grid-column: 2; justify-content: flex-start; max-width: none; }
      .dubbing-submit-row { align-items: stretch; flex-direction: column; }
      .dubbing-cost { text-align: left; }
      .dubbing-submit-row .btn { width: 100%; }
      .dubbing-result { grid-template-columns: 1fr; }
      .dubbing-result audio { grid-column: auto; grid-row: auto; }
      .dubbing-result .btn { width: 100%; }
      .voice-design-candidates { grid-template-columns: 1fr; }
      .voice-design-intro { grid-template-columns: 40px minmax(0, 1fr); }
      .voice-design-price { grid-column: 2; }
      .dubbing-config-grid { grid-template-columns: 1fr; }
      .dubbing-config-grid .wide { grid-column: auto; }
      .dubbing-admin-stats { grid-template-columns: 1fr 1fr; }
      .dubbing-admin-launch { align-items: stretch; flex-direction: column; }
      .dubbing-admin-launch .btn { width: 100%; }
    }

    @media (prefers-reduced-motion: reduce) {
      *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
    }
