/* 软件风工具站 — 主题：白色 / 雅灰 */
:root[data-theme="light"] {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #eef1f6;
  --border: #d8dee8;
  --text: #1a1d24;
  --muted: #5c6573;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --danger: #dc2626;
  --success: #16a34a;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  --radius: 6px;
  --font: "Segoe UI", "Microsoft YaHei UI", "PingFang SC", sans-serif;
}

:root[data-theme="gray"] {
  --bg: #2d3239;
  --surface: #383e47;
  --surface-2: #2f343b;
  --border: #4a535e;
  --text: #e8eaed;
  --muted: #a8b0ba;
  --accent: #5b9fff;
  --accent-hover: #82b4ff;
  --danger: #f87171;
  --success: #4ade80;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  --radius: 6px;
  --font: "Segoe UI", "Microsoft YaHei UI", "PingFang SC", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

/* 移动端：配合 viewport 禁缩放；减轻 iOS 文本自动放大；降低误触双击缩放等待 */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  touch-action: manipulation;
}
@media screen and (max-width: 1024px) {
  /* iOS：输入框字号小于 16px 时聚焦会强制整页放大，至少 16px 避免 */
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]):not([type="hidden"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="image"]),
  textarea,
  select,
  [contenteditable="true"] {
    font-size: max(16px, 1em) !important;
  }
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 40;
}

.app-header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.brand:hover {
  text-decoration: none;
  color: var(--accent);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.nav-links a {
  padding: 6px 10px;
  border-radius: var(--radius);
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
}
.nav-links a:hover {
  background: var(--surface-2);
  color: var(--text);
  text-decoration: none;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-dropdown {
  position: relative;
  z-index: 50;
}
.user-dropdown-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 180px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
}
.user-dropdown-trigger:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.user-dropdown-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-dropdown-caret {
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--muted);
  flex-shrink: 0;
}
.user-dropdown.is-open .user-dropdown-caret {
  border-top: none;
  border-bottom: 5px solid var(--muted);
}
.user-dropdown-panel {
  display: none;
  position: absolute;
  right: 0;
  /* 与按钮留 2px 间距；缝隙由 ::before 桥接，避免 :hover 中断 */
  top: calc(100% + 2px);
  margin-top: 0;
  min-width: 200px;
  padding: 6px 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
/* 向上延伸不可见命中带，避免从按钮移到面板时经过空隙失焦 */
.user-dropdown-panel::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  height: 10px;
}
.user-dropdown:hover .user-dropdown-panel,
.user-dropdown.is-open .user-dropdown-panel,
.user-dropdown:focus-within .user-dropdown-panel {
  display: block;
}
.user-dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 14px;
  border: none;
  background: none;
  color: var(--text);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  box-sizing: border-box;
}
a.user-dropdown-item:hover {
  background: var(--surface-2);
  text-decoration: none;
  color: var(--text);
}
.user-dropdown-balance {
  cursor: default;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
  padding-bottom: 10px;
}
.user-dropdown-label {
  color: var(--muted);
}
.user-dropdown-value {
  font-weight: 600;
  color: var(--text);
}
.user-dropdown-balance-row {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}
.user-balance-refresh-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  flex-shrink: 0;
}
.user-balance-refresh-btn:hover {
  background: var(--surface-2);
  color: var(--text);
}
.user-balance-refresh-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.user-balance-refresh-btn.is-loading svg {
  animation: user-balance-refresh-spin 0.7s linear infinite;
}
@keyframes user-balance-refresh-spin {
  to {
    transform: rotate(360deg);
  }
}
.user-dropdown-logout {
  color: var(--danger);
  margin-top: 2px;
}
.user-dropdown-logout:hover {
  background: var(--surface-2);
}

.theme-toggle {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-2);
}
.theme-toggle button {
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 5px 10px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
}
.theme-toggle button.active {
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
}

.app-main {
  flex: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 20px 48px;
  width: 100%;
}

.page-title {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 600;
}
.page-desc {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 13px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 16px;
}

.card h2 {
  margin: 0 0 12px;
  font-size: 16px;
}

.form-row {
  margin-bottom: 14px;
}
.form-row label {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 13px;
}

/* 自定义视频上传区（替代原生 file 控件） */
.file-upload-zone {
  position: relative;
  max-width: 520px;
  min-height: 148px;
  border: 2px dashed var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.file-upload-zone:not(.is-disabled):hover {
  border-color: var(--accent);
  background: var(--bg);
}
.file-upload-zone.is-dragover:not(.is-disabled) {
  border-color: var(--accent);
  border-style: solid;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.file-upload-zone.has-file:not(.is-dragover) {
  border-style: solid;
  border-color: var(--accent);
  background: var(--surface);
  /* 已选文件时不再保留大占位高度，与空状态区分；保留最小可点高度，避免透明 file 覆盖层塌成 0 */
  min-height: 48px;
}
.file-upload-zone.is-disabled {
  opacity: 0.65;
  cursor: not-allowed;
}
.file-upload-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}
.file-upload-zone.is-disabled .file-upload-input {
  cursor: not-allowed;
  z-index: 1;
}
.file-upload-inner {
  position: relative;
  z-index: 1;
  padding: 22px 20px;
  text-align: center;
  pointer-events: none;
}
.file-upload-icon {
  display: inline-flex;
  color: var(--accent);
  margin-bottom: 10px;
  opacity: 0.9;
}
.file-upload-title {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.file-upload-sub {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}
.file-upload-name {
  margin: 0;
  font-size: 13px;
  color: var(--accent);
  font-weight: 500;
  word-break: break-all;
}
.file-upload-zone.has-file .file-upload-inner {
  padding: 8px 12px;
  text-align: left;
}
.file-upload-zone.has-file .file-upload-name {
  text-align: left;
  line-height: 1.35;
  max-width: 100%;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-all;
}
.file-upload-repick-wrap {
  margin-top: 6px;
}
input[type="text"],
input[type="email"],
input[type="password"] {
  width: 100%;
  max-width: 360px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
}
.btn:hover {
  text-decoration: none;
}
.btn:disabled,
.btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover {
  background: var(--accent-hover);
  color: #fff;
}
.btn-ghost {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn-ghost:hover:not(:disabled):not([disabled]) {
  background: var(--surface);
  border-color: var(--accent);
  color: var(--accent);
}
.btn-danger {
  background: transparent;
  color: var(--danger);
  border-color: var(--danger);
}
.btn-sm {
  padding: 4px 10px;
  font-size: 13px;
}

/* 任务表：工具名列单行显示 */
.data-table th.cell-tool,
.data-table td.cell-tool {
  white-space: nowrap;
}
.data-table th.cell-billing,
.data-table td.cell-billing {
  white-space: nowrap;
  width: 1%;
  text-align: right;
}

/* 任务表等：操作列并排、不换行 */
.data-table td.cell-actions {
  white-space: nowrap;
  vertical-align: middle;
  width: 1%;
}
.table-actions {
  display: inline-flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 8px;
}
.table-actions .btn {
  flex-shrink: 0;
}

.task-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}
.pagination {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}
.pagination-info {
  font-size: 13px;
  min-width: 7rem;
  text-align: center;
}

/* 与雅灰主题一致：主操作略立体，删除为弱对比描边 */
.btn-action-download {
  background: var(--accent);
  color: #fff;
  border: 1px solid transparent;
  font-weight: 500;
  box-shadow: var(--shadow);
  transition: background 0.15s, box-shadow 0.15s;
}
.btn-action-download:hover {
  background: var(--accent-hover);
  color: #fff;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.1);
}
:root[data-theme="gray"] .btn-action-download:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}
.btn-action-delete {
  background: var(--surface);
  color: var(--danger);
  border: 1px solid var(--border);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.btn-action-delete:hover {
  background: var(--surface-2);
  border-color: var(--danger);
  color: var(--danger);
}
:root[data-theme="light"] .btn-action-delete:hover {
  background: #f8fafc;
}

.tool-category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.tool-category-tab {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.tool-category-tab:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.tool-category-tab.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.tool-category-tab.is-active:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #fff;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.tool-card.is-hidden {
  display: none;
}

.tool-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  transition: border-color 0.15s;
}
.tool-card:hover {
  border-color: var(--accent);
}
.tool-card-badge {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--accent);
}
.tool-card h3 {
  margin: 0 0 6px;
  font-size: 15px;
}
.tool-card-desc {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--muted);
  flex: 1;
}
.tool-card-version {
  margin: -4px 0 10px;
  font-size: 12px;
}
.tool-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: auto;
}
.tool-card-price {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
}
.tool-discount-zhe {
  font-size: 13px;
  font-weight: 600;
  color: var(--danger);
  margin-left: 4px;
  white-space: nowrap;
}
.page-tool-discount {
  color: var(--danger);
  font-weight: 600;
  margin-left: 0.25em;
  white-space: nowrap;
}

.tool-category-empty {
  margin-top: 8px;
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table.data-table th,
table.data-table td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
}
table.data-table th {
  color: var(--muted);
  font-weight: 600;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  background: var(--surface-2);
  color: var(--muted);
}
.badge.running {
  color: var(--accent);
}
.badge.done {
  color: var(--success);
}
.badge.failed {
  color: var(--danger);
}

.alert {
  padding: 10px 12px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 14px;
}
.alert-error {
  background: rgba(220, 38, 38, 0.12);
  color: var(--danger);
  border: 1px solid rgba(220, 38, 38, 0.35);
}
.alert-success {
  background: rgba(22, 163, 74, 0.12);
  color: var(--success);
  border: 1px solid rgba(22, 163, 74, 0.35);
}

.user-side {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 20px;
}
@media (max-width: 720px) {
  .user-side {
    grid-template-columns: 1fr;
  }
}

.side-nav {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
  box-shadow: var(--shadow);
  height: fit-content;
}
.side-nav a {
  display: block;
  padding: 8px 10px;
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
}
.side-nav a:hover,
.side-nav a.active {
  background: var(--surface-2);
  color: var(--accent);
}
.side-nav a.active {
  font-weight: 600;
}

.video-stage-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0 8px;
  flex-wrap: wrap;
}
.watermark-region-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.btn-region-tab {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.btn-region-tab:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.btn-region-tab.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn-region-tab.is-active:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #fff;
}
.btn-annotate-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.btn-annotate-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.btn-annotate-toggle.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn-annotate-toggle.is-active:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #fff;
}
.btn-annotate-toggle:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}
.btn-annotate-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-stage-wrap {
  position: relative;
  display: inline-block;
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #000;
  overflow: hidden;
}
/* 仅包裹画面：勿在 video 上使用原生 controls，否则 clientHeight 含控制条，与 object-fit 画面坐标不一致 */
.video-picture-host {
  position: relative;
  display: inline-block;
  max-width: 100%;
  line-height: 0;
  vertical-align: middle;
}
.video-picture-host video {
  display: block;
  max-width: 100%;
  max-height: 420px;
  vertical-align: middle;
  object-fit: contain;
  cursor: default;
}
.video-custom-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--surface-2);
  border-top: 1px solid var(--border);
}
.video-frame-hint {
  flex-basis: 100%;
  font-size: 12px;
  line-height: 1.4;
}
.video-toolbar-fps-row {
  flex-basis: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
}
.video-toolbar-fps-row .video-fps-assume-label {
  flex-basis: auto;
  margin: 0;
}
.video-fps-assume-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
}
.video-fps-assume-label input[type="number"] {
  width: 4.75rem;
  padding: 4px 6px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
}
.video-segment-quick {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}
.video-segment-quick__title {
  font-weight: 500;
  color: var(--text);
  margin-right: 2px;
  white-space: nowrap;
}
.btn-video-segment-apply {
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 500;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.btn-video-segment-apply:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}
.btn-video-segment-apply:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.btn-video-play {
  flex-shrink: 0;
  padding: 6px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
}
.btn-video-play:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.video-seek {
  flex: 1;
  min-width: 80px;
  min-height: 28px;
  cursor: pointer;
}
.video-time-label {
  flex-shrink: 0;
  font-size: 12px;
  white-space: nowrap;
}
/* 默认不拦截点击；标注模式由 annotate-mode 开启 */
#watermark-overlay {
  position: absolute;
  left: 0;
  top: 0;
  pointer-events: none;
  cursor: default;
}
.video-stage-wrap.annotate-mode #watermark-overlay {
  pointer-events: auto;
  cursor: crosshair;
}

.progress-bar {
  height: 8px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 8px;
}
.progress-bar > span {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.2s;
}

.muted {
  color: var(--muted);
  font-size: 13px;
}

/* 会员中心首页 */
.user-dashboard-main {
  min-width: 0;
}
.user-dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 0;
}
@media (max-width: 900px) {
  .user-dashboard-grid {
    grid-template-columns: 1fr;
  }
}
.user-stat-card h2 {
  margin-top: 0;
}
.user-stat-balance {
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.user-stat-balance-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.user-stat-balance-text {
  min-width: 0;
}
.user-stat-recharge-btn {
  flex-shrink: 0;
  margin-top: 2px;
}
.recharge-lookup-result {
  margin: 12px 0 16px;
  font-size: 15px;
}
.recharge-lookup-result strong {
  color: var(--accent);
  font-size: 18px;
}
.modal-actions-wrap {
  flex-wrap: wrap;
  justify-content: flex-end;
}
.user-stat-label {
  margin: 0 0 6px;
  font-size: 13px;
  color: var(--muted);
}
.user-stat-value {
  margin: 0 0 10px;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--accent);
  text-decoration: none;
}
.user-pending-withdraw-line {
  margin: -6px 0 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text);
}
.user-pending-withdraw-line strong {
  font-weight: 700;
  color: color-mix(in srgb, var(--accent) 52%, var(--text));
}
.user-stat-hint {
  font-size: 12px;
}
.user-info-dl {
  margin: 0;
}
.user-info-dl > div {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 10px 16px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.user-info-dl > div:last-child {
  border-bottom: none;
}
.user-info-dl dt {
  margin: 0;
  color: var(--muted);
  font-weight: normal;
}
.user-info-dl dd {
  margin: 0;
  word-break: break-all;
}
.user-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

/* 会员中心 · 提现申请 */
.wd-withdraw-page {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.wd-balance-card {
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--accent) 12%, var(--surface)),
    var(--surface)
  );
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
}
.wd-balance-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.wd-balance-label {
  margin: 0 0 6px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}
.wd-balance-amount {
  margin: 0 0 10px;
  font-size: clamp(1.35rem, 4vw, 2rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--accent);
}
.wd-pending-withdraw-row {
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text);
}
.wd-pending-withdraw-strong {
  font-weight: 700;
  color: color-mix(in srgb, var(--accent) 52%, var(--text));
}
.wd-balance-desc {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  max-width: 42rem;
}
.wd-rule-chips {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.wd-rule-chips li {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
}
.wd-form-card .wd-card-head {
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.wd-form-card .wd-card-head h2 {
  margin: 0 0 6px;
  font-size: 17px;
}
.wd-card-sub {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}
.wd-form-grid {
  display: grid;
  gap: 4px 20px;
}
@media (min-width: 760px) {
  .wd-form-grid {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
  .wd-field-span-2 {
    grid-column: 1 / -1;
  }
}
.wd-withdraw-page .form-row label {
  font-weight: 600;
  color: var(--text);
  font-size: 13px;
}
.wd-withdraw-page .wd-field-hint {
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.45;
}
.wd-withdraw-page input[type="text"],
.wd-withdraw-page input[type="number"],
.wd-withdraw-page select {
  width: 100%;
  max-width: none;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  box-sizing: border-box;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.wd-withdraw-page input::placeholder {
  color: var(--muted);
  opacity: 0.85;
}
.wd-withdraw-page input:focus,
.wd-withdraw-page select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
.wd-withdraw-page select {
  cursor: pointer;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) calc(50% - 2px), calc(100% - 13px) calc(50% - 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 36px;
}
.wd-alipay-banner {
  display: inline-flex;
  align-items: center;
  padding: 9px 18px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #fff;
  background: linear-gradient(135deg, #1677ff 0%, #0958d9 100%);
  box-shadow: 0 4px 14px rgba(22, 119, 255, 0.28);
}
.wd-callout {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 14px;
  margin: 12px 0 16px;
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 12px;
  line-height: 1.55;
  color: var(--muted);
}
.wd-callout strong {
  color: var(--text);
}
.wd-form-actions {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}
.wd-submit-btn {
  min-width: 140px;
  padding: 11px 22px;
  font-size: 15px;
  font-weight: 600;
}
.wd-records-card .wd-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 16px;
  margin-bottom: 12px;
}
.wd-records-card .wd-card-head h2 {
  margin: 0;
  font-size: 17px;
}
.wd-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.wd-withdraw-page .wd-table-wrap .data-table {
  margin: 0;
  min-width: 640px;
}
.wd-withdraw-page .wd-table-wrap .data-table th {
  background: var(--surface-2);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.wd-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.wd-badge-warn {
  background: color-mix(in srgb, var(--accent) 14%, var(--surface));
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 38%, var(--border));
}
.wd-badge-ok {
  background: rgba(22, 163, 74, 0.14);
  color: var(--success);
  border: 1px solid rgba(22, 163, 74, 0.35);
}
.wd-badge-danger {
  background: rgba(220, 38, 38, 0.1);
  color: var(--danger);
  border: 1px solid rgba(220, 38, 38, 0.3);
}
.wd-badge-muted {
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--border);
}

.app-footer {
  border-top: 1px solid var(--border);
  padding: 16px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

/* 模态提示（并发限制等） */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
}
.modal-backdrop.is-open {
  display: flex;
}
.modal-dialog {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
}
.modal-body-text {
  margin: 0 0 18px;
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* 站内统一 app-alert / confirm / prompt */
#modal-app-dialog .modal-body-text.is-pre {
  white-space: pre-wrap;
  word-break: break-word;
}

#modal-app-dialog .app-dialog-input {
  width: 100%;
  box-sizing: border-box;
  padding: 9px 11px;
  font-size: 15px;
  line-height: 1.45;
  border: 1px solid var(--border);
  border-radius: var(--radius, 10px);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
}

#modal-app-dialog .app-dialog-input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 0;
}

#modal-app-dialog textarea.app-dialog-input {
  min-height: 88px;
  resize: vertical;
}

#modal-app-dialog .app-dialog-prompt-label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 8px;
}

/* 处理结果视频预览 */
.modal-dialog-video {
  max-width: min(920px, 96vw);
  padding: 0;
  overflow: hidden;
}
.modal-video-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.modal-video-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}
.modal-video-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.result-preview-error {
  margin: 0 16px 12px;
  font-size: 13px;
  color: #b91c1c;
  line-height: 1.45;
}
.modal-dialog-video video {
  display: block;
  width: 100%;
  max-height: min(70vh, 720px);
  min-height: 120px;
  object-fit: contain;
  background: #0f172a;
  vertical-align: top;
}

/* 视频去水印 · 指定帧段 */
.frame-segments-section {
  margin-top: 22px;
}
/* 主界面：整组控件放在一块浅底卡片里，复选为行内、按钮用小号，避免又挤又肿 */
.frame-segments-bar {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  max-width: min(32rem, 100%);
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  box-sizing: border-box;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}
.frame-segments-bar__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-width: 0;
}
.frame-segments-bar__clear {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin: -2px -4px 0 0;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition:
    background 0.15s ease,
    color 0.15s ease;
}
.frame-segments-bar__clear:hover:not(:disabled) {
  color: #b91c1c;
  background: rgba(185, 28, 28, 0.08);
}
.frame-segments-bar__clear:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.frame-segments-bar__clear-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}
.frame-segments-check {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  user-select: none;
  font-size: 13px;
  line-height: 1.35;
  font-weight: 500;
  color: var(--text);
  box-shadow: none;
}
.frame-segments-check:has(.frame-segments-check__input:disabled) {
  cursor: not-allowed;
  opacity: 0.65;
}
/* 自绘方框 + 对勾，原生 input 仅用于可访问性（隐藏叠在方框上） */
.frame-segments-check__slot {
  position: relative;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  border-radius: 5px;
}
.frame-segments-check__input {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 18px;
  height: 18px;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.frame-segments-check__input:disabled {
  cursor: not-allowed;
}
.frame-segments-check__face {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  box-sizing: border-box;
  border-radius: 5px;
  border: 1.5px solid var(--border);
  background: var(--surface, #fff);
  box-shadow: inset 0 1px 0 rgba(15, 23, 42, 0.05);
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}
/* 对勾 */
.frame-segments-check__face::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 1px;
  width: 4px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  border-radius: 0 1px 0 0;
  transform: rotate(45deg) scale(0.5);
  opacity: 0;
  transition: opacity 0.12s ease, transform 0.12s ease;
  box-sizing: border-box;
}
.frame-segments-check:hover .frame-segments-check__face {
  border-color: rgba(37, 99, 235, 0.55);
}
.frame-segments-check__input:checked + .frame-segments-check__face {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.35);
}
.frame-segments-check__input:checked + .frame-segments-check__face::after {
  opacity: 1;
  transform: rotate(45deg) scale(1);
}
.frame-segments-check__input:focus-visible + .frame-segments-check__face {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.frame-segments-check__input:disabled + .frame-segments-check__face {
  background: var(--surface-2, #e2e8f0);
  border-color: var(--border);
  box-shadow: none;
  opacity: 0.7;
}
/* 未登录等禁用 + 已勾选：灰底、保留浅色勾 */
.frame-segments-check__input:disabled:checked + .frame-segments-check__face {
  background: rgba(100, 116, 139, 0.32);
  border-color: rgba(100, 116, 139, 0.45);
  opacity: 1;
}
.frame-segments-check__input:disabled:checked + .frame-segments-check__face::after {
  border-color: #f8fafc;
  opacity: 0.95;
  transform: rotate(45deg) scale(1);
}
:root[data-theme="gray"] .frame-segments-check:hover .frame-segments-check__face {
  border-color: rgba(91, 159, 255, 0.5);
}
.frame-segments-bar__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  width: 100%;
  min-width: 0;
}
.frame-segments-bar__actions .frame-segments-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  line-height: 1.25;
  border-radius: 999px;
}
.frame-segments-io-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  width: 100%;
  min-width: 0;
  padding-top: 4px;
  border-top: 1px solid var(--border);
  margin-top: 2px;
}
.frame-segments-io-label {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  min-width: 0;
  flex: 1 1 12rem;
}
.frame-seg-export-name-input {
  max-width: 20rem;
  width: 100%;
  min-width: 0;
  padding: 5px 9px;
  font-size: 13px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  box-sizing: border-box;
}
.frame-seg-export-name-input:focus {
  outline: 2px solid rgba(37, 99, 235, 0.35);
  border-color: var(--accent);
}
.frame-seg-export-name-input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.frame-segments-title {
  margin: 0 0 8px;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
}
.frame-segments-lead {
  margin: 0 0 14px;
  max-width: 42rem;
  line-height: 1.55;
}
.frame-segments-lead--compact {
  margin-bottom: 12px;
}
.frame-segments-pill {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.1);
  border: 1px solid rgba(37, 99, 235, 0.25);
}
:root[data-theme="gray"] .frame-segments-pill {
  color: #5b9fff;
  background: rgba(91, 159, 255, 0.1);
  border-color: rgba(91, 159, 255, 0.3);
}
body.frame-segments-drawer-lock {
  overflow: hidden;
}

/* 填入始/末：悬停气泡（高于侧滑层） */
#frame-fill-bubble.frame-fill-bubble {
  position: fixed;
  z-index: 10050;
  left: 0;
  top: 0;
  max-width: min(320px, 92vw);
  margin: 0;
  padding: 8px 12px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--text, #0f172a);
  text-align: center;
  background: var(--surface-2, #f1f5f9);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.15);
  pointer-events: none;
  transform: translate(-50%, calc(-100% - 6px));
  box-sizing: border-box;
  word-break: break-word;
}
#frame-fill-bubble.frame-fill-bubble[hidden] {
  display: none !important;
}
:root[data-theme="dark"] #frame-fill-bubble.frame-fill-bubble {
  background: #1e293b;
  color: #f1f5f9;
  border-color: #334155;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45);
}

/* 指定帧段 · 左侧侧滑层 */
.frame-segments-drawer-layer {
  position: fixed;
  inset: 0;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s;
}
.frame-segments-drawer-layer.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.frame-segments-drawer-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: rgba(15, 23, 42, 0.5);
  cursor: pointer;
}
.frame-segments-drawer {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 1;
  width: min(100vw - 20px, 420px);
  max-width: 100%;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--border);
  box-shadow: 8px 0 32px rgba(15, 23, 42, 0.2);
  transform: translateX(-100%);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
}
.frame-segments-drawer-layer.is-open .frame-segments-drawer {
  transform: translateX(0);
}
.frame-segments-drawer__header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.frame-segments-drawer__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
}
.frame-segments-drawer__close {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin: 0;
  padding: 0;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--muted);
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.frame-segments-drawer__close:hover {
  color: var(--text);
  background: var(--surface);
}
.frame-segments-drawer__scroller {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 16px 20px;
  -webkit-overflow-scrolling: touch;
}
.frame-segments-drawer__scroller .frame-segments-lead {
  margin-top: 0;
  font-size: 13px;
}
.frame-segments-drawer__scroller .frame-segments-panel {
  margin-top: 12px;
}
.frame-segments-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  margin: 0;
  padding: 10px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  user-select: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.frame-segments-toggle:hover {
  border-color: var(--accent);
}
.frame-segments-toggle input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}
.frame-segments-toggle-label {
  font-weight: 500;
  color: var(--text);
  font-size: 14px;
}
.frame-segments-panel {
  margin-top: 16px;
  padding: 18px 18px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
}
.frame-segments-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.frame-segment-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px 12px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.frame-segment-card:hover {
  border-color: rgba(37, 99, 235, 0.35);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.07);
}
:root[data-theme="gray"] .frame-segment-card:hover {
  border-color: rgba(91, 159, 255, 0.45);
}
.frame-segment-card.is-current {
  border-color: rgba(37, 99, 235, 0.55);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
}
:root[data-theme="gray"] .frame-segment-card.is-current {
  border-color: rgba(91, 159, 255, 0.65);
  box-shadow: 0 0 0 2px rgba(91, 159, 255, 0.15);
}
.frame-segment-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.frame-segment-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 999px;
}
/* 侧栏等窄容器下仍保持「起始 / 结束」两列并排（勿用 minmax(200px) 否则会强制折成单列） */
.frame-segment-card__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 10px;
  align-items: start;
}
.frame-segment-field {
  min-width: 0;
}
.frame-segment-label {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 4px;
  line-height: 1.2;
}
.frame-segment-input-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  min-width: 0;
}
.frame-segment-input {
  box-sizing: border-box;
  flex: 1 1 auto;
  min-width: 2.5rem;
  max-width: none;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
@media (max-width: 360px) {
  .frame-segment-card__grid {
    grid-template-columns: 1fr;
  }
}
.frame-segment-input:hover {
  border-color: #94a3b8;
}
:root[data-theme="gray"] .frame-segment-input:hover {
  border-color: #6b7280;
}
.frame-segment-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}
:root[data-theme="gray"] .frame-segment-input:focus {
  box-shadow: 0 0 0 3px rgba(91, 159, 255, 0.22);
}
.btn-frame-apply {
  flex-shrink: 0;
  padding: 5px 8px;
  font-size: 11px;
  font-weight: 500;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn-frame-apply:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--surface);
}
.btn-frame-remove {
  flex-shrink: 0;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 500;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.btn-frame-remove:hover {
  border-color: var(--danger);
  color: var(--danger);
  background: rgba(220, 38, 38, 0.06);
}
:root[data-theme="gray"] .btn-frame-remove:hover {
  background: rgba(248, 113, 113, 0.1);
}
.btn-add-frame-segment {
  margin-top: 8px;
  width: 100%;
  max-width: 100%;
  justify-content: center;
  border-style: dashed;
  border-width: 1.5px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 500;
}
.btn-add-frame-segment:hover {
  border-style: dashed;
  border-color: var(--accent);
  color: var(--accent);
}

/* 管理员后台（继承 base + app.css 变量；以下为布局与 Tab） */
.admin-page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.admin-page-head .page-title {
  margin-bottom: 0;
}
.admin-page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.admin-dashboard-inner {
  max-width: 1200px;
  margin: 0 auto;
}
.admin-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.admin-tabs button {
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  padding: 8px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 14px;
  font-family: inherit;
}
.admin-tabs button:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.admin-tabs button.is-active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.admin-panel {
  display: none;
}
.admin-panel.is-active {
  display: block;
}
.admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}
.admin-toolbar input,
.admin-toolbar select {
  padding: 6px 10px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  font-size: 13px;
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
}
.admin-msg {
  margin: 8px 0 16px;
  padding: 10px 12px;
  border-radius: var(--radius);
  font-size: 14px;
  display: none;
}
.admin-msg.is-error {
  display: block;
  background: rgba(220, 38, 38, 0.1);
  color: var(--danger);
  border: 1px solid rgba(220, 38, 38, 0.35);
}
.admin-msg.is-ok {
  display: block;
  background: rgba(22, 163, 74, 0.12);
  color: var(--success);
  border: 1px solid rgba(22, 163, 74, 0.35);
}
.admin-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 16px;
}
.admin-modal-backdrop.is-open {
  display: flex;
}
.admin-modal {
  background: var(--surface);
  border-radius: 12px;
  padding: 20px;
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow: auto;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.admin-modal h3 {
  margin: 0 0 12px;
  font-size: 17px;
  color: var(--text);
}
.admin-modal .form-row {
  margin-bottom: 12px;
}
.admin-modal .form-row label {
  display: block;
  font-size: 13px;
  margin-bottom: 4px;
  color: var(--muted);
  line-height: 1.35;
}
/* 弹窗内表单：与全站 text 输入一致，并覆盖全局 max-width:360px；含 number、select，避免「文本框窄、数字框撑满」等样式割裂 */
.admin-modal .form-row input:not([type="checkbox"]):not([type="hidden"]),
.admin-modal .form-row select,
.admin-modal .form-row textarea {
  display: block;
  max-width: none;
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
}
.admin-modal .form-row select {
  cursor: pointer;
  appearance: auto;
}
/* 编辑工具：计费说明标签较长，略加宽弹窗 */
#modal-tool .admin-modal {
  max-width: 520px;
}
.admin-modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 16px;
  flex-wrap: wrap;
}
.admin-panel.card {
  padding: 16px;
}
.admin-dashboard-inner .pagination {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.admin-dashboard-inner code {
  font-size: 12px;
}

/* 管理员任务列表：产出预览 */
#table-tasks .admin-task-preview {
  min-width: 140px;
  max-width: 280px;
}
#table-tasks .admin-task-preview img {
  max-height: 72px;
  max-width: 160px;
  width: auto;
  height: auto;
  object-fit: contain;
  vertical-align: middle;
  border-radius: 6px;
  border: 1px solid var(--border);
}
/* 仅包裹缩略图时用透明热区；带文案的预览按钮勿加此类名，否则 #id 选择器会盖过 .btn-primary */
#table-tasks .admin-preview-trigger:has(> img) {
  border: none;
  padding: 0;
  margin: 0;
  background: transparent;
  cursor: zoom-in;
  display: inline-block;
  line-height: 0;
  border-radius: 6px;
}
#table-tasks .admin-task-preview video {
  max-height: 100px;
  max-width: 200px;
  vertical-align: middle;
  border-radius: 6px;
  background: #000;
}
#table-tasks .admin-task-preview audio {
  width: 200px;
  max-width: 100%;
  vertical-align: middle;
}
.admin-modal-wide {
  max-width: min(920px, 96vw);
}
.admin-modal-wide #admin-media-close {
  float: right;
}
.admin-modal-wide #admin-media-body {
  margin-top: 8px;
  clear: both;
}

/* 全站：全屏遮罩/灯箱/抽屉打开时由 mobile-modal-scroll-lock.js 追加，锁 body 防移动端触控偏移 */
html.qsy-body-scroll-locked {
  overflow: hidden;
  height: 100%;
}
body.qsy-body-scroll-locked {
  overflow: hidden;
  width: 100%;
  overscroll-behavior: none;
}
@media (max-width: 768px) {
  /* 仅壳层内消息/设置等弹窗需抢触点；灯箱等一般在 main 外，不受影响 */
  body.qsy-body-scroll-locked .txt2sfx-shell,
  body.qsy-body-scroll-locked .txt2img-shell,
  body.qsy-body-scroll-locked .nts-shell {
    pointer-events: none;
  }
  body.qsy-body-scroll-locked .txt2sfx-shell .modal-backdrop.is-open,
  body.qsy-body-scroll-locked .txt2img-shell .modal-backdrop.is-open,
  body.qsy-body-scroll-locked .nts-shell .modal-backdrop.is-open {
    pointer-events: auto;
  }
  /* 文生剧本：作品侧栏 / 设定表 / 章节选择等不使用 .modal-backdrop，须单独恢复触控命中 */
  body.qsy-body-scroll-locked .nts-shell.is-drawer-open .nts-drawer-backdrop,
  body.qsy-body-scroll-locked .nts-shell.is-drawer-open .nts-aside,
  body.qsy-body-scroll-locked .nts-shell .nts-bible-drawer-backdrop.is-open,
  body.qsy-body-scroll-locked .nts-shell .nts-bible-drawer.is-open,
  body.qsy-body-scroll-locked .nts-shell .nts-chapter-gen-panel.is-open {
    pointer-events: auto;
  }
}
