* { box-sizing: border-box; }
body {
  margin: 0;
  font: 14px/1.6 -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
  color: #1f2933;
  background: #f5f6f8;
}
a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }
code { background: #eef1f5; padding: 1px 5px; border-radius: 4px; font-size: 12px; }
h2 { font-size: 18px; margin: 0; }
.top {
  display: flex; align-items: center; gap: 24px;
  background: #fff; border-bottom: 1px solid #e4e7ec;
  padding: 0 24px; height: 54px; position: sticky; top: 0; z-index: 10;
}
.brand { font-weight: 700; font-size: 15px; }
.brand a { color: #111; }
.top nav { display: flex; gap: 18px; }
.top nav a { color: #4a5568; }
.top nav a:hover { color: #2563eb; }
.top .me { margin-left: auto; display: flex; align-items: center; gap: 10px; color: #6b7280; }
main { padding: 20px 24px 60px; max-width: 1400px; margin: 0 auto; }
main.narrow { max-width: 420px; padding-top: 80px; }
.page-head { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 14px; }
.card { background: #fff; border: 1px solid #e4e7ec; border-radius: 8px; padding: 16px; margin-bottom: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.muted { color: #8a94a6; font-size: 12.5px; }
.tag { display: inline-block; background: #f1f3f7; color: #556; border-radius: 10px; padding: 0 8px; font-size: 12px; margin-left: 6px; }
.tag.blue { background: #e8f0ff; color: #2563eb; }
.btn {
  display: inline-block; border: 1px solid #d3d9e2; background: #fff; color: #333;
  border-radius: 6px; padding: 5px 12px; font-size: 13px; cursor: pointer; line-height: 1.4;
}
.btn:hover { background: #f7f9fc; text-decoration: none; }
.btn.primary { background: #2563eb; border-color: #2563eb; color: #fff; }
.btn.primary:hover { background: #1d4ed8; }
.btn.danger { color: #c0392b; border-color: #f0c9c4; }
.btn.danger:hover { background: #fff5f4; }
.btn.small { padding: 3px 8px; font-size: 12px; }
.link { border: 0; background: none; color: #6b7280; cursor: pointer; font-size: 13px; }
.actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.actions form { margin: 0; }
.flash { padding: 9px 14px; border-radius: 6px; margin-bottom: 14px; font-size: 13px; }
.flash.ok { background: #e9f8ef; color: #177245; border: 1px solid #c6ebd6; }
.flash.bad { background: #fdecea; color: #b03a2e; border: 1px solid #f5c6c0; }
table.grid { width: 100%; border-collapse: collapse; }
table.grid th, table.grid td { text-align: left; padding: 8px 10px; border-bottom: 1px solid #eef0f4; vertical-align: middle; }
table.grid th { font-size: 12px; color: #6b7280; font-weight: 600; background: #fafbfc; }
table.grid tr:hover td { background: #fbfcfe; }
tr.child td { background: #fcfcfd; }
.thumb { width: 76px; height: 56px; object-fit: cover; border-radius: 5px; border: 1px solid #e4e7ec; background: #f1f3f7; }
.thumb.ph { display: flex; align-items: center; justify-content: center; color: #9aa3b2; font-size: 11px; }
.thumb-cell { width: 96px; }
.filters { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 14px; }
.filters label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: #6b7280; }
input, select, textarea {
  font: inherit; color: inherit; border: 1px solid #d3d9e2; border-radius: 6px; padding: 5px 8px; background: #fff;
}
input[type="file"] { border: 0; padding: 0; }
textarea { width: 100%; }
.inline-form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.inline-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: #6b7280; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(240px, 1fr)); gap: 14px 18px; }
.form-grid label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: #5b6472; }
.form-grid .wide { grid-column: 1 / -1; }
.form-grid label.check, label.check { flex-direction: row; align-items: center; gap: 6px; font-size: 13px; color: #333; }
.form-actions { display: flex; gap: 10px; align-items: center; }
.add-term { margin-top: 12px; }
.add-term summary { cursor: pointer; color: #2563eb; font-size: 13px; }
.terms-box { border: 1px solid #eef0f4; border-radius: 6px; padding: 12px; }
.upload-box { border: 1px solid #eef0f4; border-radius: 6px; padding: 12px; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px 14px; align-items: end; }
.upload-box .sub-title, .upload-box .wide { grid-column: 1 / -1; }
.upload-box .muted { margin: 0; font-size: 12px; }
.sub-title { font-weight: 600; font-size: 13.5px; margin-bottom: 10px; }
.term-group { margin-bottom: 10px; }
.term-dim { font-size: 12.5px; font-weight: 600; color: #4a5568; margin-bottom: 4px; }
.term-list { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.asset-edit { display: flex; flex-direction: column; gap: 4px; max-width: 380px; }
.asset-edit input { padding: 3px 7px; font-size: 12.5px; }
input.mini { width: 70px; }
.login { padding: 24px; }
.login h2 { margin-bottom: 18px; }
.login label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: #5b6472; margin-bottom: 14px; }
.login .btn { width: 100%; padding: 9px; }
.status { padding: 1px 8px; border-radius: 10px; font-size: 12px; background: #f1f3f7; }
.s-published { background: #e9f8ef; color: #177245; }
.s-draft { background: #f1f3f7; color: #6b7280; }
.s-archived { background: #fdf3e2; color: #a86a11; }
.s-blocked { background: #fdecea; color: #b03a2e; }
.preview-body { background: #eef1f6; }
.preview-top { background: #111827; color: #fff; }
.preview-top .brand { color: #fff; }
.filters-vertical { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.dim-block { border: 1px solid #eef0f4; border-radius: 6px; padding: 8px 12px; min-width: 220px; }
.dim-block legend { font-weight: 600; font-size: 13px; padding: 0 4px; }
.dim-block .check { display: inline-flex; margin-right: 12px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.wcard { background: #fff; border: 1px solid #e4e7ec; border-radius: 8px; overflow: hidden; }
.wcover { height: 150px; background: #f1f3f7; display: flex; align-items: center; justify-content: center; color: #9aa3b2; }
.wcover img { width: 100%; height: 100%; object-fit: cover; }
.wbody { padding: 10px 12px; }
.wtitle { font-weight: 600; margin-bottom: 2px; }
.wtags { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 4px; }
.wtags .tag { margin-left: 0; }
@media (max-width: 760px) {
  .form-grid { grid-template-columns: 1fr; }
  main { padding: 14px; }
  table.grid { display: block; overflow-x: auto; }
}

/* ---- 条件词条联动 ---- */
.term-disabled { opacity: 0.4; }
.scope-block { width: 100%; border-top: 1px dashed #e4e7ec; padding-top: 10px; margin-top: 4px; }

/* ---- 素材语义打标 ---- */
.asset-row { display: flex; gap: 6px; }
.asset-row select { flex: 1; padding: 3px 7px; font-size: 12.5px; }
.shot-miss { color: #c0392b; font-weight: 600; }

/* ---- 对比组成员 ---- */
.candidate-list { max-height: 320px; overflow-y: auto; padding: 4px 0; }

/* ---- 前台对比 ---- */
.cmp-tabs { display: flex; gap: 10px; padding: 10px 16px; }
.cmp-wrap { overflow-x: auto; }
.cmp-table { border-collapse: collapse; width: 100%; }
.cmp-table th, .cmp-table td { border: 1px solid #eef0f4; padding: 10px; text-align: center; vertical-align: top; }
.cmp-table thead th { background: #fafbfc; font-size: 13px; min-width: 160px; }
.cmp-row-head { background: #fafbfc; font-size: 13px; white-space: nowrap; width: 64px; }
.cmp-corner { background: #fafbfc; }
.cmp-cell img { max-width: 220px; border-radius: 6px; border: 1px solid #e4e7ec; display: block; margin: 0 auto; }
.cmp-missing {
  min-height: 90px; display: flex; align-items: center; justify-content: center;
  background: #f1f3f7; color: #9aa3b2; border-radius: 6px; font-size: 12.5px;
}
.cmp-cad-stack { display: flex; flex-direction: column; gap: 8px; }
.cmp-cad-stack img { max-width: 140px; }

/* ---- 作品详情 ---- */
.detail-top { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 14px; }
.detail-cover img, .detail-cover .thumb { width: 220px; height: 165px; object-fit: cover; border-radius: 8px; border: 1px solid #e4e7ec; }
.detail-meta { flex: 1; }
table.kv { width: 100%; border-collapse: collapse; font-size: 13px; }
table.kv th { text-align: left; color: #6b7280; font-weight: 500; width: 110px; padding: 6px 10px 6px 0; vertical-align: top; white-space: nowrap; }
table.kv td { padding: 6px 0; }
.term-groups { display: flex; flex-wrap: wrap; gap: 18px; }
.term-groups .term-group { min-width: 160px; }
.term-groups .term-list { display: flex; flex-wrap: wrap; gap: 6px; }
.shot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.shot-item { border: 1px solid #eef0f4; border-radius: 8px; padding: 8px; background: #fff; position: relative; }
.shot-item img { width: 100%; height: 150px; object-fit: cover; border-radius: 6px; display: block; }
.shot-cap { font-size: 12.5px; margin-top: 6px; line-height: 1.5; }
.shot-item .tag { position: static; margin-top: 6px; }
@media (max-width: 720px) { .detail-top { flex-direction: column; } .detail-cover img, .detail-cover .thumb { width: 100%; height: 200px; } }

/* 分页 */
.pager { display: flex; align-items: center; gap: 6px; margin: 16px 0; flex-wrap: wrap; }
.pager .btn.current { background: #2563eb; border-color: #2563eb; color: #fff; cursor: default; }
