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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-size: 13px;
  background: #f0f2f5;
  color: #333;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── 顶部工具栏 ── */
.topbar {
  height: 48px;
  background: #fff;
  border-bottom: 1px solid #e8e8e8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
  z-index: 100;
}
.topbar-left { display: flex; align-items: center; gap: 10px; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.logo { font-size: 15px; font-weight: 700; color: #667eea; }

.health-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #ccc; display: inline-block;
  transition: background .3s;
}
.health-dot.ok  { background: #52c41a; }
.health-dot.err { background: #ff4d4f; }

/* ── 主体 ── */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 12px 16px;
  gap: 10px;
}

/* ── 筛选栏 ── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.filter-bar input, .filter-bar select {
  height: 32px;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  padding: 0 10px;
  font-size: 13px;
  outline: none;
  transition: border-color .2s;
}
.filter-bar input { width: 240px; }
.filter-bar input:focus, .filter-bar select:focus { border-color: #667eea; }
.record-count { color: #888; font-size: 12px; margin-left: 4px; }

/* ── 表格 ── */
.table-wrap {
  flex: 1;
  overflow: auto;
  background: #fff;
  border-radius: 8px;
  border: 1px solid #e8e8e8;
}
table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}
thead th {
  position: sticky; top: 0;
  background: #fafafa;
  border-bottom: 1px solid #e8e8e8;
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  color: #555;
  white-space: nowrap;
  z-index: 10;
}
tbody tr { border-bottom: 1px solid #f0f0f0; transition: background .15s; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: #fafbff; }
td {
  padding: 8px 12px;
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
td.wrap { white-space: normal; word-break: break-all; line-height: 1.5; }
.empty { text-align: center; color: #aaa; padding: 60px 0; }

/* 复选框 */
.row-check, #checkAll {
  width: 18px; height: 18px; cursor: pointer; accent-color: #667eea;
}

/* 图片缩略图 */
.thumb {
  width: 56px; height: 56px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #eee;
  cursor: pointer;
  display: block;
}
.thumb-placeholder {
  width: 56px; height: 56px;
  background: #f5f5f5;
  border-radius: 6px;
  border: 1px solid #eee;
  display: flex; align-items: center; justify-content: center;
  color: #ccc; font-size: 20px;
}

/* OSS 图标 */
.oss-icon { color: #fa8c16; font-size: 11px; margin-left: 3px; }

/* 状态徽章 */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-pending   { background: #fff7e6; color: #d46b08; }
.badge-published { background: #f6ffed; color: #389e0d; }
.badge-failed    { background: #fff1f0; color: #cf1322; }

/* ── 操作按钮组 ── */
.action-group { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; }

/* ── 通用按钮 ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  border: none; border-radius: 6px;
  cursor: pointer; font-size: 12px; font-weight: 500;
  transition: all .2s; white-space: nowrap; gap: 3px;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-sm  { height: 28px; padding: 0 10px; }
.btn-xs  { height: 24px; padding: 0 8px; font-size: 11px; }
.btn-primary { background: #667eea; color: #fff; }
.btn-primary:hover:not(:disabled) { background: #5a6fd6; }
.btn-ghost { background: transparent; color: #555; border: 1px solid #d9d9d9; }
.btn-ghost:hover:not(:disabled) { border-color: #667eea; color: #667eea; }
.btn-wecom { background: #07c160; color: #fff; }
.btn-wecom:hover:not(:disabled) { background: #06ad56; }
.btn-oss   { background: #fa8c16; color: #fff; }
.btn-oss:hover:not(:disabled)   { background: #e07b10; }
.btn-danger { background: #ff4d4f; color: #fff; }
.btn-danger:hover:not(:disabled) { background: #e04345; }
.btn-success { background: #52c41a; color: #fff; }
.btn-success:hover:not(:disabled) { background: #49b016; }

/* ── 抽屉 ── */
.drawer-mask {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.3); z-index: 200;
}
.drawer-mask.open { display: block; }
.drawer {
  position: fixed; top: 0; right: -480px; width: 480px; height: 100vh;
  background: #fff; z-index: 201;
  display: flex; flex-direction: column;
  box-shadow: -4px 0 20px rgba(0,0,0,.12);
  transition: right .3s ease;
}
.drawer.open { right: 0; }
.drawer-header {
  height: 52px; padding: 0 20px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid #f0f0f0; flex-shrink: 0;
  font-size: 15px; font-weight: 600;
}
.drawer-close {
  background: none; border: none; font-size: 22px;
  cursor: pointer; color: #999; line-height: 1;
}
.drawer-close:hover { color: #333; }
.drawer-body { flex: 1; overflow-y: auto; padding: 20px; }

/* ── 弹窗 ── */
.modal-mask {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.4); z-index: 300;
}
.modal-mask.open { display: block; }
.modal {
  display: none; position: fixed;
  top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 680px; max-width: 95vw; max-height: 88vh;
  background: #fff; border-radius: 12px;
  z-index: 301; flex-direction: column;
  box-shadow: 0 8px 40px rgba(0,0,0,.2);
  overflow: hidden;
}
.modal.open { display: flex; }
.modal-header {
  height: 52px; padding: 0 20px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid #f0f0f0; flex-shrink: 0;
  font-size: 15px; font-weight: 600;
}
.modal-close {
  background: none; border: none; font-size: 22px;
  cursor: pointer; color: #999; line-height: 1;
}
.modal-close:hover { color: #333; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px; }

/* ── 表单 ── */
.form-section { margin-bottom: 20px; }
.form-section h3 { font-size: 13px; font-weight: 600; color: #667eea; margin-bottom: 12px; padding-bottom: 6px; border-bottom: 1px solid #f0f0f0; }
.form-row { margin-bottom: 12px; }
.form-row label { display: block; font-size: 12px; color: #666; margin-bottom: 4px; font-weight: 500; }
.form-row input[type=text],
.form-row input[type=password],
.form-row input[type=number],
.form-row select,
.form-row textarea {
  width: 100%; padding: 8px 10px;
  border: 1px solid #d9d9d9; border-radius: 6px;
  font-size: 13px; outline: none;
  transition: border-color .2s;
  font-family: inherit;
}
.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus { border-color: #667eea; }
.form-row textarea { resize: vertical; min-height: 80px; }
.form-hint { font-size: 11px; color: #aaa; margin-top: 3px; }
.form-actions { display: flex; gap: 8px; margin-top: 16px; }

/* ── 上传区域 ── */
.upload-zone {
  border: 2px dashed #d9d9d9; border-radius: 8px;
  padding: 30px; text-align: center; cursor: pointer;
  transition: all .2s; color: #aaa;
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: #667eea; background: #f5f7ff; color: #667eea;
}
.upload-zone .zone-icon { font-size: 32px; display: block; margin-bottom: 8px; }

/* ── 信息块 ── */
.info-block {
  background: #f6f8ff; border-left: 3px solid #667eea;
  border-radius: 0 6px 6px 0; padding: 10px 14px;
  font-size: 12px; color: #555; line-height: 1.7;
  margin-bottom: 14px;
}
.info-block.warn { background: #fffbe6; border-color: #faad14; }
.info-block.success { background: #f6ffed; border-color: #52c41a; }
.info-block.error { background: #fff1f0; border-color: #ff4d4f; }

/* ── 进度条 ── */
.progress-bar { height: 6px; background: #f0f0f0; border-radius: 3px; overflow: hidden; margin: 8px 0; }
.progress-fill { height: 100%; background: linear-gradient(90deg, #667eea, #764ba2); transition: width .3s; }

/* ── 详情区块 ── */
.detail-block { margin-bottom: 16px; }
.detail-block .label { font-size: 11px; color: #999; margin-bottom: 4px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
.detail-block .value { font-size: 13px; color: #333; line-height: 1.7; white-space: pre-wrap; word-break: break-all; }
.detail-block .value.mono { font-family: monospace; background: #f5f5f5; padding: 8px; border-radius: 4px; font-size: 12px; }

/* ── 图片预览网格 ── */
.img-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.img-grid img { width: 80px; height: 80px; object-fit: cover; border-radius: 6px; border: 1px solid #eee; cursor: pointer; }

/* ── 消息提示 ── */
.toast {
  position: fixed; top: 60px; right: 20px;
  padding: 10px 18px; border-radius: 8px;
  color: #fff; font-size: 13px; font-weight: 500;
  box-shadow: 0 4px 16px rgba(0,0,0,.2);
  z-index: 9999; animation: toastIn .25s ease;
  max-width: 320px;
}
@keyframes toastIn  { from { opacity:0; transform: translateX(40px); } to { opacity:1; transform: translateX(0); } }
@keyframes toastOut { from { opacity:1; transform: translateX(0); }    to { opacity:0; transform: translateX(40px); } }

/* ── 分割线 ── */
hr.divider { border: none; border-top: 1px solid #f0f0f0; margin: 16px 0; }

/* ── 图片灯箱 ── */
.lightbox-mask {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.88);
  z-index: 500;
  align-items: center; justify-content: center;
}
.lightbox-mask.open { display: flex; }

.lightbox-img-wrap {
  max-width: 88vw; max-height: 88vh;
  display: flex; align-items: center; justify-content: center;
}
.lightbox-img-wrap img {
  max-width: 88vw; max-height: 88vh;
  object-fit: contain; border-radius: 6px;
  box-shadow: 0 8px 40px rgba(0,0,0,.6);
  display: block;
}

.lightbox-close {
  position: fixed; top: 16px; right: 20px;
  background: rgba(255,255,255,.15); border: none;
  color: #fff; font-size: 28px; line-height: 1;
  width: 44px; height: 44px; border-radius: 50%;
  cursor: pointer; z-index: 501;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s;
}
.lightbox-close:hover { background: rgba(255,255,255,.3); }

.lightbox-nav {
  position: fixed; top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,.15); border: none;
  color: #fff; font-size: 36px; line-height: 1;
  width: 52px; height: 52px; border-radius: 50%;
  cursor: pointer; z-index: 501;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s;
}
.lightbox-nav:hover:not(:disabled) { background: rgba(255,255,255,.3); }
.lightbox-nav:disabled { opacity: .25; cursor: default; }
.lightbox-prev { left: 16px; }
.lightbox-next { right: 16px; }

.lightbox-counter {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  color: rgba(255,255,255,.7); font-size: 13px;
  background: rgba(0,0,0,.4); padding: 4px 14px; border-radius: 20px;
}

/* ── 滚动条 ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d9d9d9; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #bbb; }
