/* ===== 全局基础 ===== */
* {
  box-sizing: border-box;
}

body.calendar-dark {
  background: radial-gradient(circle at top, #111 0, #000 55%, #050505 100%);
  color: #eee;
}
body.calendar-light {
  background: radial-gradient(circle at top, #f5f7ff 0, #e4e7f5 40%, #d8dde8 100%);
  color: #222;
}

/* ===== 主容器 ===== */
#calendar-app {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

#calendar-container {
  width: 980px;
  max-width: 96vw;
  padding: 24px;
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(22px) saturate(130%);
  -webkit-backdrop-filter: blur(22px) saturate(130%);
  box-shadow:
    0 20px 45px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.06);
  color: inherit;
}

/* ===== 顶部栏 ===== */
#calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.calendar-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

#calendar-title {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 1px;
}

.calendar-header-right {
  display: flex;
  gap: 8px;
}

/* ===== 按钮样式 ===== */
.nav-btn,
.tool-btn {
  border: none;
  cursor: pointer;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 16px;
  color: #fff;
  background: linear-gradient(135deg, #4c8dff, #7f5dff);
  box-shadow: 0 4px 12px rgba(76, 141, 255, 0.5);
  transition: all 0.2s ease;
}
.nav-btn:hover,
.tool-btn:hover {
  transform: translateY(-1px) scale(1.03);
  box-shadow: 0 6px 16px rgba(76, 141, 255, 0.7);
}
.tool-btn {
  font-size: 14px;
  padding: 5px 10px;
}

/* ===== 主体布局：左日历 + 右事件 ===== */
.calendar-body {
  display: grid;
  grid-template-columns: 2fr 1.5fr;
  gap: 18px;
}

/* 左侧日历玻璃卡片 */
.calendar-panel {
  padding: 18px;
  border-radius: 20px;
  background: rgba(15, 18, 35, 0.55);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.55);
}

/* 右侧事件面板 */
.event-panel {
  padding: 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

.event-panel-header {
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 12px;
}

/* ===== 日历网格 ===== */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  text-align: center;
}

/* 星期栏 */
.weekday {
  font-weight: 600;
  padding: 10px 0;
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.06);
}

/* 日期格子 */
.day {
  position: relative;
  padding: 12px 0 18px;
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.85);
  background: radial-gradient(circle at top, rgba(255, 255, 255, 0.12) 0, rgba(18, 22, 40, 0.95) 55%);
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
  border: 1px solid rgba(255, 255, 255, 0.04);
}
.day:hover {
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.65);
  transform: translateY(-2px);
}

/* 今天 */
.today {
  border: 1px solid #4c8dff;
  box-shadow: 0 0 0 1px rgba(76, 141, 255, 0.7), 0 10px 24px rgba(76, 141, 255, 0.7);
}

/* 节假日 */
.holiday {
  background: radial-gradient(circle at top, rgba(255, 120, 120, 0.25), rgba(18, 22, 40, 0.95) 55%);
  color: #ffb1b1;
}

/* 有事件的小圆点 */
.event-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4c8dff;
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  box-shadow: 0 0 6px rgba(76, 141, 255, 0.9);
}

/* ===== 右侧事件列表 ===== */
#event-list {
  max-height: 360px;
  overflow-y: auto;
}

.event-item {
  padding: 10px 10px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.18);
  margin-bottom: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
}
.event-item-title {
  font-size: 14px;
  font-weight: 500;
}
.event-item-desc {
  font-size: 12px;
  opacity: 0.8;
}
.event-item-time {
  font-size: 11px;
  opacity: 0.6;
}
.event-item-delete {
  position: absolute;
  right: 8px;
  top: 8px;
  border: none;
  background: transparent;
  color: #ff9b9b;
  cursor: pointer;
  font-size: 12px;
}

/* ===== 弹窗 ===== */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}
.modal.hidden {
  display: none;
}
.modal-content.glass {
  width: 360px;
  padding: 18px 18px 14px;
  border-radius: 18px;
  background: rgba(10, 13, 30, 0.85);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.75);
  color: #fff;
}
.modal-content h3 {
  margin: 0 0 6px;
}
#modal-date {
  font-size: 12px;
  opacity: 0.8;
  margin-bottom: 10px;
}
.modal-content input,
.modal-content textarea {
  width: 100%;
  border-radius: 10px;
  border: none;
  padding: 8px 10px;
  margin-bottom: 10px;
  font-size: 13px;
  outline: none;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}
.modal-content textarea {
  min-height: 70px;
  resize: vertical;
}
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.modal-btn {
  border: none;
  border-radius: 999px;
  padding: 6px 14px;
  cursor: pointer;
  font-size: 13px;
}
.modal-btn.cancel {
  background: rgba(255, 255, 255, 0.12);
  color: #ddd;
}
.modal-btn.confirm {
  background: linear-gradient(135deg, #4c8dff, #7f5dff);
  color: #fff;
}

/* 年视图 */
.year-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.year-month {
  padding: 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}
.year-month:hover {
  transform: translateY(-2px);
  background: rgba(76, 141, 255, 0.3);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.55);
}

/* 简单淡入动画 */
.fade {
  animation: fadeIn 0.28s ease-out;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
