body {
  transform: scale(1.125);
  transform-origin: top left;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background-color: #000000;
}

/* 전체 작업 영역 */
.workspace {
  position: relative;
  width: 100%;
  height: 100%;
  background-color: #000;
}

/* 배경 그리드 */
.background-grid {
  position: absolute;
  top: 50px;
  left: 50px;
  width: 100%;
  height: 100%;
  background-image:
    repeating-linear-gradient(to right, #fff 0, #fff 2px, transparent 2px, transparent 51mm),
    repeating-linear-gradient(to bottom, #fff 0, #fff 2px, transparent 2px, transparent 51mm);
  background-size: 51mm 51mm;
  background-position: 0 0;
  z-index: 0;
}

/* 좌상단 기준선 */
.cross-guides {
  position: absolute;
  top: 51px;
  left: 51px;
  z-index: 2;
}
.cross-guides::before,
.cross-guides::after {
  content: "";
  position: absolute;
  background-color: #fff;
}
.cross-guides::before {
  width: 40px;
  height: 2px;
  top: -1px;
  left: -40px;
}
.cross-guides::after {
  width: 2px;
  height: 40px;
  top: -40px;
  left: -1px;
}

/* 기본 종이(A4) */
.paper {
  position: absolute;
  top: 50px;
  left: 50px;
  width: 297mm;
  height: 210mm;
  background-color: #fff8d6;
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
  font-size: 70px;
  padding: 8px;
  transition: all 0.5s ease;
}

/* 안내문 박스 */
.intro-box {
  position: absolute;
  top: 0;
  left: 0;
  width: 50%;
  height: 100%;
  background-color: #ffffff; /* 불투명 배경 */
  color: #000;
  padding: 0px 20px 20px 20px;
  font-family: "neutronic-hangeul-condensed", sans-serif;
  font-weight: 700;
  font-size: 22px;
  line-height: 1.6;
  z-index: 4;
  box-sizing: border-box;
}

/* 본문 텍스트 박스 */
.overlay-textbox {
  position: absolute;
  top: 0;
  left: 0;
  width: 50%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.7); /* 반투명 */
  color: #000;
  padding: 0px 20px 20px 20px;
  font-family: "neutronic-hangeul-condensed", sans-serif;
  font-weight: 600;
  font-size: 22px;
  line-height: 1.6;
  z-index: 3;
  box-sizing: border-box;
  display: none; /* 기본은 숨김 */
}

/* 하이라이트 */
.highlight {
  position: relative;
  display: inline-block;
  background-color: #000000;
  color: #ffffff;
  padding: 0px 5px;
  border-radius: 2px;
  font-weight: 400;
  cursor: pointer;
}

/* hover 시 살짝 밝아지는 효과 */
.highlight:hover {
  background-color: #f8b6ff;
  color: #000000;
}

/* 하이라이트 이미지 프리뷰 — 미니멀 버전 */
.img-preview {
  position: absolute;
  top: 120%;
  left: 0;
  width: 400px;           /* 통일된 프레임 크기 */
  height: 400px;
  display: flex;
  justify-content: flex-start; /* 가로: 왼쪽 정렬 */
  align-items: flex-start;     /* 세로: 위쪽 정렬 */
  background: transparent;     /* 완전 투명 */
  border: none;                /* 테두리 제거 */
  border-radius: 0;            /* 모서리 각지게 */
  overflow: hidden;            /* 혹시 이미지 삐져나오면 자름 */
  box-shadow: none;            /* 그림자 제거 */
  z-index: 999;
}

/* 이미지 비율 유지 + 좌상단 정렬 */
.img-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;         /* 원본 비율 유지 (안 잘림) */
  object-position: left top;   /* 좌상단 기준으로 정렬 */
  display: block;
}



/* 눈금표시 */
.scale {
  position: absolute;
  display: flex;
  align-items: center;
  color: #fff;
  font-family: "din-condensed", sans-serif;
  font-size: 30px;
  font-weight: 500;
  pointer-events: none;
}

/* 가로 눈금 */
.scale-x {
  top: -40px;
  right: 0px;
  justify-content: flex-end;
}

.scale-x .value {
  text-align: right;
  margin-right: 6px;
}

.scale-x .divider {
  width: 2px;
  height: 40px;
  background-color: #fff;
  margin-left: 5px;
}

.scale-x .unit {
  text-align: left;
  margin-right: 6px;
}

/* 세로 눈금 */
.scale-y {
  bottom: 0px ;
  left: -46px;
  flex-direction: column;
  align-items: center;
}

.scale-y .value {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  text-align: right;
  margin-bottom: 6px;
}

.scale-y .divider {
  width: 40px;
  height: 2px;
  background-color: #fff;
  margin: 0 6px;
}

.scale-y .unit {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  text-align: left;
  margin-bottom: 10px;
}

/* 이름표시 */
.label {
  position: absolute;
  bottom: 20px;
  right: 20px;
  display: flex;
  align-items: center;
  gap: 3px;
  color: #000000;
  font-size: 60px;
}

.label .tag {
  display: none;
  background-color: #f8b6ff;
  padding: 6px 6px;
  font-family: "neutronic-hangeul-condensed", sans-serif;
  font-weight: 800;
  font-size: 53px;
}

.label .en {
  font-family: "din-condensed", sans-serif;
  font-weight: 400;
  position: relative;
  top: 2px;
}

/* 미디어쿼리 */

/* 1단계 A4 (기본) */
.paper { background-color: #fff8d6; }
.label .tag { display: inline; }
.label .tag::before { content: "국배판"; }
.label .en::before { content: "A4"; }
.scale-x .value::before { content: "297"; }
.scale-x .unit::before { content: "mm"; }
.scale-y .value::before { content: "mm"; }
.scale-y .unit::before { content: "210"; }

/* 2단계 4x6배판 */
@media screen and (max-width: 1350px) {
  .paper { 
    width: 257mm; 
    height: 188mm; 
    background-color: #f8b6ff; }
  .label .tag { display: inline; content: "배판"; }
  .label .tag::before { content: "배판"; }
  .label .en::before { content: "4x6"; }
  .scale-x .value::before { content: "257"; }
  .scale-y .unit::before { content: "188"; }
}

/* 3단계 B5 */
@media screen and (max-width: 1300px) {
  .paper { 
    width: 257mm; 
    height: 182mm;
    background-color: #c1c1c1; }
  .label .tag { display: none; }
  .label .en::before { content: "B5"; }
  .scale-x .value::before { content: "257"; }
  .scale-y .unit::before { content: "182"; }
}

/* 4단계 18절판(크라운판) */
@media screen and (max-width: 1250px) {
  .paper { 
    width: 248mm; 
    height: 176mm; 
    background-color: #f8b6ff; }
  .label .tag { display: inline; content: "절판 ( 크라운판 )"; }
  .label .tag::before { content: "절판 (크라운판)"; }
  .label .en::before { content: "18"; }
  .scale-x .value::before { content: "248"; }
  .scale-y .unit::before { content: "176"; }
}

/* 5단계 신국판 */
@media screen and (max-width: 1200px) {
  .paper { 
    width: 225mm; 
    height: 152mm; 
    background-color: #f8b6ff; }
  .label .tag { display: inline; content: "신국판"; }
  .label .tag::before { content: "신국판"; }
  .label .en::before { content: none; }
  .scale-x .value::before { content: "225"; }
  .scale-y .unit::before { content: "152"; }
}

/* 6단계 A5 */
@media screen and (max-width: 1150px) {
  .paper { 
    width: 210mm; 
    height: 148mm; 
    background-color: #fff8d6; }
  .label .tag { display: inline; content: "국판"; }
  .label .tag::before { content: "국판"; }
  .label .en::before { content: "A5"; }
  .scale-x .value::before { content: "210"; }
  .scale-y .unit::before { content: "148"; }
}

/* 7단계 4x6판 */
@media screen and (max-width: 1100px) {
  .paper { 
    width: 188mm; 
    height: 128mm; 
    background-color: #f8b6ff; }
  .label .tag { display: inline; content: "판"; }
  .label .tag::before { content: "판"; }
  .label .en::before { content: "4x6"; }
  .scale-x .value::before { content: "188"; }
  .scale-y .unit::before { content: "128"; }
}

/* 8단계 B6 */
@media screen and (max-width: 1000px) {
  .paper { 
    width: 182mm; 
    height: 128mm; 
    background-color: #c1c1c1; }
  .label .tag { display: none; }
  .label .en::before { content: "B6"; }
  .scale-x .value::before { content: "182"; }
  .scale-y .unit::before { content: "128"; }
}

/* 9단계 A6 */
@media screen and (max-width: 900px) {
  .paper { 
    width: 148mm; 
    height: 105mm; 
    background-color: #fff8d6; }
  .label .tag { display: inline; content: "국반판"; }
  .label .tag::before { content: "국반판"; }
  .label .en::before { content: "A6"; }
  .scale-x .value::before { content: "148"; }
  .scale-y .unit::before { content: "105"; }
}

/* 10단계 B7 */
@media screen and (max-width: 800px) {
  .paper { 
    width: 128mm; 
    height: 91mm; 
    background-color: #c1c1c1; }
  .label .tag { display: none; }
  .label .en::before { content: "B7"; }
  .scale-x .value::before { content: "128"; }
  .scale-y .unit::before { content: "91"; }
}

/* 11단계 A7 */
@media screen and (max-width: 700px) {
  .paper { 
    width: 105mm; 
    height: 74mm; 
    background-color: #fff8d6; }
  .label .tag { display: none; }
  .label .en::before { content: "A7"; }
  .scale-x .value::before { content: "105"; }
  .scale-y .unit::before { content: "74"; }
}

/* 12단계 B8 */
@media screen and (max-width: 600px) {
  .paper { 
    width: 91mm; 
    height: 64mm; 
    background-color: #c1c1c1; }
  .label .tag { display: none; }
  .label .en::before { content: "B8"; }
  .scale-x .value::before { content: "91"; }
  .scale-y .unit::before { content: "64"; }
}