:root {
  --ink: #102a2a;
  --muted: #667a78;
  --paper: #f7faf8;
  --white: #ffffff;
  --line: #dce7e3;
  --green: #0b6b66;
  --green-dark: #074d4a;
  --mint: #dff3ec;
  --sun: #f2b85b;
  --weekend: #fff8ed;
  --shadow: 0 18px 60px rgba(13, 57, 53, .1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif; }
button, select { font: inherit; }
button { cursor: pointer; }
.skip-link { position: fixed; left: 1rem; top: -4rem; z-index: 100; padding: .7rem 1rem; background: #fff; color: var(--green); border-radius: .5rem; }
.skip-link:focus { top: 1rem; }

.hero { color: #fff; background: radial-gradient(circle at 82% 12%, rgba(103, 205, 179, .23), transparent 30%), linear-gradient(135deg, #073f3d 0%, #0b6b66 64%, #0a5c58 100%); }
.topbar { max-width: 1440px; margin: auto; padding: 1.35rem clamp(1rem, 4vw, 4rem); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(255,255,255,.12); }
.brand { display: flex; align-items: center; gap: .75rem; color: #fff; text-decoration: none; font-weight: 700; letter-spacing: .04em; }
.brand-mark { display: grid; place-items: center; width: 2rem; height: 2rem; border: 1px solid rgba(255,255,255,.55); border-radius: 50%; font-family: serif; }
.nav-actions { display: flex; gap: .65rem; }
.quiet-button, .print-button, .reset-button { border-radius: 999px; padding: .65rem 1rem; border: 1px solid transparent; }
.quiet-button { border-color: rgba(255,255,255,.3); color: #fff; background: transparent; }
.print-button { color: var(--green-dark); background: #fff; font-weight: 700; }
.hero-content { max-width: 1440px; margin: auto; min-height: 390px; padding: 4.2rem clamp(1rem, 4vw, 4rem) 4.6rem; display: grid; grid-template-columns: 1.5fr .7fr; align-items: end; gap: 4rem; }
.eyebrow, .section-kicker { margin: 0 0 .9rem; font-size: .72rem; font-weight: 800; letter-spacing: .18em; }
.eyebrow { color: #9cd9cb; }
h1 { margin: 0; font-family: "Songti SC", "STSong", serif; font-size: clamp(3rem, 7vw, 6.4rem); font-weight: 600; line-height: .98; letter-spacing: -.055em; }
h1 span { color: #c7eadf; }
.hero-copy { max-width: 670px; margin: 1.7rem 0 0; color: rgba(255,255,255,.72); line-height: 1.8; }
.month-card { justify-self: end; width: min(100%, 350px); padding: 1.6rem; border: 1px solid rgba(255,255,255,.18); border-radius: 1.5rem; background: rgba(255,255,255,.08); backdrop-filter: blur(14px); display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 1rem 1.2rem; }
.month-number { font: 600 4.5rem/1 Georgia, serif; color: #fff; }
.month-card strong, .month-card div span { display: block; }
.month-card div span { margin-top: .25rem; color: rgba(255,255,255,.66); font-size: .82rem; }
.status-line { grid-column: 1 / -1; padding-top: 1rem; border-top: 1px solid rgba(255,255,255,.12); font-size: .82rem; }
.status-line i { display: inline-block; width: .5rem; height: .5rem; margin-right: .5rem; border-radius: 50%; background: #6fe0aa; box-shadow: 0 0 0 .25rem rgba(111,224,170,.15); }

main { max-width: 1440px; margin: auto; padding: 0 clamp(1rem, 4vw, 4rem) 5rem; }
.notice { position: relative; margin: -1.6rem 0 4.5rem; padding: 1rem 1.25rem; display: flex; align-items: center; gap: .9rem; border: 1px solid #e8d9bd; border-radius: 1rem; background: #fffaf0; box-shadow: 0 10px 32px rgba(70,54,24,.08); }
.notice-icon { flex: 0 0 auto; display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; color: #684610; background: #f6dca9; font-weight: 900; }
.notice p { display: inline; margin: 0 0 0 .5rem; color: #775f38; }
.controls, .section-heading { display: flex; align-items: end; justify-content: space-between; gap: 2rem; margin-bottom: 1.25rem; }
.section-kicker { color: var(--green); }
h2 { margin: 0; font: 600 clamp(2rem, 3vw, 3rem)/1.1 "Songti SC", "STSong", serif; letter-spacing: -.035em; }
.filter-group { display: flex; align-items: end; gap: .7rem; }
.filter-group label { color: var(--muted); font-size: .74rem; font-weight: 700; }
select { display: block; min-width: 140px; margin-top: .35rem; padding: .68rem 2rem .68rem .8rem; border: 1px solid var(--line); border-radius: .7rem; color: var(--ink); background: #fff; }
.reset-button { color: var(--green); border-color: var(--line); background: transparent; }

.schedule-shell { border: 1px solid var(--line); border-radius: 1.25rem; overflow: hidden; background: #fff; box-shadow: var(--shadow); }
.schedule-legend { min-height: 3.3rem; padding: .8rem 1rem; display: flex; align-items: center; gap: 1.2rem; color: var(--muted); border-bottom: 1px solid var(--line); font-size: .78rem; }
.schedule-legend span:last-child { margin-left: auto; }
.legend-dot { display: inline-block; width: .65rem; height: .65rem; margin-right: .35rem; border-radius: 50%; }
.legend-dot.weekend { background: var(--sun); }.legend-dot.today { background: var(--green); }.legend-dot.selected { background: #fff; border: 2px solid var(--green); }
.schedule-board { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(340px, .75fr); min-height: 680px; }
.calendar-panel { padding: 1.5rem; border-right: 1px solid var(--line); background: #fbfdfc; }
.calendar-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.calendar-toolbar strong { display: block; font: 600 2.3rem/1 "Songti SC", "STSong", serif; }
.calendar-toolbar span { display: block; margin-top: .35rem; color: var(--green); font-size: .68rem; font-weight: 800; letter-spacing: .13em; }
.calendar-toolbar p { margin: 0; color: var(--muted); font-size: .76rem; }
.calendar-weekdays, .month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.calendar-weekdays { margin-bottom: .45rem; color: var(--muted); text-align: center; font-size: .7rem; font-weight: 800; }
.calendar-day, .calendar-blank { min-height: 108px; }
.calendar-day { position: relative; margin: 2px; padding: .65rem; overflow: hidden; text-align: left; border: 1px solid #e3ebe8; border-radius: .75rem; color: var(--ink); background: #fff; transition: border-color .18s, transform .18s, box-shadow .18s; }
.calendar-day:hover { z-index: 1; transform: translateY(-2px); border-color: #9fc9bf; box-shadow: 0 8px 20px rgba(22,81,73,.09); }
.calendar-day.weekend-day { background: var(--weekend); }
.calendar-day.today-day::after { content: "今日"; position: absolute; top: .65rem; right: .6rem; color: var(--green); font-size: .58rem; font-weight: 900; }
.calendar-day.selected-day { color: #fff; border-color: var(--green); background: var(--green); box-shadow: 0 10px 24px rgba(11,107,102,.24); }
.calendar-day.selected-day::after { color: #bfe9dd; }
.day-number { display: block; margin-bottom: .6rem; font: 600 1.35rem/1 Georgia, serif; }
.day-preview { display: grid; gap: .24rem; }
.day-preview span { display: flex; min-width: 0; align-items: center; gap: .35rem; color: #516b67; font-size: .64rem; }
.selected-day .day-preview span { color: rgba(255,255,255,.76); }
.day-preview b { flex: 0 0 auto; color: #8aa09c; font-size: .58rem; font-weight: 700; }
.selected-day .day-preview b { color: #a6d9ce; }
.day-preview em { overflow: hidden; color: var(--ink); font-size: .6rem; font-style: normal; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.selected-day .day-preview em { color: #fff; }
.calendar-day.filtered-out { opacity: .22; }
.calendar-day.has-filter-match { border-color: var(--green); box-shadow: inset 0 0 0 1px var(--green); }

.day-detail { position: relative; display: grid; grid-template-rows: 190px 1fr; color: #fff; background: var(--green-dark); scroll-margin-top: 0; }
.detail-date { position: relative; padding: 1.5rem; overflow: hidden; background: radial-gradient(circle at 90% 20%, rgba(130,220,194,.25), transparent 45%), #0b6b66; }
.detail-date span { display: block; color: #b9e2d8; font-size: .8rem; font-weight: 700; }
.detail-date strong { display: block; margin-top: .2rem; font: 500 6rem/.9 Georgia, serif; letter-spacing: -.06em; }
.detail-date small { position: absolute; right: 1.4rem; bottom: 1.4rem; color: rgba(255,255,255,.58); letter-spacing: .1em; }
.detail-content { padding: 1.5rem; }
.detail-heading { display: flex; align-items: end; justify-content: space-between; padding-bottom: 1rem; border-bottom: 1px solid rgba(255,255,255,.13); }
.detail-heading span { color: #80c9b8; font-size: .58rem; font-weight: 800; letter-spacing: .12em; }
.detail-heading h3 { margin: .2rem 0 0; font: 600 1.65rem "Songti SC", "STSong", serif; }
.detail-heading em { color: rgba(255,255,255,.55); font-size: .7rem; font-style: normal; }
.detail-group { margin-top: 1.2rem; }
.detail-group-title { margin: 0 0 .55rem; color: #75baa9; font-size: .62rem; font-weight: 900; letter-spacing: .12em; }
.detail-role-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .45rem; }
.detail-role { min-width: 0; padding: .65rem .7rem; border: 1px solid rgba(255,255,255,.11); border-radius: .6rem; background: rgba(255,255,255,.06); }
.detail-role b { display: block; color: #9fcdc2; font-size: .62rem; }
.detail-role span { display: block; min-height: 1.25em; margin-top: .2rem; overflow: hidden; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.detail-role.empty { opacity: .48; }
.detail-role.detail-match { border-color: #8ee0ca; background: rgba(112,218,190,.17); }
.detail-empty { margin-top: 1.2rem; padding: 1.1rem; color: #b7d6cf; border: 1px dashed rgba(255,255,255,.2); border-radius: .7rem; text-align: center; font-size: .8rem; }
.matrix-disclosure { border-top: 1px solid var(--line); }
.matrix-disclosure summary { padding: 1rem 1.25rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; color: var(--green-dark); background: #f4f8f6; cursor: pointer; font-weight: 800; list-style: none; }
.matrix-disclosure summary::-webkit-details-marker { display: none; }
.matrix-disclosure summary span::before { content: "+"; display: inline-grid; place-items: center; width: 1.4rem; height: 1.4rem; margin-right: .65rem; border: 1px solid #b8d0ca; border-radius: 50%; }
.matrix-disclosure[open] summary span::before { content: "−"; }
.matrix-disclosure summary small { color: var(--muted); font-weight: 500; }
.table-scroll { overflow-x: auto; scrollbar-color: #9cbdb6 #edf4f1; }
table { border-collapse: collapse; }
.schedule-table { width: 100%; min-width: 2350px; table-layout: fixed; }
.schedule-table th, .schedule-table td { width: 72px; min-width: 72px; height: 52px; padding: .35rem .2rem; text-align: center; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: .72rem; line-height: 1.35; }
.schedule-table th:first-child, .schedule-table td:first-child { position: sticky; left: 0; z-index: 3; width: 74px; min-width: 74px; background: #fff; font-weight: 800; box-shadow: 7px 0 13px rgba(24,62,57,.06); }
.schedule-table thead th { position: sticky; top: 0; z-index: 2; height: 34px; color: var(--muted); background: #f6faf8; font-size: .68rem; }
.schedule-table thead tr:nth-child(2) th { top: 34px; height: 38px; color: var(--ink); font: 600 1rem Georgia, serif; }
.schedule-table thead th:first-child { z-index: 4; background: #eef6f3; font-family: inherit !important; font-size: .7rem !important; }
.schedule-table .weekend-col { background: var(--weekend); }
.schedule-table .today-col { background: #e3f4ef; box-shadow: inset 2px 0 var(--green), inset -2px 0 var(--green); }
.schedule-table td.has-match { color: var(--green-dark); background: #ccebe1; font-weight: 900; }
.schedule-table td.dimmed { color: #bdc9c6; background: #fafcfb; }
.schedule-table tr.role-hidden { display: none; }

.stats-section { margin-top: 5.5rem; }
.section-heading > p { max-width: 360px; margin: 0; color: var(--muted); line-height: 1.6; }
.people-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .85rem; margin: 1.5rem 0; }
.person-card { text-align: left; padding: 1.25rem; border: 1px solid var(--line); border-radius: 1rem; background: #fff; transition: transform .2s, border-color .2s, box-shadow .2s; }
.person-card:hover { transform: translateY(-3px); border-color: #9bc9be; box-shadow: 0 12px 28px rgba(21,75,68,.09); }
.person-card.active { color: #fff; border-color: var(--green); background: var(--green); }
.person-card strong { display: block; font-size: 1.05rem; }
.person-card span { display: block; margin-top: .45rem; color: var(--muted); font-size: .76rem; }
.person-card.active span { color: rgba(255,255,255,.7); }
.stats-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 1rem; background: #fff; }
.stats-table { width: 100%; min-width: 720px; }
.stats-table th, .stats-table td { padding: .85rem 1rem; text-align: center; border-bottom: 1px solid var(--line); }
.stats-table th { color: var(--muted); background: #f2f7f5; font-size: .75rem; }
.stats-table td:first-child, .stats-table th:first-child { text-align: left; font-weight: 800; }
.stats-table tr:last-child td { border-bottom: 0; }
footer { padding: 2rem clamp(1rem, 4vw, 4rem); display: flex; justify-content: space-between; color: #78908c; border-top: 1px solid var(--line); font-size: .76rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 800px) {
  .hero-content { grid-template-columns: 1fr; gap: 2.5rem; padding-top: 3rem; }
  .month-card { justify-self: start; }
  .controls, .section-heading { align-items: flex-start; flex-direction: column; }
  .filter-group { width: 100%; flex-wrap: wrap; }
  .filter-group label { flex: 1; min-width: 130px; }
  select { width: 100%; }
  .schedule-board { grid-template-columns: 1fr; }
  .calendar-panel { padding: 1rem; border-right: 0; border-bottom: 1px solid var(--line); }
  .calendar-day, .calendar-blank { min-height: 68px; }
  .calendar-day { padding: .5rem; }
  .day-preview { display: none; }
  .day-number { margin: 0; font-size: 1rem; }
  .calendar-day.has-filter-match::before { content: ""; position: absolute; right: .45rem; bottom: .45rem; width: .38rem; height: .38rem; border-radius: 50%; background: var(--green); }
  .calendar-day.selected-day.has-filter-match::before { background: #fff; }
  .day-detail { grid-template-rows: 130px 1fr; }
  .detail-date strong { font-size: 4.2rem; }
  .detail-content { padding: 1.1rem; }
  .matrix-disclosure summary small { display: none; }
  .people-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 520px) {
  .topbar { align-items: flex-start; }.brand span:last-child { display: none; }
  .quiet-button { display: none; }
  .hero-content { min-height: 420px; }.month-card { width: 100%; }
  .notice { align-items: flex-start; }.notice p { display: block; margin: .2rem 0 0; }
  .calendar-toolbar p { display: none; }
  .calendar-day, .calendar-blank { min-height: 52px; }
  .detail-role-grid { grid-template-columns: 1fr 1fr; }
  .people-grid { grid-template-columns: 1fr 1fr; }
  footer { flex-direction: column; }
}

@media print {
  @page { size: A4 landscape; margin: 8mm; }
  body { background: #fff; }
  .hero { color: #000; background: none; }.topbar, .hero-copy, .month-card, .notice, .filter-group, .schedule-legend, .people-grid, footer { display: none !important; }
  .hero-content { min-height: auto; padding: 0 0 7mm; display: block; }
  .eyebrow { color: #555; } h1 { color: #000; font-size: 28pt; } h1 br { display: none; } h1 span { color: #000; margin-left: .25em; }
  main { max-width: none; padding: 0; }.controls { margin: 0 0 4mm; }.section-kicker { display: none; } h2 { font-size: 16pt; }
  .schedule-shell, .stats-table-wrap { border-radius: 0; box-shadow: none; overflow: visible; }
  .schedule-board, .matrix-disclosure summary { display: none; }
  .matrix-disclosure, .matrix-disclosure .table-scroll { display: block !important; border: 0; overflow: visible; }.schedule-table { min-width: 0; table-layout: fixed; }
  .schedule-table th, .schedule-table td { width: auto; min-width: 0; height: 24px; font-size: 7pt; }.schedule-table th:first-child, .schedule-table td:first-child { position: static; width: 38px; min-width: 38px; box-shadow: none; }
  .schedule-table thead th { position: static; height: 20px; }.schedule-table thead tr:nth-child(2) th { height: 20px; font-size: 8pt; }
  .stats-section { margin-top: 8mm; page-break-before: always; }.section-heading { margin-bottom: 4mm; }
  .stats-table th, .stats-table td { padding: 5px 8px; font-size: 8pt; }
}
