: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 {
  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;
}

.menu button: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: 14px 20px;
  border-radius: 10px;
  background: rgba(229, 74, 44, 0.08);
  border: 1px solid rgba(229, 74, 44, 0.3);
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 12px;
}

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

.broadcast-link {
  color: var(--accent);
  text-decoration: underline;
  font-size: 13px;
}

.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;
  }
}

@media (max-width: 1000px) {
  .broadcast-bar {
    margin: 0 24px 24px;
  }
}
