:root {
  --bg0: #14080a;
  --bg1: #2a0d14;
  --bg2: #4a1520;
  --fire: #ff2d4b;
  --fire2: #ff6a3d;
  --gold: #ffd28a;
  --card: rgba(255, 255, 255, 0.96);
  --ink: #1a0c10;
  --muted: #7a5a62;
  --line: rgba(255, 255, 255, 0.14);
  --radius: 18px;
  --shadow: 0 18px 40px rgba(80, 8, 22, 0.28);
  --font-display: "DIN Alternate", "Oswald", "HarmonyOS Sans", "PingFang SC", sans-serif;
  --font-body: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(255, 106, 61, 0.35), transparent 60%),
    radial-gradient(900px 500px at 0% 0%, rgba(255, 45, 75, 0.4), transparent 55%),
    linear-gradient(165deg, var(--bg0), var(--bg1) 45%, #1c0a10 100%);
  background-attachment: fixed;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.wrap {
  width: min(1080px, calc(100% - 24px));
  margin: 0 auto;
}

/* hero */
.hero {
  position: relative;
  overflow: hidden;
  padding: 28px 0 10px;
  color: #fff;
}
.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 14px;
  padding: 8px 0 18px;
}
.brand {
  font-family: var(--font-display);
  font-size: clamp(28px, 7vw, 48px);
  font-weight: 800;
  letter-spacing: 0.12em;
  line-height: 1.05;
  background: linear-gradient(110deg, #fff 20%, var(--gold) 55%, #fff 85%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: brandIn 0.8s ease both;
}
.hero h1 {
  margin: 0;
  font-size: clamp(22px, 4.6vw, 34px);
  font-weight: 700;
  letter-spacing: 0.02em;
  animation: rise 0.7s 0.08s ease both;
}
.hero p {
  margin: 0;
  max-width: 34em;
  color: rgba(255, 255, 255, 0.78);
  font-size: 14px;
  line-height: 1.6;
  animation: rise 0.7s 0.16s ease both;
}
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  animation: rise 0.7s 0.24s ease both;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.08);
  color: #ffe8ee;
  font-size: 12px;
  backdrop-filter: blur(8px);
}
.pill strong { color: var(--gold); font-weight: 700; }

.hero-glow {
  position: absolute;
  inset: auto -20% -40% 20%;
  height: 220px;
  background: radial-gradient(circle, rgba(255, 80, 60, 0.45), transparent 70%);
  filter: blur(18px);
  pointer-events: none;
  animation: pulse 3.6s ease-in-out infinite;
}

/* tabs */
.tabs {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 0 14px;
  margin-bottom: 4px;
  background: linear-gradient(180deg, rgba(20, 8, 10, 0.92), rgba(20, 8, 10, 0.72) 70%, transparent);
  backdrop-filter: blur(10px);
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  appearance: none;
  -webkit-appearance: none;
  flex: 0 0 auto;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  color: rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.06);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.tab:hover { transform: translateY(-1px); color: #fff; }
.tab.active {
  color: #fff;
  background: linear-gradient(90deg, var(--fire), var(--fire2));
  box-shadow: 0 10px 22px rgba(255, 45, 75, 0.28);
}

/* grid */
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding-bottom: 48px;
}
@media (min-width: 760px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
}
@media (min-width: 1020px) {
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transform: translateY(12px);
  opacity: 0;
  animation: cardIn 0.55s ease forwards;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 22px 44px rgba(80, 8, 22, 0.34);
}
button.card {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  padding: 0;
  font: inherit;
  text-align: left;
  cursor: pointer;
  width: 100%;
}
.card-cover {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #f3e6e9;
  overflow: hidden;
}
.card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease;
}
.card:hover .card-cover img { transform: scale(1.05); }
.badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  padding: 4px 8px;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--fire), var(--fire2));
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.card-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 12px 14px;
  flex: 1;
}
.card-body h3 {
  margin: 0;
  font-size: 15px;
  line-height: 1.4;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.card-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1 1 8em;
  min-width: 0;
}
.venue-tag {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, #ff2145, #ff6a3d);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.card-body p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  margin-top: 2px;
}
.status {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: #e8f8ef;
  color: #1a8f4c;
}
.status-未开始 { background: #fff4e5; color: #c26a00; }
.status-已结束 { background: #f1eef0; color: #8a6a72; }
.status-进行中 { background: #e8f8ef; color: #1a8f4c; }
.time-range {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
  letter-spacing: 0.01em;
}
.card[hidden] { display: none !important; }
.cta {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  border-radius: 999px;
  background: linear-gradient(90deg, #ff2145, #ff6a3d);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}
.cta::after { content: "→"; transition: transform 0.2s ease; }
.card:hover .cta::after { transform: translateX(3px); }

.empty {
  grid-column: 1 / -1;
  padding: 48px 20px;
  text-align: center;
  color: rgba(255, 255, 255, 0.7);
}

.footer {
  padding: 8px 0 28px;
  text-align: center;
  color: rgba(255, 255, 255, 0.45);
  font-size: 12px;
}

/* grab modal — 必须用 [hidden] 强制隐藏，否则 display:flex 会一进页就弹出来 */
.modal-mask[hidden] {
  display: none !important;
}
.modal-mask:not([hidden]) {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  background: rgba(12, 4, 8, 0.62);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease;
}
@media (min-width: 720px) {
  .modal-mask:not([hidden]) { align-items: center; }
}
.modal {
  position: relative;
  width: min(420px, 100%);
  max-height: min(88vh, 640px);
  overflow: auto;
  padding: 22px 18px 20px;
  border-radius: 22px 22px 18px 18px;
  background: linear-gradient(180deg, #fff8f6 0%, #fff 40%);
  box-shadow: 0 24px 60px rgba(40, 4, 12, 0.45);
  animation: rise 0.28s ease both;
}
.modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgba(26, 12, 16, 0.06);
  color: #5a3a42;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.modal h2 {
  margin: 0 28px 4px 0;
  font-size: 18px;
  color: var(--ink);
  line-height: 1.35;
}
.modal-sub {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13px;
}
.modal-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 14px;
  padding: 4px;
  border-radius: 14px;
  background: rgba(26, 12, 16, 0.06);
}
.modal-tab {
  height: 36px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: #6a4a52;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.modal-tab.active {
  background: #fff;
  color: var(--fire);
  box-shadow: 0 4px 12px rgba(80, 8, 22, 0.12);
}
.modal-pane { display: none; }
.modal-pane.active { display: grid; gap: 12px; }
.word-box {
  padding: 14px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid rgba(26, 12, 16, 0.08);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
  word-break: break-all;
  max-height: 140px;
  overflow: auto;
}
.word-box.small { font-size: 12px; color: var(--muted); max-height: 88px; }
.qr-box {
  display: grid;
  place-items: center;
  padding: 12px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid rgba(26, 12, 16, 0.08);
}
.qr-box img {
  width: 200px;
  height: 200px;
  object-fit: contain;
}
.modal-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #ff2145, #ff6a3d);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}
.modal-btn.ghost {
  background: rgba(26, 12, 16, 0.06);
  color: #4a3036;
}
.modal-hint {
  margin: 0;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}
.toast {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(26, 12, 16, 0.88);
  color: #fff;
  font-size: 13px;
  white-space: nowrap;
  animation: fadeIn 0.15s ease;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes brandIn {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
@keyframes cardIn {
  to { opacity: 1; transform: none; }
}
@keyframes pulse {
  0%, 100% { opacity: 0.65; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.08); }
}

/* admin */
.admin-body {
  background: #f4f1ef;
  color: #1d1517;
  font-family: var(--font-body);
}
.admin-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: #1a0c10;
  color: #fff;
}
.admin-bar a { color: #ffd28a; }
.admin-main {
  width: min(1100px, calc(100% - 24px));
  margin: 18px auto 40px;
  display: grid;
  gap: 16px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.stat {
  background: #fff;
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: 0 8px 24px rgba(40, 10, 16, 0.06);
}
.stat b { display: block; font-size: 24px; }
.stat span { color: #87656d; font-size: 12px; }
.panel {
  background: #fff;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 8px 24px rgba(40, 10, 16, 0.06);
}
.panel h2 { margin: 0 0 12px; font-size: 18px; }
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.form-grid .full { grid-column: 1 / -1; }
label { display: grid; gap: 6px; font-size: 12px; color: #6d4f57; }
input, select, textarea {
  width: 100%;
  border: 1px solid #ead8dc;
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  background: #fffafb;
}
textarea { min-height: 72px; resize: vertical; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  font: inherit;
  cursor: pointer;
  background: #ff2d4b;
  color: #fff;
}
.btn.ghost { background: #f0e4e7; color: #4a2c34; }
.btn.danger { background: #7a1d2e; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td {
  padding: 10px 8px;
  border-bottom: 1px solid #f0e4e7;
  text-align: left;
  vertical-align: top;
}
.table img {
  width: 72px;
  height: 40px;
  object-fit: cover;
  border-radius: 8px;
  background: #f6ecef;
}
.muted { color: #87656d; }
.flash {
  padding: 10px 12px;
  border-radius: 10px;
  background: #e8fff0;
  color: #146b38;
}
.flash.error { background: #ffe8ec; color: #8d1d32; }
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, #1a0c10, #4a1520);
}
.login-card {
  width: min(380px, calc(100% - 24px));
  background: #fff;
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}
.login-card h1 { margin: 0 0 6px; font-size: 22px; }
.login-card p { margin: 0 0 16px; color: #87656d; font-size: 13px; }
.login-card .btn { width: 100%; margin-top: 8px; }

@media (max-width: 720px) {
  .form-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr; }
  .table-wrap { overflow-x: auto; }
}
