:root{
  --card-w:87mm;
  --card-h:141mm;

  --cell-h:5mm;
  --fs-title:3.8mm;
  --fs-week:2.3mm;
  --fs-day:2.7mm;

  /* 🟣 灰紫書頁系 */
  --card:#F6F4F9;
  --month-title:#332C3E;
  --brand:#5A5068;
  --offday:#111111;
  --memoday:#000000;
  --termday:#3F364C;
}

*{ box-sizing:border-box; }

body{
  margin:0;
  background:#e5e7ea;
  font-family:system-ui,-apple-system,"Noto Sans TC",sans-serif;
}

/* A4 紙 */
.paper{
  width:297mm;
  height:210mm;
  background:#fff;
  box-shadow:0 10px 40px rgba(0,0,0,.15);
  margin:30px auto;
  display:flex;
  align-items:center;
  justify-content:center;
}

/* 書頁外框 */
.book_page{
  /* ⭐ 不再撐滿紙張，只包內容 */
  width:max-content;
  height:max-content;

  display:flex;
  align-items:center;
  justify-content:center;

  /* ⭐ 書頁外框改灰紫石墨色 */
  border:2.2mm solid #3F364C;
  box-shadow: inset 0 0 0 0.8mm #F6F4F9;

  padding:4mm 6mm;   /* 書頁邊距感 */
  position:relative;

  margin:auto;         /* 置中 */
  background:#ECE7F2;  /* 比卡片底深一點點的灰紫紙色 */
}



/* 兩張卡 */
.stage{
  display:flex;
  gap:8mm;
  background:#ECE7F2;  /* ⭐ 填滿中縫 */
  padding:0 2mm;       /* 讓中線不貼卡片 */
}

/* 卡片 */
.card{
  width:var(--card-w);
  height:var(--card-h);
  border:0.45mm solid #6E647F;   /* ⭐ 改細＋改成灰紫墨 */
 box-shadow: inset 0 0 0 0.25mm #FFFFFF; /* 保留白內框但變細 */
  padding:3.2mm;
  position:relative;
  display:flex;
  flex-direction:column;
  background:#DCD6E3;
  border-radius:2mm;   /* 很小的圓角，會像印刷邊界而不是UI框 */

}

.card_head{
  display:flex;
  justify-content:space-between;
  padding:1.6mm 3mm .8mm;
  color:var(--month-title);
  font-weight:700;
}

/* 月曆區 */
.months{
  flex:1;
  display:grid;
  grid-template-columns:repeat(2,1fr);
  gap:1.6mm;
  align-content:center;
  padding:2.2mm 3.2mm 1.6mm;
  background:var(--card);
  border-radius:2mm;
}

.month_title{
  display:flex;
  justify-content:space-between;
  font-size:var(--fs-title);
  color:var(--month-title);
  border-bottom:0.35px solid #B9B1C7;
  margin-bottom:.5mm;
}

.grid{
  display:grid;
  grid-template-columns:repeat(7,1fr);
  gap:.6mm;
}

.cell{
  height:var(--cell-h);
  display:grid;
  grid-template-rows:1.2fr 1fr;
  align-items:center;
  justify-items:center;
}

.solar{
  font-size:calc(var(--fs-day) + .4mm);
  font-weight:600;
}

/* 節日小字（關鍵） */
.holiday_tag{
  font-size:1.12mm;
  font-weight:700;
  line-height:1;
  color:#000;
}

.week{
  font-size:var(--fs-week);
  opacity:.6;
  color:#3F364C;
}

.cell.sun,.week.sun,
.cell.sat,.week.sat{
  color:#3F364C;
}

.cell.memoday{ color:var(--memoday); }

/* 品牌 */
.brand{
  position:absolute;
  bottom:2.6mm;
  width:100%;
  text-align:center;
  font-size:2mm;
  letter-spacing:.2em;
  opacity:.85;
  color:var(--brand);
}

/* 列印 */
@page{
  size:A4 landscape;
  margin:0;
}

@media print{
  *{
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  body > *:not(.paper){
    display:none !important;
  }

  .paper{
    width:297mm;
    height:210mm;
    margin:0;
    box-shadow:none;
  }
}