/* 视频自动生成系统 - 桌面工作台布局 */
@font-face {
  font-family: "摇醒青年黑1.0";
  src: url("/static/fonts/yaoxing-qingnianhei-1.0-Regular.ttf") format("truetype");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC",
    "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: #10131b;
  color: #e9edf5;
  font-size: 14px;
  line-height: 1.55;
}

body { overflow: hidden; }

.activation-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: #10131b;
}

.activation-screen.hidden { display: none; }

.activation-card {
  width: min(420px, 100%);
  padding: 34px;
  border-radius: 10px;
  background: #151925;
  border: 1px solid #252c3a;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

.activation-logo {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: #24445f;
  font-size: 25px;
  margin: 0 auto 18px;
}

.activation-title {
  font-size: 22px;
  color: #fff;
  font-weight: 800;
  margin-bottom: 6px;
  text-align: center;
}

.activation-desc {
  color: #8d98aa;
  font-size: 13px;
  margin-bottom: 18px;
}

.activation-btn {
  width: 100%;
  margin-top: 14px;
}

.activation-message {
  min-height: 22px;
  margin-top: 12px;
  color: #8d98aa;
  font-size: 13px;
}

.activation-message.ok { color: #54d39a; }
.activation-message.bad { color: #ff7b7b; }
.activation-message.mid { color: #f3b95f; }

.activation-foot {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid #252c3a;
  color: #6f7b8e;
  font-size: 11.5px;
  word-break: break-all;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  line-height: 1.8;
}

.activation-foot a {
  color: #8d98aa;
  text-decoration: none;
}

.activation-foot a:hover {
  color: #c6ceda;
}

.police-beian {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.beian-icon {
  width: 18px;
  height: 20px;
  flex: 0 0 auto;
}

.beian-separator {
  color: #4b5568;
}

.workspace-beian {
  display: none;
  width: 100%;
  margin: 4px 0 0;
  padding: 10px 0 0;
  border-top: 1px solid #252c3a;
  color: #7f8a9c;
  font-size: 10.5px;
  line-height: 1.65;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px 6px;
  text-align: center;
  word-break: break-all;
}

.workspace-beian a {
  color: #98a4b8;
  text-decoration: none;
}

.workspace-beian a:hover {
  color: #d7deea;
}

.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  background: #10131b;
}

.app.locked { display: none; }

/* ---------- 侧边栏 ---------- */
.sidebar {
  min-height: 100vh;
  background: #151925;
  border-right: 1px solid #252c3a;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 10px 20px;
  border-bottom: 1px solid #252c3a;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #24445f;
  font-size: 20px;
}

.brand-title { font-size: 16px; font-weight: 700; color: #fff; }
.brand-sub { font-size: 12px; color: #8d98aa; margin-top: 1px; }

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 18px;
}

.nav-item,
.nav-info-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #aeb8c9;
  cursor: pointer;
  text-align: left;
  font: inherit;
}

.nav-info-item[hidden] { display: none !important; }

.nav-item:hover,
.nav-info-item:hover {
  background: #1b2130;
  border-color: #2d3748;
  color: #fff;
}

.nav-item.active {
  background: #1d3344;
  border-color: #2d6688;
  color: #fff;
}

.nav-icon {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}

.nav-item b,
.nav-info-item b {
  display: block;
  font-size: 13.5px;
  line-height: 1.2;
}

.nav-item small,
.nav-info-item small {
  display: block;
  margin-top: 2px;
  font-size: 11.5px;
  color: #7f8a9c;
}

.nav-item.active small { color: #b6d7e8; }
.nav-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.nav-skill-badge {
  display: none;
  flex-shrink: 0;
  max-width: 74px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  border: 1px solid rgba(61, 138, 168, 0.35);
  background: rgba(61, 138, 168, 0.14);
  color: #bdeaff;
  font-style: normal;
  font-size: 10.5px;
  font-weight: 800;
  line-height: 17px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-skill-badge.visible { display: inline-flex; }
.nav-skill-badge.update {
  color: #ffe0a3;
  background: rgba(244, 185, 66, 0.14);
  border-color: rgba(244, 185, 66, 0.35);
}
.nav-skill-badge.missing {
  color: #ffb0b0;
  background: rgba(255, 91, 91, 0.12);
  border-color: rgba(255, 91, 91, 0.3);
}

.sidebar-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 10px 4px;
  border-top: 1px solid #252c3a;
}

.credit-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  margin: 0 0 2px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(37, 176, 121, 0.12);
  border: 1px solid rgba(37, 176, 121, 0.35);
  color: #54d39a;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-align: center;
}

.credit-chip:hover {
  border-color: rgba(84, 211, 154, 0.62);
  background: rgba(37, 176, 121, 0.16);
  color: #79e3b1;
}

.credit-chip.is-bad {
  background: rgba(255, 93, 93, 0.12);
  border-color: rgba(255, 93, 93, 0.35);
  color: #ff8b8b;
}

.device-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 38px;
  margin: 0;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(120, 141, 255, 0.32);
  background: rgba(120, 141, 255, 0.1);
  color: #aeb9ff;
  cursor: pointer;
  font: inherit;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0;
  text-align: center;
}

.device-chip:hover {
  border-color: rgba(145, 160, 255, 0.62);
  background: rgba(120, 141, 255, 0.14);
  color: #fff;
}

.update-notice {
  margin-top: 8px;
  padding: 8px 9px;
  border-radius: 8px;
  border: 1px solid rgba(120, 141, 255, 0.26);
  background: rgba(120, 141, 255, 0.08);
  color: #aeb9ff;
  font-size: 11.5px;
  line-height: 1.45;
  word-break: break-word;
}

.update-notice[hidden] { display: none; }

.update-notice.update {
  border-color: rgba(244, 185, 66, 0.35);
  background: rgba(244, 185, 66, 0.1);
  color: #f4c86a;
}

.update-notice.required {
  border-color: rgba(255, 93, 93, 0.36);
  background: rgba(255, 93, 93, 0.1);
  color: #ff8b8b;
}

.recharge-button {
  width: 100%;
  min-height: 38px;
  margin-top: 0;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(54, 163, 200, 0.38);
  background: rgba(54, 163, 200, 0.12);
  color: #bdeaff;
  cursor: pointer;
  font: inherit;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0;
  text-align: center;
}

.recharge-button:hover {
  border-color: rgba(101, 198, 232, 0.72);
  background: rgba(54, 163, 200, 0.18);
  color: #fff;
}

.sidebar-note {
  margin-top: 8px;
  color: #6f7b8e;
  font-size: 11.5px;
}

/* ---------- 工作区 ---------- */
.workspace {
  min-width: 0;
  height: 100vh;
  overflow: auto;
  padding: 22px 28px 40px;
  background: #10131b;
}

.topbar {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid #252c3a;
  margin-bottom: 20px;
}

.page-kicker {
  color: #7f8a9c;
  font-size: 12px;
  margin-bottom: 2px;
}

.topbar h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 750;
  letter-spacing: 0;
  color: #fff;
}

.topbar-status {
  margin-left: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 6px;
}

.topbar-status-main {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.topbar-version {
  min-height: 36px;
  max-width: 320px;
  margin-top: 0;
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-version[hidden] { display: none; }

.status-strip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: #151925;
  border: 1px solid #252c3a;
  color: #aeb8c9;
  font-size: 12.5px;
  white-space: nowrap;
}

.topbar-info-button {
  display: none;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 7px 11px;
  border: 1px solid rgba(44, 217, 255, 0.36);
  border-radius: 999px;
  color: #d9fbff;
  background: rgba(14, 137, 164, 0.22);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.topbar-info-button[hidden] {
  display: none !important;
}

.topbar-info-button:hover {
  border-color: rgba(44, 217, 255, 0.58);
  background: rgba(20, 157, 188, 0.28);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #43d18f;
  box-shadow: 0 0 0 3px rgba(67, 209, 143, 0.12);
}

.topbar-device-id {
  max-width: 100%;
  color: #778399;
  font-size: 11px;
  line-height: 1.3;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-device-id[hidden] { display: none; }

.wechat-modal[hidden] { display: none; }

.wechat-modal {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.wechat-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 10, 16, 0.72);
}

.wechat-modal-card {
  position: relative;
  width: min(360px, 100%);
  padding: 24px;
  border: 1px solid #2d3748;
  border-radius: 8px;
  background: #151925;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
  text-align: center;
}

.wechat-modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  border: 1px solid #2d3748;
  border-radius: 50%;
  background: #10131b;
  color: #aeb8c9;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

.wechat-modal-close:hover {
  color: #fff;
  border-color: #4a5872;
}

.wechat-modal-title {
  color: #fff;
  font-size: 18px;
  font-weight: 850;
}

.wechat-modal-sub {
  margin-top: 6px;
  color: #8d98aa;
  font-size: 12.5px;
}

.wechat-qr-frame {
  width: min(260px, 100%);
  margin: 18px auto 14px;
  padding: 0;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.wechat-qr-frame img {
  width: 100%;
  height: auto;
  display: block;
}

.wechat-id-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #8d98aa;
  font-size: 12.5px;
}

.wechat-id-row b {
  color: #e9edf5;
  font-size: 14px;
  letter-spacing: 0;
}

.wechat-copy-btn {
  width: 100%;
  min-height: 40px;
  margin-top: 16px;
  border: 0;
  border-radius: 8px;
  background: #2b92b0;
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.wechat-copy-btn:hover { background: #36a3c8; }

.account-modal-card {
  text-align: left;
}

.talking-voice-rename-card {
  width: min(420px, 100%);
}

.talking-voice-delete-card {
  width: min(420px, 100%);
}

.talking-voice-delete-card .wechat-modal-sub {
  line-height: 1.65;
}

.talking-voice-delete-name {
  color: #f5f8ff;
  font-weight: 850;
  word-break: break-all;
}

.talking-voice-delete-confirm {
  background: #d94b62;
}

.talking-voice-delete-confirm:hover {
  background: #ee5f75;
}

.credit-modal-card {
  width: min(680px, 100%);
  text-align: left;
}

.credit-modal-card .wechat-modal-title,
.credit-modal-card .wechat-modal-sub {
  text-align: center;
}

.credit-ledger-content {
  min-height: 120px;
  margin-top: 18px;
}

.credit-ledger-balance {
  margin-bottom: 12px;
  color: #8d98aa;
  font-size: 12.5px;
  text-align: center;
}

.credit-ledger-balance b {
  color: #54d39a;
  font-size: 17px;
  margin-left: 6px;
}

.credit-ledger-table-wrap {
  max-height: min(420px, 58vh);
  overflow: auto;
  border: 1px solid #252c3a;
  border-radius: 8px;
  background: #10131b;
}

.credit-ledger-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.credit-ledger-table th,
.credit-ledger-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #202737;
  color: #cfd7e6;
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}

.credit-ledger-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #151925;
  color: #8d98aa;
  font-size: 12px;
  font-weight: 800;
}

.credit-ledger-table td:last-child {
  width: 42%;
  white-space: normal;
  word-break: break-word;
}

.credit-ledger-action {
  color: #aeb9ff;
  font-weight: 800;
}

.credit-ledger-amount {
  font-weight: 850;
  text-align: right;
}

.credit-ledger-amount.is-positive { color: #54d39a; }
.credit-ledger-amount.is-negative { color: #ffb0b0; }

.account-info-card {
  width: min(420px, 100%);
  text-align: left;
}

.account-info-card .wechat-modal-title {
  text-align: center;
}

.account-info-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.account-info-row {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #252c3a;
  border-radius: 8px;
  background: #10131b;
}

.account-info-row span {
  color: #8d98aa;
  font-size: 12.5px;
}

.account-info-row b {
  min-width: 0;
  color: #e9edf5;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-info-link {
  min-height: 30px;
  padding: 5px 10px;
  border: 1px solid rgba(120, 141, 255, 0.34);
  border-radius: 7px;
  background: rgba(120, 141, 255, 0.1);
  color: #aeb9ff;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
}

.account-info-link:disabled {
  cursor: default;
  opacity: 0.45;
}

.redeem-code-form {
  padding: 12px;
  border: 1px solid #252c3a;
  border-radius: 8px;
  background: #10131b;
}

.redeem-code-form[hidden] {
  display: none;
}

.redeem-code-label {
  display: block;
  margin-bottom: 8px;
  color: #8d98aa;
  font-size: 12.5px;
  font-weight: 800;
}

.redeem-code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.redeem-code-input {
  width: 100%;
  min-width: 0;
  height: 36px;
  padding: 0 10px;
  border: 1px solid #2d3748;
  border-radius: 7px;
  background: #151925;
  color: #e9edf5;
  font: inherit;
  font-size: 13px;
  letter-spacing: 0;
  outline: none;
  text-transform: uppercase;
}

.redeem-code-input:focus {
  border-color: rgba(120, 141, 255, 0.65);
}

.redeem-code-submit {
  min-width: 58px;
}

.redeem-code-message {
  min-height: 18px;
  margin-top: 8px;
  color: #8d98aa;
  font-size: 12px;
  line-height: 1.5;
}

.redeem-code-message.ok {
  color: #54d39a;
}

.redeem-code-message.bad {
  color: #ff8b8b;
}

.account-info-contact {
  margin-top: 4px;
}

.credit-ledger-state,
.credit-ledger-empty,
.credit-ledger-error {
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8d98aa;
  font-size: 13px;
  text-align: center;
}

.credit-ledger-error {
  color: #ff8b8b;
}

.credit-ledger-refresh {
  width: 100%;
  min-height: 40px;
  margin-top: 16px;
  border: 1px solid rgba(84, 211, 154, 0.32);
  border-radius: 8px;
  background: rgba(37, 176, 121, 0.12);
  color: #91e7bd;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.credit-ledger-refresh:hover {
  border-color: rgba(84, 211, 154, 0.62);
  background: rgba(37, 176, 121, 0.18);
  color: #fff;
}

.credit-ledger-refresh:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.account-modal-label {
  display: block;
  margin-top: 18px;
  margin-bottom: 6px;
  color: #aeb8c9;
  font-size: 12px;
  font-weight: 800;
}

.account-modal-input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid #2d3748;
  background: #10131b;
  color: #e9edf5;
  font: inherit;
  font-size: 15px;
  outline: none;
}

.account-modal-input:focus {
  border-color: #36a3c8;
  box-shadow: 0 0 0 3px rgba(54, 163, 200, 0.16);
}

.account-modal-message {
  min-height: 20px;
  margin-top: 8px;
  color: #8d98aa;
  font-size: 12px;
}

.account-modal-message.bad { color: #ff8b8b; }
.account-modal-message.ok { color: #54d39a; }

.account-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.account-modal-primary,
.account-modal-secondary {
  min-width: 76px;
  min-height: 38px;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.account-modal-primary {
  border: 0;
  background: #2b92b0;
  color: #fff;
}

.account-modal-primary:hover { background: #36a3c8; }

.account-modal-secondary {
  border: 1px solid #2d3748;
  background: #151925;
  color: #dbe4f2;
}

.account-modal-secondary:hover {
  border-color: #4a5872;
  color: #fff;
}

.account-modal-primary:disabled,
.account-modal-secondary:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

/* ---------- 通用 panel ---------- */
.panel {
  display: none;
  max-width: 1120px;
}

.panel.active { display: block; }

.panel-title {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}

.panel-sub {
  color: #8d98aa;
  margin-bottom: 18px;
}

.panel,
.result-area,
.api-card,
.steps,
.env-hint,
.check-area {
  border-radius: 8px;
}

/* ---------- 表单 ---------- */
.form-label {
  display: block;
  margin: 14px 0 6px;
  color: #c6ceda;
  font-size: 13px;
  font-weight: 600;
}

textarea,
input[type="text"],
input[type="password"],
input[type="number"],
input[type="tel"],
select {
  width: 100%;
  background: #151925;
  color: #e9edf5;
  border: 1px solid #2b3446;
  border-radius: 7px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

textarea:focus,
input:focus,
select:focus {
  border-color: #3d8aa8;
  box-shadow: 0 0 0 3px rgba(61, 138, 168, 0.15);
}

textarea { resize: vertical; min-height: 110px; }

select {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #8d98aa 50%),
    linear-gradient(135deg, #8d98aa 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 12px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 36px;
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }

.talking-color-trigger {
  width: 100%;
  height: 42px;
  background: #151925;
  border: 1px solid #2b3446;
  border-radius: 7px;
  padding: 6px;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.talking-color-trigger:hover,
.talking-color-trigger:focus {
  border-color: #3d8aa8;
  box-shadow: 0 0 0 3px rgba(61, 138, 168, 0.15);
}

.talking-color-trigger-preview {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 4px;
  background: var(--talking-color-value, #ffffff);
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.22);
}

.talking-color-popover {
  position: fixed;
  z-index: 3000;
  width: 236px;
  padding: 10px;
  background: #111622;
  border: 1px solid #2b3446;
  border-radius: 8px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.42);
}

.talking-color-popover[hidden] {
  display: none;
}

.talking-color-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

.talking-color-swatch {
  width: 28px;
  height: 28px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 6px;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.22);
  outline: none;
}

.talking-color-swatch:hover,
.talking-color-swatch:focus {
  transform: translateY(-1px);
  box-shadow: 0 0 0 3px rgba(61, 138, 168, 0.28), inset 0 0 0 1px rgba(0, 0, 0, 0.22);
}

.talking-color-swatch.is-selected {
  box-shadow: 0 0 0 3px rgba(70, 202, 255, 0.44), inset 0 0 0 1px rgba(0, 0, 0, 0.22);
}

/* ---------- 按钮 ---------- */
.btn-row {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.btn {
  border: 1px solid #2b3446;
  background: #1a2030;
  color: #e9edf5;
  border-radius: 7px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.btn:hover {
  background: #20283a;
  border-color: #3b465a;
}

.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: #247a9b;
  border-color: #247a9b;
  color: #fff;
}

.btn-primary:hover {
  background: #2b8dad;
  border-color: #2b8dad;
}

.btn-ghost {
  background: transparent;
  color: #aeb8c9;
}

/* ---------- 上传布局 ---------- */
.upload-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

/* ---------- AI生图 ---------- */
#panel-ai-image {
  max-width: 1480px;
}

.ai-image-workspace {
  display: grid;
  grid-template-columns: minmax(360px, 0.78fr) minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
}

.ai-image-card {
  min-width: 0;
  border: 1px solid #2d6688;
  border-radius: 8px;
  background: #151925;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.16);
}

.ai-image-form-card {
  padding: 22px;
}

.ai-image-result-card {
  min-height: calc(100vh - 132px);
  padding: 18px;
  display: flex;
  flex-direction: column;
}

.ai-image-upload {
  min-height: 260px;
  border: 2px dashed #65a8df;
  border-radius: 8px;
  background: #101722;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 18px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.ai-image-upload:hover,
.ai-image-upload.is-dragging {
  border-color: #8cc7f4;
  background: #132033;
}

.ai-image-upload.has-images {
  align-items: stretch;
  justify-content: flex-start;
  gap: 12px;
}

.ai-image-upload-empty {
  text-align: center;
  color: #aeb8c9;
}

.ai-image-upload-icon {
  color: #77b7ea;
  font-size: 38px;
  line-height: 1;
  margin-bottom: 22px;
}

.ai-image-upload-title {
  color: #77b7ea;
  font-size: 22px;
  font-weight: 800;
}

.ai-image-upload-sub {
  margin-top: 18px;
  color: #d2d9e5;
  font-size: 15px;
}

.ai-image-upload-hint {
  margin-top: 26px;
  color: #7f8a9c;
  font-size: 13px;
}

.ai-image-preview-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.ai-image-preview-item {
  position: relative;
  min-width: 0;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid #2b3446;
  background: #0d1118;
}

.ai-image-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ai-image-preview-item span {
  position: absolute;
  left: 8px;
  bottom: 8px;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(13, 17, 24, 0.76);
  color: #dce8f7;
  font-size: 11px;
  font-weight: 700;
}

.ai-image-preview-item button {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 50%;
  background: rgba(13, 17, 24, 0.8);
  color: #fff;
  cursor: pointer;
}

.ai-image-upload-more {
  grid-column: 1 / -1;
  width: 100%;
  min-height: 48px;
  border: 1px dashed rgba(119, 183, 234, 0.72);
  border-radius: 8px;
  color: #dbe9ff;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 14px;
  font-weight: 800;
  background: rgba(119, 183, 234, 0.08);
}

.ai-image-mode-line {
  margin: 22px 0 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #dbe9ff;
  font-size: 15px;
  font-weight: 800;
}

.ai-image-generate-btn {
  width: 100%;
  margin-top: 18px;
  min-height: 52px;
  font-size: 16px;
}

.ai-image-message {
  min-height: 22px;
  margin-top: 12px;
  color: #8d98aa;
  font-size: 12.5px;
  overflow-wrap: anywhere;
}

.ai-image-message.ok { color: #54d39a; }
.ai-image-message.mid { color: #65c6e8; }
.ai-image-message.bad { color: #ff7b7b; }

.ai-image-empty-state {
  flex: 1;
  min-height: 520px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #8d98aa;
  padding: 28px;
}

.ai-image-empty-icon {
  width: 112px;
  height: 112px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 28px;
  border-radius: 50%;
  background: #202636;
  color: #8b96a8;
  font-size: 42px;
  font-weight: 800;
}

.ai-image-empty-icon.running {
  color: #77b7ea;
}

.ai-image-empty-icon.error {
  color: #ff8b8b;
}

.ai-image-empty-title {
  color: #f3f7ff;
  font-size: 22px;
  font-weight: 850;
}

.ai-image-empty-text {
  width: min(520px, 100%);
  margin-top: 18px;
  color: #9ca8ba;
  font-size: 15px;
  line-height: 1.7;
  white-space: pre-wrap;
}

.ai-image-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.ai-image-result-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.ai-image-ios-save-hint {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid #2b5d72;
  border-radius: 8px;
  background: rgba(43, 146, 176, 0.14);
  color: #9ee9ff;
  font-size: 14px;
  font-weight: 800;
}

.ai-image-result-head b {
  display: block;
  color: #fff;
  font-size: 16px;
}

.ai-image-result-head span {
  color: #8d98aa;
  font-size: 12px;
}

.ai-image-output {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #0d1118;
  overflow: hidden;
}

.ai-image-output img {
  max-width: 100%;
  max-height: calc(100vh - 230px);
  object-fit: contain;
  display: block;
}

.ai-image-result-prompt {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid #252c3a;
  background: #111722;
  color: #aeb8c9;
  font-size: 12.5px;
  line-height: 1.65;
  white-space: pre-wrap;
}

@media (min-width: 761px) {
  #panel-image .upload-layout {
    margin-top: 12px;
  }

  #panel-image .upload-forms {
    position: relative;
  }

  #panel-image .upload-forms > .form-label:first-child {
    position: absolute;
    left: 0;
    top: -24px;
    margin: 0;
  }
}

.talking-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: start;
}

#panel-talking {
  max-width: 1480px;
}

.talking-workbench {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

.talking-workbench > * {
  min-width: 0;
}

.talking-workbench-column {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 18px;
}

.talking-card {
  padding: 18px;
  border: 1px solid #252c3a;
  border-radius: 8px;
  background: #151925;
}

.talking-stage {
  min-width: 0;
}

#talkingBrief {
  min-height: 120px;
}

#talkingFinalScript {
  min-height: 180px;
}

.talking-step-card-2 #talkingBrief {
  min-height: 92px;
}

.talking-step-card-2 #talkingFinalScript {
  min-height: 118px;
}

.talking-step-card-2 .talking-duration-row {
  margin: 8px 0 10px;
}

.talking-step-card-2 .btn-row {
  margin-top: 10px;
}

.talking-step-card-2 .form-label {
  margin-top: 10px;
}

.talking-step-card-1 {
  --step1-pair-width: min(100%, 780px);
  --step1-pair-height: 136px;
  --step1-action-button-height: 44px;
  width: 100%;
  justify-self: start;
}

.talking-step-card-7 {
  display: flex;
  flex-direction: column;
}

.talking-stage-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.talking-step-badge {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #247a9b;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  flex: 0 0 auto;
}

.talking-step {
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}

#panel-talking .talking-card .grid-2 {
  max-width: 760px;
}

.talking-duration-row {
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) minmax(150px, 0.8fr) minmax(180px, 1.2fr);
  gap: 10px;
  align-items: end;
  margin: 12px 0 14px;
}

.talking-duration-hint {
  min-height: 38px;
  display: flex;
  align-items: center;
  color: #8fa6c9;
  font-size: 13px;
  line-height: 1.35;
}

.talking-asset-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 10px;
}

.talking-asset-actions .btn {
  padding: 8px 10px;
  font-size: 12px;
}

.talking-asset-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.talking-asset-card {
  position: relative;
  border: 1px solid #2b3446;
  border-radius: 7px;
  background: #151925;
  padding: 10px 34px 10px 10px;
  color: #dfe7f6;
  cursor: pointer;
  text-align: left;
}

.talking-asset-card.is-selected {
  border-color: #36a3c9;
  background: #17364a;
}

.talking-asset-title {
  color: #f5f7fb;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.talking-asset-meta,
.talking-voice-profile {
  margin-top: 4px;
  color: #8fa6c9;
  font-size: 12px;
  line-height: 1.35;
}

.talking-asset-delete {
  position: absolute;
  right: 6px;
  top: 50%;
  width: 24px;
  height: 24px;
  transform: translateY(-50%);
  border: 1px solid #3a455c;
  border-radius: 999px;
  background: #111827;
  color: #d8e3f8;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}

.talking-asset-delete:hover {
  border-color: #ff6685;
  color: #ff8ca3;
}

.talking-asset-delete-placeholder {
  pointer-events: none;
  opacity: 0;
}

.talking-upload-item {
  padding: 14px;
  border: 1px solid #252c3a;
  border-radius: 8px;
  background: #10131b;
}

.talking-upload-item .form-label {
  margin-top: 0;
}

.talking-upload-item input[type="file"] {
  width: 180px;
  min-height: 42px;
  padding: 8px;
  border: 1px solid #2b3446;
  border-radius: 7px;
  background: #151925;
  color: #e9edf5;
}

.talking-step-card-1 .talking-upload-item {
  max-width: 100%;
}

.web-app-mode #panel-talking #talkingOpenAssetFolderBtn,
.web-app-mode #panel-talking #talkingVideoAssetList,
.web-app-mode #panel-talking #talkingSaveVideoAssetBtn {
  display: none !important;
}

.talking-step-card-1 #talkingVideoAssetList,
.talking-step-card-1 #talkingVoiceAssetList {
  width: var(--step1-pair-width);
  max-width: none;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.talking-step-card-1 .talking-asset-card {
  min-height: var(--step1-action-button-height);
  height: var(--step1-action-button-height);
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 0;
  padding-bottom: 0;
}

.talking-step-card-1 .talking-asset-list > .talking-file-placeholder {
  grid-column: 1 / -1;
}

.talking-step-card-1 .talking-asset-meta,
.talking-step-card-1 .talking-asset-title {
  margin: 0;
  font-size: 13px;
  line-height: 1.3;
}

.talking-step-card-1 .talking-file-row,
.talking-step-card-1 .talking-voice-row {
  width: var(--step1-pair-width);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.talking-step-card-1 .talking-file-preview {
  width: 100%;
  min-height: var(--step1-pair-height);
}

.talking-step-card-1 .talking-file-select {
  width: 100%;
  min-height: var(--step1-pair-height);
  flex-basis: auto;
  padding: 10px;
}

.talking-step-card-1 .talking-file-select .btn {
  width: 100%;
  min-height: var(--step1-action-button-height);
  height: var(--step1-action-button-height);
  padding: 10px 12px;
}

.talking-step-card-1 .talking-voice-controls {
  min-height: var(--step1-pair-height);
}

.talking-step-card-1 .talking-voice-asset-card {
  padding-right: 10px;
}

.talking-file-row {
  display: flex;
  align-items: stretch;
  gap: 12px;
}

.talking-file-select {
  flex: 0 0 180px;
  min-height: 136px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  border: 1px solid #2b3446;
  border-radius: 7px;
  background: #151925;
}

.talking-file-select .talking-file-input-hidden {
  display: none;
}

.talking-voice-asset-card .talking-asset-delete,
.talking-voice-asset-card .talking-asset-rename {
  top: 8px;
  transform: none;
}

.talking-voice-asset-card .talking-asset-rename {
  position: absolute;
  right: 34px;
  width: 24px;
  height: 24px;
  border: 1px solid #3a455c;
  border-radius: 999px;
  background: #111827;
  color: #d8e3f8;
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
}

.talking-voice-asset-card .talking-asset-rename:hover {
  border-color: #36a3c9;
  color: #9bd7ff;
}

.talking-file-select input[type="file"]:not(.talking-file-input-hidden) {
  width: 118px;
  min-height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: transparent;
}

.talking-file-select input[type="file"]:not(.talking-file-input-hidden)::file-selector-button {
  color: #111827;
  font-weight: 700;
  cursor: pointer;
}

.talking-voice-layout {
  display: grid;
  gap: 0;
}

.talking-voice-saved-block {
  padding: 0;
  border: 0;
  background: transparent;
}

.talking-voice-asset-actions {
  margin-bottom: 8px;
}

.talking-voice-saved-block .talking-voice-profile {
  margin: 0 0 10px;
}

.talking-voice-asset-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.talking-voice-asset-card {
  min-height: var(--step1-action-button-height);
  height: var(--step1-action-button-height);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
}

.talking-voice-asset-body {
  min-width: 0;
  flex: 1 1 auto;
}

.talking-voice-asset-card .talking-asset-title {
  color: #9bb5e8;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.talking-voice-row {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 12px;
}

.talking-voice-controls {
  width: auto;
  min-width: 0;
  min-height: 118px;
  align-items: stretch;
}

.talking-voice-controls .btn {
  width: 100%;
}

.talking-save-upload-btn {
  font-size: 12px;
  padding: 7px 9px;
}

.talking-voice-cost-note {
  color: #8fa6c9;
  font-size: 11px;
  line-height: 1.35;
  text-align: center;
}

.talking-file-preview {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 136px;
  display: flex;
  align-items: center;
  padding: 12px 40px 12px 14px;
  border: 1px solid #2b3446;
  border-radius: 7px;
  background: #151925;
}

.talking-preview-clear {
  position: absolute;
  right: 10px;
  top: 10px;
  z-index: 2;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #3a455c;
  border-radius: 999px;
  background: #111827;
  color: #d8e3f8;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.talking-preview-clear:hover {
  border-color: #ff6685;
  color: #ff8ca3;
}

.talking-file-placeholder {
  color: #8b8fa9;
  font-size: 13px;
}

.talking-file-card {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  width: 100%;
}

.talking-file-card-media-only {
  height: 100%;
  justify-content: center;
}

.talking-file-media-shell {
  position: relative;
  display: inline-block;
  max-width: 100%;
}

.talking-file-thumb,
.talking-file-icon {
  width: 86px;
  height: 104px;
  flex: 0 0 auto;
  border-radius: 6px;
  border: 1px solid #334057;
  background: #0d111a;
  object-fit: cover;
}

.talking-file-card-media-only .talking-file-thumb {
  width: 100%;
  height: 100%;
  min-height: 112px;
  border: 0;
  background: transparent;
  object-fit: cover;
}

.talking-asset-thumb {
  width: 100%;
  height: 100%;
  min-height: 68px;
  display: block;
  border-radius: 6px;
  object-fit: cover;
}

.talking-file-audio-thumb {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border-color: #36a3c9;
  background: rgba(43, 132, 163, 0.18);
  color: #eaf8ff;
  font-size: 17px;
  line-height: 1;
}

.talking-file-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  color: #ffffff;
  font-size: 24px;
  font-weight: 800;
  background: linear-gradient(145deg, #f8fafc 0%, #eef2f7 62%, #d7dde8 63%, #eef2f7 100%);
}

.talking-file-icon::after {
  content: "";
  width: 32px;
  height: 32px;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle at 38% 36%, #ff8a45 0%, #db5d8e 48%, #5b4dcc 100%);
}

.talking-file-icon span {
  position: relative;
  z-index: 1;
  margin-left: 3px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}

.talking-file-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.talking-file-name {
  color: #f5f7fb;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.talking-voice-current {
  min-height: 118px;
  padding: 14px;
  align-items: stretch;
  justify-content: center;
  flex-direction: column;
}

.talking-voice-current .talking-file-name {
  white-space: normal;
  overflow-wrap: anywhere;
}

.talking-voice-current .talking-file-card {
  flex: 0 0 auto;
}

.talking-voice-current .talking-file-meta {
  min-width: 0;
  overflow-wrap: anywhere;
}

.talking-voice-current .talking-voice-player-wrap {
  width: 100%;
  margin-top: 12px;
}

.talking-file-kind {
  color: #8b8fa9;
  font-size: 12px;
}

.talking-save-upload-btn.is-active {
  border-color: #4ca3c7;
  background: rgba(43, 132, 163, 0.2);
  color: #eaf8ff;
}

.talking-saved-voice-card .talking-file-name {
  color: #ffffff;
}

.talking-saved-voice-card .talking-file-kind {
  color: #93d5ee;
}

.talking-voice-player-wrap {
  position: relative;
  margin-top: 8px;
  width: min(100%, 360px);
  box-sizing: border-box;
  padding: 10px 28px 10px 10px;
  border: 1px solid #3a465e;
  border-radius: 8px;
  background: #101521;
  overflow: hidden;
}

.talking-voice-player-wrap[hidden] {
  display: none;
}

.talking-voice-player-wrap .talking-voice-media {
  width: 100%;
  display: block;
}

.talking-voice-player-wrap audio.talking-voice-media {
  height: 34px;
}

.talking-voice-player-wrap video.talking-voice-media {
  max-height: 180px;
  height: auto;
}

.talking-voice-player-close {
  position: absolute;
  right: 8px;
  top: 8px;
  width: 22px;
  height: 22px;
  border: 1px solid #3a465e;
  border-radius: 50%;
  background: #101521;
  color: #dce5f5;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.talking-voice-player-close:hover {
  border-color: #ff6685;
  color: #ff8ca3;
}

.talking-file-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #3a465e;
  border-radius: 50%;
  background: #101521;
  color: #dce5f5;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.talking-file-remove:hover {
  border-color: #4ca3c7;
  color: #ffffff;
}

.talking-pip-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 18px;
  margin-top: 0;
  align-items: start;
}

.talking-pip-section {
  --pip-upload-card-height: 136px;
  padding-top: 4px;
}

.talking-pip-layout > div {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.talking-pip-layout .form-label {
  margin: 0;
}

.talking-pip-anchor-field {
  margin-top: 4px;
}

.talking-pip-anchor-field textarea {
  min-height: 78px;
  line-height: 1.35;
}

.talking-pip-layout .talking-file-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}

.talking-pip-layout .talking-file-select {
  position: relative;
  width: 100%;
  flex: none;
  height: var(--pip-upload-card-height);
  min-height: var(--pip-upload-card-height);
  max-height: var(--pip-upload-card-height);
  padding: 10px;
  overflow: hidden;
}

.talking-pip-layout .talking-file-select .talking-file-preview {
  width: 100%;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  display: none;
  overflow: hidden;
}

.talking-pip-layout .talking-file-select.has-media {
  padding: 0;
}

.talking-pip-layout .talking-file-select.has-media .btn {
  display: none;
}

.talking-pip-layout .talking-file-select.has-media .talking-file-preview {
  display: flex;
  align-items: center;
  justify-content: center;
}

.talking-pip-layout .talking-file-select.has-media .talking-file-card,
.talking-pip-layout .talking-file-select.has-media .talking-file-media-shell {
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
}

.talking-pip-layout .talking-file-select.has-media .talking-file-card-media-only {
  justify-content: center;
}

.talking-pip-layout .talking-file-select.has-media .talking-file-thumb,
.talking-pip-layout .talking-file-select.has-media .talking-file-icon {
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: 100%;
  display: block;
  border: 0;
  border-radius: 7px;
  object-fit: cover;
}

.talking-pip-layout .talking-file-card {
  gap: 14px;
}

.talking-pip-photo-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.talking-pip-photo-card {
  position: relative;
  min-height: 74px;
  overflow: hidden;
  border: 1px solid #334057;
  border-radius: 7px;
  background: #0d111a;
}

.talking-pip-photo-card .talking-file-thumb {
  width: 100%;
  height: 100%;
  min-height: 74px;
  display: block;
  border: 0;
  border-radius: 0;
  object-fit: cover;
}

.talking-pip-photo-index {
  position: absolute;
  left: 6px;
  bottom: 6px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(9, 13, 22, 0.72);
  color: #f3f7ff;
  font-size: 11px;
  font-weight: 700;
}

.talking-pip-layout .talking-file-name {
  font-size: 14px;
}

.talking-pip-layout .talking-file-kind,
.talking-pip-layout .talking-file-placeholder {
  font-size: 12px;
}

.talking-pip-layout .talking-file-remove {
  top: 6px;
  right: 6px;
  width: 18px;
  height: 18px;
  font-size: 14px;
}

.talking-pip-layout .talking-file-icon::after {
  width: 22px;
  height: 22px;
}

.talking-pip-layout .talking-file-icon span {
  font-size: 16px;
  margin-left: 2px;
}

.talking-pip-layout .talking-file-select input[type="file"] {
  width: 118px;
  min-height: auto;
  height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: transparent;
}

.talking-pip-layout .talking-file-select .btn {
  padding: 10px 18px;
  font-size: 14px;
}

.talking-pip-overlay-control {
  min-width: 0;
}

.talking-pip-overlay-control input[type="range"] {
  width: 100%;
}

.post-edit-workbench.talking-pip-section .muted:empty {
  display: none;
}

.post-edit-fields {
  display: grid;
  grid-template-columns: minmax(180px, 1.6fr) minmax(120px, 1fr) minmax(100px, 0.8fr);
  gap: 5px 6px;
  margin-top: 4px;
  align-items: end;
}

.post-edit-fields > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.subtitle-edit-panel {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px 6px;
}

.post-edit-fields > .subtitle-style-fields {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px 6px;
}

.post-edit-fields > .subtitle-style-fields > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.post-edit-fields > .subtitle-style-fields > [data-subtitle-manual][hidden],
.cover-title-panel > [data-cover-manual][hidden] {
  display: none !important;
}

.subtitle-edit-panel select,
.subtitle-edit-panel input {
  min-width: 0;
}

.bgm-style-panel {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.talking-bgm-select-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 76px;
  gap: 6px;
  align-items: end;
}

.talking-bgm-preview-btn {
  width: 76px;
  min-width: 76px;
  height: 28px;
  min-height: 28px;
  border: 1px solid #2b3446;
  border-radius: 7px;
  background: #151925;
  color: #e9edf5;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 0 8px;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.talking-bgm-preview-btn:hover,
.talking-bgm-preview-btn:focus {
  border-color: #3d8aa8;
  box-shadow: 0 0 0 3px rgba(61, 138, 168, 0.15);
}

.talking-bgm-preview-btn.is-playing {
  border-color: #46caff;
  color: #46caff;
  background: rgba(70, 202, 255, 0.08);
}

.talking-bgm-preview-btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  box-shadow: none;
}

.cover-title-panel {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px 8px;
}

.cover-title-panel textarea {
  height: 36px;
  min-height: 36px;
  line-height: 1.25;
  padding-top: 6px;
  padding-bottom: 6px;
  resize: vertical;
}

.cover-title-text {
  grid-column: span 2;
}

#talkingRegenerateCoverTitleBtn {
  width: 100%;
  height: 36px;
  min-height: 36px;
}

.field-value {
  color: #65c6e8;
  font-weight: 800;
  font-size: 11px;
}

.talking-style-preview {
  position: relative;
  width: 100%;
  min-height: 100%;
  flex: 1;
  margin: 0;
  overflow: hidden;
  border: 1px solid #2b3446;
  border-radius: 8px;
  background: #080b12;
}

.talking-style-preview::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(5, 8, 13, 0.08), rgba(5, 8, 13, 0.34));
}

.talking-style-preview.is-generating {
  background: #151925;
}

.talking-style-preview.is-generation-error {
  background: #171923;
}

.talking-style-preview.is-generating::after {
  display: none;
}

.talking-style-preview.is-generating .talking-style-preview-video,
.talking-style-preview.is-generating .talking-style-preview-cover,
.talking-style-preview.is-generating .talking-style-preview-subtitle,
.talking-style-preview.is-generating .talking-style-preview-pip {
  display: none !important;
}

.talking-generating-placeholder {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: #151925;
  color: #dbeafe;
  text-align: center;
  pointer-events: none;
}

.talking-generating-placeholder[hidden] {
  display: none;
}

.talking-generating-icon {
  width: 96px;
  height: 96px;
  margin-bottom: 26px;
  border-radius: 50%;
  background: #202636;
  position: relative;
}

.talking-generating-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 34px;
  height: 34px;
  transform: translate(-50%, -50%);
  border: 4px solid #9aa8bd;
  background: repeating-linear-gradient(45deg, transparent 0 5px, #9aa8bd 5px 9px);
  opacity: 0.9;
}

.talking-generating-icon-error {
  background: rgba(255, 123, 123, 0.12);
}

.talking-generating-icon-error::before,
.talking-generating-icon-error::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 42px;
  height: 4px;
  border: 0;
  background: #ff8b8b;
  opacity: 0.95;
}

.talking-generating-icon-error::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.talking-generating-icon-error::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.talking-generating-title {
  color: #ffffff;
  font-size: 26px;
  font-weight: 850;
  line-height: 1.25;
}

.talking-generating-text {
  width: min(420px, 100%);
  margin-top: 14px;
  color: #aebdd3;
  font-size: 17px;
  line-height: 1.65;
}

.talking-generating-placeholder .talking-progress {
  width: min(460px, 100%);
  margin-top: 24px;
}

.talking-style-preview-video {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  display: none;
  object-fit: cover;
  background: #000;
}

.talking-style-preview-video.is-visible {
  display: block;
}

.talking-style-preview-cover,
.talking-style-preview-subtitle {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 84%;
  z-index: 2;
  text-align: center;
  line-height: 1.12;
  word-break: break-word;
  white-space: pre-line;
  cursor: grab;
  pointer-events: auto;
  user-select: none;
  touch-action: none;
  transform: translate(-50%, -50%);
}

.talking-style-preview-cover:active,
.talking-style-preview-subtitle:active {
  cursor: grabbing;
}

.talking-style-preview-cover {
  display: none;
  font-weight: 800;
  text-shadow: 0 2px 7px rgba(0, 0, 0, 0.75);
}

.talking-style-preview-cover.is-visible {
  display: block;
}

.talking-style-preview-cover.is-ass-cover {
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  transform: none;
  pointer-events: none;
}

.talking-cover-ass-event {
  position: absolute;
  display: inline-block;
  max-width: 96%;
  box-sizing: border-box;
  text-align: center;
  letter-spacing: 0;
  overflow-wrap: normal;
  word-break: keep-all;
  pointer-events: auto;
  user-select: none;
}

.talking-style-preview-cover.is-auto-cover {
  width: 92%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.16em;
  line-height: 0.94;
  white-space: normal;
  word-break: keep-all;
}

.talking-style-preview-cover.is-template-homework-card {
  width: 94%;
  gap: 0.3em;
  line-height: 1;
}

.talking-style-preview-cover.is-template-product-bold {
  width: 94%;
  gap: 0.08em;
  line-height: 0.92;
}

.talking-style-preview-cover.is-template-parenting-tool {
  width: 94%;
  gap: 0.18em;
  line-height: 0.92;
}

.talking-style-preview-cover.is-template-shopping-checklist {
  width: 96%;
  gap: 0.12em;
  line-height: 0.88;
}

.talking-style-preview-cover.is-template-beauty-rank {
  width: 94%;
  align-items: flex-start;
  gap: 0.1em;
  padding-left: 6%;
  line-height: 0.9;
}

.talking-style-preview-cover.is-template-wellness-column {
  width: 94%;
  align-items: flex-start;
  gap: 0.12em;
  padding-right: 14%;
  line-height: 0.94;
}

.talking-style-preview-cover.is-template-fitness-big {
  width: 94%;
  gap: 0.02em;
  line-height: 0.9;
}

.talking-style-preview-cover.is-auto-cover.is-ass-cover,
.talking-style-preview-cover.is-ass-cover.is-template-viral-big,
.talking-style-preview-cover.is-ass-cover.is-template-homework-card,
.talking-style-preview-cover.is-ass-cover.is-template-product-bold,
.talking-style-preview-cover.is-ass-cover.is-template-parenting-tool,
.talking-style-preview-cover.is-ass-cover.is-template-shopping-checklist,
.talking-style-preview-cover.is-ass-cover.is-template-beauty-rank,
.talking-style-preview-cover.is-ass-cover.is-template-wellness-column,
.talking-style-preview-cover.is-ass-cover.is-template-fitness-big {
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  display: block;
  align-items: initial;
  gap: 0;
  padding: 0;
  line-height: 1;
  transform: none;
  white-space: normal;
  pointer-events: none;
}

.talking-cover-badge {
  align-self: flex-start;
  margin-left: 7%;
  padding: 0.16em 0.44em 0.2em;
  border-radius: 0.08em;
  background: #37f06d;
  color: #101014;
  font-size: 0.34em;
  font-weight: 900;
  line-height: 1;
  transform: rotate(-4deg);
  box-shadow: 0 0.1em 0 #101014, 0 0.18em 0.36em rgba(0, 0, 0, 0.48);
}

.talking-cover-lines {
  display: flex;
  width: 100%;
  flex-direction: column;
  align-items: center;
  gap: 0.06em;
}

.talking-cover-line {
  display: block;
  max-width: 88%;
  padding: 0 0.04em;
  color: #fff;
  font-weight: 900;
  font-style: italic;
  letter-spacing: 0;
  overflow-wrap: normal;
  white-space: nowrap;
  word-break: keep-all;
  -webkit-text-stroke: 0.065em #101014;
  paint-order: stroke fill;
  text-shadow: 0.05em 0.07em 0 #101014, 0 0.16em 0.34em rgba(0, 0, 0, 0.6);
}

.talking-cover-line.is-hot {
  color: #ffe45c;
}

.talking-cover-line.is-block {
  padding: 0 0.04em;
  border-radius: 0;
  background: transparent;
  color: #ffe45c;
  box-shadow: none;
}

.talking-cover-homework-grid {
  display: grid;
  width: 72%;
  margin: 0 auto;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.04em 0.08em;
}

.talking-cover-homework-char {
  color: rgba(255, 255, 255, 0.92);
  font-size: 1.42em;
  font-weight: 950;
  line-height: 0.98;
  -webkit-text-stroke: 0.055em rgba(16, 16, 20, 0.72);
  paint-order: stroke fill;
  text-shadow: 0.04em 0.05em 0.08em rgba(0, 0, 0, 0.45);
}

.talking-cover-homework-card {
  display: block;
  width: 82%;
  margin: 0.22em auto 0;
  padding: 0.22em 0.28em 0.26em;
  border-radius: 0.08em;
  background: rgba(255, 255, 255, 0.92);
  color: #fff;
  font-size: 0.72em;
  font-weight: 950;
  line-height: 1.1;
  -webkit-text-stroke: 0.055em #101014;
  paint-order: stroke fill;
  box-shadow: 0.08em 0.1em 0.2em rgba(0, 0, 0, 0.42);
}

.talking-cover-product-tag {
  align-self: flex-start;
  margin-left: 5%;
  padding: 0.14em 0.42em 0.18em;
  border-radius: 0.06em;
  background: #ff3434;
  color: #fff;
  font-size: 0.34em;
  font-weight: 950;
  line-height: 1;
  transform: rotate(-3deg);
  box-shadow: 0 0.09em 0 #101014;
}

.talking-cover-product-lines {
  display: flex;
  width: 100%;
  flex-direction: column;
  align-items: center;
}

.talking-cover-product-line {
  display: block;
  max-width: 88%;
  padding: 0 0.04em;
  color: #fff;
  font-weight: 950;
  font-style: italic;
  letter-spacing: 0;
  overflow-wrap: normal;
  white-space: nowrap;
  word-break: keep-all;
  -webkit-text-stroke: 0.075em #101014;
  paint-order: stroke fill;
  text-shadow: 0.05em 0.07em 0 #101014, 0 0.18em 0.36em rgba(0, 0, 0, 0.62);
}

.talking-cover-product-line.is-accent {
  color: #ffe45c;
}

.talking-cover-product-line.is-red {
  color: #ff4b4b;
}

.talking-cover-parent-top {
  display: block;
  max-width: 96%;
  color: #ffd0e8;
  font-size: 1.12em;
  font-weight: 950;
  letter-spacing: 0;
  white-space: nowrap;
  -webkit-text-stroke: 0.07em #050507;
  paint-order: stroke fill;
  text-shadow: 0.04em 0.06em 0 #050507, 0 0.14em 0.26em rgba(0, 0, 0, 0.56);
}

.talking-cover-parent-checks {
  display: flex;
  flex-direction: column;
  align-self: flex-start;
  gap: 0.12em;
  margin-left: 5%;
  color: #fffef2;
  font-size: 0.32em;
  font-weight: 950;
  line-height: 1;
  transform: rotate(-2deg);
}

.talking-cover-parent-checks span {
  display: inline-block;
  width: fit-content;
  padding: 0.1em 0.28em 0.14em;
  border-radius: 0.06em;
  background: rgba(28, 206, 72, 0.95);
  -webkit-text-stroke: 0.045em #101014;
  paint-order: stroke fill;
  box-shadow: 0.06em 0.08em 0 #101014;
}

.talking-cover-parent-main {
  display: flex;
  width: 100%;
  flex-direction: column;
  align-items: center;
  gap: 0.04em;
  margin-top: 0.06em;
}

.talking-cover-parent-line {
  display: block;
  max-width: 96%;
  color: #fff36a;
  font-size: 0.78em;
  font-weight: 950;
  white-space: nowrap;
  -webkit-text-stroke: 0.07em #050507;
  paint-order: stroke fill;
  text-shadow: 0.05em 0.08em 0 #050507, 0 0.18em 0.28em rgba(0, 0, 0, 0.5);
}

.talking-cover-shop-checks {
  display: flex;
  width: 98%;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.14em;
  color: #fff;
  font-size: 0.3em;
  font-weight: 950;
  line-height: 1;
}

.talking-cover-shop-checks span {
  display: inline-block;
  white-space: nowrap;
  -webkit-text-stroke: 0.04em #101014;
  paint-order: stroke fill;
  text-shadow: 0.04em 0.06em 0 rgba(0, 0, 0, 0.85);
}

.talking-cover-shop-lines {
  display: flex;
  width: 100%;
  flex-direction: column;
  align-items: center;
  gap: 0.08em;
}

.talking-cover-shop-line {
  display: block;
  max-width: 94%;
  color: #ffe600;
  font-size: 0.98em;
  font-weight: 950;
  white-space: nowrap;
  -webkit-text-stroke: 0.075em #101014;
  paint-order: stroke fill;
  text-shadow: 0.05em 0.08em 0 #101014, 0 0.16em 0.28em rgba(0, 0, 0, 0.6);
}

.talking-cover-shop-line.is-card {
  padding: 0 0.18em 0.04em;
  border-radius: 0.08em;
  background: #ffef57;
  color: #101014;
  -webkit-text-stroke: 0.04em #ffffff;
  box-shadow: 0.06em 0.08em 0 #101014;
}

.talking-cover-shop-line.is-purple {
  color: #ffffff;
  -webkit-text-stroke: 0.075em #101014;
  text-shadow: 0.05em 0.08em 0 #6d5cff, 0.08em 0.14em 0 #101014;
}

.talking-cover-rank-warning {
  display: inline-block;
  margin-left: 4%;
  padding: 0.08em 0.18em 0.1em;
  color: #ffd84a;
  font-size: 0.32em;
  font-weight: 950;
  line-height: 1;
  transform: rotate(-7deg);
  -webkit-text-stroke: 0.045em #101014;
  paint-order: stroke fill;
  text-shadow: 0.04em 0.06em 0 rgba(0, 0, 0, 0.78);
}

.talking-cover-rank-category {
  align-self: center;
  color: #ffc936;
  font-size: 0.58em;
  font-weight: 950;
  white-space: nowrap;
  -webkit-text-stroke: 0.06em #101014;
  paint-order: stroke fill;
  text-shadow: 0.04em 0.07em 0 rgba(0, 0, 0, 0.8);
}

.talking-cover-rank-lines {
  display: flex;
  width: 100%;
  flex-direction: column;
  align-items: center;
  gap: 0.02em;
}

.talking-cover-rank-line {
  display: block;
  max-width: 96%;
  color: #111;
  font-size: 1.12em;
  font-weight: 950;
  white-space: nowrap;
  -webkit-text-stroke: 0.085em #fff;
  paint-order: stroke fill;
  text-shadow: 0.05em 0.07em 0 #101014;
}

.talking-cover-rank-line.is-red {
  color: #d71916;
}

.talking-cover-rank-red {
  color: #d71916;
}

.talking-cover-wellness-top {
  display: block;
  max-width: 96%;
  color: #4f3c2f;
  font-size: 0.96em;
  font-weight: 950;
  white-space: nowrap;
  -webkit-text-stroke: 0.025em rgba(255, 255, 255, 0.35);
  paint-order: stroke fill;
  text-shadow: 0.03em 0.05em 0 rgba(255, 255, 255, 0.35);
}

.talking-cover-wellness-side {
  position: absolute;
  right: 2%;
  top: 28%;
  padding: 0.18em 0.14em;
  background: #c8ffe5;
  color: #345047;
  font-size: 0.32em;
  font-weight: 950;
  line-height: 1.1;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  box-shadow: 0.04em 0.06em 0 rgba(0, 0, 0, 0.34);
}

.talking-cover-wellness-lines {
  display: flex;
  width: 100%;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.02em;
  margin-top: 0.7em;
}

.talking-cover-wellness-line {
  display: block;
  max-width: 96%;
  color: #fff;
  font-size: 0.78em;
  font-weight: 950;
  white-space: nowrap;
  -webkit-text-stroke: 0.035em rgba(0, 0, 0, 0.28);
  paint-order: stroke fill;
  text-shadow: 0.04em 0.06em 0 rgba(0, 0, 0, 0.48);
}

.talking-cover-wellness-line.is-yellow {
  color: #ffff62;
}

.talking-cover-fitness-top {
  display: block;
  max-width: 94%;
  padding-bottom: 0.05em;
  color: #f8f8f8;
  font-size: 0.42em;
  font-weight: 950;
  line-height: 1;
  white-space: nowrap;
  border-bottom: 0.05em solid rgba(255, 255, 255, 0.9);
  -webkit-text-stroke: 0.045em #111;
  paint-order: stroke fill;
  text-shadow: 0.04em 0.06em 0 #111;
}

.talking-cover-fitness-lines {
  display: flex;
  width: 100%;
  flex-direction: column;
  align-items: center;
  gap: 0.03em;
}

.talking-cover-fitness-line {
  display: block;
  max-width: 96%;
  color: #fff200;
  font-size: 1.16em;
  font-weight: 950;
  white-space: nowrap;
  -webkit-text-stroke: 0.075em #101014;
  paint-order: stroke fill;
  text-shadow: 0.04em 0.08em 0 #101014, 0 0.18em 0.28em rgba(0, 0, 0, 0.54);
}

.talking-style-preview-subtitle {
  font-weight: 800;
  text-shadow: 0 2px 7px rgba(0, 0, 0, 0.85);
}

.talking-style-preview-pip {
  position: absolute;
  z-index: 3;
  display: none;
  width: 30%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.92);
  border-radius: 8px;
  background: rgba(12, 16, 25, 0.88);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.34);
  cursor: grab;
  pointer-events: auto;
  user-select: none;
  touch-action: none;
}

.talking-style-preview-pip.is-visible {
  display: block;
}

.talking-style-preview-pip.is-fullscreen {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.talking-style-preview-pip.is-fullscreen.is-photo {
  background: #000;
}

.talking-style-preview-pip[hidden] {
  display: none;
}

.talking-style-preview-pip:active {
  cursor: grabbing;
}

.talking-style-preview-pip img,
.talking-style-preview-pip video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.talking-style-preview-pip.is-fullscreen.is-photo img {
  object-fit: contain;
}

.talking-style-preview-pip::after {
  content: attr(data-label);
  position: absolute;
  left: 8px;
  bottom: 6px;
  padding: 2px 6px;
  border-radius: 5px;
  color: #fff;
  background: rgba(0, 0, 0, 0.54);
  font-size: 11px;
  font-weight: 800;
}

.post-edit-workbench {
  margin-top: 0;
  display: block;
  padding: 18px;
  white-space: normal;
}

.talking-preview {
  width: 100%;
  aspect-ratio: 9 / 16;
  min-height: 0;
  max-height: 100%;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  overflow: auto;
  margin-top: 14px;
  padding: 10px;
  border: 1px solid #252c3a;
  border-radius: 8px;
  background: #10131b;
}

.talking-preview-empty {
  width: 100%;
  aspect-ratio: 9 / 16;
  min-height: 360px;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  border: 1px dashed #2b3446;
  border-radius: 8px;
  background: #151925;
}

.talking-live-status {
  margin-top: 12px;
  min-height: 24px;
  line-height: 1.45;
}

.talking-live-detail {
  margin-top: 10px;
}

.talking-mobile-result-status {
  margin-bottom: 10px;
  line-height: 1.45;
}

.talking-live-detail .talking-result-grid {
  margin-top: 8px;
}

.post-edit-workbench .talking-stage-head {
  margin-bottom: 6px;
}

.post-edit-workbench .grid-3 {
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 5px 6px;
  margin-top: 4px;
  align-items: end;
}

.post-edit-workbench .grid-3 + .grid-3 {
  margin-top: 4px;
}

.post-edit-workbench .grid-3 > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.post-edit-workbench .form-label {
  margin: 0;
  font-size: 11px;
  line-height: 1.25;
}

.post-edit-workbench input,
.post-edit-workbench select,
.post-edit-workbench textarea {
  min-height: 28px;
  margin: 0;
  padding-top: 4px;
  padding-bottom: 4px;
  font-size: 12px;
}

.post-edit-workbench input,
.post-edit-workbench select {
  height: 28px;
}

.post-edit-workbench .talking-color-trigger {
  height: 28px;
  min-height: 28px;
  padding: 3px;
}

.post-edit-workbench input[type="file"] {
  width: 100%;
  min-height: 28px;
  height: 28px;
  padding: 2px 6px;
  border: 1px solid #2b3446;
  border-radius: 7px;
  background: #151925;
  color: #e9edf5;
}

.post-edit-workbench input[type="color"] {
  height: 28px;
  padding: 3px;
}

.post-edit-workbench .btn-row {
  margin-top: 6px;
  gap: 6px;
}

.post-edit-workbench .btn {
  padding: 6px 9px;
  font-size: 12px;
}

.post-edit-workbench .muted {
  margin-top: 4px;
  font-size: 11px;
  line-height: 1.35;
}

.talking-result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.post-edit-workbench .talking-result-grid {
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.talking-preview .talking-result-grid {
  display: block;
  margin-top: 8px;
}

.talking-preview .talking-mini-card {
  margin-top: 8px;
}

.talking-mini-card {
  padding: 12px;
  border: 1px solid #252c3a;
  border-radius: 8px;
  background: #151925;
}

.talking-final-result {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid #252c3a;
  border-radius: 8px;
  background: #151925;
}

.talking-final-actions {
  margin-top: 10px;
}

.talking-progress {
  margin-top: 10px;
  display: grid;
  gap: 5px;
}

.talking-progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #222838;
  border: 1px solid #30394d;
}

.talking-progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #38bdf8, #22c55e);
  transition: width 0.25s ease;
}

.talking-progress-text {
  color: #dbeafe;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
  line-height: 1.2;
}

.talking-mini-title {
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 8px;
}

.talking-mini-card pre {
  margin: 0;
  max-height: 240px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
  color: #d7deea;
}

.upload-box {
  min-height: 250px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 2px dashed #314056;
  border-radius: 8px;
  background: #151925;
  cursor: pointer;
  padding: 14px;
  overflow: hidden;
}

.upload-box:hover {
  border-color: #3d8aa8;
  background: #17202d;
}

.upload-inner { text-align: center; padding: 22px; }
.upload-icon { font-size: 38px; margin-bottom: 10px; }
.upload-text { color: #fff; font-weight: 700; }
.upload-hint { margin-top: 4px; color: #7f8a9c; font-size: 12px; }
.upload-box img.preview { max-width: 100%; max-height: 300px; display: block; }

.upload-box.has-images {
  align-items: stretch;
  justify-content: flex-start;
}

.upload-box.has-images .upload-inner {
  padding: 10px;
  border: 1px dashed #314056;
  border-radius: 7px;
  background: #10131b;
}

.upload-box.has-images .upload-icon { display: none; }

.image-preview-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.image-preview-item {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border: 1px solid #252c3a;
  border-radius: 7px;
  background: #0d1118;
}

.image-preview-item img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.image-preview-item span {
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 6px;
  min-height: 22px;
  padding: 4px 6px;
  border-radius: 6px;
  background: rgba(8, 10, 14, 0.76);
  color: #e7edf8;
  font-size: 11px;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-reference-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  padding: 4px 7px;
  border-radius: 6px;
  background: rgba(67, 209, 143, 0.9);
  color: #07130d;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.image-remove-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  background: rgba(8, 10, 14, 0.78);
  color: #fff;
  cursor: pointer;
  line-height: 1;
}

.image-remove-btn:hover { background: rgba(255, 91, 91, 0.85); }

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.video-card {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid #2e4258;
  border-radius: 7px;
  background: #101822;
}

.video-card a {
  color: #65c6e8;
  word-break: break-all;
}

.video-preview {
  position: relative;
  margin-top: 12px;
  border-radius: 7px;
  overflow: hidden;
  background: #05080d;
  border: 1px solid #263648;
}

.video-preview video {
  display: block;
  width: 100%;
  max-height: min(62vh, 680px);
  background: #000;
}

.result-video-preview {
  width: 100%;
  margin-top: 14px;
}

.result-video-preview video {
  height: auto;
  max-height: none;
  object-fit: contain;
}

.talking-final-preview video {
  aspect-ratio: auto;
  max-height: none;
  height: auto;
  object-fit: contain;
}

.talking-final-poster-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: #000;
  cursor: pointer;
}

.talking-final-poster-overlay[hidden] {
  display: none !important;
}

.talking-final-poster-overlay img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: #000;
}

.talking-final-poster-play {
  position: absolute;
  left: 50%;
  bottom: 18px;
  width: 46px;
  height: 46px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: rgba(5, 8, 13, 0.72);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.22);
}

.talking-final-poster-play::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 13px;
  width: 0;
  height: 0;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  border-left: 15px solid #fff;
}

.result-video-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.result-video-actions .copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  text-decoration: none;
}

.mobile-video-save-hint {
  display: none;
  margin-top: 8px;
  color: #8d98aa;
  font-size: 12px;
  line-height: 1.55;
}

.talking-preview .video-preview {
  margin-top: 0;
  aspect-ratio: 9 / 16;
}

.talking-preview .video-preview video {
  height: 100%;
  max-height: none;
  object-fit: contain;
}

.talking-preview .talking-final-preview {
  aspect-ratio: auto;
}

.talking-preview .talking-final-preview video {
  display: block;
  height: auto;
  max-height: none;
  object-fit: contain;
  -webkit-touch-callout: default;
  user-select: auto;
}

/* ---------- 步骤条 ---------- */
.steps {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  gap: 10px;
  align-items: stretch;
  padding: 14px;
  background: #151925;
  border: 1px solid #252c3a;
  margin-bottom: 14px;
}

.step-item { display: flex; align-items: center; gap: 10px; min-width: 0; }

.step-dot {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #24445f;
  color: #bdeaff;
  font-weight: 800;
  flex-shrink: 0;
}

.step-text { min-width: 0; color: #aeb8c9; font-size: 12px; line-height: 1.4; }
.step-text b { display: block; color: #fff; font-size: 13px; }
.step-text div { color: #7f8a9c; margin-top: 2px; }
.step-arrow { display: flex; align-items: center; color: #536074; font-weight: 800; }

/* ---------- 结果区 ---------- */
.result-area {
  margin-top: 20px;
  min-height: 48px;
  padding: 15px;
  background: #151925;
  border: 1px solid #252c3a;
  color: #e9edf5;
  white-space: pre-wrap;
  word-break: break-word;
}

.result-area .state-running { color: #65c6e8; font-weight: 600; }
.result-area .state-done { color: #54d39a; font-weight: 700; }
.result-area .state-error { color: #ff7b7b; font-weight: 700; }

.result-area pre {
  margin: 10px 0 0;
  padding: 12px 14px;
  max-height: 430px;
  overflow: auto;
  background: #0d1118;
  border: 1px solid #252c3a;
  border-radius: 7px;
  color: #e9edf5;
  font-size: 12.5px;
  line-height: 1.75;
}

.result-area pre.link-script-text {
  max-height: none;
  overflow-x: hidden;
  overflow-y: visible;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.result-area .shot-item {
  margin: 8px 0;
  padding: 10px 12px;
  background: #111722;
  border-left: 3px solid #247a9b;
  border-radius: 6px;
}

.result-area .shot-item .meta { color: #9ca8ba; font-size: 12px; margin-bottom: 4px; }
.result-area .shot-item .desc { color: #e9edf5; font-size: 13px; }

.link-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
  margin-top: 18px;
}

.link-column {
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 14px;
  border: 1px solid #252c3a;
  border-radius: 8px;
  background: #121722;
}

.link-column-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 38px;
  margin-bottom: 12px;
}

.link-column-title {
  color: #f3f7ff;
  font-size: 15px;
  font-weight: 800;
}

.link-script-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.link-script-section {
  min-width: 0;
}

.link-script-section + .link-script-section {
  padding-top: 16px;
  border-top: 1px solid #252c3a;
}

.link-script-section-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

.link-script-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-start;
}

.link-script-result {
  margin-top: 10px;
  min-height: 136px;
}

.link-control-grid {
  margin-top: 0;
}

.link-action-row {
  margin-top: 12px;
}

.link-column-result {
  margin-top: 14px;
}

.link-column > .link-column-result:last-child {
  flex: 1;
  min-height: 136px;
}

.link-output-block {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #252c3a;
}

.link-output-title {
  color: #c6ceda;
  font-size: 13px;
  font-weight: 700;
}

.copy-btn {
  margin-top: 10px;
  margin-left: 8px;
  padding: 7px 13px;
  border: 1px solid #33516a;
  border-radius: 6px;
  background: #183142;
  color: #bdeaff;
  cursor: pointer;
  font-size: 12.5px;
}

.copy-btn:hover { background: #21455c; }

@media (max-width: 980px) {
  .link-workspace {
    grid-template-columns: 1fr;
  }
}

/* ---------- 独立技能页 ---------- */
.panel-skill-detail { max-width: 880px; }

.skill-detail-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.skill-detail-content {
  min-height: 160px;
  padding: 18px;
  border: 1px solid #252c3a;
  border-radius: 8px;
  background: #151925;
}

.skill-detail-card.disabled { opacity: 0.62; }

.skill-detail-head {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.skill-detail-icon {
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #1d3344;
  font-size: 24px;
}

.skill-detail-name {
  color: #fff;
  font-weight: 760;
  font-size: 18px;
  line-height: 1.25;
}

.skill-detail-id {
  margin-top: 3px;
  color: #6f7b8e;
  font-size: 11.5px;
  word-break: break-all;
}

.skill-detail-desc {
  max-width: 680px;
  color: #9ca8ba;
  font-size: 13px;
  line-height: 1.55;
}

.skill-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 12px 0;
}

.skill-badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
}

.skill-badge.on {
  color: #54d39a;
  background: rgba(84, 211, 154, 0.1);
  border: 1px solid rgba(84, 211, 154, 0.28);
}

.skill-badge.off,
.skill-badge.missing {
  color: #ff9f9f;
  background: rgba(255, 91, 91, 0.1);
  border: 1px solid rgba(255, 91, 91, 0.28);
}

.skill-badge.ver,
.skill-badge.pkg {
  color: #bdeaff;
  background: rgba(61, 138, 168, 0.12);
  border: 1px solid rgba(61, 138, 168, 0.3);
}

.skill-badge.update {
  color: #ffe0a3;
  background: rgba(244, 185, 66, 0.12);
  border: 1px solid rgba(244, 185, 66, 0.35);
}

.skill-detail-meta {
  margin-top: 10px;
  color: #6f7b8e;
  font-size: 12px;
}

.skill-detail-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.skill-detail-actions .btn {
  padding: 8px 12px;
  font-size: 12.5px;
}

.skill-tool-panel {
  margin-top: 16px;
  padding-top: 18px;
  border-top: 1px solid #252c3a;
}

.skill-tool-title {
  margin-bottom: 12px;
  color: #fff;
  font-size: 16px;
  font-weight: 800;
}

.skill-tool-desc {
  color: #8d98aa;
  font-size: 12.5px;
  line-height: 1.6;
}

.skill-grid {
  margin-top: 10px;
  margin-bottom: 10px;
}

.inline-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  color: #aeb8c9;
  font-size: 13px;
}

.inline-check input {
  width: 16px;
  height: 16px;
  accent-color: #36a3c8;
}

.skill-run-result {
  margin-top: 14px;
  min-height: 88px;
}

.run-log-title {
  margin-top: 14px;
  color: #8b8fa9;
  font-size: 12px;
}

.skill-run-log {
  margin-top: 5px;
  max-height: 320px;
  white-space: pre-wrap;
}

code {
  background: #151925;
  color: #bdeaff;
  padding: 1px 6px;
  border-radius: 4px;
}

/* ---------- 响应式 ---------- */
@media (max-width: 860px) {
  body { overflow: auto; }
  .app { grid-template-columns: 1fr; }
  .sidebar {
    min-height: auto;
    border-right: none;
    border-bottom: 1px solid #252c3a;
  }
  .side-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .sidebar-footer { display: none; }
  .workspace { height: auto; min-height: 0; padding: 18px; }
  .topbar { align-items: flex-start; }
  .topbar-status {
    margin-left: 0;
    align-items: flex-start;
    justify-content: flex-start;
  }
  .topbar-status-main {
    justify-content: flex-start;
  }
  .topbar-device-id {
    text-align: left;
  }
  .topbar-version {
    max-width: 100%;
    border-radius: 8px;
    white-space: normal;
  }
  .upload-layout,
  .ai-image-workspace,
  .talking-layout,
  .talking-workbench,
  .post-edit-workbench,
  .grid-2,
  .grid-3,
  .steps,
  .talking-result-grid {
    grid-template-columns: 1fr;
  }
  .ai-image-result-card {
    min-height: 520px;
  }
  .ai-image-output img {
    max-height: 460px;
  }
  .talking-file-select {
    width: 100%;
    flex-basis: auto;
    min-height: 74px;
  }
  .talking-step-card-1,
  .talking-step-card-1 .talking-upload-item,
  .talking-step-card-1 .talking-asset-list,
  .talking-step-card-1 .talking-file-row,
  .talking-step-card-1 .talking-voice-row {
    width: 100%;
    max-width: none;
  }
  .talking-step-card-1 .talking-file-row,
  .talking-step-card-1 .talking-voice-row {
    grid-template-columns: 1fr;
  }
  .talking-voice-row {
    grid-template-columns: 1fr;
  }
  .talking-file-select input[type="file"] {
    width: 118px;
  }
  .talking-file-preview {
    min-height: 104px;
  }
  .talking-file-thumb,
  .talking-file-icon {
    width: 70px;
    height: 86px;
  }
  .talking-pip-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .talking-pip-layout .talking-file-row {
    flex-direction: column;
    gap: 8px;
  }
  .talking-pip-layout .talking-file-select {
    width: 100%;
    flex-basis: auto;
    height: var(--pip-upload-card-height);
    min-height: var(--pip-upload-card-height);
    max-height: var(--pip-upload-card-height);
  }
  .web-app-mode #panel-talking .run-log-title,
  .web-app-mode #panel-talking .skill-run-log,
  .web-app-mode #panel-talking .talking-mini-card pre,
  .web-app-mode #panel-talking .talking-live-detail pre {
    display: none !important;
  }
  .step-arrow { display: none; }
}

@media (max-width: 860px) {
  body.web-app-mode {
    padding-bottom: 118px;
  }

  .web-app-mode .app {
    min-height: 100dvh;
  }

  .web-app-mode .sidebar {
    position: sticky;
    top: 0;
    z-index: 20;
    padding: 12px;
  }

  .web-app-mode .brand {
    min-height: 62px;
    padding: 6px 6px 12px;
    padding-right: min(350px, 46vw);
  }

  .web-app-mode .side-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 12px;
  }

  .web-app-mode .nav-item {
    min-height: 64px;
    padding: 9px;
  }

  .web-app-mode .nav-icon {
    width: 28px;
    height: 28px;
  }

  .web-app-mode .sidebar-footer {
    display: grid;
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: 10px;
    z-index: 45;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    margin-top: 0;
    padding: 8px;
    border: 1px solid #252c3a;
    border-radius: 12px;
    background: rgba(16, 19, 27, 0.96);
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.32);
    backdrop-filter: blur(14px);
  }

  .web-app-mode .recharge-button {
    grid-column: auto;
  }

  .web-app-mode .credit-chip,
  .web-app-mode .device-chip,
  .web-app-mode .recharge-button {
    width: 100%;
    min-height: 38px;
  }

  .web-app-mode .workspace {
    padding: 14px;
  }

  .web-app-mode .workspace-beian {
    margin-top: 2px;
    padding: 8px 0 0;
    font-size: 10.5px;
    gap: 4px 6px;
  }

  .web-app-mode #panel-talking .talking-workbench {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  .web-app-mode #panel-talking .talking-card {
    padding: 14px;
  }

  .web-app-mode #panel-talking .talking-stage-head {
    margin-bottom: 8px;
  }

  .web-app-mode #panel-talking .talking-step {
    font-size: 13.5px;
  }

  .web-app-mode .topbar {
    position: relative;
    flex-direction: row;
    align-items: flex-start;
    gap: 10px;
    min-height: 0;
    padding-right: 0;
  }

  .web-app-mode .topbar-status {
    position: fixed;
    top: 20px;
    right: 24px;
    z-index: 60;
    width: min(330px, 42vw);
    margin-left: 0;
    align-items: flex-end;
  }

  .web-app-mode .topbar-status-main {
    justify-content: flex-end;
    flex-wrap: nowrap;
  }

  .web-app-mode .topbar-device-id {
    max-width: 100%;
    text-align: right;
  }

  .web-app-mode input,
  .web-app-mode textarea,
  .web-app-mode select,
  .web-app-mode button {
    font-size: 16px;
  }

  .web-app-mode .wechat-modal-card,
  .web-app-mode .account-modal-card,
  .web-app-mode .credit-modal-card {
    width: min(100% - 24px, 520px);
    max-height: calc(100dvh - 32px);
    overflow: auto;
  }

  .web-app-mode .activation-screen {
    align-items: stretch;
    padding: 16px;
  }

  .web-app-mode .activation-card {
    align-self: center;
    padding: 24px;
  }
}

@media (max-width: 560px) {
  body.web-app-mode {
    padding-bottom: 112px;
  }

  .web-app-mode .sidebar {
    padding: 10px 10px 8px;
  }

  .web-app-mode .brand {
    gap: 10px;
    min-height: 56px;
    padding: 4px 4px 10px;
    padding-right: 168px;
  }

  .web-app-mode .brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    font-size: 18px;
  }

  .web-app-mode .brand-title {
    font-size: 16px;
    line-height: 1.2;
  }

  .web-app-mode .side-nav {
    display: flex;
    flex-direction: row;
    gap: 8px;
    margin-top: 10px;
    overflow-x: auto;
    padding: 0 0 8px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }

  .web-app-mode .side-nav::-webkit-scrollbar {
    display: none;
  }

  .web-app-mode .nav-item {
    flex: 0 0 78px;
    min-height: 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    padding: 7px 6px;
    text-align: center;
    scroll-snap-align: start;
  }

  .web-app-mode .nav-icon {
    width: 26px;
    height: 26px;
    margin: 0 auto;
    font-size: 15px;
  }

  .web-app-mode .nav-item b {
    font-size: 12px;
    line-height: 1.15;
    white-space: nowrap;
  }

  .web-app-mode .nav-item small {
    display: none;
  }

  .web-app-mode .nav-title-row {
    justify-content: center;
  }

  .web-app-mode .sidebar-footer {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
    left: 8px;
    right: 8px;
    bottom: 8px;
    padding: 7px;
    border-radius: 11px;
  }

  .web-app-mode .credit-chip,
  .web-app-mode .device-chip {
    min-height: 32px;
    padding: 6px 4px;
    border-radius: 8px;
    font-size: 11px;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .web-app-mode .recharge-button {
    grid-column: auto;
    min-height: 32px;
    padding: 6px 4px;
    border-radius: 8px;
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .web-app-mode .workspace {
    padding: 12px 10px 28px;
  }

  .web-app-mode .workspace-beian {
    padding-bottom: 0;
    line-height: 1.6;
  }

  .web-app-mode .topbar {
    min-height: 0;
    gap: 8px;
    padding-bottom: 12px;
    padding-right: 0;
    margin-bottom: 14px;
  }

  .web-app-mode .page-kicker {
    font-size: 11px;
    margin-bottom: 0;
  }

  .web-app-mode .topbar h1 {
    font-size: 24px;
    line-height: 1.15;
  }

  .web-app-mode .topbar-status {
    position: fixed;
    top: 12px;
    right: 12px;
    width: 156px;
    display: flex;
    align-items: flex-end;
  }

  .web-app-mode .topbar-status-main {
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    justify-content: flex-end;
    gap: 5px;
    flex-wrap: nowrap;
  }

  .web-app-mode .topbar-version {
    min-height: 24px;
    max-width: 74px;
    padding: 4px 7px;
    border-radius: 8px;
    font-size: 10.5px;
    white-space: nowrap;
  }

  .web-app-mode .status-strip {
    min-height: 24px;
    padding: 4px 7px;
    border-radius: 8px;
    font-size: 10.5px;
    gap: 5px;
  }

  .web-app-mode .topbar-device-id {
    display: block;
    width: 156px;
    margin-top: 4px;
    font-size: 9.5px;
    line-height: 1.2;
    opacity: 0.8;
  }

  .web-app-mode .panel {
    max-width: none;
  }

  .web-app-mode .panel-sub {
    margin-bottom: 12px;
    font-size: 13px;
    line-height: 1.5;
  }

  .web-app-mode .form-label {
    margin: 12px 0 6px;
    font-size: 12.5px;
  }

  .web-app-mode input[type="text"],
  .web-app-mode input[type="password"],
  .web-app-mode input[type="number"],
  .web-app-mode input[type="tel"],
  .web-app-mode select {
    min-height: 42px;
    padding: 9px 11px;
  }

  .web-app-mode textarea {
    min-height: 132px;
    padding: 10px 11px;
    line-height: 1.5;
  }

  .web-app-mode #textPrompt,
  .web-app-mode #talkingBrief {
    min-height: 128px;
  }

  .web-app-mode #talkingFinalScript {
    min-height: 160px;
  }

  .web-app-mode .btn-row {
    gap: 8px;
    margin-top: 12px;
  }

  .web-app-mode .btn-row .btn {
    min-height: 42px;
    padding: 9px 12px;
  }

  .web-app-mode .activation-screen {
    padding: 12px;
  }

  .web-app-mode .activation-card {
    padding: 22px 18px;
  }

  .web-app-mode .activation-title {
    font-size: 19px;
  }
}

@media (max-width: 380px) {
  .web-app-mode .nav-item {
    flex-basis: 72px;
  }

  .web-app-mode .brand {
    gap: 8px;
    padding-right: 138px;
  }

  .web-app-mode .brand-title {
    font-size: 15px;
  }

  .web-app-mode .topbar h1 {
    font-size: 22px;
  }

  .web-app-mode .topbar-status {
    right: 10px;
    width: 126px;
  }

  .web-app-mode .topbar-version,
  .web-app-mode .status-strip {
    min-height: 22px;
    padding: 3px 5px;
    font-size: 9.5px;
  }

  .web-app-mode .topbar-version {
    max-width: 58px;
  }

  .web-app-mode .topbar-device-id {
    width: 126px;
    font-size: 9px;
  }
}

.web-app-mode .sidebar-footer .credit-chip,
.web-app-mode .sidebar-footer .device-chip {
  display: none;
}

.web-app-mode .sidebar-footer {
  grid-template-columns: 1fr;
  z-index: 1200;
  pointer-events: auto;
}

.web-app-mode .sidebar-footer .recharge-button {
  grid-column: 1 / -1;
  min-height: 38px;
  font-size: 13px;
}

.web-app-mode .sidebar-footer .workspace-beian {
  display: flex;
}

@media (max-width: 860px) {
  body.web-app-mode {
    padding-bottom: 0;
  }

  .web-app-mode .topbar-info-button {
    display: inline-flex;
  }

  .web-app-mode .sidebar-footer {
    display: none !important;
  }

  .web-app-mode .mobile-workspace-beian {
    display: flex;
    margin: 14px 0 0;
    padding: 10px 8px max(10px, env(safe-area-inset-bottom));
    border-top: 1px solid rgba(37, 44, 58, 0.8);
    color: #7f8a9c;
    font-size: 10px;
    line-height: 1.55;
    opacity: 0.76;
  }

  .web-app-mode .workspace {
    padding-bottom: 16px;
  }
}

@media (max-width: 560px) {
  body.web-app-mode {
    padding-bottom: 0;
  }

  .web-app-mode .topbar-status-main {
    flex-wrap: wrap;
  }

  .web-app-mode .topbar-info-button {
    min-height: 22px;
    padding: 3px 7px;
    border-radius: 8px;
    font-size: 9.5px;
  }

  .web-app-mode .workspace {
    padding-bottom: 16px;
  }
}

@media (max-width: 860px) {
  body.web-app-mode.mobile-web-clean-footer {
    padding-bottom: 0 !important;
  }

  body.web-app-mode.mobile-web-clean-footer .sidebar-footer,
  body.web-app-mode.mobile-web-clean-footer .sidebar-footer[hidden] {
    display: none !important;
    position: static !important;
    inset: auto !important;
    height: 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    overflow: hidden !important;
    pointer-events: none !important;
    visibility: hidden !important;
  }

  body.web-app-mode.mobile-web-clean-footer .topbar-info-button {
    display: inline-flex !important;
  }
}

@media (max-width: 860px) {
  body.web-app-mode .topbar-version {
    display: none !important;
  }

  body.web-app-mode .topbar-info-button,
  body.web-app-mode.mobile-web-clean-footer .topbar-info-button {
    display: none !important;
  }

  body.web-app-mode .side-nav {
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
    overflow: visible;
    padding: 0;
  }

  body.web-app-mode .nav-item,
  body.web-app-mode .nav-info-item {
    width: auto;
    min-width: 0;
    min-height: 58px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: initial;
    padding: 6px 4px;
    gap: 4px;
    scroll-snap-align: none;
    text-align: center;
  }

  body.web-app-mode .nav-info-item:not([hidden]) {
    display: flex;
  }

  body.web-app-mode .nav-icon {
    width: 24px;
    height: 24px;
    font-size: 14px;
  }

  body.web-app-mode .nav-item b,
  body.web-app-mode .nav-info-item b {
    font-size: 11px;
    line-height: 1.1;
    white-space: nowrap;
  }

  body.web-app-mode .nav-item small,
  body.web-app-mode .nav-info-item small {
    display: none;
  }

  body.web-app-mode .talking-final-result {
    padding: 10px;
  }

  body.web-app-mode .result-video-preview {
    margin-top: 10px;
    border-radius: 8px;
  }

  body.web-app-mode .result-video-preview video {
    width: 100%;
    height: auto;
    max-height: none;
  }

  body.web-app-mode .result-video-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  body.web-app-mode .result-video-actions .copy-btn {
    width: 100%;
    min-height: 40px;
    padding: 9px 10px;
    font-size: 14px;
  }

body.web-app-mode.mobile-device-web-mode .mobile-video-save-hint {
  display: block;
}

  body.web-app-mode.mobile-device-web-mode #panel-talking .talking-step-card-1 {
    --step1-pair-width: 100%;
    --step1-pair-height: 124px;
    --step1-action-button-height: 40px;
  }

  body.web-app-mode.mobile-device-web-mode #panel-talking .talking-step-card-1 .talking-file-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
    width: 100%;
  }

  body.web-app-mode.mobile-device-web-mode #panel-talking .talking-step-card-1 .talking-file-select,
  body.web-app-mode.mobile-device-web-mode #panel-talking .talking-step-card-1 .talking-file-preview {
    min-height: var(--step1-pair-height);
  }

  body.web-app-mode.mobile-device-web-mode #panel-talking .talking-step-card-1 .talking-file-select {
    padding: 8px;
  }

  body.web-app-mode.mobile-device-web-mode #panel-talking .talking-step-card-1 .talking-file-preview {
    padding: 10px 30px 10px 10px;
  }

  body.web-app-mode.mobile-device-web-mode #panel-talking .talking-step-card-1 .talking-voice-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
    align-items: stretch;
  }

  body.web-app-mode.mobile-device-web-mode #panel-talking .talking-step-card-1 .talking-voice-saved-block,
  body.web-app-mode.mobile-device-web-mode #panel-talking .talking-step-card-1 .talking-voice-row {
    min-width: 0;
  }

  body.web-app-mode.mobile-device-web-mode #panel-talking .talking-step-card-1 .talking-voice-row {
    display: contents;
  }

  body.web-app-mode.mobile-device-web-mode #panel-talking .talking-step-card-1 .talking-voice-controls {
    min-height: 0;
    height: auto;
  }

  body.web-app-mode.mobile-device-web-mode #panel-talking .talking-step-card-1 .talking-voice-current {
    grid-column: 1 / -1;
    min-height: 78px;
  }

  body.web-app-mode.mobile-device-web-mode #panel-talking .talking-step-card-1 #talkingVoiceAssetList {
    grid-template-columns: minmax(0, 1fr);
    margin-bottom: 0;
  }

  body.web-app-mode.mobile-device-web-mode #panel-talking .talking-step-card-1 .talking-voice-asset-card {
    justify-content: flex-start;
  }

  body.web-app-mode.mobile-device-web-mode #panel-talking .talking-step-card-2 .talking-script-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 58px;
    gap: 8px;
    align-items: stretch;
  }

  body.web-app-mode.mobile-device-web-mode #panel-talking .talking-step-card-2 .talking-script-actions .btn {
    width: 100%;
    min-width: 0;
    min-height: 40px;
    padding: 8px 6px;
    font-size: 13px;
    line-height: 1.25;
    white-space: nowrap;
  }

  body.web-app-mode.mobile-device-web-mode #panel-talking .talking-step-card-2 #talkingClearBtn {
    padding-left: 5px;
    padding-right: 5px;
  }

  body.web-app-mode.mobile-device-web-mode #panel-talking .talking-step-card-4 .cover-title-panel textarea#talkingCoverTitle {
    height: 58px;
    min-height: 58px;
    max-height: 82px;
    padding: 9px 10px;
    line-height: 1.35;
    resize: vertical;
  }

  body.web-app-mode.mobile-device-web-mode #panel-talking .talking-step-card-5 {
    --pip-upload-card-height: 112px;
  }

  body.web-app-mode.mobile-device-web-mode #panel-talking .talking-step-card-5 .talking-pip-layout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    align-items: start;
  }

  body.web-app-mode.mobile-device-web-mode #panel-talking .talking-step-card-5 .talking-pip-layout > div {
    min-width: 0;
    gap: 6px;
  }

  body.web-app-mode.mobile-device-web-mode #panel-talking .talking-step-card-5 .talking-file-row {
    width: 100%;
  }

  body.web-app-mode.mobile-device-web-mode #panel-talking .talking-step-card-5 .talking-file-select {
    height: var(--pip-upload-card-height);
    min-height: var(--pip-upload-card-height);
    max-height: var(--pip-upload-card-height);
    padding: 8px;
  }

  body.web-app-mode.mobile-device-web-mode #panel-talking .talking-step-card-5 .talking-file-select .btn {
    width: 100%;
    min-height: 40px;
    padding: 9px 8px;
    font-size: 13px;
    line-height: 1.25;
    white-space: normal;
  }

  body.web-app-mode.mobile-device-web-mode #panel-talking .talking-step-card-5 .talking-pip-layout .form-label {
    font-size: 12.5px;
    line-height: 1.35;
  }

  body.web-app-mode.mobile-device-web-mode #panel-talking .talking-step-card-5 .talking-pip-anchor-field textarea {
    min-height: 92px;
    padding: 10px;
    font-size: 13px;
    line-height: 1.4;
  }
}

@media (max-width: 380px) {
  body.web-app-mode .side-nav {
    gap: 5px;
  }

  body.web-app-mode .nav-item,
  body.web-app-mode .nav-info-item {
    min-height: 54px;
    padding: 5px 3px;
  }

  body.web-app-mode .nav-icon {
    width: 23px;
    height: 23px;
  }

  body.web-app-mode .nav-item b,
  body.web-app-mode .nav-info-item b {
    font-size: 10.5px;
  }
}



