/*!
 * CalEpoch 可嵌入日历组件样式 v2
 * 全部选择器以 .ce-cal / .ce-modal 前缀作用域，避免污染宿主页面
 */
.ce-calendar {
  font-family: -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #1f2733;
  background: #fff;
  border: 1px solid #e3e8ef;
  border-radius: 12px;
  padding: 14px;
  max-width: 960px;
}

.ce-calendar * { box-sizing: border-box; }

.ce-cal-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.ce-cal-titlewrap { display: flex; flex-direction: column; gap: 2px; }

.ce-cal-title { font-weight: 700; font-size: 17px; }

.ce-cal-name { color: #6b7787; font-size: 12.5px; }

.ce-cal-spacer { flex: 1 1 auto; }

.ce-cal-nav { display: flex; gap: 6px; }

.ce-cal-btn {
  border: 1px solid #e3e8ef;
  background: #f6f7f9;
  color: #33445a;
  border-radius: 6px;
  font-size: 13px;
  padding: 4px 10px;
  cursor: pointer;
  line-height: 1.4;
}

.ce-cal-btn:hover { background: #eef1f5; }

.ce-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border-top: 1px solid #eef1f5;
  border-left: 1px solid #eef1f5;
}

.ce-cal-cell {
  border-right: 1px solid #eef1f5;
  border-bottom: 1px solid #eef1f5;
  min-height: 84px;
  padding: 6px;
  font-size: 12px;
  overflow: hidden;
  position: relative;
}

.ce-cal-cell.ce-cal-weekday {
  min-height: 0;
  padding: 6px 8px;
  font-weight: 600;
  font-size: 12px;
  color: #6b7787;
  background: #fafbfc;
  text-align: center;
}

.ce-cal-cell.ce-cal-out { background: #fbfcfd; }
.ce-cal-cell.ce-cal-out .ce-cal-daynum { color: #b7c0cc; }

.ce-cal-cell.ce-cal-clickable { cursor: pointer; }
.ce-cal-cell.ce-cal-clickable:hover { background: #f5f9fe; }

.ce-cal-daynum {
  font-size: 12px;
  color: #6b7787;
  margin-bottom: 4px;
  display: inline-block;
}

.ce-cal-cell.ce-cal-today .ce-cal-daynum {
  color: #fff;
  background: #3a6ea5;
  border-radius: 4px;
  padding: 0 5px;
}

.ce-cal-chip {
  display: block;
  font-size: 11.5px;
  line-height: 1.4;
  background: #eef4fb;
  color: #2b5581;
  border-left: 2px solid #3a6ea5;
  border-radius: 3px;
  padding: 2px 5px;
  margin-bottom: 3px;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ce-cal-chip:hover { background: #e2edf9; }

.ce-cal-chip.ce-cal-chip-off {
  background: #f3f4f6;
  color: #98a2b3;
  border-left-color: #c3cad5;
  text-decoration: line-through;
}

.ce-cal-more { font-size: 11px; color: #6b7787; }

.ce-cal-foot {
  margin-top: 10px;
  font-size: 11.5px;
  color: #6b7787;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.ce-cal-link { color: #2b5581; text-decoration: none; }
.ce-cal-link:hover { text-decoration: underline; }

.ce-cal-empty,
.ce-cal-loading {
  padding: 28px;
  text-align: center;
  color: #6b7787;
  font-size: 13px;
}

/* ---------------- 弹框 ---------------- */

.ce-modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(20, 26, 34, .45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}

.ce-modal {
  width: 100%;
  max-width: 460px;
  max-height: 90vh;
  overflow: auto;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 18px 50px rgba(16, 24, 40, .22);
  font-family: -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #1f2733;
}

.ce-modal-head {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid #eef1f5;
}

.ce-modal-title { font-weight: 700; font-size: 15px; flex: 1 1 auto; }

.ce-modal-close {
  border: 0;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  color: #6b7787;
  cursor: pointer;
  padding: 0 4px;
}

.ce-modal-body { padding: 14px 16px; }

.ce-field { margin-bottom: 12px; }

.ce-label {
  display: block;
  font-size: 12px;
  color: #6b7787;
  margin-bottom: 4px;
}

.ce-input {
  width: 100%;
  border: 1px solid #e3e8ef;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  font-family: inherit;
  color: #1f2733;
  background: #fff;
}

.ce-input:focus { outline: 2px solid #cfe1f5; border-color: #9dbde0; }

.ce-textarea { resize: vertical; }

.ce-row { display: flex; gap: 10px; margin-bottom: 12px; }
.ce-col { flex: 1 1 0; min-width: 0; }

.ce-modal-err {
  color: #b42318;
  font-size: 12.5px;
  min-height: 18px;
}

.ce-modal-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid #eef1f5;
}

.ce-modal-hint { flex: 1 1 auto; font-size: 12px; color: #6b7787; }

.ce-btn-primary,
.ce-btn-ghost,
.ce-btn-danger {
  border-radius: 8px;
  font-size: 13px;
  padding: 7px 14px;
  cursor: pointer;
  border: 1px solid transparent;
  font-family: inherit;
}

.ce-btn-primary { background: #3a6ea5; color: #fff; }
.ce-btn-primary:hover { background: #325f8f; }
.ce-btn-primary:disabled { opacity: .6; cursor: not-allowed; }

.ce-btn-ghost { background: #fff; border-color: #e3e8ef; color: #33445a; }
.ce-btn-ghost:hover { background: #f6f7f9; }

.ce-btn-danger { background: #fff; border-color: #f3c6c1; color: #b42318; }
.ce-btn-danger:hover { background: #fef3f2; }
