.template-list.badge-tpls {
  grid-template-columns: 1fr 1fr;
}
.tpl-card .tpl-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 54 / 85.6;
  background: #f7f4ee;
  border: 1px solid #e6e0d6;
  position: relative;
  overflow: hidden;
}
.tpl-card .tpl-thumb.is-land {
  aspect-ratio: 85.6 / 54;
}
.tpl-card .tpl-thumb::after {
  content: "";
  position: absolute;
  inset: 8% 10% 46%;
  background: #ffffff;
  border: 1px solid #ece8e1;
  border-radius: 2px;
}
.tpl-card .tpl-thumb.is-land::after {
  inset: 10% 52% 10% 8%;
}

.badge-pair,
.art-pair,
.stage-inner.badge-pair {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: center;
  gap: 28px;
}

.badge-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.badge-side figcaption {
  margin: 0;
  font-size: 12px;
  color: var(--brand-navy);
  letter-spacing: 0.06em;
  text-align: center;
  line-height: 1.45;
}
.badge-side figcaption em {
  font-style: normal;
  color: #6b645c;
  font-size: 11px;
  letter-spacing: 0;
}

/* —— 人像卡（插入卡） —— */
.badge-sheet {
  position: relative;
  overflow: hidden;
  background: #f7f4ee;
  color: #1c1917;
  box-shadow: 0 8px 28px rgba(28, 25, 23, 0.18);
  font-family: "FZHei B01S", "PingFang SC", "Microsoft YaHei", sans-serif;
  box-sizing: border-box;
}
.badge-sheet.portrait {
  width: 54mm;
  height: 85.6mm;
  display: flex;
  flex-direction: column;
}
.badge-sheet.landscape {
  width: 85.6mm;
  height: 54mm;
  display: flex;
  flex-direction: row;
}

.badge-sheet [data-slot],
.sleeve-sheet [data-slot] { cursor: pointer; }
.badge-sheet [data-slot].is-selected,
.sleeve-sheet [data-slot].is-selected {
  outline: 2px solid var(--brand-navy);
  outline-offset: 1px;
  position: relative;
  z-index: 2;
}
.badge-sheet.is-exporting [data-slot].is-selected,
.sleeve-sheet.is-exporting [data-slot].is-selected,
.worn-set.is-exporting [data-slot].is-selected { outline: none; }
.badge-sheet [data-slot].badge-photo.is-selected,
.sleeve-sheet [data-slot].badge-photo.is-selected,
.worn-set [data-slot].badge-photo.is-selected {
  outline: none;
  outline-offset: 0;
}

.badge-sheet.portrait.front {
  padding: 3.6mm 3.5mm 4mm;
  align-items: center;
}
.badge-sheet.portrait.front .badge-photo {
  flex: 0 0 44mm;
  width: 47mm;
  height: 44mm;
  align-self: center;
}
.badge-sheet.portrait.front .badge-meta {
  flex: 1 1 auto;
  width: 100%;
  align-items: center;
  text-align: center;
  justify-content: center;
  padding-top: 2.8mm;
  gap: 2.2mm;
}

.badge-photo {
  width: 21mm;
  height: 26mm;
  border-radius: 0.6mm;
  overflow: visible;
  background: transparent;
  flex: 0 0 auto;
  display: block;
  color: #6b645c;
  font-size: 2.6mm;
  letter-spacing: 0.12em;
  position: relative;
}
.badge-photo-window {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
  background: #ffffff;
}
.badge-photo img {
  display: block;
  position: absolute;
  cursor: grab;
  max-width: none;
  max-height: none;
  user-select: none;
  -webkit-user-drag: none;
}
body.is-photo-dragging,
body.is-photo-dragging * {
  cursor: grabbing !important;
  user-select: none !important;
}
.badge-photo.is-empty::before {
  content: "照片";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  pointer-events: none;
}
.photo-crop-ui {
  display: none;
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
}
.badge-photo.is-selected .photo-crop-ui { display: block; }
.badge-sheet.is-exporting .photo-crop-ui,
.sleeve-sheet.is-exporting .photo-crop-ui,
.worn-set.is-exporting .photo-crop-ui,
.is-exporting .photo-crop-ui { display: none !important; }
.crop-corner {
  position: absolute;
  width: 3.2mm;
  height: 3.2mm;
  border: 0.35mm solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 0 0 0.18mm rgba(10, 46, 93, 0.28);
  box-sizing: border-box;
}
.crop-corner.tl { top: 0.7mm; left: 0.7mm; border-right: 0; border-bottom: 0; }
.crop-corner.tr { top: 0.7mm; right: 0.7mm; border-left: 0; border-bottom: 0; }
.crop-corner.bl { bottom: 0.7mm; left: 0.7mm; border-right: 0; border-top: 0; }
.crop-corner.br { bottom: 0.7mm; right: 0.7mm; border-left: 0; border-top: 0; }
.photo-crop-zoom {
  position: absolute;
  left: 50%;
  bottom: 1.2mm;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 1mm;
  padding: 0.55mm 1.3mm;
  background: rgba(10, 46, 93, 0.84);
  color: #fff;
  border-radius: 1.1mm;
  pointer-events: auto;
  white-space: nowrap;
  font-size: 2.1mm;
  letter-spacing: 0;
  line-height: 1;
  box-shadow: 0 0.4mm 1.2mm rgba(10, 46, 93, 0.28);
}
.photo-zoom-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
  font-size: 2.8mm;
  line-height: 1;
  width: 4mm;
  padding: 0;
  font-family: inherit;
}
.photo-zoom-range {
  width: 16mm;
  margin: 0;
  accent-color: var(--brand-gold);
}
.photo-zoom-val {
  font-style: normal;
  min-width: 7.5mm;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.badge-meta {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 2.2mm;
  text-align: center;
}
.badge-name {
  margin: 0;
  font-size: 6.4mm;
  font-weight: 700;
  color: var(--brand-navy);
  letter-spacing: 0.18em;
  line-height: 1.15;
  word-break: break-word;
}
.badge-name::after {
  content: "";
  display: block;
  width: 8mm;
  height: 0.55mm;
  background: var(--brand-gold);
  margin: 1.8mm auto 0;
  border-radius: 0.2mm;
}
.badge-role-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.3mm;
}
.badge-role-sep {
  display: inline-block;
  width: 0.45mm;
  height: 2.5mm;
  background: var(--brand-gold);
  border-radius: 0.2mm;
  flex: 0 0 auto;
}
.badge-title,
.badge-dept {
  margin: 0;
  font-size: 2.6mm;
  color: #3f3a36;
  letter-spacing: 0.08em;
  line-height: 1.25;
  white-space: nowrap;
}
.badge-dept { color: #6b645c; }
.badge-sheet.front .badge-id {
  font-size: 1.85mm;
  letter-spacing: 0.08em;
  color: #6b645c;
  line-height: 1.3;
}
.badge-sheet.front .badge-id .id-label {
  display: inline;
  font-size: 1.45mm;
  letter-spacing: 0.16em;
  color: #8a837c;
  margin-right: 1.2mm;
}

/* 横版人像卡：左大照片，右横排文字，无品牌条 */
.badge-sheet.landscape.front {
  padding: 3mm;
  align-items: stretch;
  gap: 3.5mm;
}
.badge-sheet.landscape.front .badge-photo {
  flex: 0 0 38mm;
  width: 38mm;
  height: auto;
  align-self: stretch;
}
.badge-sheet.landscape.front .badge-meta {
  align-items: flex-start;
  text-align: left;
  justify-content: center;
  padding-top: 0;
  gap: 2.4mm;
}
.badge-sheet.landscape.front .badge-name {
  font-size: 7mm;
  letter-spacing: 0.14em;
}
.badge-sheet.landscape.front .badge-name::after {
  margin: 1.8mm 0 0;
}
.badge-sheet.landscape.front .badge-role-row { justify-content: flex-start; }
.badge-sheet.landscape.front .badge-title,
.badge-sheet.landscape.front .badge-dept { font-size: 3mm; }

/* 人像卡背面：干净、小标、网址与二维码 */
.badge-sheet.back {
  background: #f7f4ee;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8mm 5mm;
  gap: 3mm;
  text-align: center;
}
.badge-sheet.back .badge-logo.is-small {
  display: flex;
  justify-content: center;
}
.badge-sheet.back .badge-logo svg,
.badge-sheet.back .badge-logo img {
  display: block;
  height: 6.5mm;
  width: auto;
}
.badge-website {
  margin: 0;
  font-family: "Fira Sans Extra Condensed", "FZHei B01S", sans-serif;
  font-size: 2.6mm;
  letter-spacing: 0.08em;
  color: var(--brand-navy);
}
.badge-qr {
  width: 16mm;
  height: 16mm;
  background: #fff;
  padding: 0.6mm;
  box-sizing: border-box;
  flex: 0 0 auto;
  border-radius: 0.4mm;
}
.badge-qr img,
.badge-qr canvas {
  display: block;
  width: 100%;
  height: 100%;
}
.badge-qr-cap {
  margin: 0;
  font-size: 2.1mm;
  color: #6b645c;
  letter-spacing: 0.12em;
}
.badge-sheet.landscape.back { padding: 5mm 8mm; }
.badge-sheet.landscape.back .badge-qr { width: 14mm; height: 14mm; }

/* 反白横排锁图：翅膀 + 捷运通 | JETWAY + SUPPLYCHAIN TECHNOLOGY */
.jw-lockup {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  min-width: 0;
  color: #fff;
  flex: 0 0 auto;
}
.jw-lockup-mark {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  line-height: 0;
}
.jw-lockup-mark svg,
.jw-lockup-mark img {
  display: block;
  width: auto;
  height: var(--jw-lockup-h, 6.4mm);
}
.jw-lockup-type {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  flex: 0 0 auto;
  margin-left: var(--jw-lockup-gap, 1.5mm);
}
.jw-lockup-word {
  display: flex;
  align-items: center;
  white-space: nowrap;
  line-height: 1;
  color: #fff;
}
.jw-lockup-word .cn {
  font-family: "FZHei B01S", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-weight: 700;
  font-size: var(--jw-cn, 3.05mm);
  letter-spacing: 0.04em;
  line-height: 1;
  transform: translateY(0.04mm);
}
.jw-lockup-word .bar {
  display: inline-block;
  width: var(--jw-bar-w, 0.32mm);
  height: var(--jw-bar-h, 2.35mm);
  background: var(--brand-gold);
  margin: 0 var(--jw-bar-gap, 0.62mm);
  border-radius: 0.08mm;
  flex: 0 0 auto;
  transform: translateY(-0.04mm);
}
.jw-lockup-word .en {
  font-family: "Fira Sans Extra Condensed", "FZHei B01S", sans-serif;
  font-weight: 800;
  font-size: var(--jw-en, 3.35mm);
  letter-spacing: 0.04em;
  line-height: 1;
  transform: translateY(0.02mm);
}
.jw-lockup-sub {
  font-family: "Fira Sans Extra Condensed", "FZHei B01S", sans-serif;
  font-weight: 400;
  font-size: var(--jw-sub, 1.05mm);
  letter-spacing: var(--jw-sub-track, 0.22em);
  color: rgba(255, 255, 255, 0.90);
  white-space: nowrap;
  line-height: 1;
  margin-top: var(--jw-sub-gap, 0.62mm);
  align-self: flex-start;
  text-align: left;
}

/* —— 卡套 —— */
.sleeve-sheet {
  width: 65mm;
  height: 110mm;
  background: var(--brand-navy);
  color: #fff;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 10px 32px rgba(10, 46, 93, 0.28);
  font-family: "FZHei B01S", "PingFang SC", "Microsoft YaHei", sans-serif;
  position: relative;
  overflow: hidden;
}
.sleeve-sheet.landscape {
  width: 110mm;
  height: 78mm;
}
.sleeve-clip-area {
  flex: 0 0 11mm;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-navy-deep, #071E3C);
}
.sleeve-slot {
  width: 18mm;
  height: 5mm;
  border-radius: 2.6mm;
  background: #e8e2d6;
  box-shadow: inset 0 0 0 0.25mm rgba(247, 183, 44, 0.7);
}
.sleeve-brand {
  flex: 0 0 17mm;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5.5mm;
  box-sizing: border-box;
  min-width: 0;
}
.sleeve-brand .jw-lockup {
  --jw-lockup-h: 6.1mm;
  --jw-lockup-gap: 1.75mm;
  --jw-cn: 2.85mm;
  --jw-en: 3.15mm;
  --jw-bar-w: 0.3mm;
  --jw-bar-h: 2.2mm;
  --jw-bar-gap: 0.62mm;
  --jw-sub: 1.05mm;
  --jw-sub-gap: 0.72mm;
  --jw-sub-track: 0.22em;
}
.sleeve-gold {
  flex: 0 0 0.8mm;
  width: 100%;
  background: var(--brand-gold);
}
.sleeve-window {
  width: 51mm;
  height: 80mm;
  margin: 1.6mm auto 0;
  background: #ffffff;
  overflow: hidden;
  position: relative;
  box-shadow: 0 0 0 0.45mm var(--brand-gold);
  flex: 0 0 auto;
}
.sleeve-sheet.landscape .sleeve-clip-area { flex-basis: 9mm; }
.sleeve-sheet.landscape .sleeve-brand { flex-basis: 14mm; padding: 0 6mm; }
.sleeve-sheet.landscape .sleeve-brand .jw-lockup {
  --jw-lockup-h: 5.7mm;
  --jw-lockup-gap: 1.6mm;
  --jw-cn: 2.65mm;
  --jw-en: 2.95mm;
  --jw-bar-h: 2.05mm;
  --jw-bar-gap: 0.58mm;
  --jw-sub: 0.98mm;
  --jw-sub-gap: 0.66mm;
}
.sleeve-sheet.landscape .sleeve-window {
  width: 82mm;
  height: 51mm;
  margin: 1.4mm auto 0;
}
.sleeve-window-fill {
  width: 100%;
  height: 100%;
  background:
    repeating-linear-gradient(
      45deg,
      #f7f4ee,
      #f7f4ee 3mm,
      #ffffff 3mm,
      #ffffff 6mm
    );
}
.sleeve-insert {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 54mm;
  height: 85.6mm;
  transform: translate(-50%, -50%);
}
.sleeve-sheet.landscape .sleeve-insert {
  width: 85.6mm;
  height: 54mm;
}
.sleeve-insert .badge-sheet {
  box-shadow: none;
}
.sleeve-foot {
  flex: 1 1 auto;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 1.8mm 0 2.2mm;
  box-sizing: border-box;
}
.sleeve-foot-rule {
  display: block;
  width: 18mm;
  height: 0.55mm;
  background: var(--brand-gold);
  border-radius: 0.2mm;
}

/* —— 挂绳 —— */
.lanyard-strap {
  width: var(--lanyard-width, 25mm);
  background: var(--brand-navy);
  background-image: linear-gradient(
    90deg,
    rgba(0, 0, 0, 0.16),
    transparent 16%,
    transparent 84%,
    rgba(0, 0, 0, 0.16)
  );
  overflow: hidden;
  box-sizing: border-box;
  box-shadow: 0 2px 8px rgba(10, 46, 93, 0.22);
}
.lanyard-strap,
.lanyard-art {
  position: relative;
}
.lanyard-pattern {
  display: block;
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
}

.lanyard-pair {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: flex-start;
  gap: 6mm;
}
.lanyard-strap {
  min-height: 0;
  flex: 0 0 var(--lanyard-width, 25mm);
  width: var(--lanyard-width, 25mm);
  overflow: hidden;
}
.lanyard-clip {
  width: 58mm;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: -2.4mm;
  z-index: 3;
}
.clip-plate {
  width: 58mm;
  height: 8mm;
  background: var(--brand-navy-deep, #071E3C);
  border: 0.35mm solid var(--brand-gold);
  border-radius: 1.1mm;
  box-sizing: border-box;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
}
.clip-hook {
  width: 9mm;
  height: 8mm;
  border: 1.15mm solid #c8c8c8;
  border-top: none;
  border-radius: 0 0 5mm 5mm;
  margin-top: -0.6mm;
  background: transparent;
  box-sizing: border-box;
}

.worn-set {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.worn-set .sleeve-sheet {
  margin-top: -6.2mm;
  z-index: 1;
}

.lanyard-art {
  background: var(--brand-navy);
  overflow: hidden;
  position: relative;
  box-shadow: 0 8px 24px rgba(10, 46, 93, 0.22);
}
.lanyard-art .lanyard-strap { box-shadow: none; }

/* 印刷出血：人像卡 / 卡套 / 挂绳 */
.badge-sheet.is-print-bleed.portrait {
  width: 60mm;
  height: 91.6mm;
  padding: 6.6mm 6.5mm 7mm;
}
.badge-sheet.is-print-bleed.landscape.front {
  width: 91.6mm;
  height: 60mm;
  padding: 6mm;
}
.badge-sheet.is-print-bleed.portrait.back {
  padding: 11mm 8mm;
}
.badge-sheet.is-print-bleed.landscape.back {
  width: 91.6mm;
  height: 60mm;
  padding: 8mm 11mm;
}
.sleeve-sheet.is-print-bleed {
  width: 71mm;
  height: 116mm;
  padding: 3mm;
}
.sleeve-sheet.landscape.is-print-bleed {
  width: 116mm;
  height: 84mm;
}
.lanyard-art.is-print-bleed {
  background: var(--brand-navy);
  box-sizing: border-box;
  position: relative;
}
.lanyard-art.is-print-bleed .lanyard-strap { box-shadow: none; }

/* 预览切换 */
.view-switch {
  display: inline-flex;
  align-items: center;
  gap: 0;
  border: 1px solid #c9c1b4;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}
.view-switch button {
  appearance: none;
  border: 0;
  background: transparent;
  color: #3f3a36;
  font-size: 12px;
  letter-spacing: 0.04em;
  padding: 6px 12px;
  cursor: pointer;
  font-family: inherit;
  line-height: 1.2;
}
.view-switch button + button { border-left: 1px solid #e6e0d6; }
.view-switch button.is-on {
  background: var(--brand-navy);
  color: #fff;
}
.view-switch button:focus-visible {
  outline: 2px solid var(--brand-gold);
  outline-offset: -2px;
}

.photo-tools { margin-top: 8px; }
.photo-editor { margin-top: 6px; }
.photo-editor .photo-preview {
  width: 100%;
  height: auto;
  aspect-ratio: 47 / 44;
  border: 1px solid #e6e0d6;
  border-radius: 8px;
  background: #ffffff;
  position: relative;
  overflow: hidden;
  margin-bottom: 8px;
}
.photo-editor .photo-preview.is-landscape { aspect-ratio: 38 / 48; }
.photo-editor .photo-preview .badge-photo-window {
  border-radius: 7px;
}
.photo-editor .photo-preview img {
  max-width: none;
  max-height: none;
  cursor: default;
}
.photo-editor .photo-preview.is-empty {
  color: #6b645c;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.photo-scale-note {
  margin: 2px 0 8px;
  font-size: 11px;
  color: #6b645c;
  line-height: 1.4;
}
.lanyard-width-field {
  margin-top: 12px;
}
.lanyard-width-field .export-group-label { margin-top: 0; }
.lanyard-width-switch { margin-top: 4px; }
.lanyard-width-field > .hint { margin-top: 6px; }
.cutout-status {
  margin: 6px 0 0;
  font-size: 12px;
  color: #6b645c;
  line-height: 1.4;
}
.cutout-status.ok { color: #1b5e3b; }
.cutout-status.error { color: #8a3b12; }
.cutout-status.busy { color: var(--brand-navy); }

.export-group-label {
  margin: 10px 0 4px;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: #6b645c;
}
