:root {
  color-scheme: light;
  --ink: #0c1b24;
  --muted: #3a4a57;
  --paper: #e8fbff;
  --card: rgba(255, 255, 255, 0.78);
  --accent: #39d2c6;
  --accent-dark: #0f9ea0;
  --leaf: #3ec7ff;
  --night: #082735;
  --sun: #ff7fc4;
  --shadow: 0 20px 45px rgba(8, 39, 53, 0.18);
  --radius: 20px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 12%, rgba(57, 210, 198, 0.35), transparent 45%),
    radial-gradient(circle at 88% 10%, rgba(111, 240, 255, 0.4), transparent 40%),
    radial-gradient(circle at 80% 80%, rgba(255, 127, 196, 0.25), transparent 45%),
    linear-gradient(145deg, #dff9ff 0%, #e8fbff 40%, #d5f4ff 100%);
  min-height: 100vh;
  overflow-wrap: anywhere;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.45), transparent 50%),
    linear-gradient(0deg, rgba(10, 60, 78, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(10, 60, 78, 0.08) 1px, transparent 1px);
  background-size: 100% 100%, 100% 32px, 32px 100%;
  opacity: 0.4;
  pointer-events: none;
  z-index: -1;
}

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 42px 24px 70px;
}

.hero {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 26px;
  padding: 32px;
  border-radius: calc(var(--radius) + 6px);
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.9) 0%, rgba(225, 251, 255, 0.85) 50%, rgba(196, 245, 255, 0.85) 100%);
  box-shadow: var(--shadow);
  animation: lift 0.7s ease forwards;
}

.eyebrow {
  font-family: "Chakra Petch", sans-serif;
  letter-spacing: 0.35em;
  font-size: 12px;
  text-transform: uppercase;
  color: var(--accent-dark);
  margin: 0 0 12px;
}

.hero h1 {
  font-family: "Chakra Petch", sans-serif;
  font-size: clamp(28px, 4vw, 42px);
  margin: 0 0 10px;
}

.subtitle {
  margin: 0;
  color: var(--muted);
  max-width: 520px;
}

.meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  justify-content: center;
  font-size: 14px;
  color: var(--muted);
  min-width: 180px;
}

.layout {
  margin-top: 32px;
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 26px;
}

.calendar,
.details {
  background: var(--card);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.calendar {
  animation: lift 0.85s ease forwards;
}

.details {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.92) 0%, rgba(225, 251, 255, 0.9) 100%);
  animation: lift 1s ease forwards;
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.month {
  font-family: "Chakra Petch", sans-serif;
  font-size: 20px;
  color: var(--night);
}

.calendar-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.ghost {
  border: 1px solid rgba(57, 210, 198, 0.35);
  background: rgba(255, 255, 255, 0.7);
  color: var(--accent-dark);
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  transition: transform 0.2s ease, background 0.2s ease;
}

.ghost:hover {
  background: rgba(57, 210, 198, 0.2);
  transform: translateY(-1px);
}

.day-rail {
  display: none;
  gap: 10px;
  overflow-x: auto;
  padding: 16px 4px 10px;
  scroll-snap-type: x mandatory;
}

.rail-day {
  border: 1px solid rgba(57, 210, 198, 0.4);
  background: rgba(255, 255, 255, 0.75);
  color: var(--night);
  border-radius: 16px;
  min-width: 66px;
  padding: 8px 8px 10px;
  display: grid;
  gap: 4px;
  justify-items: center;
  scroll-snap-align: center;
  cursor: pointer;
  font: inherit;
  transition: transform 0.2s ease, border 0.2s ease;
}

.rail-day:hover {
  transform: translateY(-2px);
}

.rail-day.is-selected {
  border-color: var(--accent);
  background: rgba(57, 210, 198, 0.18);
}

.rail-number {
  font-weight: 700;
  font-size: 15px;
}

.rail-weekday {
  font-size: 11px;
  color: var(--muted);
}

.rail-count {
  font-size: 11px;
  color: var(--accent-dark);
  font-weight: 600;
}

.weekday {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin-top: 20px;
  text-align: center;
  font-weight: 600;
  color: var(--accent-dark);
  font-size: 13px;
}

.grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}

.day {
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.75);
  min-height: 92px;
  padding: 10px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border: 1px solid transparent;
  text-align: left;
  font: inherit;
  cursor: pointer;
  transition: border 0.2s ease, transform 0.2s ease;
}

.day:hover {
  border-color: rgba(57, 210, 198, 0.5);
  transform: translateY(-2px);
}

.day.is-today {
  border-color: var(--accent);
  box-shadow: 0 8px 20px rgba(57, 210, 198, 0.35);
}

.day.is-selected {
  border-color: var(--leaf);
}

.day.is-muted {
  opacity: 0.45;
}

.day-number {
  font-size: 14px;
  font-weight: 700;
  color: var(--night);
}

.day-count {
  margin-top: auto;
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.day-count span {
  display: inline-flex;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--sun);
}

.details-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.details h2 {
  margin: 0;
  font-size: 20px;
  font-family: "Chakra Petch", sans-serif;
}

.count {
  font-size: 13px;
  color: var(--muted);
}

.filters {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.filters input {
  width: 100%;
  border-radius: 999px;
  border: 1px solid rgba(57, 210, 198, 0.35);
  padding: 10px 14px;
  font-size: 14px;
  font-family: inherit;
  background: rgba(255, 255, 255, 0.8);
  color: var(--ink);
}

.filters input:focus {
  outline: 2px solid rgba(255, 107, 74, 0.3);
  border-color: var(--accent);
}

.filter-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.filter-row label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.filter-row input {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(57, 210, 198, 0.35);
  padding: 8px 10px;
  font-family: inherit;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
}

.filter-row input:focus {
  outline: 2px solid rgba(255, 107, 74, 0.3);
  border-color: var(--accent);
}

.event-list {
  margin-top: 16px;
  padding-top: 2px;
  display: grid;
  gap: 12px;
  max-height: 280px;
  overflow: auto;
  padding-right: 6px;
}

.event-item {
  border-radius: 16px;
  padding: 12px 14px;
  border: 1px solid rgba(57, 210, 198, 0.2);
  background: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  transition: transform 0.2s ease, border 0.2s ease;
}

.event-item:hover,
.event-item.active {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.event-item h3 {
  margin: 0 0 6px;
  font-size: 15px;
  overflow-wrap: anywhere;
}

.event-item p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.event-detail {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px dashed rgba(57, 210, 198, 0.3);
  min-height: 220px;
}

.event-detail h3 {
  margin: 0 0 10px;
  font-size: 18px;
}

.detail-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(57, 210, 198, 0.3);
  background: rgba(255, 255, 255, 0.9);
  overflow-wrap: anywhere;
}

.detail-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.action-btn {
  border: 1px solid rgba(57, 210, 198, 0.4);
  background: rgba(57, 210, 198, 0.18);
  color: var(--night);
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.action-btn:hover {
  background: rgba(57, 210, 198, 0.3);
  transform: translateY(-1px);
}

.event-detail img {
  width: 100%;
  border-radius: 16px;
  height: auto;
  object-fit: contain;
  max-height: 260px;
  margin-bottom: 12px;
}

.event-detail a {
  color: var(--leaf);
  font-weight: 600;
  text-decoration: none;
}

.event-detail a:hover {
  text-decoration: underline;
}

.event-detail .meta-line {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
  overflow-wrap: anywhere;
}

.empty {
  color: var(--muted);
  font-size: 14px;
}

.mobile-nav {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  padding: 10px;
  border-radius: 18px;
  background: rgba(225, 251, 255, 0.95);
  border: 1px solid rgba(57, 210, 198, 0.4);
  box-shadow: var(--shadow);
  display: none;
  gap: 10px;
  justify-content: space-around;
  z-index: 20;
}

.mobile-nav button {
  flex: 1;
  border: none;
  background: rgba(57, 210, 198, 0.2);
  color: var(--night);
  padding: 10px 0;
  border-radius: 12px;
  font-weight: 600;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
}

.mobile-nav button:hover {
  background: rgba(57, 210, 198, 0.35);
}

.spotlight {
  display: grid;
  gap: 12px;
}

.spotlight h3 {
  margin: 0;
  font-size: 18px;
  font-family: "Chakra Petch", sans-serif;
}

.spotlight-grid {
  display: grid;
  gap: 12px;
}

.spotlight-card {
  border: 1px solid rgba(57, 210, 198, 0.25);
  border-radius: 16px;
  padding: 10px;
  display: grid;
  gap: 10px;
  background: rgba(255, 255, 255, 0.85);
  text-align: left;
  font: inherit;
  cursor: pointer;
  transition: transform 0.2s ease, border 0.2s ease;
}

.spotlight-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.spotlight-card img {
  width: 100%;
  height: auto;
  max-height: 180px;
  object-fit: contain;
  border-radius: 12px;
}

.spotlight-body {
  display: grid;
  gap: 4px;
  font-size: 13px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.spotlight-body strong {
  color: var(--night);
  font-size: 15px;
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.modal.is-open {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 39, 53, 0.35);
  backdrop-filter: blur(3px);
}

.modal-card {
  position: relative;
  width: min(680px, calc(100% - 32px));
  max-height: calc(100vh - 80px);
  overflow: auto;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 22px;
  border: 1px solid rgba(57, 210, 198, 0.35);
  box-shadow: var(--shadow);
  padding: 24px;
  z-index: 1;
  animation: lift 0.3s ease;
}

.modal-content .detail-card {
  border: none;
  background: transparent;
  padding: 0;
}

.modal-content img {
  width: 100%;
  height: auto;
  max-height: 320px;
  object-fit: contain;
  border-radius: 16px;
  margin-bottom: 12px;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  border: none;
  background: rgba(57, 210, 198, 0.15);
  color: var(--night);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
}

.modal-close:hover {
  background: rgba(57, 210, 198, 0.3);
}
@keyframes lift {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .event-list {
    max-height: none;
  }
}

@media (max-width: 860px) {
  .page {
    padding: 28px 16px 110px;
  }

  .calendar,
  .details {
    padding: 18px;
  }

  .calendar-header {
    align-items: flex-start;
  }

  .calendar-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .day-rail {
    display: flex;
  }

  .weekday,
  .grid {
    display: none;
  }

  .mobile-nav {
    display: flex;
  }

  .modal-card {
    width: calc(100% - 24px);
    padding: 20px;
  }
}

@media (max-width: 560px) {
  .hero {
    padding: 20px;
    gap: 16px;
  }

  .meta {
    width: 100%;
    font-size: 12px;
  }

  .ghost {
    padding: 10px 16px;
    font-size: 14px;
  }

  .rail-day {
    min-width: 58px;
  }

  .filters input {
    font-size: 13px;
  }

  .event-list {
    display: block;
    column-count: 2;
    column-gap: 12px;
  }

  .event-item {
    display: inline-block;
    width: 100%;
    margin-bottom: 12px;
  }

  .spotlight-card img {
    max-height: 160px;
  }

  .event-list {
    gap: 10px;
  }

  .event-detail img {
    max-height: 220px;
  }
}

@media (max-width: 420px) {
  .subtitle {
    font-size: 14px;
  }

  .event-item h3 {
    font-size: 14px;
  }
}
