/* ── 多功能日历 ─────────────────────────────────────────────── */
#screen-calendar {
  position: relative;
  z-index: 5;
  width: 100%;
  height: 100%;
  min-height: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.62) 0%, rgba(248, 246, 255, 0.42) 100%);
}

[data-theme="dark"] #screen-calendar {
  background: linear-gradient(180deg, rgba(16, 16, 22, 0.62) 0%, rgba(12, 12, 18, 0.4) 100%);
}

.cal-scroll {
  padding: 8px 14px 28px;
}

.cal-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}

.cal-title {
  flex: 1;
  border: 0;
  background: transparent;
  text-align: center;
  padding: 4px 6px;
  border-radius: 12px;
  color: inherit;
}

.cal-title strong {
  display: block;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.cal-title small {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  font-weight: 600;
  color: #7c4dff;
  letter-spacing: 0.06em;
}

[data-theme="dark"] .cal-title small {
  color: #c4b5ff;
}

.cal-nav,
.cal-today-btn,
.cal-opt-btn,
.cal-view-btn,
.cal-act,
.cal-pm {
  border: 0;
  cursor: pointer;
  font: inherit;
}

.cal-nav {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  color: #222;
  font-size: 22px;
  line-height: 1;
  box-shadow: 0 2px 10px rgba(80, 50, 140, 0.08);
}

[data-theme="dark"] .cal-nav {
  background: rgba(40, 40, 50, 0.85);
  color: #f3f3f7;
}

.cal-today-btn {
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, #7c4dff, #536dfe);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 6px 16px rgba(124, 77, 255, 0.32);
}

.cal-views {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 4px;
  margin-bottom: 8px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.55);
  box-shadow: inset 0 0 0 1px rgba(124, 77, 255, 0.08);
}

[data-theme="dark"] .cal-views {
  background: rgba(255, 255, 255, 0.06);
}

.cal-view-btn {
  height: 32px;
  border-radius: 10px;
  background: transparent;
  color: #555;
  font-size: 13px;
  font-weight: 700;
}

.cal-view-btn.active {
  background: #fff;
  color: #5e35b1;
  box-shadow: 0 4px 12px rgba(94, 53, 177, 0.14);
}

[data-theme="dark"] .cal-view-btn {
  color: #c8c8d0;
}

[data-theme="dark"] .cal-view-btn.active {
  background: #3a2d5c;
  color: #eee6ff;
}

.cal-opt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.cal-opt-btn {
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(124, 77, 255, 0.1);
  color: #5e35b1;
  font-size: 12px;
  font-weight: 700;
}

.cal-opt-btn.on {
  background: rgba(124, 77, 255, 0.2);
}

.cal-jump {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #666;
}

.cal-jump input {
  border: 0;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 8px;
  padding: 4px 6px;
  font-size: 12px;
  color: inherit;
}

[data-theme="dark"] .cal-jump {
  color: #bbb;
}

[data-theme="dark"] .cal-jump input {
  background: rgba(255, 255, 255, 0.08);
  color: #eee;
}

.cal-weekhead,
.cal-row {
  display: grid;
  grid-template-columns: 26px repeat(7, 1fr);
  gap: 3px;
  align-items: stretch;
}

.cal-wh {
  text-align: center;
  font-size: 11px;
  font-weight: 800;
  color: #7a7a86;
  padding: 4px 0 6px;
  letter-spacing: 0.04em;
}

.cal-wh.wk {
  color: #ef6c8b;
}

.cal-wn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  font-size: 11px;
  font-weight: 800;
  color: #7c4dff;
  line-height: 1.05;
}

.cal-wn b {
  font-size: 12px;
}

.cal-wn i {
  font-style: normal;
  font-size: 9px;
  font-weight: 700;
  color: #9a8bb8;
}

.cal-weekhead .cal-wn {
  padding-bottom: 4px;
}

.cal-row.is-on .cal-wn {
  color: #4a148c;
}

.cal-row.is-on .cal-wn i {
  color: #7c4dff;
}

.cal-week-banner {
  text-align: center;
  font-size: 14px;
  font-weight: 800;
  color: #5e35b1;
  margin: 0 0 8px;
  letter-spacing: 0.04em;
}

.cal-week-line {
  display: block !important;
  margin-top: 2px;
  font-size: 12px !important;
  font-weight: 800 !important;
  color: #7c4dff !important;
}

.cal-grid {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.cal-cell {
  position: relative;
  min-height: 54px;
  border: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.62);
  padding: 5px 2px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  color: #1d1d22;
  box-shadow: inset 0 0 0 1px rgba(90, 70, 140, 0.04);
}

[data-theme="dark"] .cal-cell {
  background: rgba(255, 255, 255, 0.05);
  color: #f0f0f5;
}

.cal-cell.is-out {
  opacity: 0.34;
}

.cal-cell.is-weekend .cal-num {
  color: #e85a7a;
}

.cal-cell.is-fest .cal-sub {
  color: #d32f55;
  font-weight: 800;
}

.cal-cell.is-term .cal-sub {
  color: #2e7d32;
  font-weight: 700;
}

.cal-cell.is-today {
  background: linear-gradient(160deg, #7c4dff, #5c6bc0);
  color: #fff;
  box-shadow: 0 8px 18px rgba(92, 107, 192, 0.32);
}

.cal-cell.is-today .cal-num,
.cal-cell.is-today .cal-sub,
.cal-cell.is-today.is-weekend .cal-num,
.cal-cell.is-today.is-fest .cal-sub,
.cal-cell.is-today.is-term .cal-sub {
  color: #fff;
}

.cal-cell.is-sel:not(.is-today) {
  box-shadow: inset 0 0 0 2px #7c4dff;
  background: rgba(124, 77, 255, 0.1);
}

.cal-num {
  font-size: 15px;
  font-weight: 800;
  line-height: 1.15;
}

.cal-sub {
  font-size: 9px;
  font-weight: 600;
  line-height: 1.15;
  color: #8a8498;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cal-sub.muted {
  color: #a8a3b3;
}

.cal-dots {
  position: absolute;
  bottom: 3px;
  display: flex;
  gap: 3px;
}

.cal-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  display: block;
}

.cal-dot.ev { background: #7c4dff; }
.cal-dot.td { background: #26a69a; }
.cal-dot.md { background: #ffb300; }
.cal-dot.dy { background: #42a5f5; }
.cal-cell.is-today .cal-dot { background: #fff; }

.cal-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.cal-week-col {
  min-height: 168px;
  border: 0;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.7);
  padding: 8px 5px;
  text-align: left;
  color: inherit;
  box-shadow: 0 6px 16px rgba(80, 50, 140, 0.06);
}

[data-theme="dark"] .cal-week-col {
  background: rgba(255, 255, 255, 0.05);
}

.cal-week-col.is-today {
  background: linear-gradient(180deg, #7c4dff, #5c6bc0);
  color: #fff;
}

.cal-week-col.is-sel:not(.is-today) {
  box-shadow: inset 0 0 0 2px #7c4dff;
}

.cal-week-hd {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 6px;
}

.cal-week-hd b {
  font-size: 18px;
}

.cal-week-hd span,
.cal-week-sub {
  font-size: 10px;
  font-weight: 700;
  opacity: 0.78;
}

.cal-week-items {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cal-chip {
  display: block;
  font-size: 10px;
  font-weight: 700;
  border-radius: 6px;
  padding: 2px 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cal-chip.ev { background: rgba(124, 77, 255, 0.16); }
.cal-chip.td { background: rgba(38, 166, 154, 0.16); }
.cal-chip.md { background: rgba(255, 179, 0, 0.2); }

.cal-year {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.cal-ymin {
  border: 0;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.7);
  padding: 8px 6px 10px;
  text-align: left;
  color: inherit;
}

[data-theme="dark"] .cal-ymin {
  background: rgba(255, 255, 255, 0.05);
}

.cal-ymin.is-cur {
  box-shadow: inset 0 0 0 2px #7c4dff;
}

.cal-ymin-t {
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 6px;
  color: #5e35b1;
}

.cal-ymin-g {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
}

.cal-ymin-d {
  font-size: 8px;
  text-align: center;
  line-height: 1.6;
  color: #444;
}

.cal-ymin-d.out { opacity: 0.22; }
.cal-ymin-d.today {
  background: #7c4dff;
  color: #fff;
  border-radius: 4px;
  font-weight: 800;
}
.cal-ymin-d.mark { color: #7c4dff; font-weight: 800; }

[data-theme="dark"] .cal-ymin-d { color: #ddd; }

.cal-agenda {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cal-ag-day {
  background: rgba(255, 255, 255, 0.72);
  border-radius: 16px;
  padding: 10px 12px;
}

[data-theme="dark"] .cal-ag-day {
  background: rgba(255, 255, 255, 0.05);
}

.cal-ag-hd {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
}

.cal-ag-hd b { font-size: 15px; }
.cal-ag-hd span { font-size: 12px; font-weight: 700; color: #d32f55; }

.cal-ag-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: rgba(124, 77, 255, 0.06);
  border-radius: 10px;
  padding: 8px 10px;
  margin-top: 5px;
  font-size: 13px;
  font-weight: 650;
  color: inherit;
}

.cal-ag-item.td { background: rgba(38, 166, 154, 0.08); }
.cal-ag-item.dy { background: rgba(66, 165, 245, 0.1); }
.cal-ag-item.md { background: rgba(255, 179, 0, 0.12); }

.cal-ag-empty {
  margin: 4px 0 0;
  font-size: 12px;
  color: #999;
}

.cal-detail {
  margin-top: 12px;
  padding: 14px 14px 16px;
  border-radius: 22px;
  background:
    radial-gradient(120% 80% at 0% 0%, rgba(124, 77, 255, 0.14), transparent 50%),
    rgba(255, 255, 255, 0.78);
  box-shadow: 0 12px 32px rgba(70, 40, 130, 0.1);
}

[data-theme="dark"] .cal-detail {
  background:
    radial-gradient(120% 80% at 0% 0%, rgba(124, 77, 255, 0.22), transparent 50%),
    rgba(28, 28, 36, 0.78);
}

.cal-detail-top {
  margin-bottom: 10px;
}

.cal-detail-date {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cal-detail-date em {
  font-style: normal;
  font-size: 40px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  background: linear-gradient(180deg, #7c4dff, #3949ab);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.cal-detail-date b {
  display: block;
  font-size: 15px;
}

.cal-detail-date span,
.cal-detail-meta {
  font-size: 12px;
  font-weight: 650;
  color: #666;
}

[data-theme="dark"] .cal-detail-date span,
[data-theme="dark"] .cal-detail-meta {
  color: #bbb;
}

.cal-detail-fest {
  margin-top: 8px;
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(211, 47, 85, 0.1);
  color: #c2185b;
  font-size: 12px;
  font-weight: 800;
}

.cal-almanac {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 10px 0 12px;
}

.cal-almanac > div {
  border-radius: 12px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.55);
}

[data-theme="dark"] .cal-almanac > div {
  background: rgba(255, 255, 255, 0.05);
}

.cal-almanac span {
  display: block;
  font-size: 11px;
  font-weight: 800;
  color: #7c4dff;
  margin-bottom: 2px;
}

.cal-almanac b {
  font-size: 12px;
  font-weight: 650;
}

.cal-mood-line {
  font-size: 13px;
  margin-bottom: 8px;
}

.cal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.cal-act {
  height: 38px;
  border-radius: 12px;
  background: #fff;
  color: #4a148c;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(80, 40, 140, 0.08);
}

[data-theme="dark"] .cal-act {
  background: #2a2438;
  color: #eee6ff;
}

.cal-picker {
  margin-bottom: 10px;
  padding: 10px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.8);
}

[data-theme="dark"] .cal-picker {
  background: rgba(255, 255, 255, 0.06);
}

.cal-picker-yr {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 16px;
  font-weight: 800;
}

.cal-picker-ms {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.cal-pm {
  height: 34px;
  border-radius: 10px;
  background: rgba(124, 77, 255, 0.08);
  color: inherit;
  font-weight: 700;
}

.cal-pm.active {
  background: #7c4dff;
  color: #fff;
}

html[data-bg="custom"] #screen-calendar {
  background: transparent !important;
}
