:root {
  --bg: #fcfaf7;
  --bg-accent: #f3eee6;
  --card: #ffffff;
  --text: #2a2624;
  --muted: #8a8178;
  --pink: #c45c5c;
  --pink-deep: #b44a4a;
  --pink-soft: #f8e6e4;
  --weekend-bg: #fdeeee;
  --holiday-bg: #f6d4d2;
  --work-bg: #f3ead8;
  --term: #5d8a62;
  --today-fill: #d8eee6;
  --today-line: #6f9d88;
  --grid-line: #efe6dc;
  --radius: 16px;
  --radius-sm: 12px;
  --shadow: 0 8px 24px rgba(80, 56, 48, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(ellipse at 50% 0%, #fff8ef 0%, transparent 46%),
    var(--bg);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

.page {
  max-width: 1080px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 20px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.site-header {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 8px;
  padding: 16px 20px 12px;
  background: var(--card);
  border: 1px solid var(--grid-line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.site-header__row {
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr);
  align-items: center;
  gap: 20px 28px;
}

.site-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.site-logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  flex-shrink: 0;
  display: block;
}

.site-name {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.1;
}

.site-search {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  max-width: 560px;
  height: 44px;
  margin: 0 auto;
  padding: 0 18px;
  border: 1px solid #e6ddd3;
  border-radius: 999px;
  background: #fff;
  box-shadow: var(--shadow);
}

.site-search__icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  border: 1.6px solid #b9aaa0;
  border-radius: 50%;
  position: relative;
}

.site-search__icon::after {
  content: "";
  position: absolute;
  width: 6px;
  height: 1.6px;
  background: #b9aaa0;
  right: -5px;
  bottom: -2px;
  transform: rotate(45deg);
  border-radius: 1px;
}

.site-search input {
  width: 100%;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 14px;
  color: var(--text);
  outline: none;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 28px;
  font-size: 15px;
}

.site-nav a {
  color: #5c5550;
  text-decoration: none;
  padding: 4px 0 6px;
}

.site-nav a:hover,
.site-nav a.is-active {
  color: var(--pink-deep);
}

.site-nav a.is-active {
  box-shadow: inset 0 -2px 0 var(--pink);
  font-weight: 650;
}

.tabbar {
  display: none !important;
}

@media (min-width: 841px) {
  .tabbar {
    display: none !important;
    height: 0;
    overflow: hidden;
    pointer-events: none;
  }
}

.tabbar .nav-holiday.is-active,
.tabbar .nav-jieqi.is-active {
  color: var(--pink-deep);
}

.page-main {
  padding: 4px 0 8px;
}

.page__heading {
  margin: 0 0 10px;
  font-size: 24px;
  font-weight: 650;
}

.page__heading--year {
  margin: 18px 0 8px;
  font-size: 34px;
  text-align: center;
  letter-spacing: 0.04em;
  font-weight: 700;
}

.page__heading--space {
  margin-top: 28px;
}

.page__lede {
  margin: 0 0 16px;
  font-size: 14px;
  color: #666;
}

.page__lede--center {
  text-align: center;
}

body.is-year {
  background-color: #fcf8ef;
  background-image:
    radial-gradient(ellipse at 12% 100%, rgba(70, 68, 62, 0.12) 0%, transparent 42%),
    radial-gradient(ellipse at 88% 102%, rgba(48, 52, 48, 0.1) 0%, transparent 40%),
    radial-gradient(ellipse at 50% -8%, #fff8ef 0%, transparent 48%),
    linear-gradient(180deg, #fbf6ec 0%, #fcf8ef 36%, #f4efe4 100%);
}

body.is-year::after {
  content: "";
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 200px;
  pointer-events: none;
  opacity: 0.22;
  background:
    radial-gradient(ellipse at 18% 128%, #5a564e 0%, transparent 48%),
    radial-gradient(ellipse at 52% 140%, #7d786e 0%, transparent 46%),
    radial-gradient(ellipse at 84% 126%, #4e4c46 0%, transparent 44%);
}

.page__lede a,
.topic-links a,
.table-card a {
  color: var(--pink-deep);
}

.topic-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 0 0 16px;
  font-size: 13px;
}

.topic-capsules {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin: 0 0 14px;
}

.capsule {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 132px;
  justify-content: center;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--pink-deep);
  color: var(--pink-deep);
  text-decoration: none;
  font-size: 14px;
  font-weight: 650;
  background: #fff;
}

.capsule--jieqi {
  border-color: #9bb89a;
  color: var(--term);
}

.capsule__icon {
  width: 16px;
  height: 16px;
  display: block;
  flex-shrink: 0;
}

.page__footer {
  margin-top: auto;
  padding-top: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #1b4f9a;
}

.page__footer a {
  color: inherit;
  text-decoration: none;
}

.page__footer-mps {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.page__footer-mps img {
  width: 16px;
  height: 16px;
}

.calendar {
  background: var(--card);
  border: 1px solid var(--grid-line);
  border-radius: 12px;
  overflow: hidden;
}

.calendar__caption {
  padding: 10px 12px 0;
  font-size: 13px;
  font-weight: 600;
}

.calendar__weekdays,
.calendar__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.calendar__weekday {
  padding: 8px 2px;
  text-align: center;
  font-size: 12px;
  color: #888;
}

.calendar__weekday--weekend {
  color: var(--pink-deep);
}

.day-cell {
  min-height: 72px;
  padding: 8px 6px;
  border-right: 1px solid var(--grid-line);
  border-bottom: 1px solid var(--grid-line);
  border-radius: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  position: relative;
}

.day-cell:nth-child(7n) {
  border-right: 0;
}

.day-cell--weekend {
  background: var(--weekend-bg);
  border-radius: 0;
}

.day-cell--holiday {
  background: var(--holiday-bg);
  border-radius: 0;
}

.day-cell--work {
  background: var(--work-bg);
  border-radius: 0;
}

.day-cell--muted {
  opacity: 0.4;
}

.day-cell--today {
  background: var(--today-fill);
  box-shadow: inset 0 0 0 1px var(--today-line);
  border-radius: 0;
}

.day-cell--weekend .day-cell__solar,
.day-cell--holiday .day-cell__solar {
  color: var(--pink-deep);
}

.day-cell__solar {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.1;
}

.day-cell__lunar {
  font-size: 12px;
  color: #666;
  line-height: 1.2;
}

.day-cell__lunar--fest {
  color: var(--pink-deep);
}

.day-cell__lunar--term {
  color: var(--term);
  font-weight: 650;
}

.day-cell__ban {
  position: absolute;
  top: 4px;
  right: 4px;
  font-size: 10px;
  font-weight: 650;
  color: #8a5a2a;
}

.calendar--mini .day-cell {
  min-height: 36px;
  padding: 3px 2px;
}

.calendar--mini .day-cell__solar {
  font-size: 12px;
}

.calendar--mini .day-cell__lunar {
  font-size: 9px;
}

.cal-card {
  display: block;
  color: inherit;
  text-decoration: none;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.cal-card .calendar {
  border: 0;
  border-radius: var(--radius);
}

.cal-card:hover {
  outline: 2px solid #e8c4c0;
}

.cals {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.cals--year {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.table-card {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border: 1px solid var(--grid-line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.table-card caption {
  caption-side: top;
  text-align: left;
  font-weight: 600;
  padding: 0 0 8px;
}

.table-card th,
.table-card td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--grid-line);
  text-align: left;
  font-size: 14px;
}

.table-card th {
  background: var(--pink-soft);
  font-weight: 550;
  color: #6a3f3f;
}

.table-card tr:last-child td {
  border-bottom: 0;
}

.faq {
  margin-top: 28px;
}

.faq h2,
.makeup-panel h2 {
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 650;
}

.faq__item {
  background: var(--card);
  border: 1px solid var(--grid-line);
  border-radius: 12px;
  padding: 0 16px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
}

.faq__item summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  font-size: 15px;
  font-weight: 600;
}

.faq__item summary::-webkit-details-marker {
  display: none;
}

.faq__item summary::after {
  content: "›";
  color: var(--muted);
  font-size: 20px;
  font-weight: 400;
  transform: rotate(90deg);
}

.faq__item[open] summary::after {
  transform: rotate(-90deg);
}

.faq__item p {
  margin: 0 0 14px;
  font-size: 14px;
  color: #555;
}

.makeup-panel {
  display: none;
  margin: 18px 0 8px;
}

@media (max-width: 840px) {
  .site-header__row {
    grid-template-columns: 1fr minmax(140px, 52%);
    gap: 10px 12px;
  }

  .site-search {
    max-width: none;
    height: 38px;
    padding: 0 12px;
    margin: 0;
  }

  .site-nav {
    display: none;
  }

  .cals,
  .cals--year {
    grid-template-columns: 1fr 1fr;
  }

  .tabbar {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr);
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    background: #fffdf9;
    border-top: 1px solid var(--grid-line);
    padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
  }

  .tabbar a {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    color: #5c5550;
    text-decoration: none;
    font-size: 12px;
    text-align: center;
  }

  .tabbar a.is-active {
    color: var(--pink-deep);
    font-weight: 650;
  }

  .page {
    padding-bottom: 72px;
  }

  .page__heading--year {
    font-size: 22px;
  }
}

@media (max-width: 640px) {
  .page {
    padding: 12px 10px 72px;
  }

  .site-name {
    font-size: 20px;
  }

  .site-logo {
    width: 36px;
    height: 36px;
  }

  .page__heading {
    font-size: 20px;
  }

  .day-cell {
    min-height: 56px;
  }

  .col-week,
  .col-makeup {
    display: none;
  }

  .makeup-panel {
    display: block;
  }
}
