.tp-pop {
  --tp-red: #c8102e;
  --tp-red-dark: #9e0b23;
  --tp-ink: #25262b;
  --tp-muted: #62656d;
  --tp-tint: #fceef0;
  --tp-line: #eadfe1;
  --tp-white: #ffffff;
  font-family: "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  color: var(--tp-ink);
  line-height: 1.5;
}
.tp-pop *,
.tp-pop *::before,
.tp-pop *::after {
  box-sizing: border-box;
}
.tp-pop[hidden] {
  display: none;
}

.tp-pop__overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: transparent;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.tp-pop__wrap {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 144px 16px 16px;
  pointer-events: none;
}
.tp-pop__stage {
  position: relative;
  width: 100%;
  max-width: 400px;
  opacity: 0;
  transform: translateY(12px);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}
.tp-pop__dialog {
  position: relative;
  z-index: 1;
  max-height: calc(100vh - 104px);
  display: flex;
  flex-direction: column;
  background: var(--tp-white);
  border-radius: 20px;
  pointer-events: auto;
}
.tp-pop__dialog:focus,
.tp-pop__dialog:focus-visible {
  outline: none;
}
.tp-pop.is-open .tp-pop__overlay {
  opacity: 1;
}
.tp-pop.is-open .tp-pop__stage {
  opacity: 1;
  transform: none;
}

/* 內容區（超出高度時在這裡捲動） */
.tp-pop__body {
  min-height: 0;
  overflow-y: auto;
  padding: 32px 24px 20px;
  border-radius: inherit;
}

/* 關閉按鈕 */
.tp-pop__close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--tp-white);
  color: var(--tp-muted);
  cursor: pointer;
}
.tp-pop__close:hover {
  background: #f2f2f4;
  color: var(--tp-ink);
}

/* CB超人從卡片後方冒出：去背 PNG，建議輸出 280×280（2 倍圖）
top 決定露出多少：-76px = 露出上方 76px，其餘藏在卡片後面 */
.tp-pop__mascot {
  position: absolute;
  z-index: 0;
  top: -132px;
  left: 50%;
  width: 200px;
  height: 200px;
  margin-left: -85px;
  pointer-events: none;
  transform: translateY(136px);
}
.tp-pop.is-open .tp-pop__mascot {
  animation: tp-pop-rise 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s forwards;
}
@keyframes tp-pop-rise {
  to {
    transform: none;
  }
}
.tp-pop__mascot img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
/* 示意用佔位，放入正式圖後可刪除 */
.tp-pop__mascot-ph {
  width: 100%;
  height: 100%;
  display: grid;
  justify-items: center;
  align-content: start;
  padding-top: 24px;
  border-radius: 50%;
  background: var(--tp-tint);
  border: 2px dashed #e3a9b2;
  color: var(--tp-red);
  font-size: 13px;
  text-align: center;
  line-height: 1.4;
}

/* 標題 */
.tp-pop__title {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
  text-wrap: balance;
}
.tp-pop__sub {
  margin: 0 0 24px;
  font-size: 15px;
  color: var(--tp-muted);
  text-align: center;
  text-wrap: balance;
}

/* 局部月曆 */
.tp-pop__cal {
  position: relative;
  background: var(--tp-tint);
  border-radius: 14px;
  padding: 14px 12px 36px;
}
.tp-pop__month {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin: 0 4px 8px;
  color: var(--tp-red);
  font-weight: 700;
}
.tp-pop__month-num {
  font-size: 32px;
  line-height: 1;
}
.tp-pop__month-unit {
  font-size: 16px;
}
.tp-pop__month-year {
  margin-left: 6px;
  font-size: 13px;
  font-weight: 400;
  color: var(--tp-muted);
}

.tp-pop__table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}
.tp-pop__table th {
  padding: 4px 0 6px;
  font-size: 12px;
  font-weight: 400;
  color: var(--tp-muted);
  text-align: center;
}
.tp-pop__table td {
  padding: 3px 0;
  text-align: center;
}
.tp-pop__d {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  font-size: 15px;
}
.tp-pop__d--out {
  color: #8a8d94;
}
.tp-pop__d--hol {
  background: var(--tp-red);
  color: var(--tp-white);
  font-weight: 700;
}
.tp-pop {
  --tp-alt: #ffc402;
}
.tp-pop__d--alt {
  background: var(--tp-alt);
}
.tp-pop__legend li.tp-pop__legend--alt::before {
  background: var(--tp-alt);
}
.tp-pop__d--start {
  border-radius: 18px 0 0 18px;
}
.tp-pop__d--end {
  border-radius: 0 18px 18px 0;
}
.tp-pop__d--start.tp-pop__d--end {
  border-radius: 18px;
}

/* 佈置貼紙：去背 PNG，建議輸出 2 倍圖（例如顯示 60px → 輸出 120×120）
位置與角度都在各自的 --1 ~ --4 調整 */
.tp-pop__deco {
  position: absolute;
  z-index: 1;
  object-fit: contain;
  pointer-events: none;
}
.tp-pop__deco--1 {
  top: -20px;
  right: -12px;
  width: 80px;
  height: 80px;
  transform: rotate(12deg);
}
.tp-pop__deco--2 {
  top: 4px;
  right: 60px;
  width: 60px;
  height: 60px;
  transform: rotate(-10deg);
}
.tp-pop__deco--3 {
  bottom: -24px;
  right: -10px;
  width: 70px;
  height: 70px;
  transform: rotate(-8deg);
}
.tp-pop__deco--4 {
  bottom: -40px;
  left: -12px;
  width: 80px;
  height: 80px;
  transform: rotate(10deg);
}
/* 示意用佔位，放入正式圖後可刪除 */
.tp-pop__deco--ph {
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--tp-white);
  border: 2px dashed #e3a9b2;
  color: var(--tp-red);
  font-size: 11px;
  font-weight: 700;
}

.tp-pop__gap td {
  padding: 0;
}
.tp-pop__gap span {
  display: block;
  height: 14px;
  background: radial-gradient(circle, #d9b7bd 1.5px, transparent 2px) center /
    12px 14px repeat-x;
}

/* 連假說明 */
.tp-pop__legend {
  margin: 12px 4px 0;
  padding: 0;
  list-style: none;
  font-size: 13px;
}
.tp-pop__legend li > span {
  display: flex;
  flex-wrap: wrap;
  column-gap: 8px;
}
.tp-pop__legend li > span > span {
  white-space: nowrap;
}
.tp-pop__legend li {
  display: flex;
  gap: 8px;
  align-items: center;
}
.tp-pop__legend li + li {
  margin-top: 4px;
}
.tp-pop__legend strong {
  font-weight: 700;
}
.tp-pop__legend li::before {
  content: "";
  flex: none;
  width: 14px;
  height: 8px;
  border-radius: 4px;
  background: var(--tp-red);
}

/* 按鈕 */
.tp-pop__actions {
  display: grid;
  gap: 8px;
  margin-top: 36px;
}
.tp-pop__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  border-radius: 24px;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.tp-pop__btn--primary {
  position: relative;
  overflow: hidden;
  gap: 6px;
  box-shadow: 0 6px 16px rgba(200, 16, 43, 0.35);
  transition:
    transform.1s ease,
    box-shadow 0.1s ease;
  background: var(--tp-red);
  color: var(--tp-white);
  border: 0;
}
.tp-pop__btn--primary::before {
  content: "";
  position: absolute;
  top: 0;
  left: -60%;
  width: 40%;
  height: 100%;
}
.tp-pop__btn--primary:hover {
  background: var(--tp-red-dark);
}
.tp-pop__btn--ghost {
  background: transparent;
  color: var(--tp-muted);
  border: 0;
  font-weight: 400;
}
.tp-pop__btn--ghost:hover {
  color: var(--tp-ink);
}

.tp-pop :focus-visible:not(.tp-pop__dialog) {
  outline: 3px solid #1a5fb4;
  outline-offset: 2px;
}

.tp-pop__sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 360px) {
  .tp-pop__body {
    padding: 28px 16px 16px;
  }
  .tp-pop__mascot {
    width: 150px;
    height: 150px;
    margin-left: -75px;
    top: -116px;
  }
  .tp-pop__title {
    font-size: 20px;
  }
  .tp-pop__d {
    height: 32px;
    font-size: 14px;
  }
  .tp-pop__deco {
    scale: 0.85;
  }
}
@media (max-height: 700px) {
  .tp-pop__stage {
    zoom: 0.7;
  }
  .tp-pop__wrap {
    padding-top: 124px;
  }
  .tp-pop__dialog {
    max-height: calc(100dvh - 140px);
  }
  .tp-pop__mascot {
    width: 200px;
    height: 200px;
    /* margin-left: -73px; */
    top: -140px;
  }
  .tp-pop__body {
    padding: 24px 20px 16px;
  }
  .tp-pop__title {
    font-size: 19px;
  }
  .tp-pop__sub {
    font-size: 14px;
    margin-bottom: 16px;
  }
  .tp-pop__month-num {
    font-size: 26px;
  }
  .tp-pop__table td {
    padding: 2px 0;
  }
  .tp-pop__d {
    height: 30px;
    font-size: 14px;
  }
  .tp-pop__cal {
    padding-bottom: 30px;
  }
  .tp-pop__deco {
    scale: 0.8;
  }
  .tp-pop__actions {
    margin-top: 28px;
    gap: 4px;
  }
  .tp-pop__btn {
    min-height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tp-pop__overlay,
  .tp-pop__stage {
    transition: none;
  }
  .tp-pop__stage {
    transform: none;
  }
  .tp-pop__mascot {
    transform: none;
  }
  .tp-pop.is-open .tp-pop__mascot {
    animation: none;
  }
}
