/* 外贸产品识图查款系统 */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
  background: #f2f4f8; color: #1f2937; min-height: 100vh;
}
code { background: #e5e7eb; padding: 1px 6px; border-radius: 4px; font-size: 0.9em; }

header {
  background: linear-gradient(135deg, #0f4c81, #1d6fb8); color: #fff;
  padding: 18px 28px; display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 10px;
}
.brand h1 { font-size: 22px; font-weight: 600; }
.brand .sub { opacity: .85; font-size: 13px; }
.status-bar { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.badge { padding: 4px 12px; border-radius: 20px; font-size: 13px; font-weight: 600; }
.badge.tencent { background: #ffd042; color: #5b3a00; }
.badge.mock { background: #fff; color: #0f4c81; }
.meta { font-size: 12px; opacity: .9; }

nav { display: flex; gap: 4px; background: #fff; padding: 0 20px; border-bottom: 1px solid #e5e7eb; }
.tab {
  border: none; background: none; padding: 13px 22px; font-size: 15px; cursor: pointer;
  color: #6b7280; border-bottom: 3px solid transparent; font-family: inherit;
}
.tab.active { color: #0f4c81; border-bottom-color: #0f4c81; font-weight: 600; }

.tab-page { display: none; max-width: 1080px; margin: 0 auto; padding: 22px 20px 60px; }
.tab-page.active { display: block; }

/* ---------- 上传 ---------- */
.upload-card {
  background: #fff; border-radius: 14px; padding: 26px;
  box-shadow: 0 1px 4px rgba(15, 40, 80, .08);
}
.drop-zone {
  border: 2px dashed #b6c4d8; border-radius: 12px; padding: 46px 20px;
  text-align: center; cursor: pointer; transition: .15s;
}
.drop-zone:hover, .drop-zone.drag { border-color: #1d6fb8; background: #eef5fc; }
.drop-zone.small { padding: 20px; }
.dz-icon { font-size: 40px; }
.dz-main { font-size: 16px; font-weight: 600; margin-top: 6px; }
.dz-sub { font-size: 13px; color: #8a94a6; margin-top: 4px; }

.preview-box { display: flex; gap: 18px; align-items: center; margin-top: 18px; }
.preview-box img { max-width: 260px; max-height: 220px; border-radius: 10px; border: 1px solid #e5e7eb; }
.preview-box.compact img { max-width: 160px; max-height: 130px; }
.preview-info { display: flex; flex-direction: column; gap: 10px; word-break: break-all; }
.preview-actions { display: flex; gap: 10px; }

.btn {
  border: 1px solid #cbd5e1; background: #fff; color: #334155;
  padding: 10px 26px; border-radius: 8px; font-size: 15px; cursor: pointer; font-family: inherit;
}
.btn:hover { background: #f1f5f9; }
.btn.primary { background: #1d6fb8; border-color: #1d6fb8; color: #fff; }
.btn.primary:hover { background: #0f4c81; }
.btn.danger { color: #dc2626; border-color: #fca5a5; padding: 5px 12px; font-size: 13px; }
.btn.danger:hover { background: #fef2f2; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- 结果 ---------- */
.result-summary {
  margin: 20px 0 6px; background: #fff; border-radius: 10px; padding: 12px 18px;
  font-size: 14px; color: #475569; box-shadow: 0 1px 3px rgba(15,40,80,.06);
}
.sec-title { margin: 26px 0 12px; font-size: 17px; }
.sec-title small { font-weight: 400; color: #8a94a6; font-size: 13px; margin-left: 8px; }
.sec-title.ok { color: #15803d; }
.sec-title.warn { color: #b45309; }

.match-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.match-card {
  background: #fff; border-radius: 12px; padding: 16px;
  box-shadow: 0 1px 4px rgba(15,40,80,.08); border-top: 4px solid #22c55e;
}
.review .match-card { border-top-color: #f59e0b; opacity: .95; }
.mc-head { display: flex; gap: 14px; }
.mc-head img { width: 110px; height: 110px; object-fit: cover; border-radius: 8px; border: 1px solid #e5e7eb; }
.mc-info { flex: 1; min-width: 0; }
.mc-style { font-size: 21px; font-weight: 700; color: #0f4c81; word-break: break-all; }
.mc-score { font-size: 26px; font-weight: 700; margin-top: 2px; }
.mc-score .pct { font-size: 14px; font-weight: 400; color: #8a94a6; }
.review .mc-score { color: #b45309; }
.match-card.auto-card .mc-score { color: #15803d; }
.mc-file { font-size: 12px; color: #8a94a6; margin-top: 4px; word-break: break-all; }
.mc-color-label { font-size: 13px; color: #64748b; margin: 12px 0 6px; font-weight: 600; }
.mc-colors { display: flex; flex-wrap: wrap; gap: 8px; }
.color-chip {
  display: flex; align-items: center; gap: 6px; background: #f1f5f9;
  padding: 4px 10px 4px 4px; border-radius: 20px; font-size: 13px;
}
.color-chip img { width: 34px; height: 34px; object-fit: cover; border-radius: 50%; }
.color-chip .cnt { color: #8a94a6; font-size: 12px; }
.color-chip.hit { outline: 2px solid #22c55e; }

.empty {
  background: #fff; border-radius: 10px; padding: 26px; text-align: center;
  color: #8a94a6; font-size: 14px;
}

/* ---------- 管理 ---------- */
.manage-grid { display: grid; grid-template-columns: 1fr 300px; gap: 16px; align-items: start; }
.manage-grid h3 { margin-bottom: 10px; font-size: 16px; }
.hint { font-size: 13px; color: #64748b; margin-bottom: 14px; line-height: 1.7; }
.form-row { display: flex; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.form-row label { flex: 1; font-size: 13px; color: #475569; display: flex; flex-direction: column; gap: 5px; }
.form-row input {
  border: 1px solid #cbd5e1; border-radius: 8px; padding: 9px 12px; font-size: 14px; font-family: inherit;
}
.form-row input:focus { outline: 2px solid #93c5fd; border-color: #1d6fb8; }
.msg { margin-top: 12px; font-size: 13px; min-height: 18px; }
.msg.ok { color: #15803d; } .msg.err { color: #dc2626; }

.manage-side { display: flex; flex-direction: column; gap: 12px; }
.stats-card {
  background: #fff; border-radius: 12px; padding: 18px; display: flex; gap: 10px;
  box-shadow: 0 1px 4px rgba(15,40,80,.08);
}
.stat { flex: 1; text-align: center; }
.stat b { display: block; font-size: 26px; color: #0f4c81; }
.stat span { font-size: 13px; color: #8a94a6; }
.filter {
  border: 1px solid #cbd5e1; border-radius: 10px; padding: 10px 14px; font-size: 14px; font-family: inherit;
}

.gallery-list { margin-top: 18px; display: flex; flex-direction: column; gap: 12px; }
.style-card { background: #fff; border-radius: 12px; padding: 14px 16px; box-shadow: 0 1px 3px rgba(15,40,80,.06); }
.style-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.style-name { font-size: 17px; font-weight: 700; color: #0f4c81; }
.style-meta { font-size: 13px; color: #8a94a6; }
.style-thumbs { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.thumb-item { width: 92px; text-align: center; }
.thumb-item img { width: 92px; height: 92px; object-fit: cover; border-radius: 8px; border: 1px solid #e5e7eb; }
.thumb-item .cap { font-size: 11px; color: #64748b; margin-top: 3px; word-break: break-all; }
.thumb-item button { margin-top: 3px; }

.toast {
  position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%);
  background: #1f2937; color: #fff; padding: 12px 26px; border-radius: 10px;
  font-size: 14px; box-shadow: 0 6px 20px rgba(0,0,0,.25); z-index: 99;
}

@media (max-width: 860px) {
  .manage-grid { grid-template-columns: 1fr; }
  .match-list { grid-template-columns: 1fr; }
}
