:root {
  --bg: #f7f1e8;
  --panel: rgba(255, 250, 244, 0.92);
  --panel-strong: #fffaf3;
  --text: #2e2a26;
  --muted: #6a6158;
  --accent: #d15a2f;
  --accent-deep: #8f3819;
  --accent-soft: rgba(209, 90, 47, 0.1);
  --green-soft: rgba(132, 181, 145, 0.14);
  --line: rgba(46, 42, 38, 0.12);
  --shadow: 0 18px 60px rgba(91, 55, 33, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Plus Jakarta Sans", "Avenir Next", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(209, 90, 47, 0.16), transparent 32%),
    radial-gradient(circle at top right, rgba(132, 181, 145, 0.18), transparent 24%),
    linear-gradient(180deg, #f4ecdf 0%, var(--bg) 42%, #f8f4ed 100%);
  min-height: 100vh;
}

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

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

.hero,
.page-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.hero {
  padding: 24px 0 48px;
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 48px;
}

.brand {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  color: var(--muted);
}

.hero-content,
.page-header,
.section,
.filter-bar {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.hero-content {
  padding: 56px;
}

.hero-proof,
.header-notes {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-proof {
  margin-top: 24px;
}

.proof-pill,
.note-chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.88);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
}

.page-shell {
  padding: 24px 0 48px;
}

.page-header {
  padding: 40px;
  margin-bottom: 24px;
}

.section,
.filter-bar,
.results-toolbar {
  padding: 28px;
  margin-bottom: 24px;
}

.eyebrow,
.section-tag {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-deep);
  font-size: 0.78rem;
  font-weight: 700;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(2.8rem, 6vw, 5.3rem);
  line-height: 0.98;
  margin-bottom: 20px;
}

.hero-content h1 {
  max-width: 11ch;
}

.page-header h1 {
  max-width: none;
}

h2 {
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  margin-bottom: 10px;
}

h3 {
  font-size: 1.2rem;
}

.lead {
  max-width: 720px;
  font-size: 1.08rem;
  line-height: 1.7;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 28px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 20px;
  border-radius: 999px;
  font-weight: 700;
  border: 1px solid transparent;
  cursor: pointer;
  font: inherit;
  transition: transform 180ms ease, background-color 180ms ease, border-color 180ms ease, color 180ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:disabled {
  opacity: 0.6;
  cursor: wait;
  transform: none;
}

.button:focus-visible,
.text-input:focus-visible,
.filter-bar select:focus-visible,
.back-link:focus-visible,
.nav-links a:focus-visible,
.link-chip:focus-visible {
  outline: 3px solid rgba(209, 90, 47, 0.22);
  outline-offset: 2px;
}

.button.primary {
  background: var(--accent);
  color: #fff8f1;
}

.button.secondary {
  background: transparent;
  border: 1px solid var(--line);
}

.button.tertiary {
  background: #fffdf8;
  border: 1px solid var(--line);
  color: var(--text);
}

.button.primary:hover {
  background: #b94c25;
  color: #fff8f1;
}

.button.secondary:hover,
.button.tertiary:hover {
  background: #fff7ee;
}

.grid-two,
.grid-three {
  display: grid;
  gap: 20px;
}

.grid-two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card {
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 24px;
}

.accent-panel {
  background: linear-gradient(135deg, rgba(209, 90, 47, 0.08), rgba(132, 181, 145, 0.12));
}

.feature-list {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.8;
}

.back-link {
  display: inline-block;
  margin-bottom: 18px;
  color: var(--muted);
}

.back-link:hover {
  color: var(--accent-deep);
}

.filter-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.location-panel {
  grid-column: 1 / -1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fffdf8;
}

.location-panel > div:first-child {
  flex: 1 1 280px;
  min-width: 0;
}

.location-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: flex-end;
  flex: 1 1 520px;
}

.text-input {
  flex: 1 1 320px;
  min-width: 220px;
  min-height: 46px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #fffdf8;
  padding: 0 16px;
  font: inherit;
  color: var(--text);
}

.text-input:hover,
.filter-bar select:hover {
  border-color: rgba(143, 56, 25, 0.24);
}

.text-input:focus-visible,
.filter-bar select:focus-visible {
  border-color: rgba(143, 56, 25, 0.38);
  background: #ffffff;
}

.search-field {
  min-width: 0;
}

.search-input {
  width: 100%;
}

.location-label {
  margin-bottom: 6px;
  font-size: 0.9rem;
  color: var(--accent-deep);
  font-weight: 700;
}

.location-status {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.filter-bar label {
  display: grid;
  gap: 8px;
  font-size: 0.95rem;
  color: var(--muted);
}

.filter-bar select {
  width: 100%;
  min-height: 44px;
  border-radius: 14px;
  border: 1px solid var(--line);
  padding: 0 14px;
  background: #fffdf8;
}

.results-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: rgba(255, 250, 244, 0.72);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.results-label {
  margin-bottom: 6px;
  color: var(--accent-deep);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.results-summary {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.urgency-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.list-pagination {
  margin-top: -8px;
}

.activity-list {
  display: grid;
  gap: 18px;
}

.activity-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 26px;
}

.activity-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.activity-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 16px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-size: 0.85rem;
  font-weight: 700;
}

.pill.soft {
  background: var(--green-soft);
  color: #315a47;
}

.time-context-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(143, 56, 25, 0.92);
  color: #fff8f1;
  font-size: 0.85rem;
  font-weight: 800;
}

.activity-card h2 {
  margin-bottom: 8px;
}

.activity-card .lead {
  max-width: none;
  font-size: 1rem;
  margin-bottom: 18px;
}

.activity-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 18px;
}

.detail-block {
  min-width: 0;
}

.detail-label {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.detail-value {
  margin: 0;
  line-height: 1.55;
}

.activity-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.countdown-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 18px;
}

.countdown-chip {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: rgba(46, 42, 38, 0.06);
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 700;
}

.legend-chip {
  min-height: 30px;
  font-size: 0.8rem;
  pointer-events: none;
}

.event-countdown {
  border-color: rgba(46, 42, 38, 0.08);
}

.register-countdown {
  border-color: rgba(209, 90, 47, 0.18);
}

.countdown-chip.normal {
  background: rgba(46, 42, 38, 0.06);
  color: var(--text);
}

.countdown-chip.upcoming {
  background: rgba(196, 145, 59, 0.18);
  border-color: rgba(196, 145, 59, 0.26);
  color: #7c5416;
}

.countdown-chip.soon {
  background: rgba(209, 90, 47, 0.16);
  border-color: rgba(209, 90, 47, 0.28);
  color: var(--accent-deep);
}

.countdown-chip.critical {
  background: rgba(143, 56, 25, 0.92);
  border-color: rgba(143, 56, 25, 0.92);
  color: #fff8f1;
}

.countdown-chip.expired {
  background: rgba(46, 42, 38, 0.12);
  border-color: rgba(46, 42, 38, 0.1);
  color: var(--muted);
}

.register-countdown.upcoming {
  box-shadow: inset 0 0 0 1px rgba(196, 145, 59, 0.12);
}

.register-countdown.soon {
  box-shadow: 0 0 0 3px rgba(209, 90, 47, 0.08);
}

.register-countdown.critical {
  box-shadow: 0 0 0 4px rgba(143, 56, 25, 0.14);
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(46, 42, 38, 0.06);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.activity-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  color: var(--muted);
}

.activity-source-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
}

.source-name {
  color: var(--muted);
  font-size: 0.95rem;
}

.activity-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.link-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fffdf8;
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 700;
  transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.link-chip:hover {
  background: #fff7ee;
  transform: translateY(-1px);
}

.link-chip.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff8f1;
}

.link-chip.primary:hover {
  background: #b94c25;
  border-color: #b94c25;
  color: #fff8f1;
}

.distance-text {
  font-weight: 700;
  color: var(--accent-deep);
}

.status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(46, 42, 38, 0.06);
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 700;
  white-space: nowrap;
}

.status-chip.required {
  background: var(--accent-soft);
  color: var(--accent-deep);
}

code {
  padding: 2px 6px;
  border-radius: 8px;
  background: rgba(46, 42, 38, 0.06);
}

@media (max-width: 800px) {
  .grid-two,
  .grid-three,
  .filter-bar,
  .activity-detail-grid {
    grid-template-columns: 1fr;
  }

  .location-panel {
    align-items: flex-start;
    flex-direction: column;
  }

  .location-actions {
    justify-content: stretch;
  }

  .location-actions,
  .text-input,
  .location-actions .button {
    width: 100%;
  }

  .hero-content,
  .page-header,
  .section,
  .filter-bar,
  .results-toolbar,
  .activity-card {
    padding: 22px;
  }

  h1 {
    font-size: 2.8rem;
  }

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

  .activity-card-header,
  .results-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .urgency-legend {
    justify-content: flex-start;
  }

  .list-pagination .button {
    width: 100%;
  }
}
