:root {
  --bg: #f9f0ec;
  --paper: #fff8f4;
  --ink: #261815;
  --soft: #6d524b;
  --line: rgba(117, 40, 33, 0.2);
  --accent: #9f3128;
  --accent-deep: #6d1d17;
  --accent-wash: #f4ddd5;
  --ok-bg: #e2f1e8;
  --ok-ink: #1f6646;
  --neutral-bg: #ece6e2;
  --neutral-ink: #655c56;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Manrope", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at 14% -6%, rgba(159, 49, 40, 0.16) 0, transparent 44%),
    radial-gradient(circle at 86% 10%, rgba(109, 29, 23, 0.1) 0, transparent 36%),
    linear-gradient(180deg, #fff7f3 0%, var(--bg) 100%);
}

.hero {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: max(14px, env(safe-area-inset-top)) 14px 12px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 246, 241, 0.95) 0%, rgba(255, 241, 234, 0.88) 100%);
  backdrop-filter: blur(10px);
}

.site-logo {
  width: min(64vw, 220px);
  height: auto;
  display: block;
}

.hero-desc,
.hero-tip {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--soft);
}

.admin-entry {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 8px;
  border: 1px solid rgba(159, 49, 40, 0.42);
  border-radius: 999px;
  padding: 6px 12px;
  text-decoration: none;
  color: var(--accent-deep);
  background: #fff7f3;
  font-size: 12px;
  font-weight: 800;
}

.container {
  padding: 12px 12px calc(18px + env(safe-area-inset-bottom));
}

.panel {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 251, 248, 0.94) 0%, rgba(255, 246, 241, 0.94) 100%);
  box-shadow: 0 10px 24px rgba(90, 31, 27, 0.1);
}

.controls {
  padding: 12px;
}

label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 800;
  color: #654e47;
}

.search-wrap {
  margin-bottom: 10px;
}

input,
select {
  width: 100%;
  border: 1px solid rgba(117, 40, 33, 0.24);
  border-radius: 11px;
  padding: 10px 11px;
  font: inherit;
  color: var(--ink);
  background: #fffefd;
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(159, 49, 40, 0.14);
}

.filter-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.ghost-btn,
.pager-btn {
  border: 1px solid rgba(159, 49, 40, 0.36);
  border-radius: 999px;
  padding: 9px 14px;
  background: #fff7f3;
  color: var(--accent-deep);
  font: inherit;
  font-weight: 800;
}

.ghost-btn {
  margin-top: 10px;
}

.meta-row {
  margin: 12px 2px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

#resultCount,
#institutionCount {
  margin: 0;
  font-size: 12px;
  color: #4f3933;
  font-weight: 700;
}

.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(155deg, var(--paper) 0%, #ffece5 100%);
  padding: 10px;
  box-shadow: 0 12px 26px rgba(105, 37, 31, 0.13);
}

.card-link {
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.card-link:hover {
  transform: translateY(-2px);
  border-color: rgba(159, 49, 40, 0.52);
  box-shadow: 0 16px 28px rgba(105, 37, 31, 0.2);
}

.cover-wrap {
  margin: 0 0 10px;
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: #d9c6ba;
}

.cover-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-top {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
}

.pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.pill[hidden] {
  display: none !important;
}

.status-pill.ongoing {
  background: var(--ok-bg);
  color: var(--ok-ink);
}

.status-pill.upcoming {
  background: var(--accent-wash);
  color: var(--accent);
}

.status-pill.ended,
.status-pill.unknown {
  background: var(--neutral-bg);
  color: var(--neutral-ink);
}

.new-pill {
  background: var(--accent-deep);
  color: #fff6f2;
}

.institution {
  margin: 0;
  font-size: 12px;
  color: #6e584f;
  font-weight: 700;
}

.institution-link {
  border: 0;
  padding: 0;
  background: transparent;
  text-align: left;
  text-decoration: underline;
  text-decoration-color: rgba(159, 49, 40, 0.45);
  text-underline-offset: 2px;
  cursor: pointer;
}

.title {
  margin: 7px 0;
  font-size: 18px;
  line-height: 1.45;
  font-weight: 900;
}

.date {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
}

.ticket-price {
  margin: 8px 0 0;
  font-size: 13px;
  font-weight: 800;
  color: #922f27;
}

.summary {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.56;
  color: #604d46;
}

.empty {
  padding: 28px 12px;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 14px;
  color: #5d4039;
  background: rgba(255, 244, 238, 0.72);
}

.pager {
  margin: 12px 0 14px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 8px;
  align-items: center;
}

.pager-btn {
  margin: 0;
}

#pageInfo {
  margin: 0;
  text-align: center;
  font-size: 12px;
  font-weight: 800;
}

.pager-btn:disabled {
  opacity: 0.4;
}

.directory {
  padding: 12px;
}

.directory-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.directory-head h2,
.directory-head p {
  margin: 0;
  font-size: 13px;
}

.institution-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  max-height: 170px;
  overflow: auto;
}

.institution-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 11px;
  color: #483932;
  background: #fff9f6;
}

@media (max-width: 640px) {
  .filter-row {
    grid-template-columns: 1fr;
  }
}
