:root {
  color-scheme: light;
  --ink: #171717;
  --muted: #69645d;
  --line: #ded8cf;
  --paper: #fffdf9;
  --soft: #f5f1e9;
  --blue: #145596;
  --blue-dark: #0b3f76;
  --gold: #b26a00;
  --red: #b5332e;
}

* { box-sizing: border-box; }

html { background: #f6f3ed; }

body {
  margin: 0;
  color: var(--ink);
  background: #f6f3ed;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

a { color: inherit; }

.site-header {
  min-height: 66px;
  padding: 10px 24px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.calendar-site-nav {
  width: min(760px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.calendar-site-nav a {
  min-width: 0;
  padding: 11px 10px;
  color: #2c2823;
  background: var(--paper);
  border: 1px solid #ddcfb8;
  border-radius: 12px;
  font-size: 17px;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
}

.calendar-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 64px;
}

.calendar-hero {
  padding: 28px 30px;
  background: linear-gradient(135deg, #fff, #f4f8fc);
  border: 1px solid #d9e2ec;
  border-radius: 18px;
  box-shadow: 0 8px 28px rgba(36, 49, 63, .06);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--blue);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .08em;
}

.calendar-hero h1 {
  margin: 0;
  font-size: clamp(34px, 5vw, 52px);
  line-height: 1.12;
}

.calendar-hero > p:not(.eyebrow) {
  max-width: 760px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.65;
}

.freshness { font-size: 14px !important; }

.calendar-controls {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin: 22px 0 14px;
}

.control-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.control-group button {
  min-height: 42px;
  padding: 8px 16px;
  color: #37332e;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.control-group button:hover,
.control-group button:focus-visible { border-color: var(--blue); }

.control-group button.is-active {
  color: #fff;
  background: var(--blue);
  border-color: var(--blue);
}

.calendar-card {
  overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 8px 28px rgba(36, 31, 24, .06);
}

.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

th, td {
  padding: 15px 14px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid #ece7df;
}

th {
  color: #5f5a53;
  background: #f3efe7;
  font-size: 14px;
}

tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fffaf0; }

.importance-col,
.stars {
  min-width: 88px;
  white-space: nowrap;
  letter-spacing: 1px;
}

.stars.level-3 { color: var(--red); }
.stars.level-2 { color: var(--gold); }
.stars.level-1 { color: #74808b; }

.event-col { width: 42%; }

.event-name {
  display: block;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.35;
}

.event-meta {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.event-source {
  color: var(--blue);
  text-decoration: none;
}

.event-source:hover { text-decoration: underline; }

.date-divider td {
  padding: 10px 14px;
  color: var(--blue-dark);
  background: #edf4fb;
  font-weight: 800;
}

.pending {
  color: var(--blue-dark);
  font-weight: 800;
  white-space: nowrap;
}

.empty-state {
  padding: 36px 20px;
  color: var(--muted);
  text-align: center;
}

.calendar-note {
  margin-top: 20px;
  padding: 20px 24px;
  color: var(--muted);
  background: #ece9e3;
  border-radius: 14px;
  font-size: 15px;
  line-height: 1.7;
}

.calendar-note h2 {
  margin: 0 0 6px;
  color: #39352f;
  font-size: 18px;
}

.calendar-note p { margin: 6px 0; }

.back-home {
  display: inline-flex;
  margin-top: 22px;
  color: var(--blue);
  font-weight: 800;
  text-decoration: none;
}

@media (max-width: 720px) {
  .site-header { min-height: 58px; padding: 8px 10px; }
  .calendar-site-nav { gap: 7px; }
  .calendar-site-nav a { padding: 10px 5px; font-size: 15px; }
  .calendar-shell { width: min(100% - 20px, 1120px); padding-top: 18px; }
  .calendar-hero { padding: 22px 18px; border-radius: 14px; }
  .calendar-hero > p:not(.eyebrow) { font-size: 16px; }
  .calendar-controls { display: block; }
  .control-group { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .importance-filter { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 10px; }
  .control-group button { min-width: 0; padding: 8px 5px; font-size: 14px; }
  table { min-width: 700px; }
  th, td { padding: 13px 11px; }
  .calendar-note { padding: 18px; }
}
