:root {
  color-scheme: light;
  --ink: #222128;
  --muted: #706d78;
  --line: rgba(40, 35, 48, 0.12);
  --paper: rgba(255, 255, 255, 0.86);
  --paper-strong: rgba(255, 255, 255, 0.95);
  --accent: #4476c5;
  --accent-soft: #e8effb;
  --pink: #bc5677;
  --violet: #7564b4;
  --teal: #3f847d;
  --amber: #a3692c;
  --shadow: 0 16px 48px rgba(50, 39, 67, 0.12);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: #f2f0f4;
}

body::before {
  position: fixed;
  z-index: -2;
  inset: 0;
  content: "";
  background-image: url("/assets/september-bg.png");
  background-position: center center;
  background-size: cover;
  opacity: 0.5;
}

body::after {
  position: fixed;
  z-index: -1;
  inset: 0;
  content: "";
  background: rgba(247, 245, 248, 0.42);
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

.app-shell {
  width: min(1760px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 0 clamp(20px, 3vw, 64px) 28px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  color: var(--ink);
  font-size: 14px;
  font-weight: 680;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 7px;
  color: white;
  background: #292730;
  font-family: Georgia, serif;
  font-size: 16px;
}

.sync-status {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.sync-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #c19a45;
  box-shadow: 0 0 0 3px rgba(193, 154, 69, 0.13);
}

.sync-status.is-online .sync-dot {
  background: #4d966f;
  box-shadow: 0 0 0 3px rgba(77, 150, 111, 0.13);
}

.sync-status.is-local .sync-dot {
  background: #77717d;
  box-shadow: 0 0 0 3px rgba(119, 113, 125, 0.12);
}

main {
  padding-top: clamp(30px, 5vw, 72px);
}

.month-header {
  display: flex;
  gap: 32px;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 32px;
}

.eyebrow,
.section-label {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.12em;
}

h1 {
  margin: 0;
  font-family: Georgia, "Songti SC", serif;
  font-size: clamp(38px, 5vw, 70px);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: 0;
}

.title-note {
  display: inline-block;
  margin-left: 0.55em;
  color: #5f5b65;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 18px;
  font-weight: 650;
  white-space: nowrap;
  vertical-align: 0.3em;
}

.subtitle {
  width: fit-content;
  max-width: 620px;
  margin: 14px 0 0;
  padding: 8px 13px 8px 11px;
  border-left: 3px solid var(--pink);
  border-radius: 0 6px 6px 0;
  color: #302c34;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 5px 18px rgba(48, 39, 57, 0.1);
  font-size: 16px;
  font-weight: 720;
  line-height: 1.5;
  backdrop-filter: blur(12px);
}

.month-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  flex: 0 0 auto;
}

.month-switcher,
.today-button {
  height: 38px;
  border: 1px solid var(--line);
  background: var(--paper-strong);
  box-shadow: 0 3px 12px rgba(47, 40, 55, 0.05);
}

.month-switcher {
  display: flex;
  align-items: center;
  border-radius: 7px;
  overflow: hidden;
  font-size: 13px;
  font-weight: 650;
}

.month-switcher span {
  padding: 0 10px;
  white-space: nowrap;
}

.icon-button {
  width: 34px;
  height: 100%;
  border: 0;
  color: #aaa5ae;
  background: transparent;
  font-size: 22px;
}

.today-button {
  padding: 0 14px;
  border-radius: 7px;
  color: var(--ink);
  cursor: pointer;
  font-size: 12px;
  font-weight: 650;
}

.today-button:hover {
  border-color: rgba(68, 118, 197, 0.42);
  color: var(--accent);
}

.overview {
  margin-bottom: 22px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 8px 30px rgba(47, 40, 55, 0.07);
  backdrop-filter: blur(18px);
}

.overview-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 15px;
}

.overview-heading .section-label {
  margin: 0;
  color: var(--muted);
  letter-spacing: 0;
}

.overview-heading > span:last-child {
  color: var(--muted);
  font-size: 11px;
}

.member-progress {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.member-progress-item {
  min-width: 0;
  padding: 0 20px;
  border-left: 1px solid var(--line);
}

.member-progress-item:first-child {
  padding-left: 0;
  border-left: 0;
}

.member-progress-item:last-child {
  padding-right: 0;
}

.member-progress-heading,
.member-identity {
  display: flex;
  align-items: center;
}

.member-progress-heading {
  gap: 12px;
  justify-content: space-between;
}

.member-identity {
  min-width: 0;
  gap: 8px;
}

.member-progress-heading strong {
  flex: 0 0 auto;
  font-size: 22px;
  line-height: 1;
}

.member-progress-meta {
  margin: 6px 0 9px;
  color: var(--muted);
  font-size: 11px;
}

.member-dot {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--member-color);
}

.member-name {
  overflow: hidden;
  color: var(--ink);
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-progress-track {
  height: 5px;
  border-radius: 3px;
  background: #e5e2e7;
  overflow: hidden;
}

.member-progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--member-color);
  transition: width 260ms ease;
}

.calendar-panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-strong);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.weekday-row,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.weekday-row {
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  background: rgba(247, 246, 248, 0.9);
  font-size: 11px;
  font-weight: 650;
}

.weekday-row span {
  padding: 12px 14px;
  border-right: 1px solid var(--line);
}

.weekday-row span:last-child {
  border-right: 0;
}

.calendar-grid {
  grid-template-rows: repeat(5, minmax(238px, 1fr));
}

.day-card {
  position: relative;
  min-width: 0;
  min-height: 238px;
  padding: 12px;
  border: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.35);
}

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

.day-card:nth-last-child(-n + 7) {
  border-bottom: 0;
}

.day-card.is-weekend {
  background: rgba(248, 245, 248, 0.74);
}

.day-card.is-today {
  background: rgba(237, 243, 253, 0.8);
  box-shadow: inset 0 0 0 2px rgba(68, 118, 197, 0.48);
}

.day-card.is-empty {
  background: rgba(240, 238, 242, 0.62);
}

.day-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 23px;
  margin-bottom: 8px;
}

.day-number {
  display: inline-grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 680;
}

.is-today .day-number {
  color: white;
  background: var(--accent);
}

.day-label {
  display: none;
  color: var(--muted);
  font-size: 11px;
}

.day-count {
  color: #928e97;
  font-size: 10px;
}

.check-list {
  display: grid;
  gap: 5px;
}

.check-button {
  display: grid;
  grid-template-columns: 17px minmax(0, 1fr);
  gap: 7px;
  align-items: center;
  width: 100%;
  min-height: 24px;
  padding: 3px 6px;
  border: 1px solid transparent;
  border-radius: 5px;
  color: #5e5963;
  background: transparent;
  cursor: pointer;
  font-size: 11px;
  text-align: left;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}

.check-button:hover {
  border-color: color-mix(in srgb, var(--member-color) 28%, transparent);
  background: color-mix(in srgb, var(--member-color) 7%, white);
}

.check-button:focus-visible,
.today-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.check-button[aria-pressed="true"] {
  color: color-mix(in srgb, var(--member-color) 78%, #111);
  background: color-mix(in srgb, var(--member-color) 10%, white);
  font-weight: 680;
}

.check-icon {
  display: grid;
  width: 16px;
  height: 16px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--member-color) 50%, #b8b4ba);
  border-radius: 50%;
  color: transparent;
  font-size: 10px;
  line-height: 1;
}

[aria-pressed="true"] .check-icon {
  border-color: var(--member-color);
  color: white;
  background: var(--member-color);
}

.check-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

footer {
  display: flex;
  justify-content: space-between;
  padding: 20px 2px 0;
  color: #74707a;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.toast {
  position: fixed;
  z-index: 10;
  right: 20px;
  bottom: 20px;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 7px;
  color: white;
  background: rgba(34, 33, 40, 0.92);
  box-shadow: 0 10px 30px rgba(30, 25, 35, 0.2);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 160ms ease, transform 160ms ease;
  font-size: 12px;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (min-width: 1500px) {
  .calendar-grid {
    grid-template-rows: repeat(5, minmax(260px, 1fr));
  }

  .day-card {
    min-height: 260px;
    padding: 15px;
  }

  .check-list {
    gap: 7px;
  }

  .check-button {
    min-height: 26px;
    font-size: 12px;
  }
}

@media (max-width: 1080px) {
  .member-progress-item {
    padding-right: 14px;
    padding-left: 14px;
  }
}

@media (max-width: 760px) {
  body::before {
    background-position: 60% center;
    opacity: 0.5;
  }

  .app-shell {
    padding: 0 14px calc(22px + env(safe-area-inset-bottom));
  }

  .topbar {
    min-height: 58px;
  }

  main {
    padding-top: 26px;
  }

  .month-header {
    display: block;
    margin-bottom: 22px;
  }

  h1 {
    font-size: 40px;
  }

  .title-note {
    display: block;
    margin-top: 8px;
    margin-left: 0;
    font-size: 15px;
    vertical-align: 0;
  }

  .subtitle {
    margin-top: 10px;
    max-width: 100%;
    padding: 7px 10px;
    font-size: 14px;
  }

  .month-meta {
    justify-content: space-between;
    margin-top: 20px;
  }

  .overview {
    margin-bottom: 14px;
    padding: 15px;
  }

  .overview-heading {
    margin-bottom: 16px;
  }

  .member-progress {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 18px;
  }

  .member-progress-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 0 12px;
  }

  .member-progress-item:nth-child(odd) {
    padding-left: 0;
    border-left: 0;
  }

  .member-progress-item:nth-child(even) {
    padding-right: 0;
  }

  .member-progress-heading {
    display: contents;
  }

  .member-progress-heading strong {
    grid-column: 2;
    grid-row: 2;
    align-self: center;
    font-size: 20px;
  }

  .member-progress-item .member-identity {
    grid-column: 1 / -1;
    grid-row: 1;
    gap: 6px;
  }

  .member-progress-item .member-name {
    font-size: 11px;
  }

  .member-progress-meta {
    grid-column: 1;
    grid-row: 2;
    align-self: center;
  }

  .member-progress-track {
    grid-column: 1 / -1;
  }

  .calendar-panel {
    border: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    overflow: visible;
  }

  .weekday-row {
    display: none;
  }

  .calendar-grid {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: none;
    gap: 10px;
  }

  .day-card {
    display: grid;
    grid-template-columns: 62px minmax(0, 1fr);
    gap: 12px;
    min-height: 0;
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.86);
    box-shadow: 0 6px 18px rgba(45, 38, 54, 0.06);
    backdrop-filter: blur(14px);
  }

  .day-card:nth-child(7n),
  .day-card:nth-last-child(-n + 7) {
    border: 1px solid var(--line);
  }

  .day-card.is-empty {
    display: none;
  }

  .day-card.is-today {
    border-color: rgba(68, 118, 197, 0.55);
    box-shadow: inset 3px 0 0 var(--accent), 0 6px 18px rgba(45, 38, 54, 0.06);
  }

  .day-heading {
    display: flex;
    height: auto;
    margin: 1px 0 0;
    flex-direction: column;
    justify-content: start;
  }

  .day-number {
    width: 30px;
    height: 30px;
    font-size: 14px;
  }

  .day-label {
    display: block;
    margin-top: 5px;
  }

  .day-count {
    margin-top: 5px;
  }

  .check-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .check-button {
    min-height: 34px;
    padding: 6px 8px;
    border-color: rgba(45, 40, 50, 0.08);
    background: rgba(249, 248, 250, 0.72);
    font-size: 11px;
  }
}

@media (max-width: 390px) {
  .brand span:last-child {
    display: none;
  }

  .month-switcher span {
    padding: 0 6px;
  }

  .today-button {
    padding: 0 10px;
  }

  .check-list {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
