:root {
  --bg-dark: #efe6dc;
  --bg-light: #f7f1ea;
  --accent: #e54a2c;
  --accent-2: #f1d5c1;
  --text: #2f221a;
  --muted: #8b7d73;
  --card: rgba(255, 255, 255, 0.7);
  --border: rgba(74, 46, 33, 0.15);
  --shadow: 0 18px 40px rgba(95, 63, 45, 0.18);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  font-family: "Space Grotesk", "Sora", "Noto Sans TC", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 15% 15%, rgba(229, 74, 44, 0.12), transparent 45%),
    radial-gradient(circle at 85% 10%, rgba(241, 213, 193, 0.55), transparent 50%),
    linear-gradient(150deg, var(--bg-dark), var(--bg-light));
  min-height: 100vh;
}

button {
  margin-top: 8px;
}

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

.link-muted {
  color: var(--muted);
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 20px 48px;
  gap: 32px;
}

.header .brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header .brand img {
  height: 40px;
}

.menu {
  display: flex;
  gap: 16px;
}

.menu button,
.menu a {
  margin-top: 0;
  background: transparent;
  color: var(--text);
  border: none;
  padding: 10px 6px;
  border-radius: 0;
  cursor: pointer;
  font-size: 16px;
  letter-spacing: 0.5px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.menu button:hover,
.menu a:hover {
  color: var(--accent);
}

.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.broadcast-bar {
  margin: 0 48px 24px;
  padding: 18px 22px;
  border-radius: 24px;
  background:
    linear-gradient(140deg, rgba(255, 255, 255, 0.58), rgba(255, 245, 238, 0.28)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(229, 74, 44, 0.08));
  color: #6a3428;
  display: flex;
  align-items: center;
  gap: 18px;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(22px) saturate(135%);
  -webkit-backdrop-filter: blur(22px) saturate(135%);
  box-shadow:
    0 20px 48px rgba(106, 52, 40, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    inset 0 -1px 0 rgba(255, 255, 255, 0.22);
}

.broadcast-bar::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0.02) 38%, rgba(255, 255, 255, 0.12)),
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.38), transparent 42%);
  pointer-events: none;
}

.broadcast-bar::after {
  content: "";
  position: absolute;
  top: 0;
  left: 18px;
  right: 18px;
  height: 46%;
  border-radius: 0 0 22px 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0));
  pointer-events: none;
}

.broadcast-badge {
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-width: 120px;
  padding: 10px 14px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 240, 233, 0.92), rgba(255, 221, 206, 0.72));
  color: #8a2f1c;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 10px 24px rgba(153, 74, 48, 0.12);
  font-size: 14px;
  letter-spacing: 0.04em;
}

.broadcast-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex: 1;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 14px 20px;
  flex-wrap: wrap;
}

.broadcast-message {
  margin: 0;
  flex: 1;
  min-width: min(320px, 100%);
  color: #542a22;
  font-size: 20px;
  line-height: 1.45;
  font-weight: 700;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.26);
}

.broadcast-bar.is-hidden {
  display: none;
}

.broadcast-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(168, 71, 47, 0.92), rgba(136, 47, 27, 0.92));
  color: #fffaf6;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow:
    0 14px 28px rgba(120, 47, 29, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.broadcast-link:hover {
  background: linear-gradient(180deg, rgba(154, 59, 36, 0.96), rgba(118, 35, 18, 0.96));
}

.ticket-status {
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px dashed var(--border);
  color: var(--muted);
}

.footer {
  padding: 24px 48px 40px;
  color: var(--muted);
  font-size: 13px;
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(41, 29, 21, 0.42);
  display: none;
  z-index: 15;
}

.sidebar-overlay.active {
  display: block;
}

.sidebar {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: min(380px, 92%);
  background: #fdf6ef;
  border-left: 1px solid var(--border);
  padding: 28px 24px;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  z-index: 16;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
}

.sidebar.active {
  transform: translateX(0);
}

.sidebar .close-btn {
  align-self: flex-end;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 12px;
  border-radius: 10px;
  cursor: pointer;
}

.sidebar-schedule-content {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-right: 4px;
}

.sidebar-schedule-status {
  margin: 0;
}

.sidebar-schedule-date-nav {
  position: static;
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  overflow-x: auto;
  padding: 8px 2px 10px 0;
  background: #fdf6ef;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.sidebar-schedule-date-nav::-webkit-scrollbar {
  display: none;
}

.sidebar-schedule-date-btn {
  margin-top: 0;
  border: 1px solid var(--border);
  background: #ffffff;
  color: #5a514a;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  flex: 0 0 auto;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.sidebar-schedule-date-btn.active {
  border-color: transparent;
  color: #fff8f3;
  background: #a34d37;
}

.sidebar-schedule-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sidebar-schedule-item {
  --schedule-accent: #c5a059;
  border: 1px solid rgba(74, 46, 33, 0.08);
  border-left: 4px solid var(--schedule-accent);
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  padding: 14px 14px 13px;
}

.sidebar-schedule-time {
  margin: 0 0 6px;
  color: #7f766f;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.sidebar-schedule-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.sidebar-schedule-description {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.sidebar-schedule-link {
  display: inline-block;
  margin-top: 10px;
  color: #a34d37;
  text-decoration: none;
  border-bottom: 1px solid rgba(163, 77, 55, 0.35);
  font-size: 13px;
  font-weight: 600;
}

.contact-qr {
  display: inline-flex;
  margin: 8px 0;
}

.contact-qr img {
  width: 160px;
  height: 160px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #ffffff;
}

.button-primary {
  margin-top: 8px;
  background: var(--accent);
  color: #fffaf5;
  border: none;
  padding: 12px 18px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
}

.button-primary.is-loading {
  opacity: 0.8;
  cursor: progress;
  pointer-events: none;
}

.button-primary.is-loading::after {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-left: 8px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.6);
  border-top-color: #fffaf5;
  animation: spin 0.8s linear infinite;
  vertical-align: -2px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.button-secondary {
  margin-top: 8px;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  padding: 12px 18px;
  border-radius: 10px;
  cursor: pointer;
}

.button-danger {
  margin-top: 8px;
  background: #b83232;
  color: #fffaf5;
  border: none;
  padding: 12px 18px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
}

.button-danger.is-loading {
  opacity: 0.8;
  cursor: progress;
  pointer-events: none;
}

@media (max-width: 768px) {
  .header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    padding: 20px 24px;
  }

  .menu {
    flex-wrap: wrap;
    column-gap: 16px;
    row-gap: 4px;
  }

  .menu button,
  .menu a {
    padding-top: 6px;
    padding-bottom: 6px;
    line-height: 1.1;
  }
}

@media (max-width: 1000px) {
  .broadcast-bar {
    margin: 0 24px 24px;
    padding: 16px 18px;
    gap: 14px;
    border-radius: 22px;
  }

  .broadcast-badge {
    min-width: 0;
  }

  .broadcast-content {
    gap: 12px;
  }

  .broadcast-message {
    min-width: 0;
    font-size: 18px;
  }
}
