:root {
  color-scheme: light;
  --bg: #ffffff;
  --paper: #ffffff;
  --text: #1f2933;
  --muted: #6b7280;
  --line: #e5e7eb;
  --accent: #111827;
  --accent-dark: #000000;
  --danger: #b42318;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  line-height: 1.65;
}

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

a:hover {
  color: var(--accent);
}

.site-header,
.site-footer,
.container {
  width: min(760px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}

.brand {
  font-size: 20px;
  font-weight: 750;
}

nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 14px;
  color: var(--muted);
  font-size: 14px;
}

.container {
  padding: 28px 0 48px;
}

.hero {
  padding: 56px 0 44px;
  border-bottom: 1px solid var(--line);
}

.hero h1,
.page-head h1,
.article h1,
.form h1,
.calendar-head h1,
.admin-head h1 {
  margin: 0;
  line-height: 1.18;
  letter-spacing: 0;
}

.hero h1 {
  max-width: 760px;
  font-size: clamp(34px, 6vw, 62px);
}

.hero p {
  max-width: 620px;
  color: var(--muted);
  font-size: 18px;
}

.eyebrow,
.meta {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
}

.eyebrow {
  color: var(--accent);
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.button,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 9px 16px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font: inherit;
}

.button:hover,
button:hover {
  background: var(--accent-dark);
  color: #fff;
}

.button.ghost {
  background: transparent;
  color: var(--accent);
}

.button.ghost:hover {
  background: #f3f4f6;
}

.danger {
  border-color: var(--danger);
  background: var(--danger);
}

.section-title,
.calendar-head,
.admin-head,
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin: 18px 0 14px;
}

.section-title,
.page-head {
  justify-content: center;
  text-align: center;
}

.admin-head {
  justify-content: space-between;
}

.page-head,
.admin-head {
  align-items: center;
}

.section-title h2,
.list-item h2,
.card h3 {
  margin: 0;
}

.section-title a,
.list-item > a {
  color: var(--accent);
  font-weight: 650;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
}

.card,
.form,
.calendar,
.article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.card {
  padding: 18px;
}

.card h3 {
  font-size: 20px;
}

.card p:last-child,
.list-item p:last-child {
  margin-bottom: 0;
  color: var(--muted);
}

.list {
  display: grid;
  gap: 0;
}

.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.article {
  padding: min(7vw, 56px);
}

.article h1 {
  max-width: 680px;
  font-size: clamp(30px, 5vw, 52px);
}

.content {
  max-width: 680px;
  margin-top: 30px;
  font-size: 18px;
}

.content p {
  margin: 0 0 20px;
}

.content img {
  display: block;
  width: 100%;
  height: auto;
  margin: 0;
  border-radius: 8px;
}

.content p:has(img),
.content .photo-block {
  margin: 30px 0;
}

.content .photo-block figcaption {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.content h1,
.content h2,
.content h3 {
  margin: 28px 0 12px;
  line-height: 1.28;
}

.content ul,
.content ol {
  margin: 0 0 20px;
  padding-left: 24px;
}

.content blockquote {
  margin: 0 0 20px;
  padding: 10px 16px;
  border-left: 3px solid var(--accent);
  background: #f9fafb;
  color: var(--muted);
}

.content code {
  padding: 2px 5px;
  border-radius: 5px;
  background: #f3f4f6;
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: .92em;
}

.content pre {
  overflow-x: auto;
  margin: 0 0 22px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fafb;
}

.content pre code {
  padding: 0;
  background: transparent;
}

.calendar {
  padding: 12px;
}

.calendar.compact {
  margin-bottom: 22px;
  padding: 0 0 18px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
}

.compact-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 14px;
}

.compact-head span {
  color: var(--text);
  font-weight: 700;
}

.week {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.week + .week {
  margin-top: 8px;
}

.labels {
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.day {
  position: relative;
  min-height: 82px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.compact .day {
  min-height: 38px;
  padding: 6px;
  font-size: 13px;
}

.compact .badge {
  right: 5px;
  bottom: 5px;
  min-width: 18px;
  padding: 0 5px;
  font-size: 11px;
}

.day:hover {
  border-color: var(--accent);
}

.day.muted {
  opacity: .38;
}

.day.today {
  border-color: var(--accent);
}

.badge {
  position: absolute;
  right: 8px;
  bottom: 8px;
  min-width: 24px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  text-align: center;
}

.form {
  display: grid;
  gap: 16px;
  max-width: 760px;
  padding: 24px;
}

.form.narrow {
  max-width: 420px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font: inherit;
  padding: 10px 12px;
}

textarea {
  resize: vertical;
}

.editor-dropzone textarea {
  min-height: 340px;
}

.editor-help {
  margin: -6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.editor-dragging .editor-dropzone textarea {
  border-color: var(--accent);
  background: #f9fafb;
  outline: 2px solid rgba(17, 24, 39, .12);
}

.admin-tools {
  display: flex;
  gap: 10px;
  margin-top: 28px;
}

.photo-form {
  margin-bottom: 18px;
}

.photo-help {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.photo-error-text {
  color: var(--danger);
}

.photo-notice {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fafb;
}

.photo-notice p {
  margin: 0;
  color: var(--muted);
}

.photo-gallery {
  display: grid;
  gap: 14px;
}

.photo-item {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.photo-item img {
  width: 150px;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 8px;
}

.photo-item div {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.empty,
.error {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.error {
  border-color: #fecaca;
  color: var(--danger);
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 18px;
  padding: 24px 0 36px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

@media (max-width: 700px) {
  .site-header,
  .section-title,
  .calendar-head,
  .admin-head,
  .page-head,
  .list-item {
    align-items: flex-start;
    flex-direction: column;
  }

  nav {
    justify-content: flex-start;
  }

  .hero {
    padding-top: 34px;
  }

  .day {
    min-height: 58px;
    padding: 7px;
  }

  .week {
    gap: 5px;
  }

  .photo-item {
    grid-template-columns: 1fr;
  }

  .photo-item img {
    width: 100%;
  }
}
