* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  background: #f0f4f8;
  color: #333;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }

.page-header {
  background: linear-gradient(135deg, #1e6fd9, #37b5e8);
  color: #fff;
  padding: 24px 16px;
  text-align: center;
}
.page-header h1 { font-size: 24px; font-weight: 600; }
.page-header p { margin-top: 6px; font-size: 13px; opacity: .85; }
.container { max-width: 1080px; margin: 0 auto; padding: 24px 16px 60px; }

.status { text-align: center; padding: 60px 0; color: #888; font-size: 15px; }
.status.error { color: #d9534f; }

/* ---------- 通用标签、按钮 ---------- */
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  background: #e8f2fd; color: #1e6fd9;
  font-size: 13px; padding: 3px 12px; border-radius: 20px;
}
.tag-gray { background: #eef0f2; color: #777; }

.btn {
  display: inline-flex; align-items: center; gap: 4px;
  border: none; cursor: pointer; font-size: 13px;
  padding: 6px 14px; border-radius: 6px; text-decoration: none;
  transition: opacity .2s;
}
.btn:hover { opacity: .85; }
.btn:disabled { opacity: .5; cursor: default; }
.btn-primary { background: #1e6fd9; color: #fff; }
.btn-outline { background: #fff; color: #1e6fd9; border: 1px solid #1e6fd9; }

/* ---------- 列表页：卡片网格 ---------- */
.toolbar {
  max-width: 1080px; margin: 0 auto; padding: 16px 16px 0;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 14px; color: #666;
}
.toolbar-filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.filter-sel, .filter-input {
  height: 32px; padding: 0 8px; border: 1px solid #d9d9d9; border-radius: 6px;
  font-size: 13px; color: #333; background: #fff; outline: none;
}
.filter-input { width: 200px; }
.filter-sel:focus, .filter-input:focus { border-color: #1677ff; }
.grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr); /* 一行固定 5 个 */
  gap: 16px;
  margin-top: 16px;
}
@media (max-width: 900px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 600px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
}
.res-card {
  background: #fff; border-radius: 12px; overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,.07);
  display: flex; flex-direction: column;
  transition: transform .15s, box-shadow .15s;
}
.res-card:hover { transform: translateY(-4px); box-shadow: 0 8px 20px rgba(0,0,0,.12); }
.res-cover { position: relative; height: 120px; background: #e9eef3; }
.res-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.res-cover-empty {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: #aab; font-size: 14px;
}
.res-video-badge {
  position: absolute; left: 8px; bottom: 8px;
  background: rgba(0,0,0,.6); color: #fff;
  font-size: 12px; padding: 2px 8px; border-radius: 4px;
}
.res-body { padding: 14px; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.res-title {
  font-size: 15px; font-weight: 600; color: #1a1a1a; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.res-info { font-size: 12px; color: #888; margin-top: auto; }

/* ---------- 分页条 ---------- */
.pager {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 6px; margin-top: 30px;
}
.page-btn {
  min-width: 34px; height: 34px; padding: 0 10px;
  border: 1px solid #d5dce4; background: #fff; color: #333;
  border-radius: 6px; cursor: pointer; font-size: 13px;
}
.page-btn:hover:not(:disabled) { border-color: #1e6fd9; color: #1e6fd9; }
.page-btn.active { background: #1e6fd9; color: #fff; border-color: #1e6fd9; }
.page-btn:disabled { opacity: .5; cursor: default; }
.page-gap { color: #999; padding: 0 4px; }
.page-jump { font-size: 13px; color: #666; margin-left: 12px; }
.page-jump input {
  width: 56px; height: 30px; padding: 0 6px; text-align: center;
  border: 1px solid #d5dce4; border-radius: 6px; font-size: 13px;
}

/* ---------- 详情页 ---------- */
.detail-nav { max-width: 1080px; margin: 0 auto; padding: 16px 16px 0; }
.back-link { color: #1e6fd9; font-size: 14px; }
.back-link:hover { text-decoration: underline; }

.card {
  background: #fff; border-radius: 12px; overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,.08); margin-top: 16px;
}
.card-head { display: flex; flex-wrap: wrap; gap: 20px; padding: 24px; border-bottom: 1px solid #f0f0f0; }
.cover-box { flex: 0 0 260px; }
.cover-box img {
  width: 260px; height: 170px; object-fit: cover;
  border-radius: 8px; cursor: zoom-in; display: block; background: #eee;
}
.cover-actions { margin-top: 10px; display: flex; gap: 8px; }
.meta { flex: 1; min-width: 260px; }
.meta h2 { font-size: 22px; margin-bottom: 12px; color: #1a1a1a; }
.meta .tags { margin-bottom: 14px; }
.meta-row { font-size: 14px; color: #555; line-height: 1.9; }
.meta-row b { color: #333; margin-right: 4px; }

.section { padding: 20px 24px; border-bottom: 1px solid #f0f0f0; }
.section:last-child { border-bottom: none; }
.section-title {
  font-size: 16px; font-weight: 600; margin-bottom: 14px;
  padding-left: 10px; border-left: 4px solid #1e6fd9;
}
.desc { font-size: 14px; line-height: 1.9; color: #555; white-space: pre-wrap; }

.video-wrap { position: relative; background: #000; border-radius: 8px; overflow: hidden; }
.video-wrap video { width: 100%; max-height: 480px; display: block; }
.video-unsupported {
  background: #f7f9fc; border: 1px dashed #cdd8e6; border-radius: 8px;
  padding: 36px 24px; text-align: center;
}
.video-unsupported .vu-icon {
  width: 52px; height: 52px; margin: 0 auto 14px;
  display: flex; align-items: center; justify-content: center;
  background: #9b59b6; color: #fff; border-radius: 50%; font-size: 22px;
}
.video-unsupported .vu-title { font-size: 15px; font-weight: 600; color: #333; margin-bottom: 8px; }
.video-unsupported .vu-tip { font-size: 13px; color: #888; line-height: 1.7; }
.video-actions { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }

.file-list { list-style: none; }
.file-item { display: flex; align-items: center; gap: 12px; padding: 12px 8px; border-bottom: 1px dashed #eee; }
.file-item:last-child { border-bottom: none; }
.file-icon {
  width: 40px; height: 40px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.file-icon.word  { background: #2b7cd3; }
.file-icon.pdf   { background: #d9534f; }
.file-icon.zip   { background: #f0ad4e; }
.file-icon.image { background: #5cb85c; }
.file-icon.video { background: #9b59b6; }
.file-icon.other { background: #95a5a6; }
.file-name { flex: 1; font-size: 14px; word-break: break-all; }
.file-ext { font-size: 12px; color: #999; margin-top: 2px; }
.file-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ---------- 图片预览弹层 ---------- */
.lightbox {
  position: fixed; inset: 0; background: rgba(0,0,0,.85);
  display: none; align-items: center; justify-content: center;
  z-index: 999; cursor: zoom-out;
}
.lightbox.show { display: flex; }
.lightbox img { max-width: 92vw; max-height: 92vh; border-radius: 6px; }
.lightbox-close {
  position: absolute; top: 16px; right: 24px;
  color: #fff; font-size: 34px; cursor: pointer; line-height: 1; user-select: none;
}

/* ---------- OSS 批量转存页 ---------- */
.tr-summary {
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
  background: #fff; border: 1px solid #e5e8ef; border-radius: 10px;
  padding: 18px 24px; margin-bottom: 16px;
}
.tr-stat { display: flex; flex-direction: column; min-width: 90px; }
.tr-stat b { font-size: 22px; color: #1e6fd9; }
.tr-stat span { font-size: 12px; color: #888; margin-top: 2px; }
.tr-stat-actions { margin-left: auto; }

.tr-running {
  background: #f0f7ff; border: 1px solid #bcd8f7; border-radius: 10px;
  padding: 14px 20px; margin-bottom: 16px;
}
.tr-running-head { display: flex; align-items: center; justify-content: space-between; }
.tr-running-title { font-weight: 600; color: #1e6fd9; }
.tr-running-detail { font-size: 13px; color: #555; margin: 8px 0; word-break: break-all; }
.tr-bar { height: 8px; background: #dde7f5; border-radius: 4px; overflow: hidden; }
.tr-bar-inner { height: 100%; background: #1e6fd9; border-radius: 4px; transition: width .4s; }

.tr-lastmsg {
  font-size: 13px; color: #4a8a4a; background: #f2faf2; border: 1px solid #cfe8cf;
  border-radius: 8px; padding: 10px 16px; margin-bottom: 16px;
}
.tr-lastmsg.error { color: #b04040; background: #fdf3f3; border-color: #eecccc; }

.tr-batches { display: flex; flex-direction: column; gap: 14px; }
.tr-batch {
  background: #fff; border: 1px solid #e5e8ef; border-radius: 10px; padding: 16px 20px;
}
.tr-batch-head { display: flex; align-items: baseline; gap: 12px; }
.tr-batch-head b { font-size: 16px; }
.tr-batch-head span { font-size: 13px; color: #888; }
.tr-badges { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 12px; }
.tr-badge {
  font-size: 12px; padding: 3px 10px; border-radius: 20px;
  background: #f2f3f7; color: #777; border: 1px solid #e2e4ea;
}
.tr-badge.ok { background: #f2faf2; color: #3d8b3d; border-color: #cfe8cf; }
.tr-badge.warn { background: #fff8ec; color: #b07a2a; border-color: #f0ddb8; }
.tr-batch-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.tr-guide {
  background: #fff; border: 1px solid #e5e8ef; border-radius: 10px;
  padding: 18px 24px; margin-top: 24px; font-size: 14px; color: #444;
}
.tr-guide ol { margin: 10px 0 0 20px; display: flex; flex-direction: column; gap: 6px; }
.tr-guide code {
  background: #f2f3f7; padding: 1px 6px; border-radius: 4px; font-size: 12px;
}
.tr-guide a { color: #1e6fd9; }

/* ---------- 数据库区块：状态行与差异清单表格 ---------- */
.tr-db-stats { margin: 10px 0; font-size: 13px; color: #555; }
.diff-table-wrap { margin-top: 12px; max-height: 420px; overflow: auto; border: 1px solid #e8e8e8; border-radius: 6px; }
.diff-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.diff-table th, .diff-table td {
  padding: 6px 8px; border-bottom: 1px solid #f0f0f0; text-align: left;
  white-space: nowrap; max-width: 260px; overflow: hidden; text-overflow: ellipsis;
}
.diff-table th { position: sticky; top: 0; background: #fafafa; color: #666; }
.diff-table .dt-title { max-width: 180px; }
.diff-table .dt-val { max-width: 300px; color: #555; }
.diff-table .dt-more { text-align: center; color: #999; }
