:root {
  --bg: #f5efe7;
  --bg-soft: #fff8f0;
  --ink: #1b140f;
  --ink-soft: #5f5248;
  --line: rgba(67, 42, 22, 0.14);
  --line-strong: rgba(67, 42, 22, 0.24);
  --panel: rgba(255, 251, 246, 0.8);
  --panel-strong: rgba(255, 248, 240, 0.94);
  --accent: #ff7a18;
  --accent-deep: #c94f00;
  --accent-soft: rgba(255, 122, 24, 0.12);
  --teal: #1d7f72;
  --teal-soft: rgba(29, 127, 114, 0.12);
  --shadow: 0 18px 40px rgba(64, 30, 9, 0.12);
  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-sm: 14px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(255, 166, 77, 0.24), transparent 28%),
    radial-gradient(circle at top right, rgba(29, 127, 114, 0.16), transparent 24%),
    linear-gradient(180deg, #fbf6ef 0%, #f5ede4 52%, #efe6dc 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.26) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.26) 1px, transparent 1px);
  background-size: 36px 36px;
  opacity: 0.24;
  pointer-events: none;
}

.page-shell {
  position: relative;
  width: min(1380px, calc(100vw - 32px));
  margin: 24px auto 40px;
}

.hero {
  display: grid;
  grid-template-columns: 1.55fr 0.95fr;
  gap: 18px;
  align-items: end;
  padding: 22px 24px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 32px;
  background:
    linear-gradient(135deg, rgba(255, 250, 245, 0.95), rgba(255, 240, 226, 0.9)),
    rgba(255, 255, 255, 0.4);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.eyebrow,
.panel-kicker {
  margin: 0 0 8px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-deep);
}

.hero h1,
.panel h2 {
  margin: 0;
  line-height: 1.1;
  font-family: "Noto Serif SC", "Songti SC", serif;
}

.hero h1 {
  font-size: clamp(2.15rem, 3.6vw, 3.5rem);
}

.hero-text,
.controls-hint,
.section-note,
.muted {
  color: var(--ink-soft);
}

.hero-text {
  max-width: 56ch;
  margin: 10px 0 0;
  font-size: 0.98rem;
  line-height: 1.65;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.stat-card {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.stat-card strong {
  display: inline;
  margin: 0;
  font-size: 1rem;
  line-height: 1;
}

.stat-card span {
  color: var(--ink-soft);
  font-size: 0.82rem;
  white-space: nowrap;
}

.content-grid {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.panel {
  padding: 24px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.58);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.controls-panel {
  background:
    linear-gradient(135deg, rgba(255, 244, 232, 0.95), rgba(255, 252, 245, 0.86)),
    var(--panel);
}

.controls-head,
.section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
}

.controls-hint,
.section-note {
  margin: 0;
  max-width: 30ch;
  line-height: 1.6;
}

.member-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

.filter-chip {
  position: relative;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.66);
  color: var(--ink);
  border-radius: 999px;
  padding: 11px 18px;
  font-size: 0.96rem;
  font-weight: 700;
  cursor: pointer;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    color 180ms ease;
}

.filter-chip:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 122, 24, 0.36);
}

.filter-chip.is-active {
  background: linear-gradient(135deg, #ff9347, #ff6a00);
  border-color: transparent;
  color: #fffdf7;
  box-shadow: 0 10px 24px rgba(255, 106, 0, 0.26);
}

.selected-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.summary-pill {
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.editor-panel {
  background:
    linear-gradient(135deg, rgba(255, 249, 240, 0.96), rgba(252, 255, 251, 0.9)),
    var(--panel);
}

.editor-card {
  margin-top: 18px;
  padding: 20px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.62);
}

.editor-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
}

.editor-status {
  flex: 1;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 247, 236, 0.92);
  border: 1px solid rgba(255, 153, 89, 0.2);
}

.editor-status strong,
.editor-status h3 {
  display: block;
  margin: 0;
  font-size: 1.05rem;
}

.editor-status p {
  margin: 6px 0 0;
  color: var(--ink-soft);
  line-height: 1.6;
}

.toolbar-actions,
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.primary-button,
.secondary-button,
.ghost-button,
.event-button {
  appearance: none;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  min-height: 42px;
  padding: 0 16px;
  font-family: inherit;
  font-size: 0.94rem;
  font-weight: 700;
  cursor: pointer;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    color 180ms ease,
    box-shadow 180ms ease;
}

.primary-button {
  border-color: transparent;
  background: linear-gradient(135deg, #ff9347, #ff6a00);
  color: #fffaf5;
  box-shadow: 0 10px 24px rgba(255, 106, 0, 0.18);
}

.secondary-button,
.ghost-button,
.event-button {
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover,
.event-button:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 122, 24, 0.36);
}

.primary-button:disabled,
.secondary-button:disabled,
.ghost-button:disabled,
.event-button:disabled {
  opacity: 0.56;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.event-form {
  margin-top: 18px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.form-grid-wide {
  grid-template-columns: 1fr 1.4fr;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-wide {
  grid-column: span 1;
}

.field-label {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--ink-soft);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  font: inherit;
  outline: none;
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease;
}

.field textarea {
  resize: vertical;
  min-height: 110px;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: rgba(255, 122, 24, 0.42);
  box-shadow: 0 0 0 4px rgba(255, 122, 24, 0.08);
  background: #fffdfa;
}

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

.member-choice {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  padding: 0 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  cursor: pointer;
}

.member-choice input {
  width: 18px;
  height: 18px;
  accent-color: #ff7a18;
}

.event-card.is-editing {
  border-color: rgba(255, 122, 24, 0.42);
  box-shadow: 0 0 0 3px rgba(255, 122, 24, 0.08);
}

.schedule-scroll {
  overflow-x: auto;
  margin-top: 18px;
  padding-bottom: 8px;
}

.schedule-desktop {
  display: block;
}

.schedule-mobile {
  display: none;
}

.schedule-table {
  display: grid;
  grid-template-columns: 170px repeat(5, minmax(230px, 1fr));
  min-width: 1320px;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid var(--line);
}

.cell {
  position: relative;
  min-height: 156px;
  padding: 18px 18px 16px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 252, 248, 0.85);
}

.cell:nth-child(6n + 1) {
  background: rgba(255, 248, 242, 0.9);
}

.cell.is-header,
.cell.is-slot {
  min-height: auto;
  background: rgba(255, 255, 255, 0.88);
}

.cell.is-header {
  position: sticky;
  top: 0;
  z-index: 1;
}

.cell.is-slot {
  font-size: 1.15rem;
  font-weight: 800;
}

.corner {
  background:
    linear-gradient(135deg, rgba(255, 189, 138, 0.18), rgba(255, 255, 255, 0.85)),
    rgba(255, 255, 255, 0.92);
}

.date-title {
  display: block;
  margin-bottom: 6px;
  font-size: 1.55rem;
  font-family: "Noto Serif SC", "Songti SC", serif;
}

.weekday {
  color: var(--ink-soft);
  font-size: 0.96rem;
}

.slot-name {
  font-size: 1.1rem;
}

.cell-toolbar {
  display: flex;
  justify-content: flex-end;
  margin: -4px -4px 10px 0;
}

.cell-add-button {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 122, 24, 0.12);
  color: var(--accent-deep);
  font-family: inherit;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition:
    transform 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease;
}

.cell-add-button:hover {
  transform: translateY(-1px);
  background: rgba(255, 122, 24, 0.18);
  box-shadow: 0 8px 18px rgba(255, 122, 24, 0.14);
}

.event-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.event-card {
  padding: 12px 14px;
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.84), rgba(255, 245, 236, 0.92)),
    var(--panel-strong);
  border: 1px solid rgba(255, 153, 89, 0.18);
}

.event-time {
  margin: 0 0 6px;
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--accent-deep);
}

.event-title {
  margin: 0;
  font-size: 1rem;
  line-height: 1.55;
  font-weight: 700;
}

.event-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.event-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.member-tag,
.map-tag,
.note-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 11px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 700;
}

.member-tag {
  background: var(--teal-soft);
  color: var(--teal);
}

.map-tag {
  background: var(--accent-soft);
  color: var(--accent-deep);
  text-decoration: none;
  border: 0;
  transition:
    transform 180ms ease,
    background 180ms ease,
    color 180ms ease;
}

.map-tag:hover {
  transform: translateY(-1px);
  background: rgba(255, 122, 24, 0.18);
}

.event-button {
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-soft);
  background: rgba(103, 78, 56, 0.06);
  box-shadow: none;
}

.event-button:hover {
  color: var(--ink);
  background: rgba(103, 78, 56, 0.1);
}

.note-tag {
  background: rgba(103, 78, 56, 0.08);
  color: var(--ink-soft);
}

.empty-state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  color: var(--ink-soft);
  opacity: 0.9;
}

.mobile-schedule {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mobile-swipe-hint {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 122, 24, 0.08);
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-weight: 700;
}

.mobile-day-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 100%;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 6px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.mobile-day-rail::-webkit-scrollbar {
  display: none;
}

.mobile-day-slide {
  scroll-snap-align: start;
  min-width: 0;
}

.mobile-day {
  padding: 16px 14px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 248, 241, 0.92)),
    rgba(255, 255, 255, 0.76);
}

.mobile-day-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 12px;
  margin-bottom: 10px;
}

.mobile-day-title {
  display: block;
  font-size: 1.08rem;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-weight: 700;
}

.mobile-day-weekday {
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.mobile-slots {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mobile-slot {
  padding: 10px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(67, 42, 22, 0.1);
}

.mobile-slot-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.mobile-slot-name {
  font-size: 0.96rem;
  font-weight: 800;
}

.mobile-add-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 122, 24, 0.14);
  color: var(--accent-deep);
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 800;
  cursor: pointer;
  transition:
    transform 180ms ease,
    background 180ms ease;
}

.mobile-add-button:hover {
  transform: translateY(-1px);
  background: rgba(255, 122, 24, 0.2);
}

.mobile-slot-empty {
  display: block;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(103, 78, 56, 0.04);
  color: var(--ink-soft);
  font-size: 0.9rem;
}

@media (max-width: 980px) {
  .page-shell {
    width: min(100vw - 20px, 1380px);
    margin: 10px auto 26px;
  }

  .hero,
  .controls-head,
  .section-head {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: start;
  }

  .hero {
    padding: 22px;
  }

  .hero-stats {
    width: 100%;
  }

  .panel {
    padding: 18px;
  }

  .form-grid,
  .form-grid-wide {
    grid-template-columns: 1fr;
  }

  .member-checklist {
    grid-template-columns: 1fr;
  }

  .editor-toolbar {
    flex-direction: column;
    align-items: start;
  }

  .schedule-table {
    min-width: 1160px;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100vw - 14px, 1380px);
    margin: 8px auto 20px;
  }

  .hero,
  .panel,
  .editor-card {
    border-radius: 22px;
  }

  .hero {
    padding: 18px;
  }

  .hero h1 {
    font-size: 1.95rem;
  }

  .hero-stats {
    justify-content: flex-start;
  }

  .hero-text,
  .controls-hint,
  .section-note {
    font-size: 0.94rem;
  }

  .panel {
    padding: 16px;
  }

  .member-filter {
    gap: 10px;
  }

  .filter-chip {
    min-height: 42px;
    padding: 0 14px;
    font-size: 0.9rem;
  }

  .selected-summary {
    gap: 8px;
  }

  .summary-pill {
    width: 100%;
    padding: 10px 12px;
  }

  .schedule-desktop {
    display: none;
  }

  .schedule-mobile {
    display: block;
  }

  .mobile-day {
    border-radius: 18px;
  }

  .event-card {
    padding: 12px;
    border-radius: 16px;
  }

  .event-time {
    font-size: 0.84rem;
  }

  .event-title {
    font-size: 0.96rem;
    line-height: 1.45;
  }

  .event-meta,
  .event-actions {
    gap: 6px;
  }

  .member-tag,
  .map-tag,
  .note-tag,
  .event-button {
    min-height: 30px;
    font-size: 0.76rem;
  }

  .map-tag,
  .event-button {
    padding: 0 10px;
  }

  .toolbar-actions,
  .form-actions {
    width: 100%;
  }

  .toolbar-actions > *,
  .form-actions > * {
    flex: 1 1 100%;
  }

  .field input,
  .field select,
  .field textarea {
    min-height: 46px;
    font-size: 16px;
  }

  .field textarea {
    min-height: 120px;
  }

  .member-choice {
    min-height: 46px;
    padding: 0 12px;
  }

  .date-title {
    font-size: 1.3rem;
  }
}
