/* 后台页面样式（必须外置：生产 CSP style-src 仅允许 'self'，内联 <style> 会被拦截） */

.admin-cover {
  display: block;
  width: 72px;
  max-width: 72px;
  height: 40px;
  max-height: 40px;
  object-fit: cover;
  background: #ddd;
  border-radius: 5px;
  flex: 0 0 auto;
}

#videos table {
  table-layout: auto;
}

#videos td:first-child {
  width: 88px;
  max-width: 88px;
  vertical-align: middle;
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.group-input {
  min-width: 120px;
}

.sort-input {
  width: 76px;
  min-width: 76px;
  padding: 8px;
}

.video-actions {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.video-actions button {
  padding: 7px 10px;
}

.wide-form {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.wide-form .full {
  grid-column: 1 / -1;
}

.batch-form {
  display: flex;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
}

.batch-form label {
  min-width: 150px;
}

.batch-form button {
  height: 42px;
}

.batch-actions {
  margin: 18px 0;
  display: flex;
  gap: 10px;
}

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

.batch-qr {
  padding: 12px;
  text-align: center;
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
}

.batch-qr img {
  width: 100%;
  max-width: 180px;
}

.batch-qr strong,
.batch-qr small {
  display: block;
}

.batch-qr small {
  margin: 5px 0;
  color: #888;
}

.upload-progress {
  height: 10px;
  background: #eee;
  border-radius: 6px;
  overflow: hidden;
  margin: 10px 0;
}

.upload-bar {
  height: 100%;
  width: 0;
  background: #2563eb;
  transition: width .15s;
}

dialog {
  width: min(720px, calc(100vw - 32px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: 0 24px 80px #0005;
}

dialog::backdrop {
  background: #0008;
}

dialog form {
  padding: 24px;
}

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

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

.inline-sort {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.inline-sort input {
  width: 72px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid #d8d6cf;
  border-radius: 3px;
}

.inline-sort button {
  min-height: 32px;
}

@media (max-width: 800px) {
  .wide-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .admin-cover {
    width: 44px;
    max-width: 44px;
    height: 25px;
    max-height: 25px;
  }

  .group-input {
    min-width: 80px;
  }

  .sort-input {
    width: 54px;
    min-width: 54px;
    padding: 6px;
  }

  .video-actions {
    gap: 5px;
  }

  .video-actions button {
    padding: 6px 8px;
    font-size: 13px;
  }

  #videos td,
  #videos th {
    padding: 6px;
  }
}

@media print {
  body * {
    visibility: hidden;
  }

  #batchResult,
  #batchResult * {
    visibility: visible;
  }

  #batchResult {
    position: absolute;
    inset: 0;
  }

  .batch-actions {
    display: none;
  }

  .batch-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
