:root {
  --gold:     #A67D44;
  --sand:     #C8BA9A;
  --cream:    #EFE9E1;
  --role-bg:  #1E3D2C;
  --skill-bg: #A1543F;   /* 磚紅 v3 */
  --mcp-bg:   #2E3A4E;
  --know-bg:  #7A6218;   /* 舊金 v4 */
  --back-bg:  #0d1f35;
  --font-zh:  "PingFang TC","PingFang SC","STHeiti","Microsoft JhengHei",sans-serif;
  --font-en:  "Avenir Next","Avenir",-apple-system,sans-serif;
}

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

body { background: #1a1a1a; font-family: var(--font-en); padding: 24px; }

.screen-lbl {
  color: var(--gold); font-size: 10px; letter-spacing: 0.18em;
  text-transform: uppercase; margin-bottom: 8px; margin-top: 24px;
}
.sheet-group { margin-bottom: 24px; }

/* ══════════ A4 SHEET ══════════ */
.sheet {
  width: 210mm; height: 297mm; background: white;
  position: relative; overflow: visible;
  page-break-after: always; box-shadow: 0 6px 32px rgba(0,0,0,0.6);
}
.sheet:last-child { page-break-after: avoid; }

/* ══════════ CARD GRID — 2×2 (76×106) ══════════ */
.card-grid {
  position: absolute; top: 41mm; left: 27.5mm;
  display: grid;
  grid-template-columns: 76mm 76mm;
  grid-template-rows: 106mm 106mm;
  gap: 3mm;
}

/* ══════════ ROLE LANDSCAPE GRID — 2 stacked (106×76) ══════════ */
.land-grid {
  position: absolute; top: 38mm; left: 52mm;
  display: grid;
  grid-template-columns: 106mm;
  grid-template-rows: 76mm 76mm;
  gap: 14mm;
}

/* ══════════ CELL & CROP MARKS ══════════ */
.card-cell { position: relative; width: 76mm; height: 106mm; }
.card-cell.land { width: 106mm; height: 76mm; }

.cm { position: absolute; width: 5mm; height: 5mm; }
.cm-tl { top:-2.5mm;    left:-2.5mm;  border-top:0.25px solid #999; border-left:0.25px solid #999; }
.cm-tr { top:-2.5mm;    right:-2.5mm; border-top:0.25px solid #999; border-right:0.25px solid #999; }
.cm-bl { bottom:-2.5mm; left:-2.5mm;  border-bottom:0.25px solid #999; border-left:0.25px solid #999; }
.cm-br { bottom:-2.5mm; right:-2.5mm; border-bottom:0.25px solid #999; border-right:0.25px solid #999; }

.pos-tag {
  position: absolute; bottom: 1mm; right: 1mm;
  font-size: 1.8mm; color: rgba(255,255,255,0.18);
  font-family: var(--font-en); z-index: 10;
}
.pos-tag.dark { color: rgba(0,0,0,0.12); }

/* ══════════ CARD FRONT (portrait) ══════════ */
.card-front {
  width: 76mm; height: 106mm; border-radius: 4mm;
  overflow: hidden; display: flex; flex-direction: column;
}
.card-front.role  { background: var(--role-bg); }
.card-front.skill { background: var(--skill-bg); }
.card-front.mcp   { background: var(--mcp-bg); }
.card-front.know  { background: var(--know-bg); }

/* Meta row */
.c-meta {
  display: flex; justify-content: space-between;
  padding: 2.5mm 5mm 0; font-family: var(--font-en);
  font-size: 2mm; font-weight: 600; letter-spacing: 0.06em;
  color: rgba(200,186,154,0.42); text-transform: uppercase; flex-shrink: 0;
}
.c-meta .meta-main { font-size: 2.4mm; color: rgba(200,186,154,0.6); }

/* Title block */
.c-title { padding: 1.5mm 5mm 0; flex-shrink: 0; }
.c-name {
  font-family: var(--font-zh); font-weight: 700;
  color: var(--cream); line-height: 1.05;
}
.c-name.s { font-size: 11.5mm; }
.c-name.m { font-size: 9mm; }
.c-name.l { font-size: 6.5mm; line-height: 1.12; }
/* A 版：技能卡英文標題放大（技能僅 2 欄位、有空間）*/
.card-front.skill .c-name { font-size: 8.5mm; line-height: 1.08; }
.c-en {
  font-family: var(--font-en); font-size: 2.8mm; font-weight: 600;
  color: rgba(200,186,154,0.55); margin-top: 0.8mm;
  letter-spacing: 0.08em; text-transform: uppercase;
}
.c-sub-zh {
  font-family: var(--font-zh); font-size: 3.2mm; font-weight: 600;
  color: rgba(239,233,225,0.85); margin-top: 1.2mm; letter-spacing: 0.04em;
}
.c-accent { width: 7mm; height: 0.5mm; background: var(--gold); margin-top: 1.5mm; border-radius: 0.5mm; }

/* Divider */
.c-div { height: 0.25mm; background: rgba(200,186,154,0.12); margin: 2mm 5mm 0; flex-shrink: 0; }

/* Fields */
.c-fields { flex: 1; padding: 0 5mm; display: flex; flex-direction: column; justify-content: center; overflow: hidden; }
.c-field {
  display: flex; gap: 2mm; padding: 1.3mm 0;
  border-bottom: 0.25mm solid rgba(239,233,225,0.14);
  align-items: flex-start; flex-shrink: 0;
}
.c-field:last-child { border-bottom: none; }
.c-dot {
  width: 1.3mm; height: 1.3mm; border-radius: 50%;
  background: var(--gold); flex-shrink: 0; margin-top: 1.8mm; opacity: 0.85;
}
.c-text { font-family: var(--font-zh); font-size: 4.2mm; font-weight: 600; color: var(--cream); line-height: 1.32; }

/* T / V block */
.c-tv {
  display: flex; margin: 2mm 5mm 0;
  border: 0.3mm solid rgba(166,125,68,0.45); border-radius: 1mm;
  overflow: hidden; flex-shrink: 0;
}
.tv-cell { flex: 1; padding: 1.2mm 0; text-align: center; }
.tv-cell:first-child { border-right: 0.3mm solid rgba(166,125,68,0.45); }
.tv-lbl { font-family: var(--font-en); font-size: 2.8mm; letter-spacing: 0.10em; color: rgba(255,255,255,0.65); text-transform: uppercase; }
.tv-val {
  font-family: var(--font-en); font-size: 6mm; font-weight: 800; color: #fff; line-height: 1;
  font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1;
}

/* Bottom band */
.c-band {
  height: 12mm; flex-shrink: 0; display: flex; align-items: center;
  padding: 0 5mm; gap: 2mm; border-top: 0.25mm solid rgba(166,125,68,0.3); margin-top: 2mm;
}
.k-box {
  width: 8mm; height: 8mm; border: 0.3mm solid var(--gold); border-radius: 1mm;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.k-box img { width: 5.8mm; height: auto; display: block; filter: brightness(0) invert(1); }
.band-labels { flex: 1; }
.band-zh { font-family: var(--font-zh); font-size: 3.4mm; font-weight: 600; color: var(--cream); line-height: 1; }
.band-en { font-family: var(--font-en); font-size: 1.9mm; color: rgba(200,186,154,0.5); letter-spacing: 0.1em; text-transform: uppercase; }
.band-code { font-family: var(--font-en); font-size: 2.2mm; font-weight: 600; color: rgba(166,125,68,0.85); letter-spacing: 0.08em; }

/* ══════════ ROLE LANDSCAPE (106×76) ══════════ */
.card-front.land {
  width: 106mm; height: 76mm; flex-direction: column;
  padding: 5mm 6mm; text-align: center;
}
.land-head { display: flex; justify-content: space-between; align-items: center; flex-shrink: 0; }
.land-tag {
  display: flex; align-items: center; gap: 1.8mm;
  font-family: var(--font-en); font-size: 2.4mm; font-weight: 600;
  letter-spacing: 0.08em; color: rgba(200,186,154,0.6); text-transform: uppercase;
}
.land-tag .tag-swatch { width: 3mm; height: 3mm; border-radius: 0.6mm; background: var(--gold); flex-shrink: 0; }
.land-tag .tag-zh { font-family: var(--font-zh); font-size: 2.8mm; color: var(--cream); letter-spacing: 0.04em; }
.land-code { font-family: var(--font-en); font-size: 2.4mm; font-weight: 600; letter-spacing: 0.08em; color: rgba(166,125,68,0.85); }
.land-body { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2.5mm; min-height: 0; padding: 3mm 0; }
.land-name { font-family: var(--font-zh); font-weight: 700; color: var(--cream); font-size: 9mm; line-height: 1.15; }
.land-en { font-family: var(--font-en); font-size: 3mm; font-weight: 600; color: rgba(200,186,154,0.55); margin-top: 1.4mm; letter-spacing: 0.08em; text-transform: uppercase; }
.land-accent { width: 10mm; height: 0.6mm; background: var(--gold); margin: 1.5mm auto 0; border-radius: 0.6mm; }
.land-desc { display: flex; flex-direction: column; align-items: center; gap: 1.8mm; margin-top: 1.5mm; }
.land-desc .c-text { font-family: var(--font-zh); font-weight: 600; color: var(--cream); font-size: 4.5mm; line-height: 1.4; }
.land-foot {
  display: flex; align-items: center; gap: 2mm;
  border-top: 0.25mm solid rgba(166,125,68,0.3); padding-top: 2.5mm; flex-shrink: 0;
}
.land-foot .k-box { width: 7mm; height: 7mm; border: 0.3mm solid var(--gold); border-radius: 1mm; display: flex; align-items: center; justify-content: center; }
.land-foot .k-box img { width: 5mm; height: auto; display: block; filter: brightness(0) invert(1); }
.land-foot .band-zh { font-family: var(--font-zh); font-size: 3mm; font-weight: 600; color: var(--cream); line-height: 1; }
.land-foot .band-en { font-family: var(--font-en); font-size: 1.8mm; color: rgba(200,186,154,0.5); letter-spacing: 0.1em; text-transform: uppercase; }
.land-tv { margin-left: auto; display: flex; border: 0.3mm solid rgba(166,125,68,0.45); border-radius: 1mm; overflow: hidden; }
.land-tv-cell { padding: 1mm 3.5mm; text-align: center; }
.land-tv-cell:first-child { border-right: 0.3mm solid rgba(166,125,68,0.45); }
.land-tv-lbl { font-family: var(--font-en); font-size: 2.8mm; letter-spacing: 0.10em; color: rgba(255,255,255,0.65); text-transform: uppercase; }
.land-tv-val { font-family: var(--font-en); font-size: 6.5mm; font-weight: 800; color: #fff; line-height: 1.05; font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }

/* ══════════ ROLE ROTATE WRAPPER (橫式版面塞進直式卡格) ══════════
   .card-front.land 是 106 寬×76 高，rotate(90deg) 後佔 76 寬×106 高，填滿直式卡格 */
.role-rot {
  width: 76mm; height: 106mm;
  position: relative;
  overflow: hidden;
}
.role-rot .card-front.land {
  position: absolute;
  top: 50%; left: 50%;
  margin: 0;
  transform: translate(-50%, -50%) rotate(90deg);
}

/* ══════════ CARD BACK ══════════ */
.card-back {
  width: 76mm; height: 106mm; border-radius: 4mm; overflow: hidden;
  background-color: var(--back-bg);
  background-image: url('cbk-1-medallion.jpg');
  background-size: 100% 100%;
}

.sheet-info {
  position: absolute; bottom: 5mm; left: 0; right: 0; text-align: center;
  font-family: var(--font-en); font-size: 2.2mm; color: rgba(0,0,0,0.15); letter-spacing: 0.1em;
}
.sheet-info.light { color: rgba(255,255,255,0.1); }
