/* ==================================================
🎛 基礎參數（尺寸 / 字級 / 視覺重心）
================================================== */
:root{
  --w:105mm;
  --h:170mm;

  --cell-h:5.52mm;
  --fs-title:4.6mm;
  --fs-week:2.8mm;
  --fs-day:3.2mm;

  --card:#F3EDE4;
  --month-title:#8B7768;
  --brand:#CBBFB4;
  --offday:#3A322C;
  --memoday:#7A6A5E;
  --termday:#BFAE9F;
}

*{ box-sizing:border-box; }

body{
  margin:0;
  background:#e5e7ea;
  font-family:system-ui,-apple-system,"Noto Sans TC",sans-serif;
}

/* ==================================================
📄 A5 紙張
================================================== */
.paper{
  width:148mm;
  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;
}

/* ==================================================
🖼 版心
================================================== */
.stage{
  width:var(--w);
  display:flex;
  justify-content:center;
}

/* ==================================================
🎴 卡片外框（裁切框 + 白內框）
================================================== */
.card{
  width:var(--w);
  height:var(--h);

  border:1.4mm solid #000;
  box-shadow: inset 0 0 0 0.5mm #fff;

  padding:4mm;
  position:relative;

  display:flex;
  flex-direction:column;

  background:#EADFD2;
}


/* ================================
📌 卡片標頭（瘦身＋上移版）
================================ */
.card_head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;

  padding:2.2mm 4mm 1.2mm;
  line-height:1.1;

  background:transparent;   /* ⭐ 改透明 */
  color:var(--month-title);
  font-weight:700;
}

/* 月曆區 = 吃剩餘高度 */
.months{
  flex:1;                 /* ⭐ 自動填滿剩餘空間 */
  display:grid;
  grid-template-columns:repeat(2,1fr);
  gap:2.0mm;

  align-content:center;   /* ⭐ 垂直置中整個年曆 */

  padding:3mm 4.5mm 2.2mm;

  background:var(--card);
  border-radius:2mm;
  box-shadow:
    0 1.2mm 2mm rgba(0,0,0,.06),
    inset 0 0 0 0.3mm rgba(255,255,255,.5);
}


.month_title{
  display:flex;
  justify-content:space-between;
  font-size:var(--fs-title);
  color:var(--month-title);
  border-bottom:0.45px solid #e0e6e8;
  padding-bottom:.7mm;
  margin-bottom:.7mm;
}

/* ==================================================
📆 日期格
================================================== */
.grid{
  display:grid;
  grid-template-columns:repeat(7,1fr);
  gap:.8mm;
}

.cell{
  height:var(--cell-h);
  display:grid;
  grid-template-rows:1.2fr 1fr;
  align-items:center;
  justify-items:center;
}

.solar,
.holiday_tag{
  width:100%;
  text-align:center;
  font-size:calc(var(--fs-day) + .6mm);
  font-weight:600;
}

.holiday_tag{
  font-size:1.35mm;
  line-height:1;
  min-height:1.35mm;
  display:flex;
  align-items:center;
  justify-content:center;
  white-space:nowrap;
}

.no_tag .holiday_tag{ visibility:hidden; }

/* ==================================================
🗓 星期 & 特殊日
================================================== */
.week{ font-size:var(--fs-week); opacity:.55; }

.cell.sun,.week.sun,
.cell.sat,.week.sat{
  color:#C9825A;
  opacity:.9;
}

.cell.offday{ color:var(--offday); font-weight:700; }
.cell.memoday{ color:var(--memoday); }
.cell.termday{ color:var(--termday); font-weight:600; }

/* ==================================================
🏷 品牌
================================================== */
.brand{
  position:absolute;
  bottom:3mm;
  left:0;
  right:0;
  text-align:center;
  color:#8A766B;
  font-size:2.5mm;          /* ⭐ 微加大 */
  letter-spacing:.22em;     /* 空氣感變多，會更高級 */
  opacity:.82;              /* 印出來才不會糊掉 */

  
}

/* ==================================================
🖨 列印模式
================================================== */
@page{
  size:A5 portrait;
  margin:0;
}

@media print{
  *{
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  body > *:not(.paper){
    display:none !important;
  }

  body{ margin:0; }

  .paper{
    width:148mm;
    height:210mm;
    margin:0;
    box-shadow:none;
  }

  .card{
    border:0.7px solid rgba(80,100,110,.55);
    box-shadow: inset 0 0 0 0.3px rgba(255,255,255,.6);
  }
}