#card-calendar {
  margin-bottom: 1rem;
}

#card-calendar .cal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: bold;
  margin-bottom: 8px;
  font-size: 0.9rem;
}

#card-calendar .cal-header button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.4rem;
  color: var(--font-color);
  padding: 0 4px;
  line-height: 1;
  transition: color 0.2s;
}

#card-calendar .cal-header button:hover {
  color: var(--theme-color, #d97f50);
}

/* 关键修复：用 separate 代替 collapse，避免 overflow 被裁切 */
#card-calendar .cal-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.8rem;
  text-align: center;
  table-layout: fixed;
}

#card-calendar .cal-table th {
  color: var(--theme-color, #d97f50);
  padding: 4px 0;
  font-weight: 600;
  font-size: 0.75rem;
}

#card-calendar .cal-table td {
  padding: 3px 0;
  overflow: visible; /* 允许角标溢出 */
}

/* 用 inner div 承载圆形，不直接加在 td 上 */
#card-calendar .cal-day-inner {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  margin: auto;
}

#card-calendar .cal-table td.cal-today .cal-day-inner {
  background-color: var(--theme-color, #d97f50);
  color: #fff;
  font-weight: bold;
}

/* 节假日文字颜色 */
#card-calendar .cal-table td.cal-is-holiday .cal-day-inner {
  color: #9a2d28;
}

/* 调休文字颜色 */
#card-calendar .cal-table td.cal-is-makeup .cal-day-inner {
  color: #eca93b;
}

/* 角标通用 */
#card-calendar .cal-badge {
  position: absolute;
  top: -4px;
  right: -6px;
  font-size: 9px;
  border-radius: 3px;
  padding: 0 2px;
  line-height: 1.5;
  font-weight: bold;
  pointer-events: none;
}

#card-calendar .cal-rest {
  background: #9a2d28;
  color: #fff;
}

#card-calendar .cal-work {
  background: #eca93b;
  color: #fff;
}