/* ============================================================================
 * 绳舍 · 门户页样式（浅色极简）
 * 白底、细线、单一强调色；无渐变、无阴影、无位移动效。
 * 目录：1 变量与基础 2 通用 3 页头 4 简介 5 海报墙 6 日历 7 关于与联系
 *       8 页脚 9 弹窗 10 响应式
 * ========================================================================== */

/* ---------- 1. 变量与基础 ---------- */
:root {
  --bg: #ffffff;
  --bg-soft: #f7f6f3;
  --text: #1c1a17;
  --muted: #6f6862;
  --faint: #98918a;
  --line: #e5e1da;
  --line-dark: #c9c3ba;
  --accent: #8a5a2b;
  --accent-soft: #f2ece4;
  --ongoing: #a8452c;
  --maxw: 1060px;
  --font-serif: "Songti SC", "Noto Serif SC", "Source Han Serif SC", "SimSun", serif;
  --font-sans: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.75;
}

body.is-locked { overflow: hidden; }

h1, h2, h3 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.35;
  margin: 0;
}

p { margin: 0; }
ul, ol, dl, dt, dd { margin: 0; padding: 0; }
li { list-style: none; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

img { display: block; max-width: 100%; }

button { font: inherit; color: inherit; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.icon-sprite { display: none; }
.icon { width: 1em; height: 1em; flex: none; fill: none; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  padding: 10px 16px;
  background: var(--text);
  color: #fff;
  z-index: 100;
}
.skip-link:focus { left: 0; color: #fff; }

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 22px;
}

/* ---------- 2. 通用 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid var(--line-dark);
  border-radius: 3px;
  background: #fff;
  color: var(--text);
  font-size: 14.5px;
  line-height: 1.5;
  cursor: pointer;
}
.btn:hover { border-color: var(--text); text-decoration: none; }
.btn-sm { padding: 5px 12px; font-size: 13.5px; }
.btn-primary { background: var(--text); border-color: var(--text); color: #fff; }
.btn-primary:hover { background: #000; border-color: #000; color: #fff; }

.tag {
  display: inline-block;
  padding: 1px 8px;
  border: 1px solid var(--line-dark);
  border-radius: 2px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.7;
  white-space: nowrap;
}
.tag-ongoing { border-color: var(--ongoing); color: var(--ongoing); }
.tag-upcoming { border-color: var(--line-dark); color: var(--muted); }
.tag-ended { border-color: var(--line); color: var(--faint); }

.section { padding: 56px 0; border-top: 1px solid var(--line); }
.section:first-of-type { border-top: 0; }

.section-head { margin-bottom: 26px; }
.section-head h2 { font-size: 24px; }
.section-head p { color: var(--muted); font-size: 14.5px; margin-top: 6px; }
.section-meta { color: var(--faint); font-size: 13.5px; }

.empty-state {
  padding: 28px 0;
  color: var(--muted);
  font-size: 14.5px;
}

.noscript {
  margin: 0;
  padding: 12px 22px;
  background: var(--accent-soft);
  color: var(--text);
  font-size: 14px;
}

/* ---------- 3. 页头 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 22px;
  min-height: 62px;
}

.brand { display: inline-flex; align-items: baseline; gap: 10px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand strong {
  font-family: var(--font-serif);
  font-size: 19px;
  letter-spacing: 0.14em;
}
.brand span { font-size: 11px; letter-spacing: 0.12em; color: var(--faint); }

.site-nav {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-left: auto;
  font-size: 14.5px;
}
.site-nav a { color: var(--muted); }
.site-nav a:hover { color: var(--text); text-decoration: none; }
.site-nav a[aria-current="page"] {
  color: var(--text);
  border-bottom: 1px solid var(--text);
  padding-bottom: 2px;
}

/* ---------- 4. 简介 ---------- */
.intro { padding: 48px 0 8px; }
.intro h1 {
  font-size: clamp(26px, 3.4vw, 34px);
  letter-spacing: 0.01em;
}
.intro-text { max-width: 680px; margin-top: 16px; color: var(--muted); }
.intro-text strong { color: var(--text); font-weight: 500; }

.intro-next {
  margin-top: 24px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--bg-soft);
  font-size: 14.5px;
}
.intro-next-label { color: var(--faint); font-size: 13px; margin-bottom: 2px; }
.intro-next strong { font-weight: 500; }

.intro-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }

/* ---------- 5. 海报墙 ---------- */
.poster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 26px 22px;
}

.poster-card { display: flex; flex-direction: column; }

.poster-media {
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--bg-soft);
  cursor: pointer;
  overflow: hidden;
  aspect-ratio: 3 / 4;
}
.poster-media img { width: 100%; height: 100%; object-fit: cover; }
.poster-media:hover { border-color: var(--line-dark); }

.poster-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.poster-title { font-size: 17px; margin-top: 8px; }
.poster-card:hover .poster-title { text-decoration: underline; }
.poster-sub { color: var(--faint); font-size: 12.5px; }
.poster-facts { margin-top: 8px; color: var(--muted); font-size: 14px; }
.poster-facts dt { color: var(--faint); font-size: 12.5px; }
.poster-facts dd { margin: 0; }
.poster-facts > div + div { margin-top: 3px; }
.poster-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* ---------- 6. 日历 ---------- */
.calendar {
  padding: 16px 18px 18px;
  border: 1px solid var(--line);
  border-radius: 3px;
}

.calendar-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 18px;
  margin-bottom: 14px;
}
.calendar-nav { display: flex; gap: 6px; }
.calendar-title {
  font-family: var(--font-serif);
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}
.calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  color: var(--faint);
  font-size: 12.5px;
}
.calendar-legend li { display: inline-flex; align-items: center; gap: 5px; }
.legend-dot { width: 8px; height: 8px; border: 1px solid var(--line-dark); border-radius: 50%; }
.legend-dot.is-ongoing { background: var(--ongoing); border-color: var(--ongoing); }
.legend-dot.is-upcoming { background: var(--accent); border-color: var(--accent); }
.legend-dot.is-ended { background: #fff; border-color: var(--line-dark); }

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}
.calendar-weekdays {
  margin-bottom: 4px;
  color: var(--faint);
  font-size: 12.5px;
  text-align: center;
}

.cal-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  width: 100%;
  min-height: 48px;
  padding: 4px 2px;
  border: 1px solid transparent;
  border-radius: 3px;
  background: none;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}
.cal-day:hover { border-color: var(--line-dark); }
.cal-num { font-size: 14.5px; line-height: 1.3; }
.cal-mark { min-height: 14px; color: var(--faint); font-size: 11px; line-height: 14px; }

.cal-day.has-events { background: var(--accent-soft); border-color: var(--line); color: var(--text); }
.cal-day.has-events .cal-mark { font-weight: 600; }
.cal-day.is-upcoming .cal-mark { color: var(--accent); }
.cal-day.is-ongoing { border-color: var(--ongoing); color: var(--ongoing); }
.cal-day.is-ongoing .cal-mark { color: var(--ongoing); }
.cal-day.is-ended { background: var(--bg-soft); color: var(--faint); }

.cal-day.is-today:not(.has-events) { border-color: var(--line-dark); }
.cal-day.is-today .cal-num { font-weight: 700; color: var(--text); }

.cal-day[aria-pressed="true"] {
  border-color: var(--text);
  background: var(--text);
  color: #fff;
}
.cal-day[aria-pressed="true"] .cal-num,
.cal-day[aria-pressed="true"] .cal-mark { color: #fff; }

.calendar-day { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.calendar-day-title { font-family: var(--font-serif); font-size: 16px; margin-bottom: 6px; }

.day-item {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: baseline;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.day-item:last-child { border-bottom: 0; padding-bottom: 0; }
.day-time { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.day-time strong { display: block; color: var(--text); font-weight: 500; }
.day-time span { display: block; color: var(--faint); font-size: 12.5px; }
.day-body { display: grid; gap: 2px; }
.day-item-title { font-family: var(--font-serif); font-size: 16px; }
.day-item-meta { color: var(--muted); font-size: 13.5px; }
.day-item.is-ended .day-item-title,
.day-item.is-ended .day-item-meta { color: var(--muted); }
.day-actions { display: flex; gap: 8px; }

/* ---------- 7. 关于与联系 ---------- */
.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 32px 40px;
}
.about-grid h3 { font-size: 16px; margin-bottom: 8px; }
.about-grid p, .about-grid li { color: var(--muted); font-size: 14.5px; }
.about-grid ul { display: grid; gap: 4px; }
.about-note {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 13.5px;
}

/* ---------- 8. 页脚 ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 28px 0 34px;
  color: var(--faint);
  font-size: 13.5px;
}
.footer-inner { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.footer-links a { color: var(--muted); }

/* ---------- 9. 弹窗 ---------- */
.modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(28, 26, 23, 0.5); }

.modal-panel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
  width: min(880px, 100%);
  max-height: min(88vh, 860px);
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line-dark);
  border-radius: 4px;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--line-dark);
  border-radius: 3px;
  background: #fff;
  cursor: pointer;
  line-height: 1;
}
.modal-close:hover { border-color: var(--text); }

.modal-poster { background: var(--bg-soft); display: grid; place-items: center; }
.modal-poster img { width: 100%; height: 100%; object-fit: contain; }

.modal-body {
  padding: 26px 28px 28px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.modal-body h2 { font-size: 22px; }
.modal-sub { color: var(--faint); font-size: 13px; }
.modal-facts { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 14px 0; }
.modal-facts > div { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 10px; font-size: 14.5px; }
.modal-facts > div + div { margin-top: 6px; }
.modal-facts dt { color: var(--faint); font-size: 13.5px; }
.modal-facts dd { margin: 0; }
.modal-facts dd small { display: block; color: var(--faint); font-size: 12.5px; }
.modal-summary { color: var(--muted); font-size: 14.5px; }
.modal-highlights { display: grid; gap: 4px; }
.modal-highlights li {
  color: var(--muted);
  font-size: 14px;
  padding-left: 14px;
  position: relative;
}
.modal-highlights li::before { content: "—"; position: absolute; left: 0; color: var(--line-dark); }
.modal-host { color: var(--faint); font-size: 13px; }
.modal-signup { align-self: flex-start; }

/* ---------- 10. 响应式 ---------- */
@media (max-width: 760px) {
  .header-inner { flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; gap: 8px 18px; }
  .site-nav { width: 100%; margin-left: 0; gap: 16px; font-size: 14px; }
  .section { padding: 40px 0; }
  .poster-grid { grid-template-columns: repeat(auto-fill, minmax(146px, 1fr)); gap: 20px 14px; }
  .poster-title { font-size: 15.5px; }
  .calendar { padding: 12px 12px 14px; }
  .calendar-bar { justify-content: flex-start; }
  .calendar-title { font-size: 16.5px; }
  .calendar-grid, .calendar-weekdays { gap: 4px; }
  .cal-day { min-height: 46px; padding: 2px 1px; }
  .day-item { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .modal-panel { grid-template-columns: minmax(0, 1fr); max-height: 90vh; }
  .modal-poster { max-height: 34vh; }
  .modal-body { padding: 20px 18px 22px; }
  .modal-facts > div { grid-template-columns: minmax(0, 1fr); gap: 0; }
}

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