:root {
  --bg: #0b1017;
  --panel: #121b26;
  --panel-soft: #172331;
  --line: #253648;
  --text: #eef4f8;
  --muted: #8fa4b5;
  --accent: #ff6b4a;
  --accent-2: #f7c95c;
  --open: #4fe3b1;
  --upcoming: #f7c95c;
  --closed: #5f7485;
  --purple: #b49bff;
  --shadow: 0 16px 40px rgba(0, 0, 0, .28);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-width: 320px;
  max-width: 100%;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 85% -10%, rgba(255, 107, 74, .16), transparent 32rem),
    radial-gradient(circle at -10% 20%, rgba(79, 227, 177, .1), transparent 30rem),
    var(--bg);
  font-family: Inter, "Noto Sans TC", "Hiragino Sans", "Yu Gothic", system-ui, sans-serif;
}

button, input { font: inherit; }
button { cursor: pointer; }
code {
  padding: 2px 6px;
  border-radius: 5px;
  color: var(--accent-2);
  background: rgba(255, 255, 255, .07);
  font-size: .85em;
}

.app-shell {
  width: min(1280px, calc(100% - 28px));
  margin: 0 auto;
  padding: 28px 0 56px;
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  padding: 32px clamp(20px, 4vw, 48px);
  border: 1px solid rgba(255, 107, 74, .32);
  border-radius: 22px;
  background: linear-gradient(125deg, rgba(22, 34, 47, .96), rgba(14, 21, 30, .9));
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent-2);
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .16em;
}

h1, h2, h3, p { margin-top: 0; }
h1 {
  margin-bottom: 12px;
  font-size: clamp(2rem, 5vw, 3.8rem);
  line-height: 1;
  letter-spacing: -.04em;
}
h1 span { color: var(--accent); }
.hero-title-with-avatar {
  display: flex;
  align-items: center;
  gap: 14px;
}
.hero-brand-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 107, 74, .5);
  box-shadow: 0 0 14px rgba(255, 107, 74, .35);
  flex-shrink: 0;
  transition: transform .2s ease;
}
.hero-brand-avatar:hover {
  transform: scale(1.1) rotate(6deg);
}

.hero-description {
  max-width: 680px;
  margin: 0;
  color: #c2d0db;
  font-size: .92rem;
  line-height: 1.7;
}

.worker-card {
  flex: 0 0 270px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(13, 20, 29, .85);
}
.worker-card.online {
  border-color: rgba(79, 227, 177, .45);
  background: rgba(79, 227, 177, .08);
}
.worker-card.busy {
  border-color: rgba(247, 201, 92, .55);
  background: rgba(247, 201, 92, .1);
}
.worker-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
}
.worker-header strong { font-size: .92rem; }
.worker-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--closed);
}
.worker-card.online .worker-dot {
  background: var(--open);
  box-shadow: 0 0 10px var(--open);
}
.worker-card.busy .worker-dot {
  background: var(--upcoming);
  box-shadow: 0 0 12px var(--upcoming);
  animation: pulse 1.2s infinite ease-in-out;
}
.worker-card small {
  display: block;
  color: var(--muted);
  font-size: .75rem;
  line-height: 1.45;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: .65; }
}

/* Wishlist Panel (許願池) */
.wish-panel {
  margin: 16px 0;
  padding: 16px 18px;
  border: 1px solid rgba(247, 201, 92, .38);
  border-radius: 18px;
  background: linear-gradient(125deg, rgba(28, 38, 54, .95), rgba(18, 26, 38, .95));
  box-shadow: 0 8px 24px rgba(0, 0, 0, .28);
}
.wish-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}
.wish-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 800;
  font-size: .88rem;
  color: #f7c95c;
  background: rgba(247, 201, 92, .14);
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid rgba(247, 201, 92, .28);
}
.wish-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f7c95c;
  box-shadow: 0 0 8px #f7c95c;
  animation: pulse-dot 1.8s infinite ease-in-out;
}
@keyframes pulse-dot {
  0% { transform: scale(0.9); opacity: 0.6; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.6; }
}
.wish-subtitle {
  font-size: .78rem;
  color: #8da4b8;
}
.wish-form {
  display: flex;
  gap: 10px;
}
.wish-input-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 0 14px;
  border: 1px solid #354c63;
  border-radius: 12px;
  background: #0c131b;
  transition: .15s ease;
}
.wish-input-wrap:focus-within {
  border-color: #f7c95c;
  box-shadow: 0 0 0 3px rgba(247, 201, 92, .18);
}
.wish-icon { font-size: 1.1rem; }
.wish-input-wrap input {
  width: 100%;
  min-width: 0;
  padding: 12px 0;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  font-size: .95rem;
}

/* Add Artist Panel (Deprecated/Admin) */
.add-panel {
  margin: 16px 0;
  padding: 16px 18px;
  border: 1px solid rgba(247, 201, 92, .32);
  border-radius: 18px;
  background: linear-gradient(120deg, rgba(24, 36, 50, .94), rgba(17, 26, 36, .94));
  box-shadow: var(--shadow);
}
.add-panel.is-locked {
  background: linear-gradient(120deg, rgba(40, 24, 20, .9), rgba(28, 17, 14, .9));
  border: 1px solid rgba(255, 107, 74, .45);
  padding: 14px 18px;
}
.security-lock-banner {
  display: flex;
  align-items: center;
  gap: 14px;
}
.security-lock-banner .lock-icon {
  font-size: 1.8rem;
  flex-shrink: 0;
}
.security-lock-banner .lock-title {
  font-size: .95rem;
  font-weight: 850;
  color: #ff9e87;
  margin-bottom: 3px;
}
.security-lock-banner .lock-desc {
  font-size: .82rem;
  color: #c9d6e2;
  line-height: 1.45;
}
.add-form {
  display: flex;
  gap: 10px;
}
.add-input-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 0 14px;
  border: 1px solid #354c63;
  border-radius: 12px;
  background: #0c131b;
}
.add-input-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 107, 74, .16);
}
.add-icon { font-size: 1.1rem; }
.add-input-wrap input {
  width: 100%;
  min-width: 0;
  padding: 12px 0;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  font-size: .95rem;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  background: var(--panel-soft);
  font-size: .88rem;
  font-weight: 700;
  white-space: nowrap;
  transition: .16s ease;
}
.button:hover {
  transform: translateY(-1px);
  border-color: #46627d;
}
.button-primary {
  border-color: rgba(255, 107, 74, .65);
  color: #fff;
  background: linear-gradient(135deg, rgba(255, 107, 74, .85), rgba(230, 74, 46, .85));
}
.button-primary:hover {
  background: linear-gradient(135deg, rgba(255, 107, 74, 1), rgba(230, 74, 46, 1));
}
.button-sm {
  padding: 6px 11px;
  border-radius: 9px;
  font-size: .76rem;
}
.button-danger:hover {
  border-color: #ff7b72;
  color: #ff7b72;
}
.button-danger.is-confirming {
  background: rgba(248, 81, 73, 0.22) !important;
  border-color: #f85149 !important;
  color: #ff7b72 !important;
  font-weight: 700;
  animation: pulse-danger 0.9s infinite alternate ease-in-out;
}
@keyframes pulse-danger {
  0% { transform: scale(1); }
  100% { transform: scale(1.03); }
}

.quick-Row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 11px;
  overflow-x: auto;
  scrollbar-width: none;
}
.quick-Row::-webkit-scrollbar { display: none; }
.quick-label {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: .76rem;
  font-weight: 700;
}
.quick-chips {
  display: flex;
  align-items: center;
  gap: 6px;
}
.quick-chip {
  flex: 0 0 auto;
  padding: 5px 11px;
  border: 1px solid rgba(143, 164, 181, .28);
  border-radius: 999px;
  color: #c9d8e4;
  background: rgba(12, 19, 27, .72);
  font-size: .76rem;
  font-weight: 650;
  white-space: nowrap;
  transition: .15s ease;
}
.quick-chip:hover {
  border-color: var(--accent-2);
  color: var(--accent-2);
}

/* Toolbar */
.toolbar {
  position: sticky;
  top: 8px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 14px 0;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(18, 27, 38, .94);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}
.toolbar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.status-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0c131b;
}
.status-tab {
  padding: 7px 12px;
  border: 0;
  border-radius: 7px;
  color: var(--muted);
  background: transparent;
  font-size: .8rem;
  font-weight: 750;
  white-space: nowrap;
}
.status-tab.active {
  color: #0b1017;
  background: var(--accent-2);
}

/* ============================================================= */
/* 3 類獨立顯示開關項 (Independent Category Filter Toggles) */
/* ============================================================= */
.filter-toggles-group {
  display: inline-flex;
  gap: 5px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0c131b;
  align-items: center;
}
.filter-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, .08);
  background: rgba(255, 255, 255, .03);
  color: var(--muted);
  font-size: .8rem;
  font-weight: 750;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: all .16s ease;
}
.filter-toggle-btn:hover {
  background: rgba(255, 255, 255, .07);
}

/* 🟢 抽票開關 (Lottery Toggle) */
.filter-toggle-btn.is-lottery.active {
  background: rgba(16, 185, 129, .18);
  border-color: rgba(16, 185, 129, .5);
  color: #34d399;
  box-shadow: 0 0 10px rgba(16, 185, 129, .2);
}

/* 🟡 開票開關 (Result Toggle) */
.filter-toggle-btn.is-result.active {
  background: rgba(245, 158, 11, .18);
  border-color: rgba(245, 158, 11, .5);
  color: #fbbf24;
  box-shadow: 0 0 10px rgba(245, 158, 11, .2);
}

/* 🔵 演出開關 (Session Toggle) */
.filter-toggle-btn.is-session.active {
  background: rgba(14, 165, 233, .18);
  border-color: rgba(14, 165, 233, .5);
  color: #38bdf8;
  box-shadow: 0 0 10px rgba(14, 165, 233, .2);
}

/* 關閉狀態 (Inactive State) */
.filter-toggle-btn.inactive {
  opacity: .45;
  background: transparent;
  border-color: transparent;
  color: #64748b;
  text-decoration: line-through;
}
.filter-toggle-btn.inactive:hover {
  opacity: .75;
  text-decoration: none;
}

/* 開關狀態標籤（由按鈕背景色、邊框光暈與文字刪除線直觀呈現開關，隱藏打勾以防手機破格） */
.filter-toggle-btn .toggle-indicator {
  display: none !important;
}
.search-box {
  flex: 1 1 220px;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  background: #0c131b;
}
.search-box input {
  width: 100%;
  min-width: 0;
  padding: 8px 0;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  font-size: .85rem;
}

.artist-tabs-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  border-top: 1px solid rgba(37, 54, 72, .7);
  padding-top: 8px;
  width: 100%;
}
.tabs-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(18, 27, 39, 0.95);
  color: var(--text);
  font-size: 1.2rem;
  line-height: 1;
  font-weight: 800;
  cursor: pointer;
  transition: 0.15s ease;
  z-index: 2;
  user-select: none;
  -webkit-user-select: none;
}
.tabs-nav-btn:hover {
  background: rgba(255, 107, 74, 0.25);
  border-color: var(--accent);
  color: #fff;
  transform: scale(1.1);
}
.tabs-nav-btn:active {
  transform: scale(0.95);
}
.artist-tabs {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 107, 74, 0.35) transparent;
  padding-bottom: 4px;
}
.artist-tabs.is-dragging {
  cursor: grabbing;
  cursor: -webkit-grabbing;
}
.artist-tabs::-webkit-scrollbar {
  height: 4px;
}
.artist-tabs::-webkit-scrollbar-track {
  background: transparent;
}
.artist-tabs::-webkit-scrollbar-thumb {
  background: rgba(255, 107, 74, 0.35);
  border-radius: 4px;
}
.artist-tabs::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 107, 74, 0.7);
}
.artist-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(12, 19, 27, .8);
  font-size: .78rem;
  font-weight: 750;
  white-space: nowrap;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  cursor: pointer;
}
.artist-pill.active {
  border-color: var(--accent);
  color: #fff;
  background: rgba(255, 107, 74, .22);
}
.artist-pill-badge {
  padding: 1px 6px;
  border-radius: 999px;
  color: #0b1017;
  background: var(--open);
  font-size: .68rem;
  font-weight: 900;
}

/* Summary Bar */
.summary-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin: 14px 4px;
  color: var(--muted);
  font-size: .82rem;
}
.summary-counts {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 18px;
}
.summary-counts b {
  color: var(--text);
  font-size: 1.05rem;
}
.open-count b { color: var(--open); }
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: .76rem;
}
.timeline-legend-container {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}
.timeline-legend-top {
  display: flex;
  align-items: center;
}
.timeline-count-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid rgba(56, 189, 248, 0.35);
  background: rgba(14, 165, 233, 0.12);
  color: #7dd3fc;
  font-size: .76rem;
  font-weight: 750;
  white-space: nowrap;
}
.timeline-count-badge b {
  color: #fff;
  font-weight: 900;
  font-size: .92rem;
}
.timeline-legend-items {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  font-size: .76rem;
  color: var(--muted);
}
.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 4px;
  border-radius: 50%;
}
.dot-open { background: var(--open); }
.dot-upcoming { background: var(--upcoming); }
.dot-closed { background: var(--closed); }

/* Artist Cards */
.artist-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.artist-card {
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(18, 27, 38, .9);
  box-shadow: var(--shadow);
}
.artist-card.is-loading {
  border-color: rgba(247, 201, 92, .55);
  background: linear-gradient(135deg, rgba(35, 32, 22, .92), rgba(18, 27, 38, .95));
}
.artist-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(37, 54, 72, .8);
}
.artist-title-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.artist-avatar {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: #0b1017;
  font-size: 1.05rem;
  font-weight: 900;
}
.artist-title-group h2 {
  margin: 0;
  font-size: 1.45rem;
  letter-spacing: -.02em;
}
.artist-jp {
  color: var(--muted);
  font-size: .85rem;
  font-weight: 600;
}
.artist-meta {
  margin-top: 6px;
  color: var(--muted);
  font-size: .75rem;
}
.artist-memory-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding: 4px 10px;
  border: 1px solid rgba(180, 155, 255, .35);
  border-radius: 8px;
  background: rgba(180, 155, 255, .08);
  color: #d8cbff;
  font-size: .74rem;
  font-weight: 600;
  transition: all .16s ease;
}
.artist-memory-chip:hover {
  background: rgba(180, 155, 255, .15);
  border-color: rgba(180, 155, 255, .65);
}
.artist-memory-chip b {
  color: #fff;
  font-weight: 850;
}
.memory-icon {
  font-size: .88rem;
}
.artist-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.artist-summary {
  margin: 12px 0 16px;
  padding: 10px 14px;
  border-left: 3px solid var(--accent-2);
  border-radius: 8px;
  color: #d6e3ec;
  background: rgba(12, 19, 27, .65);
  font-size: .86rem;
  line-height: 1.6;
}

.loading-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 16px;
  border: 1px dashed rgba(247, 201, 92, .5);
  border-radius: 12px;
  color: var(--accent-2);
  background: rgba(247, 201, 92, .07);
  font-size: .9rem;
  font-weight: 650;
}
.spinner {
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(247, 201, 92, .25);
  border-top-color: var(--accent-2);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Tour Block */
.tour-block {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid rgba(53, 76, 99, .55);
  border-radius: 15px;
  background: rgba(13, 20, 29, .72);
}
.tour-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.tour-header h3 {
  margin: 0;
  color: #fff;
  font-size: 1.08rem;
}
.external-link {
  color: var(--accent-2);
  font-size: .8rem;
  font-weight: 700;
  text-decoration: none;
}
.external-link:hover { text-decoration: underline; }

.tour-columns {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 16px;
}
.sub-heading {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .08em;
}

/* Lottery Cards (Highlighting open/upcoming, dimming closed) */
.lottery-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.lottery-card {
  padding: 11px 13px;
  border: 1px solid rgba(64, 84, 98, .4);
  border-left: 4px solid var(--closed);
  border-radius: 11px;
  background: rgba(19, 29, 38, .55);
  transition: .16s ease;
}
.lottery-card.status-open {
  border-color: rgba(79, 227, 177, .65);
  border-left: 5px solid var(--open);
  background: linear-gradient(135deg, rgba(79, 227, 177, .24), rgba(18, 52, 46, .92));
  box-shadow: 0 6px 18px rgba(79, 227, 177, .14);
}
.lottery-card.status-upcoming {
  border-color: rgba(247, 201, 92, .6);
  border-left: 5px solid var(--upcoming);
  background: linear-gradient(135deg, rgba(247, 201, 92, .2), rgba(48, 39, 18, .92));
}
.lottery-card.status-closed {
  opacity: .55;
}
.lottery-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
}
.lottery-round {
  font-size: .9rem;
  font-weight: 800;
}
.status-badge {
  flex: 0 0 auto;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 850;
}
.status-badge.open {
  color: #072219;
  background: var(--open);
}
.status-badge.upcoming {
  color: #241a04;
  background: var(--upcoming);
}
.status-badge.closed {
  color: #b0c0cd;
  background: rgba(95, 116, 133, .35);
}
.lottery-period {
  display: block;
  margin-bottom: 4px;
  color: var(--accent-2);
  font-size: .82rem;
  font-weight: 750;
}
.lottery-card.status-closed .lottery-period { color: var(--muted); }
.lottery-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  color: #c2d0db;
  font-size: .75rem;
}
.platform-tag {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 6px;
  color: #e2ecf3;
  background: rgba(255, 255, 255, .1);
  font-weight: 700;
}

/* Sessions List */
.session-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.session-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border: 1px solid rgba(53, 76, 99, .5);
  border-radius: 10px;
  background: rgba(18, 27, 38, .75);
}
.session-date-box {
  flex: 0 0 98px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.session-date {
  font-size: .84rem;
  font-weight: 850;
  letter-spacing: -.01em;
}
.session-dow {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .1);
  font-size: .68rem;
  font-weight: 800;
}
.session-dow.sat { color: #70b5ff; background: rgba(112, 181, 255, .16); }
.session-dow.sun { color: #ff8a80; background: rgba(255, 138, 128, .16); }
.session-info {
  flex: 1;
  min-width: 0;
}
.session-venue-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.city-badge {
  padding: 1px 6px;
  border-radius: 5px;
  color: var(--accent-2);
  background: rgba(247, 201, 92, .14);
  font-size: .7rem;
  font-weight: 800;
}
.session-venue {
  font-size: .86rem;
  font-weight: 750;
}
.session-sub {
  margin-top: 2px;
  color: var(--muted);
  font-size: .72rem;
}

.empty-box {
  padding: 36px 20px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  color: var(--muted);
  text-align: center;
}

.footer {
  margin-top: 32px;
  color: #6f8496;
  font-size: .75rem;
  line-height: 1.6;
}
.footer p { margin: 0 0 4px; }

/* View Switcher */
.view-switcher {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 16px 0 10px;
  flex-wrap: wrap;
}
.view-tabs-left {
  display: inline-flex;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(18, 27, 38, .9);
}
.view-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border: 0;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
  font-size: .88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .18s ease;
  user-select: none;
}
.view-tab:hover {
  color: var(--text);
  background: rgba(255, 255, 255, .05);
}
.view-tab.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(255, 107, 74, .32), rgba(247, 201, 92, .24));
  border: 1px solid rgba(255, 107, 74, .5);
  box-shadow: 0 4px 16px rgba(255, 107, 74, .2);
}
.view-tab-icon {
  font-size: 1.15rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.view-tab-text-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.view-tab-label {
  font-weight: 750;
  letter-spacing: .02em;
}
.view-tab-badge {
  padding: 1px 7px;
  border-radius: 999px;
  color: #0b1118;
  background: var(--accent-2);
  font-size: .72rem;
  font-weight: 850;
  line-height: 1.2;
}

.schedule-status-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border: 1px solid rgba(79, 227, 177, .3);
  border-radius: 999px;
  background: rgba(79, 227, 177, .08);
  color: #8feccc;
  font-size: .78rem;
  font-weight: 650;
}
.schedule-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--open);
  box-shadow: 0 0 8px var(--open);
  animation: pulse 1.8s infinite ease-in-out;
}

/* Timeline View */
.timeline-view {
  margin: 18px 0;
}
.timeline-stream {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.timeline-month-divider {
  position: sticky;
  top: 76px;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  margin: 14px 0 8px;
  border: 1px solid rgba(247, 201, 92, .25);
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(24, 36, 50, .96), rgba(16, 24, 34, .92));
  backdrop-filter: blur(10px);
}
.month-title {
  color: var(--accent-2);
  font-size: .95rem;
  font-weight: 850;
  letter-spacing: .02em;
}
.month-count {
  color: var(--muted);
  font-size: .74rem;
  font-weight: 600;
}

.timeline-row {
  display: flex;
  align-items: stretch;
  gap: 16px;
  position: relative;
}
.timeline-date-col {
  flex: 0 0 82px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-start;
  padding-top: 10px;
}
.timeline-month-day {
  color: #fff;
  font-size: 1.15rem;
  font-weight: 850;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.timeline-dow {
  font-size: .74rem;
  font-weight: 750;
  color: var(--muted);
}
.timeline-dow.sat { color: #70b5ff; }
.timeline-dow.sun { color: #ff8a80; }
.timeline-year {
  color: #556877;
  font-size: .68rem;
  font-weight: 600;
}

.timeline-node {
  flex: 0 0 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  padding-top: 14px;
}
.node-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #0b1118;
  z-index: 2;
  transition: transform .2s ease;
}
.node-dot.dot-lottery {
  background: var(--open);
  box-shadow: 0 0 10px rgba(79, 227, 177, .75);
}
.node-dot.dot-result {
  background: var(--purple);
  box-shadow: 0 0 10px rgba(180, 155, 255, .75);
}
.node-dot.dot-session {
  background: #5dade2;
  box-shadow: 0 0 10px rgba(93, 173, 226, .75);
}
.node-line {
  position: absolute;
  top: 26px;
  bottom: -16px;
  width: 2px;
  background: linear-gradient(180deg, var(--line), rgba(37, 54, 72, .2));
}

.timeline-content-card {
  flex: 1;
  min-width: 0;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(18, 27, 38, .82);
  transition: transform .18s ease, border-color .18s ease;
}
.timeline-content-card:hover {
  transform: translateX(3px);
  border-color: #3f5973;
}
.item-lottery .timeline-content-card {
  border-left: 3px solid var(--open);
}
.item-result .timeline-content-card {
  border-left: 3px solid var(--purple);
}
.item-session .timeline-content-card {
  border-left: 3px solid #5dade2;
}

.timeline-header-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.timeline-artist-tag {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: .84rem;
}
.artist-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.artist-name {
  color: #fff;
  font-weight: 800;
}
.tour-name {
  color: var(--muted);
  font-size: .8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 320px;
}
.timeline-badges-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.timeline-cat-badge {
  padding: 3px 8px;
  border-radius: 6px;
  font-size: .72rem;
  font-weight: 750;
}
.timeline-cat-badge.open {
  color: var(--open);
  background: rgba(79, 227, 177, .14);
}
.timeline-cat-badge.upcoming {
  color: var(--upcoming);
  background: rgba(247, 201, 92, .14);
}
.timeline-cat-badge.result {
  color: var(--purple);
  background: rgba(180, 155, 255, .16);
}
.timeline-cat-badge.session {
  color: #70b5ff;
  background: rgba(112, 181, 255, .16);
}

.timeline-urgency {
  padding: 3px 8px;
  border-radius: 6px;
  font-size: .72rem;
  font-weight: 800;
}
.timeline-urgency.urgent {
  color: #fff;
  background: #ff5252;
  box-shadow: 0 0 10px rgba(255, 82, 82, .5);
  animation: pulse 1.4s infinite ease-in-out;
}
.timeline-urgency.warning {
  color: #0b1118;
  background: var(--upcoming);
}
.timeline-urgency.normal {
  color: #9ab4c7;
  background: rgba(255, 255, 255, .08);
}

.timeline-body-line h4 {
  margin: 0 0 4px;
  font-size: .95rem;
  font-weight: 750;
  color: #eef4f8;
}
.timeline-event-sub {
  margin: 0;
  color: #9db3c3;
  font-size: .78rem;
  line-height: 1.5;
}

.timeline-footer-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed rgba(255, 255, 255, .08);
}
.venue-pill {
  color: var(--accent-2);
  font-size: .78rem;
  font-weight: 750;
}
.button-ticket {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(255, 107, 74, .85), rgba(230, 74, 46, .85));
  color: #fff;
  font-size: .76rem;
  font-weight: 750;
  text-decoration: none;
  transition: transform .15s ease;
}
.button-ticket:hover {
  transform: translateY(-1px);
  color: #fff;
}
.dot-session {
  background: #5dade2;
}

/* Timeline Sub-toolbar (Gantt vs List Toggle & Controls) */
.timeline-sub-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 10px 0 16px;
  flex-wrap: wrap;
}
.timeline-display-modes {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(18, 27, 38, .9);
}
.sub-mode-btn {
  padding: 6px 14px;
  border: 0;
  border-radius: 9px;
  color: var(--muted);
  background: transparent;
  font-size: .82rem;
  font-weight: 750;
  transition: all .16s ease;
}
.sub-mode-btn:hover {
  color: var(--text);
}
.sub-mode-btn.active {
  color: #fff;
  background: rgba(255, 107, 74, .25);
  border: 1px solid rgba(255, 107, 74, .45);
}

.gantt-nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.jump-btn {
  padding: 5px 11px;
  border: 1px solid rgba(143, 164, 181, .28);
  border-radius: 999px;
  color: #c9d8e4;
  background: rgba(12, 19, 27, .75);
  font-size: .74rem;
  font-weight: 700;
  white-space: nowrap;
  transition: all .15s ease;
}
.jump-btn:hover {
  border-color: var(--accent-2);
  color: var(--accent-2);
}
.today-jump-btn {
  border-color: rgba(255, 71, 87, .5);
  color: #ff6b81;
  background: rgba(255, 71, 87, .12);
}
.today-jump-btn:hover {
  background: rgba(255, 71, 87, .25);
  color: #fff;
}
.month-jumps-group {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}
.month-jumps-group::-webkit-scrollbar { display: none; }

.gantt-row-filter-group {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #0c131b;
}
.gantt-filter-btn {
  padding: 4px 10px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-size: .75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .16s ease;
  white-space: nowrap;
}
.gantt-filter-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, .06);
}
.gantt-filter-btn.active {
  color: #0b1118;
  background: var(--accent-2);
  box-shadow: 0 1px 4px rgba(78, 201, 176, .35);
}

/* Gantt Chart Container & Layout */
.gantt-section {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(18, 27, 38, .88);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.gantt-wrapper {
  overflow-x: auto;
  overflow-y: hidden;
  cursor: grab;
  scrollbar-width: thin;
  scrollbar-color: #3b5066 #0e151e;
}
.gantt-wrapper.is-dragging {
  cursor: grabbing;
  user-select: none;
}
.gantt-wrapper::-webkit-scrollbar {
  height: 9px;
}
.gantt-wrapper::-webkit-scrollbar-track {
  background: #0e151e;
}
.gantt-wrapper::-webkit-scrollbar-thumb {
  background: #3b5066;
  border-radius: 6px;
}
.gantt-wrapper::-webkit-scrollbar-thumb:hover {
  background: #506d8a;
}

.gantt-layout {
  display: flex;
  align-items: stretch;
  min-height: 240px;
  width: max-content;
  min-width: 100%;
}

/* Left Sticky Sidebar (凍結固定側邊欄 - 橫向滾動時永久釘選左側) */
.gantt-sidebar {
  flex: 0 0 250px;
  width: 250px;
  position: sticky;
  left: 0;
  z-index: 20;
  background: #0d1520;
  border-right: 2px solid rgba(255, 107, 74, .45);
  box-shadow: 6px 0 22px rgba(0, 0, 0, .65);
}
.gantt-sidebar-header {
  height: 56px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  border-bottom: 2px solid var(--line);
  color: var(--accent-2);
  font-size: .84rem;
  font-weight: 850;
  letter-spacing: .02em;
  background: #0a1018;
  position: relative;
  z-index: 21;
}
.gantt-sidebar-body {
  background: #0d1520;
}
.gantt-group-header {
  height: 44px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  background: #111b27;
}
.gantt-artist-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.gantt-group-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.gantt-artist-name {
  color: #fff;
  font-size: .82rem;
  font-weight: 850;
  line-height: 1.2;
}
.gantt-tour-name {
  color: var(--muted);
  font-size: .7rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gantt-lane-title {
  height: 38px;
  padding: 0 14px 0 24px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, .04);
  color: #c9d8e4;
  font-size: .76rem;
  font-weight: 700;
  background: #0d1520;
}
.gantt-lane-title.lane-lottery { border-left: 3px solid var(--open); background: #0d1520; }
.gantt-lane-title.lane-result { border-left: 3px solid var(--purple); background: #0d1520; }
.gantt-lane-title.lane-session { border-left: 3px solid #5dade2; background: #0d1520; }
.gantt-track-lane {
  position: relative;
  height: 38px;
  border-bottom: 1px solid rgba(255, 255, 255, .04);
  border-left: 0 !important;
}
.gantt-lane-title.lane-lottery-row {
  height: 38px;
  padding: 0 10px 0 16px;
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, .04);
  border-left: 3px solid var(--open);
  color: #c9d8e4;
  font-size: .74rem;
  font-weight: 700;
  overflow: hidden;
  background: #0d1520;
}
/* 甘特圖現場公演緊湊列 (只顯示現場公演模式：左側只留歌手名字，連巡迴名稱都省略) */
.gantt-compact-session-row {
  height: 38px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, .05);
  background: #0d1520;
  border-left: 3px solid #0ea5e9;
  box-sizing: border-box;
  transition: background .15s ease;
}
.gantt-compact-session-row:hover {
  background: rgba(14, 165, 233, .08);
}
.gantt-artist-name-compact {
  color: #fff;
  font-size: .84rem;
  font-weight: 850;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gantt-track-lane.lane-session-compact {
  height: 38px;
  border-bottom: 1px solid rgba(255, 255, 255, .05);
}
.lane-type-icon {
  font-size: .8rem;
  flex-shrink: 0;
}
.lane-round-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lane-group-badge {
  padding: 1px 5px;
  border-radius: 4px;
  font-size: .62rem;
  font-weight: 850;
  flex-shrink: 0;
}
.lane-group-badge.zenhan {
  color: #ffb873;
  background: rgba(255, 159, 67, .18);
  border: 1px solid rgba(255, 159, 67, .4);
}
.lane-group-badge.kouhan {
  color: #79b7ff;
  background: rgba(84, 160, 255, .18);
  border: 1px solid rgba(84, 160, 255, .4);
}

/* Right Canvas & Tracks */
.gantt-canvas-wrap {
  position: relative;
  flex: 1 0 auto;
}
.gantt-header-sticky {
  position: sticky;
  top: 0;
  z-index: 8;
  height: 56px;
  background: rgba(15, 23, 33, .98);
  border-bottom: 2px solid var(--line);
  backdrop-filter: blur(10px);
}
.gantt-header-months {
  display: flex;
  height: 28px;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}
.gantt-month-block {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  padding: 0 10px;
  border-right: 1px solid var(--line);
  color: var(--accent-2);
  font-size: .78rem;
  font-weight: 850;
  background: rgba(255, 255, 255, .02);
}
.gantt-header-days {
  display: flex;
  height: 28px;
}
.gantt-day-col {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .7rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #7a93a6;
  border-right: 1px solid rgba(255, 255, 255, .04);
}
.gantt-day-col.sat { color: #70b5ff; background: rgba(112, 181, 255, .04); }
.gantt-day-col.sun { color: #ff8a80; background: rgba(255, 138, 128, .04); }
.gantt-day-col.is-today {
  color: #fff;
  background: rgba(255, 71, 87, .25);
  font-weight: 850;
}
.gantt-day-col.is-col-hovered {
  background: rgba(247, 201, 92, .32) !important;
  color: #fff !important;
  font-weight: 900 !important;
  box-shadow: inset 0 -3px 0 var(--accent-2);
}

/* Grid & Red Today Line */
.gantt-grid-bg {
  position: absolute;
  top: 56px;
  bottom: 0;
  left: 0;
  right: 0;
  pointer-events: none;
}
.gantt-today-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #ff4757;
  box-shadow: 0 0 10px rgba(255, 71, 87, .8);
  z-index: 6;
}
.today-tag {
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  padding: 2px 6px;
  border-radius: 4px;
  color: #fff;
  background: #ff4757;
  font-size: .66rem;
  font-weight: 850;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(255, 71, 87, .6);
}

/* 滑鼠停留之垂直日期引導光柱 (Hover Column Spotlight) */
.gantt-hover-column {
  position: absolute;
  top: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 3;
  background: linear-gradient(180deg, rgba(247, 201, 92, .18) 0%, rgba(247, 201, 92, .07) 35%, rgba(247, 201, 92, .02) 100%);
  border-left: 1px dashed rgba(247, 201, 92, .45);
  border-right: 1px dashed rgba(247, 201, 92, .45);
  box-shadow: 0 0 18px rgba(247, 201, 92, .15);
  transition: left .04s ease-out;
}
.hover-col-header-tag {
  position: absolute;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  padding: 2px 7px;
  border-radius: 5px;
  background: #f7c95c;
  color: #0b1118;
  font-size: .68rem;
  font-weight: 850;
  white-space: nowrap;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .5);
  z-index: 15;
  pointer-events: none;
}

/* Rows & Bars */
.gantt-tracks-body {
  position: relative;
  z-index: 5;
}
.gantt-track-group-header {
  height: 44px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .015);
}
.gantt-track-lane {
  position: relative;
  height: 38px;
  border-bottom: 1px solid rgba(255, 255, 255, .04);
  border-left: 0 !important;
}

/* Gantt Bar Styles */
.gantt-bar {
  position: absolute;
  top: 4px;
  height: 30px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
  z-index: 4;
}
.gantt-bar:hover {
  transform: translateY(-2px);
  z-index: 7;
}

.gantt-bar-lottery {
  color: #fff;
  background: linear-gradient(135deg, rgba(79, 227, 177, .35), rgba(25, 140, 100, .45));
  border: 1px solid rgba(79, 227, 177, .75);
  box-shadow: 0 3px 12px rgba(79, 227, 177, .2);
  font-size: .76rem;
  font-weight: 750;
}
.gantt-bar-lottery:hover {
  box-shadow: 0 6px 20px rgba(79, 227, 177, .45);
  border-color: rgba(79, 227, 177, 1);
}
.gantt-bar-lottery.status-upcoming {
  background: linear-gradient(135deg, rgba(247, 201, 92, .35), rgba(190, 140, 30, .45));
  border-color: rgba(247, 201, 92, .75);
  box-shadow: 0 3px 12px rgba(247, 201, 92, .2);
}
.gantt-bar-lottery.status-upcoming:hover {
  box-shadow: 0 6px 20px rgba(247, 201, 92, .45);
  border-color: rgba(247, 201, 92, 1);
}

.gantt-bar-result {
  color: #e6dbff;
  background: linear-gradient(135deg, rgba(180, 155, 255, .35), rgba(120, 90, 210, .45));
  border: 1px solid rgba(180, 155, 255, .7);
  box-shadow: 0 3px 12px rgba(180, 155, 255, .2);
  font-size: .74rem;
  font-weight: 750;
}
.gantt-bar-result:hover {
  box-shadow: 0 6px 20px rgba(180, 155, 255, .45);
  border-color: rgba(180, 155, 255, 1);
}

/* 當落發表符號標記 (接在抽票欄後，無長文字，用符號顯示) */
.gantt-bar-result.milestone-symbol {
  justify-content: center;
  gap: 4px;
  padding: 0 4px;
  background: linear-gradient(135deg, rgba(180, 155, 255, .32), rgba(120, 90, 210, .48));
  border: 1px solid rgba(180, 155, 255, .8);
  box-shadow: 0 2px 10px rgba(180, 155, 255, .25);
  box-sizing: border-box;
}

/* 單日軸元素：長度剛好填滿 1 天格子，呈圓角方形方塊，無偏位也無多餘空隙 */
.gantt-bar.gantt-bar-single-day,
.gantt-session-cell {
  position: absolute;
  top: 4px;
  height: 30px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  cursor: pointer;
  z-index: 5;
  user-select: none;
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
}

/* 現場公演 (Session) 圓角方塊 */
.gantt-session-cell {
  background: linear-gradient(135deg, rgba(14, 165, 233, .35), rgba(2, 132, 199, .55));
  border: 1.5px solid rgba(14, 165, 233, .85);
  box-shadow: 0 2px 8px rgba(14, 165, 233, .25);
  color: #fff;
}
.gantt-session-cell:hover {
  transform: translateY(-2px);
  border-color: #38bdf8;
  box-shadow: 0 4px 16px rgba(14, 165, 233, .5);
  z-index: 12;
}
.gantt-session-cell.zenhan {
  background: linear-gradient(135deg, rgba(255, 159, 67, .4), rgba(210, 110, 25, .65));
  border-color: #ff9f43;
  box-shadow: 0 2px 8px rgba(255, 159, 67, .3);
}
.gantt-session-cell.kouhan {
  background: linear-gradient(135deg, rgba(84, 160, 255, .4), rgba(40, 110, 220, .65));
  border-color: #54a0ff;
  box-shadow: 0 2px 8px rgba(84, 160, 255, .3);
}

/* 連續多日同場地公演連條 */
.gantt-session-cell.is-multiday {
  border-radius: 8px;
  gap: 4px;
  padding: 0 4px;
  background: linear-gradient(135deg, rgba(14, 165, 233, .45), rgba(2, 132, 199, .7));
  border: 1.5px solid rgba(56, 189, 248, .9);
  box-shadow: 0 2px 10px rgba(14, 165, 233, .35);
}
.session-multiday-badge {
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.3px;
  color: #e0f2fe;
  background: rgba(14, 165, 233, 0.45);
  border: 1px solid rgba(125, 211, 252, 0.5);
  border-radius: 4px;
  padding: 1px 3px;
  white-space: nowrap;
}

/* 單日抽票受付 (Single-Day Lottery) 圓角方塊 */
.gantt-bar.gantt-bar-single-day.gantt-bar-lottery {
  background: linear-gradient(135deg, rgba(16, 185, 129, .35), rgba(5, 150, 105, .55));
  border: 1.5px solid rgba(16, 185, 129, .85);
  box-shadow: 0 2px 8px rgba(16, 185, 129, .25);
}
.gantt-bar.gantt-bar-single-day.gantt-bar-lottery:hover {
  transform: translateY(-2px);
  border-color: #34d399;
  box-shadow: 0 4px 16px rgba(16, 185, 129, .5);
  z-index: 12;
}
.gantt-bar.gantt-bar-single-day.gantt-bar-lottery.status-upcoming {
  background: linear-gradient(135deg, rgba(247, 201, 92, .35), rgba(190, 140, 30, .55));
  border-color: rgba(247, 201, 92, .85);
  box-shadow: 0 2px 8px rgba(247, 201, 92, .25);
}
.gantt-bar.gantt-bar-single-day.gantt-bar-lottery.status-upcoming:hover {
  border-color: #fcd34d;
  box-shadow: 0 4px 16px rgba(247, 201, 92, .5);
}

/* 單日當落發表 (Single-Day Result) 圓角方塊 */
.gantt-bar.gantt-bar-single-day.gantt-bar-result {
  background: linear-gradient(135deg, rgba(180, 155, 255, .38), rgba(120, 90, 210, .6));
  border: 1.5px solid rgba(180, 155, 255, .9);
  box-shadow: 0 2px 8px rgba(180, 155, 255, .3);
  color: #e6dbff;
}
.gantt-bar.gantt-bar-single-day.gantt-bar-result:hover {
  transform: translateY(-2px);
  border-color: #d8b4fe;
  box-shadow: 0 4px 16px rgba(180, 155, 255, .55);
  z-index: 12;
}

/* 方塊內部的 ICON 符號：居中、透明底，不重複疊加圓圈 */
.cell-symbol {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: .88rem;
  line-height: 1;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  user-select: none;
  pointer-events: none;
}

.bar-title {
  font-weight: 750;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bar-dates {
  font-size: .68rem;
  opacity: .85;
}
.gantt-bar-tag {
  margin-left: auto;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: .66rem;
  font-weight: 850;
}
.gantt-bar-tag.urgent {
  background: #ff4757;
  color: #fff;
  animation: pulse 1.2s infinite ease-in-out;
}
.gantt-bar-tag.warn {
  background: var(--accent-2);
  color: #0b1118;
}

/* Tooltip Popover */
.gantt-popover {
  position: fixed;
  z-index: 1000;
  min-width: 280px;
  max-width: 380px;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(14, 21, 30, .96);
  border: 1px solid rgba(255, 107, 74, .5);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .65);
  backdrop-filter: blur(14px);
  pointer-events: auto;
}
.popover-header {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.popover-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 4px;
  flex-shrink: 0;
}
.popover-line {
  color: #c9d8e4;
  font-size: .78rem;
  line-height: 1.5;
  margin-bottom: 2px;
}
.popover-line strong {
  color: var(--muted);
}

@media (max-width: 860px) {
  .hero {
    flex-direction: column;
    padding: 20px 18px;
  }
  .worker-card {
    flex: none;
    width: 100%;
  }
  .tour-columns {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .app-shell {
    width: calc(100% - 14px);
    padding: 10px 0 40px;
  }
  .hero h1 { font-size: 1.65rem; }
  .hero-description { font-size: .82rem; }
  .add-panel { padding: 12px; }
  .add-form { flex-direction: column; }
  .add-submit { width: 100%; padding: 11px; }
  .artist-card { padding: 14px; }
  .artist-header { flex-direction: column; }
  .artist-actions { width: 100%; justify-content: flex-end; }
  .tour-block { padding: 12px; }
  .session-card { align-items: flex-start; flex-direction: column; gap: 4px; }
  .session-date-box { flex: none; }
  /* 手機端頂部篩選按鈕列自適應：等寬均勻分佈且移除換行溢出 */
  .toolbar-top {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .status-tabs[style*="display: none"],
  .filter-toggles-group[style*="display: none"],
  .status-tabs[style*="display:none"],
  .filter-toggles-group[style*="display:none"] {
    display: none !important;
  }
  .status-tabs,
  .filter-toggles-group {
    width: 100%;
    display: flex;
    box-sizing: border-box;
    justify-content: space-between;
    gap: 4px;
    padding: 3px;
  }
  .status-tab,
  .filter-toggle-btn {
    flex: 1 1 0;
    min-width: 0;
    justify-content: center;
    padding: 6px 4px;
    font-size: .78rem;
    gap: 4px;
    text-align: center;
  }
  .filter-toggle-btn .toggle-dot {
    font-size: .75rem;
    line-height: 1;
    flex-shrink: 0;
  }
  .filter-toggle-btn .toggle-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .search-box {
    width: 100%;
    flex: 1 1 100%;
    box-sizing: border-box;
  }
  .view-switcher {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin: 12px 0 8px;
  }
  .view-tabs-left {
    width: 100%;
    display: flex;
    gap: 4px;
    padding: 4px;
    box-sizing: border-box;
  }
  .view-tab {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 7px 3px 6px;
    border-radius: 9px;
  }
  .view-tab-icon {
    font-size: 1.25rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .view-tab-text-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    max-width: 100%;
    white-space: nowrap;
  }
  .view-tab-label {
    font-size: .78rem;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: .01em;
    white-space: nowrap;
  }
  .view-tab-badge {
    padding: 0 5px;
    border-radius: 999px;
    font-size: .62rem;
    font-weight: 850;
    line-height: 1.2;
  }
  .schedule-status-tag {
    justify-content: center;
    width: fit-content;
    margin: 0 auto;
  }
  /* 手機端統計列與時間軸子工具列排版防偏優化 */
  .summary-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin: 10px 0;
  }
  .summary-counts {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 6px 14px;
    font-size: .78rem;
  }
  .summary-counts b {
    font-size: .95rem;
  }
  .timeline-legend-container {
    width: 100%;
    align-items: flex-start;
    gap: 6px;
  }
  .timeline-legend-top {
    width: 100%;
  }
  .timeline-legend-items {
    gap: 6px 12px;
    font-size: .72rem;
  }
  .timeline-display-modes {
    width: 100%;
    display: flex;
    box-sizing: border-box;
  }
  .sub-mode-btn {
    flex: 1 1 0;
    text-align: center;
    padding: 6px 4px;
    font-size: .76rem;
  }
  .timeline-row {
    gap: 8px;
  }
  .timeline-date-col {
    flex: 0 0 54px;
  }
  .timeline-month-day {
    font-size: .95rem;
  }
  .timeline-content-card {
    padding: 10px 12px;
  }
  .timeline-header-line {
    flex-direction: column;
    align-items: flex-start;
  }
  .tour-name {
    max-width: 180px;
  }
  /* 手機端甘特圖防跳躍與側邊欄緊湊適配 */
  .gantt-wrapper {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
  }
  .gantt-sidebar {
    flex: 0 0 140px !important;
    width: 140px !important;
    position: sticky !important;
    left: 0 !important;
    z-index: 20 !important;
    background: #0d1520 !important;
  }
  .gantt-sidebar-header {
    height: 56px !important;
    padding: 0 8px !important;
    font-size: .74rem !important;
  }
  .gantt-group-header {
    height: 44px !important;
    padding: 0 6px !important;
    gap: 5px !important;
  }
  .gantt-artist-name {
    font-size: .74rem !important;
  }
  .gantt-tour-name {
    font-size: .62rem !important;
  }
  .gantt-compact-session-row {
    height: 38px !important;
    padding: 0 8px !important;
    gap: 6px !important;
  }
  .gantt-artist-name-compact {
    font-size: .78rem !important;
  }
}

/* ============================================================= */
/* 抽選場次雙向精準對應與分段樣式 (Lottery & Session Matching)   */
/* ============================================================= */

/* Lottery Target Scope Box */
.lottery-target-scope-box {
  margin: 7px 0 9px;
  padding: 8px 10px;
  border-radius: 9px;
  background: rgba(0, 0, 0, .28);
  border: 1px solid rgba(255, 255, 255, .08);
  border-left: 3px solid var(--accent-2);
}
.lottery-target-scope-box.tag-zenhan {
  border-left-color: #ff9f43;
  background: rgba(255, 159, 67, .08);
}
.lottery-target-scope-box.tag-kouhan {
  border-left-color: #54a0ff;
  background: rgba(84, 160, 255, .08);
}
.scope-header-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.target-scope-pill {
  padding: 1px 7px;
  border-radius: 5px;
  background: rgba(247, 201, 92, .18);
  color: var(--accent-2);
  font-size: .7rem;
  font-weight: 850;
  letter-spacing: .02em;
}
.target-scope-desc {
  color: #fff;
  font-size: .8rem;
  font-weight: 750;
  line-height: 1.4;
}
.scope-toggle-row {
  margin-top: 6px;
  padding-top: 5px;
  border-top: 1px dashed rgba(255, 255, 255, .08);
}
.btn-toggle-drawer {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 6px;
  background: rgba(255, 255, 255, .05);
  color: #d2e0eb;
  font-size: .72rem;
  font-weight: 700;
  transition: all .16s ease;
}
.btn-toggle-drawer:hover {
  background: rgba(255, 255, 255, .12);
  color: #fff;
  border-color: rgba(255, 255, 255, .3);
}
.btn-toggle-drawer strong {
  color: var(--accent-2);
}
.toggle-arrow {
  font-size: .8em;
  transition: transform .2s ease;
}

/* Lottery Sessions Drawer */
.lottery-sessions-drawer {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(9, 14, 20, .85);
  border: 1px solid rgba(255, 255, 255, .06);
  max-height: 220px;
  overflow-y: auto;
}
.drawer-inner-grid {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.drawer-session-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 6px;
  border-radius: 4px;
  font-size: .73rem;
  color: #c9d8e4;
  background: rgba(255, 255, 255, .02);
}
.drawer-session-row:hover {
  background: rgba(255, 255, 255, .07);
}
.drawer-idx {
  flex: 0 0 16px;
  color: var(--muted);
  font-size: .68rem;
  text-align: right;
}
.drawer-date {
  font-weight: 800;
  color: #fff;
  font-variant-numeric: tabular-nums;
}
.drawer-city {
  padding: 0 5px;
  border-radius: 4px;
  background: rgba(247, 201, 92, .15);
  color: var(--accent-2);
  font-size: .68rem;
  font-weight: 750;
}
.drawer-venue {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Session Group Badge */
.session-group-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 5px;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .12);
  color: #e0ecf5;
  font-size: .69rem;
  font-weight: 850;
}
.session-group-badge.badge-zenhan {
  background: rgba(255, 159, 67, .18);
  border-color: rgba(255, 159, 67, .5);
  color: #ffb873;
}
.session-group-badge.badge-kouhan {
  background: rgba(84, 160, 255, .18);
  border-color: rgba(84, 160, 255, .5);
  color: #79b7ff;
}
.session-status-row {
  margin-top: 3px;
}
.session-lottery-status {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 4px;
  font-size: .68rem;
  font-weight: 750;
}
.session-lottery-status.open {
  background: rgba(79, 227, 177, .16);
  color: var(--open);
  border: 1px solid rgba(79, 227, 177, .35);
}
.session-lottery-status.upcoming {
  background: rgba(247, 201, 92, .14);
  color: var(--upcoming);
  border: 1px solid rgba(247, 201, 92, .3);
}
.session-lottery-status.closed {
  color: var(--muted);
  font-size: .67rem;
}

/* Tour Subgroup Nav */
.tour-subgroup-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(10, 16, 23, .65);
  border: 1px solid rgba(255, 255, 255, .05);
}
.subgroup-title {
  color: var(--muted);
  font-size: .74rem;
  font-weight: 750;
}
.subgroup-pill {
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, .04);
  color: #b0c4d4;
  font-size: .72rem;
  font-weight: 750;
  transition: all .16s ease;
}
.subgroup-pill:hover {
  background: rgba(255, 255, 255, .09);
  color: #fff;
}
.subgroup-pill.active {
  background: rgba(255, 107, 74, .25);
  border-color: var(--accent);
  color: #fff;
  font-weight: 850;
}

/* Cross Linkage Styling (Cards) */
.session-card, .lottery-card {
  transition: all .2s cubic-bezier(.16, 1, .3, 1);
}
.session-card.is-matched-target {
  border-color: var(--accent-2) !important;
  background: linear-gradient(135deg, rgba(247, 201, 92, .18), rgba(22, 34, 47, .95)) !important;
  box-shadow: 0 0 14px rgba(247, 201, 92, .4) !important;
  transform: translateX(4px) scale(1.01);
  z-index: 5;
}
.session-card.is-not-matched {
  opacity: .32;
  filter: grayscale(.4);
}
.lottery-card.is-matched-target {
  border-color: var(--open) !important;
  box-shadow: 0 0 16px rgba(79, 227, 177, .45) !important;
  transform: translateX(4px) scale(1.01);
  z-index: 5;
}
.lottery-card.is-not-matched {
  opacity: .32;
  filter: grayscale(.4);
}

/* Gantt Group Badges */
.gantt-group-badge {
  display: inline-block;
  padding: 1px 5px;
  margin-right: 4px;
  border-radius: 4px;
  font-size: .65rem;
  font-weight: 850;
  background: rgba(0, 0, 0, .35);
  border: 1px solid rgba(255, 255, 255, .2);
}
.gantt-group-badge.zenhan {
  color: #ffb873;
  border-color: #ff9f43;
}
.gantt-group-badge.kouhan {
  color: #79b7ff;
  border-color: #54a0ff;
}
.pin-group-tag {
  display: inline-block;
  padding: 0 4px;
  margin-right: 3px;
  border-radius: 3px;
  font-size: .62rem;
  font-weight: 850;
  background: rgba(0, 0, 0, .4);
}
.pin-group-tag.zenhan { color: #ffb873; }
.pin-group-tag.kouhan { color: #79b7ff; }

/* Gantt Cross-Highlighting */
.gantt-session-cell.gantt-session-cell-target-highlight,
.gantt-pin-session.gantt-pin-target-highlight {
  z-index: 15 !important;
}
.gantt-session-cell.gantt-session-cell-target-highlight {
  border-color: #f7c95c !important;
  background: linear-gradient(135deg, rgba(247, 201, 92, .85), rgba(210, 140, 20, .95)) !important;
  box-shadow: 0 0 16px rgba(247, 201, 92, .95) !important;
  color: #fff !important;
  transform: translateY(-2px);
}
.gantt-session-cell.gantt-session-cell-target-dim,
.gantt-pin-session.gantt-pin-target-dim {
  opacity: .18;
  filter: grayscale(.7);
}
.gantt-bar-lottery.gantt-bar-target-highlight {
  border-color: #fff !important;
  box-shadow: 0 0 22px rgba(79, 227, 177, .9) !important;
  transform: translateY(-4px) scale(1.03);
  z-index: 10 !important;
}
.gantt-bar-lottery.gantt-bar-single-day.gantt-bar-target-highlight {
  border-color: #fff !important;
  box-shadow: 0 0 16px rgba(79, 227, 177, .95) !important;
  transform: translateY(-2px);
}
.gantt-bar-lottery.gantt-bar-target-dim {
  opacity: .22;
  filter: grayscale(.6);
}
.popover-line.highlight-scope {
  padding: 4px 6px;
  border-radius: 5px;
  background: rgba(247, 201, 92, .12);
  margin-bottom: 6px;
}

/* Timeline Stream Tags */
.timeline-target-scope-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 4px 0 6px;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(247, 201, 92, .12);
  border: 1px solid rgba(247, 201, 92, .25);
  color: #fff;
  font-size: .75rem;
  font-weight: 750;
}
.timeline-session-group-pill {
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, .08);
  font-size: .68rem;
  font-weight: 800;
  color: #c9d8e4;
}
.timeline-session-group-pill.zenhan {
  color: #ffb873;
  background: rgba(255, 159, 67, .18);
  border: 1px solid rgba(255, 159, 67, .35);
}
.timeline-session-group-pill.kouhan {
  color: #79b7ff;
  background: rgba(84, 160, 255, .18);
  border: 1px solid rgba(84, 160, 255, .35);
}

/* ============================================================= */
/* 月曆形式檢視 (Monthly Calendar View)                          */
/* ============================================================= */
.calendar-section {
  position: relative;
  margin-top: 12px;
}
.cal-wrapper {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.cal-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: #0c141d;
  flex-wrap: wrap;
}
.cal-month-nav {
  display: flex;
  align-items: center;
  gap: 10px;
}
.cal-btn {
  padding: 6px 12px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--line);
  border-radius: 7px;
  color: #fff;
  cursor: pointer;
  font-weight: 700;
  font-size: .82rem;
  transition: all .14s ease;
}
.cal-btn:hover {
  background: rgba(255, 255, 255, .14);
  border-color: var(--accent);
}
.cal-btn-today {
  background: rgba(255, 107, 74, .15);
  border-color: rgba(255, 107, 74, .4);
  color: #ff9e87;
  font-size: .75rem;
  padding: 6px 10px;
}
.cal-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 850;
  color: #fff;
  min-width: 140px;
  text-align: center;
}
.cal-quick-jumps {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.cal-quick-title {
  font-size: .78rem;
  font-weight: 750;
  color: var(--muted);
}
.cal-chips-row {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  max-width: 650px;
  padding: 3px 0;
  cursor: grab;
  scrollbar-width: none; /* Firefox: 完全隱藏移動軸 */
  -ms-overflow-style: none; /* IE / Edge */
}
.cal-chips-row::-webkit-scrollbar {
  display: none; /* Chrome, Safari: 完全隱藏移動軸 */
}
.cal-chips-row.is-dragging {
  cursor: grabbing;
  user-select: none;
}
.cal-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .04);
  color: var(--muted);
  font-size: .74rem;
  font-weight: 750;
  cursor: pointer;
  transition: all .14s ease;
  white-space: nowrap;
}
.cal-chip:hover {
  color: #fff;
  background: rgba(255, 255, 255, .1);
}
.cal-chip.active {
  color: #0b1118;
  background: var(--accent-2);
  border-color: var(--accent-2);
  box-shadow: 0 1px 6px rgba(78, 201, 176, .4);
}
.chip-bubble {
  padding: 1px 5px;
  border-radius: 10px;
  font-size: .66rem;
  background: rgba(0, 0, 0, .25);
  font-weight: 800;
}
.cal-summary-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 14px;
  padding: 8px 14px;
  background: rgba(0, 0, 0, .22);
  border-bottom: 1px solid rgba(255, 255, 255, .05);
  font-size: .8rem;
  color: #c2d0db;
  flex-wrap: wrap;
}
.cal-summary-title {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .78rem;
  font-weight: 750;
  color: var(--muted);
  white-space: nowrap;
}
.cal-summary-title b {
  color: var(--text);
  font-weight: 850;
}
.cal-summary-toggles-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap; /* 嚴格禁止三個按鈕折行，永遠保持一列！ */
}
/* 月曆摘要列中可直接點擊的切換標籤 (Interactive Summary Badges) */
.cal-summary-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, .1);
  background: rgba(255, 255, 255, .04);
  color: #c9d6e2;
  font-size: .76rem;
  font-weight: 750;
  cursor: pointer;
  transition: all .14s ease;
  user-select: none;
  white-space: nowrap;
}
.cal-summary-toggle:hover {
  transform: translateY(-1px);
  filter: brightness(1.2);
}
.cal-summary-toggle .toggle-dot {
  font-size: .75rem;
  line-height: 1;
}
.cal-summary-toggle b {
  font-size: .84rem;
  font-weight: 850;
  margin: 0 1px;
}
.cal-summary-toggle .toggle-unit {
  font-size: .7rem;
  opacity: .85;
}
.cal-summary-toggle.is-lottery.active {
  background: rgba(16, 185, 129, .16);
  border-color: rgba(16, 185, 129, .45);
  color: #6ee7b7;
}
.cal-summary-toggle.is-result.active {
  background: rgba(245, 158, 11, .16);
  border-color: rgba(245, 158, 11, .45);
  color: #fde68a;
}
.cal-summary-toggle.is-session.active {
  background: rgba(14, 165, 233, .16);
  border-color: rgba(14, 165, 233, .45);
  color: #7dd3fc;
}
.cal-summary-toggle.inactive {
  opacity: .4;
  color: #64748b;
  border-color: transparent;
  background: rgba(255, 255, 255, .02);
  text-decoration: line-through;
}
.cal-all-closed-warning {
  width: 100%;
  color: #ff9b94;
  font-size: .74rem;
  font-weight: 750;
}
.cal-grid-card {
  padding: 0;
  overflow-x: auto;
  width: 100%;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.cal-grid-card::-webkit-scrollbar {
  display: none;
}
.cal-week-header {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  width: 100%;
  background: #0e1722;
  border-bottom: 1px solid var(--line);
  text-align: center;
  font-weight: 800;
  font-size: .78rem;
}
.cal-weekday {
  padding: 10px 4px;
  color: var(--muted);
  border-right: 1px solid rgba(255, 255, 255, .04);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cal-weekday:last-child {
  border-right: 0;
}
.cal-weekday.is-sun {
  color: #ff7b72;
}
.cal-weekday.is-sat {
  color: #79b7ff;
}
.cal-weekday .dow-long {
  display: inline;
}
.cal-weekday .dow-short {
  display: none;
}
/* ============================================================= */
/* 7 欄日曆主體架構 (Google Calendar / FullCalendar 跨格多日連條) */
/* ============================================================= */
.cal-month-weeks {
  display: flex;
  flex-direction: column;
  width: 100%;
  background: rgba(255, 255, 255, .05);
  gap: 1px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.cal-week-row {
  position: relative;
  min-height: 108px;
  width: 100%;
}
.cal-week-bg {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1px;
  pointer-events: none;
}
.cal-day-cell {
  background: #0c1219;
  padding: 6px 7px;
  display: flex;
  flex-direction: column;
  transition: background .14s ease;
  position: relative;
  box-sizing: border-box;
  pointer-events: auto;
  cursor: pointer;
  height: 100%;
}
.cal-day-cell:hover {
  background: #121c27;
}
.cal-day-cell.is-other-month {
  background: rgba(8, 12, 17, .65);
  opacity: .35;
}
.cal-day-cell.is-today {
  box-shadow: inset 0 0 0 2px var(--accent), inset 0 0 12px rgba(255, 107, 74, .25);
}
.cal-day-cell.is-sun {
  background: #0f131a;
}
.cal-day-cell.is-sat {
  background: #0d141e;
}
.cal-day-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
  font-size: .78rem;
  font-weight: 800;
  pointer-events: none;
}
.cal-day-num {
  color: #c9d6e2;
  font-weight: 800;
}
.cal-day-cell.is-sun .cal-day-num {
  color: #ff9b94;
}
.cal-day-cell.is-sat .cal-day-num {
  color: #9acaff;
}
.cal-badge-today {
  font-size: .64rem;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--accent);
  color: #fff;
  font-weight: 850;
}
.cal-day-count {
  font-size: .64rem;
  padding: 1px 5px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .08);
  color: var(--muted);
}

/* 跨格活動層 (7 欄 CSS Grid，支援 grid-column 跨欄連條) */
.cal-week-events {
  position: relative;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  grid-auto-flow: row dense;
  gap: 3px 0;
  padding: 30px 2px 6px;
  pointer-events: none;
  min-height: 108px;
  box-sizing: border-box;
}

/* 活動項目基本樣式 (Pills & Continuous Spanning Ribbons) */
.cal-event-pill {
  pointer-events: auto;
  position: relative;
  display: flex;
  flex-wrap: wrap; /* 支援文字太長自動換行，絕不撐破欄位 */
  align-items: center;
  gap: 3px 6px;
  padding: 3px 6px;
  min-height: 24px;
  height: auto;
  font-size: .72rem;
  line-height: 1.25;
  border-radius: 4px;
  box-sizing: border-box;
  word-break: break-word;
  overflow-wrap: anywhere;
  cursor: pointer;
  user-select: none;
  transition: transform .12s ease, filter .12s ease, box-shadow .12s ease;
  z-index: 2;
  margin: 1px 2px;
}
.cal-event-pill:hover {
  transform: translateY(-1px);
  filter: brightness(1.22);
  box-shadow: 0 3px 12px rgba(0, 0, 0, .55);
  z-index: 10;
}
.cal-event-pill .pill-artist {
  font-weight: 850;
  flex-shrink: 1;
  word-break: break-word;
  overflow-wrap: anywhere;
  line-height: 1.2;
}
.cal-event-pill .pill-region {
  color: #93c5fd;
  font-size: .68rem;
  font-weight: 750;
  flex-shrink: 0;
  white-space: nowrap;
}
.cal-event-pill .pill-title {
  color: #cbd5e1;
  opacity: .92;
  font-size: .68rem;
  display: -webkit-box;
  -webkit-line-clamp: 2; /* 限制最多 2 行，優雅防止極端長標題過度拉長 */
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}
.cal-event-pill .pill-badge-start {
  font-size: .64rem;
  font-weight: 850;
  flex-shrink: 0;
  color: #34d399;
}
.cal-event-pill .pill-badge-end {
  font-size: .64rem;
  font-weight: 850;
  margin-left: auto;
  flex-shrink: 0;
  color: #fca5a5;
  background: rgba(239, 68, 68, .2);
  padding: 1px 4px;
  border-radius: 3px;
  white-space: nowrap;
}
.cal-event-pill .cal-flow-arrow {
  font-size: .66rem;
  font-weight: 900;
  flex-shrink: 0;
  color: #34d399;
  opacity: .85;
}
.cal-event-pill .cal-flow-arrow.to-next {
  margin-left: auto;
}

/* ============================================================= */
/* 月曆 3 類視覺規範 (抽選 🟢 / 開票 🟡 / 演出 🔵) */
/* ============================================================= */

/* 1. 🟢 抽選全區間 (Connected Multi-Day Lottery Ribbon) */
.cal-event-pill.cal-cat-lottery,
.cal-event-pill.type-lottery {
  background: rgba(16, 185, 129, .17);
  border: 1px solid rgba(16, 185, 129, .32);
  color: #ecfdf5;
}
.cal-event-pill.cal-cat-lottery:hover,
.cal-event-pill.type-lottery:hover {
  background: rgba(16, 185, 129, .28);
  border-color: rgba(16, 185, 129, .6);
}

/* 起點在當週 (具有左綠條與左圓角) */
.cal-event-pill.cal-cat-lottery.has-start {
  border-left: 3.5px solid #10b981;
  border-top-left-radius: 4px;
  border-bottom-left-radius: 4px;
  margin-left: 2px;
}
/* 從上週延續過來 (左側平切直角，緊貼該週最左側) */
.cal-event-pill.cal-cat-lottery.from-prev {
  border-left: none;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  margin-left: 0;
}

/* 終點在當週 (具有右紅條與右圓角) */
.cal-event-pill.cal-cat-lottery.has-end {
  border-right: 3.5px solid #ef4444;
  border-top-right-radius: 4px;
  border-bottom-right-radius: 4px;
  margin-right: 2px;
  background: rgba(16, 185, 129, .14);
}
/* 延續到下週 (右側平切直角，緊貼該週最右側) */
.cal-event-pill.cal-cat-lottery.to-next {
  border-right: none;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  margin-right: 0;
}

/* 2. 🟡 開票 (Result 當落發表 / 入金) - 色條在左側 */
.cal-event-pill.cal-cat-result,
.cal-event-pill.type-result {
  background: rgba(245, 158, 11, .15);
  border: 1px solid rgba(245, 158, 11, .35);
  border-left: 3.5px solid #f59e0b;
  border-right: none;
  color: #fffbeb;
  border-radius: 4px;
}
.cal-event-pill.cal-cat-result:hover,
.cal-event-pill.type-result:hover {
  background: rgba(245, 158, 11, .26);
}

/* 3. 🔵 演出 (Session 現場巡迴公演) - 色條在左側 */
.cal-event-pill.cal-cat-session,
.cal-event-pill.type-session {
  background: rgba(14, 165, 233, .14);
  border: 1px solid rgba(14, 165, 233, .35);
  border-left: 3.5px solid #0ea5e9;
  border-right: none;
  color: #f0f9ff;
  border-radius: 4px;
}
.cal-event-pill.cal-cat-session:hover,
.cal-event-pill.type-session:hover {
  background: rgba(14, 165, 233, .25);
}

/* 屬性標籤 [抽選] / [截止] / [開票] / [演出] */
.cal-cat-tag {
  font-size: .66rem;
  font-weight: 850;
  padding: 1px 4px;
  border-radius: 4px;
  line-height: 1.15;
  flex-shrink: 0;
}
.cal-cat-tag.tag-lottery-start,
.cal-cat-tag.tag-lottery,
.cal-attr-tag.attr-lottery {
  color: #34d399;
  background: rgba(16, 185, 129, .22);
  border: 1px solid rgba(16, 185, 129, .45);
}
.cal-cat-tag.tag-lottery-end,
.cal-attr-tag.attr-lottery-end {
  color: #f87171;
  background: rgba(239, 68, 68, .22);
  border: 1px solid rgba(239, 68, 68, .45);
}
.cal-cat-tag.tag-result,
.cal-attr-tag.attr-result {
  color: #fbbf24;
  background: rgba(245, 158, 11, .22);
  border: 1px solid rgba(245, 158, 11, .45);
}
.cal-cat-tag.tag-session,
.cal-attr-tag.attr-session {
  color: #38bdf8;
  background: rgba(14, 165, 233, .22);
  border: 1px solid rgba(14, 165, 233, .45);
}

.cal-artist-name {
  font-weight: 800;
  font-size: .72rem;
  line-height: 1.25;
  color: #fff;
}
.cal-region-name {
  font-weight: 750;
  font-size: .68rem;
  color: #c9d6e2;
  background: rgba(255, 255, 255, .1);
  padding: 0 4px;
  border-radius: 3px;
  line-height: 1.2;
}
.cal-more-pill {
  font-size: .68rem;
  padding: 2px 5px;
  border-radius: 4px;
  color: var(--muted);
  text-align: center;
  cursor: pointer;
  background: rgba(255, 255, 255, .04);
  transition: all .14s ease;
  margin-top: 2px;
}
.cal-more-pill:hover {
  color: #fff;
  background: rgba(255, 255, 255, .1);
}
/* ============================================================= */
/* 月曆行動端專屬佈局與底部清單抽屜 (Bottom Sheet Modal)        */
/* 參考 paul90539.github.io 行動端日曆架構與互動設計              */
/* ============================================================= */

/* 1. 月曆活動詳情抽屜彈窗 (Day Sheet Modal) */
.cal-sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 8, 14, .75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s cubic-bezier(0.16, 1, 0.3, 1);
}
.cal-sheet-overlay.open {
  opacity: 1;
  pointer-events: auto;
}
.cal-sheet-card {
  background: #121922;
  border: 1px solid var(--line);
  border-radius: 16px;
  width: 100%;
  max-width: 540px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .7);
  overflow: hidden;
  transform: scale(0.96);
  transition: transform .22s cubic-bezier(0.16, 1, 0.3, 1);
}
.cal-sheet-overlay.open .cal-sheet-card {
  transform: scale(1);
}
.cal-sheet-handle {
  display: none;
  width: 38px;
  height: 4px;
  background: rgba(255, 255, 255, .25);
  border-radius: 2px;
  margin: 10px auto 4px;
  flex-shrink: 0;
}
.cal-sheet-header {
  padding: 14px 18px;
  background: rgba(255, 255, 255, .03);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}
.cal-sheet-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.cal-sheet-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 850;
  color: #fff;
  letter-spacing: -.2px;
}
.cal-sheet-badge {
  font-size: .74rem;
  font-weight: 750;
  padding: 2px 8px;
  background: rgba(255, 107, 74, .18);
  color: var(--accent);
  border: 1px solid rgba(255, 107, 74, .38);
  border-radius: 999px;
}
.cal-sheet-close {
  background: rgba(255, 255, 255, .08);
  border: 1px solid var(--line);
  color: var(--muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  cursor: pointer;
  transition: all .14s ease;
  flex-shrink: 0;
}
.cal-sheet-close:hover {
  background: rgba(255, 255, 255, .18);
  color: #fff;
}
.cal-sheet-body {
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  -webkit-overflow-scrolling: touch;
}
.cal-sheet-empty {
  text-align: center;
  padding: 32px 16px;
  color: var(--muted);
}
.cal-sheet-empty .empty-icon {
  font-size: 2.2rem;
  margin-bottom: 8px;
}
.cal-sheet-empty .empty-title {
  font-size: .95rem;
  font-weight: 750;
  color: #e0e6ed;
  margin-bottom: 4px;
}
.cal-sheet-empty .empty-sub {
  font-size: .8rem;
  color: var(--muted);
}

/* 抽屜內活動卡片 (左右色條對應) */
.cal-sheet-item {
  background: #17202c;
  border: 1px solid var(--line);
  border-left: 4px solid #0ea5e9;
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  transition: transform .14s ease, border-color .14s ease;
}
.cal-sheet-item.cal-cat-lottery,
.cal-sheet-item.cal-cat-lottery-start {
  border-left: 4px solid #10b981;
  border-right: none;
}
.cal-sheet-item.cal-cat-lottery-end {
  border-left: none;
  border-right: 4px solid #ef4444;
}
.cal-sheet-item.cal-cat-result {
  border-left: 4px solid #f59e0b;
  border-right: none;
}
.cal-sheet-item.cal-cat-session {
  border-left: 4px solid #0ea5e9;
  border-right: none;
}
.cal-sheet-item:hover {
  border-color: rgba(255, 255, 255, .2);
}
.cal-sheet-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.cal-sheet-item-tags {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.cal-sheet-artist-name {
  font-weight: 850;
  font-size: .88rem;
}
.cal-sheet-scope-tag {
  font-size: .72rem;
  font-weight: 700;
  color: #ff9f43;
  background: rgba(255, 159, 67, .18);
  border: 1px solid rgba(255, 159, 67, .35);
  border-radius: 4px;
  padding: 1px 6px;
}
.cal-sheet-days-tag {
  font-size: .72rem;
  font-weight: 800;
  color: #ff7b72;
  background: rgba(255, 107, 74, .18);
  border: 1px solid rgba(255, 107, 74, .4);
  border-radius: 4px;
  padding: 1px 6px;
}
.cal-sheet-days-tag.tag-today {
  color: #fff;
  background: #ff6b4a;
  box-shadow: 0 0 8px rgba(255, 107, 74, .6);
}
.cal-sheet-days-tag.tag-expired {
  color: var(--muted);
  background: rgba(255, 255, 255, .08);
  border-color: rgba(255, 255, 255, .15);
}
.cal-sheet-dow-badge {
  font-size: .72rem;
  color: var(--muted);
  font-weight: 700;
  background: rgba(255, 255, 255, .06);
  padding: 2px 7px;
  border-radius: 4px;
}
.cal-sheet-tour-name {
  font-weight: 800;
  font-size: .95rem;
  color: #fff;
  line-height: 1.35;
}
.cal-sheet-sub-title {
  font-size: .8rem;
  color: var(--muted);
  margin-top: -3px;
}
.cal-sheet-details {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: .82rem;
  color: #c9d6e2;
  background: rgba(0, 0, 0, .2);
  border-radius: 6px;
  padding: 8px 10px;
  margin-top: 2px;
}
.cal-sheet-line {
  line-height: 1.4;
  word-break: break-word;
}
.cal-sheet-line.highlight-scope {
  color: #ffeaa7;
  font-weight: 750;
  background: rgba(253, 203, 110, .12);
  border-left: 3px solid #fdcb6e;
  padding: 3px 6px;
  border-radius: 0 4px 4px 0;
  margin: 2px 0;
}
.cal-sheet-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 4px;
}
.btn-sheet-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: .78rem;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  background: rgba(255, 255, 255, .08);
  border: 1px solid var(--line);
  color: #fff;
  transition: all .14s ease;
}
.btn-sheet-action:hover {
  background: rgba(255, 255, 255, .16);
  border-color: rgba(255, 255, 255, .3);
  color: #fff;
}
.btn-sheet-action.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 2px 10px rgba(255, 107, 74, .35);
}
.btn-sheet-action.primary:hover {
  background: #ff7d5e;
  box-shadow: 0 3px 14px rgba(255, 107, 74, .5);
}

/* 2. 行動端排版最適配規則 (@media max-width: 768px) */
@media (max-width: 768px) {
  /* Day Sheet 抽屜轉變為手機端專屬底部抽屜 (Bottom Sheet) */
  .cal-sheet-overlay {
    align-items: flex-end;
    padding: 0;
  }
  .cal-sheet-card {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    max-width: 100%;
    max-height: 82vh;
    transform: translateY(100%);
    transition: transform .26s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .cal-sheet-overlay.open .cal-sheet-card {
    transform: translateY(0);
  }
  .cal-sheet-handle {
    display: block;
  }

  /* 月曆外層包裝器與頂部控制列 */
  .cal-wrapper {
    border-radius: 10px;
  }
  .cal-nav-bar {
    padding: 10px 12px;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .cal-month-nav {
    justify-content: space-between;
    width: 100%;
  }
  .cal-title {
    font-size: 1.1rem;
    min-width: 0;
  }
  .cal-btn {
    padding: 5px 9px;
    font-size: .78rem;
  }
  .cal-btn-today {
    padding: 5px 8px;
    font-size: .72rem;
  }
  .cal-quick-jumps {
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  .cal-quick-title {
    font-size: .72rem;
  }
  .cal-chips-row {
    width: 100%;
    max-width: 100%;
    padding: 2px 0 4px;
    -webkit-overflow-scrolling: touch;
  }
  .cal-chip {
    padding: 3px 8px;
    font-size: .7rem;
  }
  .cal-summary-strip {
    padding: 6px 10px;
    gap: 6px;
    flex-direction: column;
    align-items: stretch;
  }
  .cal-summary-title {
    justify-content: center;
    font-size: .75rem;
  }
  .cal-summary-toggles-row {
    display: flex !important;
    width: 100%;
    gap: 4px;
    box-sizing: border-box;
    flex-wrap: nowrap !important; /* 永遠保持同一列 */
  }
  .cal-summary-toggle {
    flex: 1 1 0;
    min-width: 0;
    padding: 5px 3px;
    font-size: .72rem;
    gap: 3px;
    justify-content: center;
  }
  .cal-summary-toggle .toggle-dot {
    font-size: .7rem;
  }
  .cal-summary-toggle b {
    font-size: .78rem;
  }
  .cal-summary-toggle .toggle-unit {
    font-size: .66rem;
  }

  /* 月曆網格 (100% 滿版，嚴格容納完整一週 7 天，無須且禁止橫向捲動) */
  .cal-wrapper {
    border-radius: 8px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }
  .cal-grid-card {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
    overflow-y: visible !important;
    cursor: default !important;
  }
  .cal-week-header {
    display: grid !important;
    grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    gap: 1px !important;
  }
  .cal-weekday {
    padding: 5px 1px !important;
    font-size: .72rem !important;
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    text-align: center !important;
    overflow: hidden !important;
  }
  .cal-weekday .dow-long {
    display: none !important;
  }
  .cal-weekday .dow-short {
    display: inline !important;
  }
  .cal-days-grid {
    display: grid !important;
    grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    gap: 1px !important;
  }
  .cal-day-cell {
    min-height: 64px !important;
    padding: 2px 1.5px 3px !important;
    min-width: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    cursor: pointer !important;
  }
  .cal-day-cell:active {
    background: #17202c !important;
  }
  .cal-day-header {
    margin-bottom: 2px !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
    box-sizing: border-box !important;
    position: relative !important;
  }
  .cal-day-num {
    width: 20px !important;
    height: 20px !important;
    font-size: .74rem !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 auto !important;
    font-weight: 750 !important;
  }
  .cal-day-cell.is-today {
    border: none !important;
    box-shadow: none !important;
  }
  .cal-day-cell.is-today .cal-day-num {
    background: var(--accent) !important;
    color: #fff !important;
    font-weight: 850 !important;
    box-shadow: 0 0 8px rgba(255, 107, 74, .55) !important;
  }
  .cal-badge-today,
  .cal-day-count {
    display: none !important; /* 手機端只保留置中日期數字，不佔用任何寬度 */
  }

  /* 手機端微型標籤：隱藏 [演出]/[抽選]/[開獎] 與地區，只保留歌手名稱，太長自動換行 */
  .cal-day-events {
    gap: 1.5px !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }
  .cal-attr-tag,
  .cal-cat-tag,
  .cal-region-name {
    display: none !important;
  }
  .cal-artist-name {
    font-size: .62rem !important;
    font-weight: 800 !important;
    line-height: 1.16 !important;
    word-break: break-all !important;
    overflow-wrap: anywhere !important;
    white-space: normal !important;
    text-align: center !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    display: block !important;
  }
  .cal-event-pill {
    height: auto !important;
    min-height: 18px !important;
    padding: 2px 2px !important;
    margin-bottom: 2px !important;
    border-radius: 3px !important;
    white-space: normal !important;
    word-break: break-all !important;
    overflow-wrap: anywhere !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    border-left-width: 2.5px !important;
  }
  /* 手機端 7 欄日曆跨格連條微調 */
  .cal-week-row {
    min-height: 72px !important;
  }
  .cal-week-bg {
    gap: 1px !important;
  }
  .cal-day-cell {
    min-height: 72px !important;
    padding: 2px 2px !important;
  }
  .cal-day-header {
    margin-bottom: 2px !important;
    font-size: .68rem !important;
  }
  .cal-day-num {
    font-size: .66rem !important;
  }
  .cal-week-events {
    padding: 20px 1px 2px !important;
    gap: 2px 0 !important;
    min-height: 72px !important;
  }
  .cal-event-pill {
    min-height: 18px !important;
    height: auto !important;
    font-size: .62rem !important;
    line-height: 1.18 !important;
    padding: 2px 3px !important;
    margin: 1px 1px !important;
    gap: 2px 4px !important;
    flex-wrap: wrap !important;
    word-break: break-word !important;
    overflow-wrap: anywhere !important;
  }
  .cal-event-pill .pill-artist {
    font-size: .62rem !important;
    word-break: break-word !important;
    overflow-wrap: anywhere !important;
    line-height: 1.15 !important;
  }
  .cal-event-pill .pill-region {
    font-size: .56rem !important;
  }
  .cal-event-pill .pill-title {
    font-size: .56rem !important;
    -webkit-line-clamp: 2 !important;
  }
  .cal-event-pill .pill-badge-start,
  .cal-event-pill .pill-badge-end,
  .cal-event-pill .cal-flow-arrow {
    font-size: .56rem !important;
  }
  .cal-event-pill.cal-cat-lottery.has-start {
    border-left-width: 2.5px !important;
    margin-left: 1px !important;
  }
  .cal-event-pill.cal-cat-lottery.from-prev {
    margin-left: 0 !important;
  }
  .cal-event-pill.cal-cat-lottery.has-end {
    border-right-width: 2.5px !important;
    margin-right: 1px !important;
  }
  .cal-event-pill.cal-cat-lottery.to-next {
    margin-right: 0 !important;
  }
}

/* 超窄螢幕 (< 380px iPhone SE 等) 緊湊微調 */
@media (max-width: 380px) {
  .status-tab,
  .filter-toggle-btn {
    padding: 5px 2px !important;
    font-size: .70rem !important;
    gap: 2px !important;
  }
  .filter-toggle-btn .toggle-dot {
    font-size: .68rem !important;
  }
  .cal-summary-toggle .toggle-unit {
    display: none !important;
  }
  .cal-summary-toggle {
    padding: 4px 2px !important;
    font-size: .68rem !important;
    gap: 2px !important;
  }
  .view-tab {
    padding: 6px 2px 5px !important;
    gap: 2px !important;
  }
  .view-tab-icon {
    font-size: 1.15rem !important;
  }
  .view-tab-label {
    font-size: .72rem !important;
  }
  .view-tab-badge {
    font-size: .58rem !important;
    padding: 0 4px !important;
  }
  .cal-day-cell {
    min-height: 58px !important;
    padding: 1.5px 1px 2px !important;
  }
  .cal-day-num {
    width: 18px !important;
    height: 18px !important;
    font-size: .68rem !important;
  }
  .cal-artist-name {
    font-size: .56rem !important;
    line-height: 1.12 !important;
  }
  .cal-event-pill {
    min-height: 16px !important;
    padding: 1.5px 1px !important;
  }
}

/* Modern Toast Notification Container */
#toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 999999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  max-width: calc(100vw - 48px);
}

.toast-msg {
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 0.92rem;
  font-weight: 650;
  color: #fff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  pointer-events: auto;
  opacity: 0;
  transform: translateY(-12px);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  gap: 10px;
}

.toast-msg.show {
  opacity: 1;
  transform: translateY(0);
}

.toast-msg.toast-success {
  background: rgba(16, 185, 129, 0.95);
  border-color: rgba(52, 211, 153, 0.3);
}

.toast-msg.toast-warning {
  background: rgba(245, 158, 11, 0.95);
  border-color: rgba(251, 191, 36, 0.3);
}

.toast-msg.toast-error {
  background: rgba(239, 68, 68, 0.95);
  border-color: rgba(248, 113, 113, 0.3);
}

/* =============================================================
   Google Calendar 同步與匯出功能樣式 (Google Calendar Sync)
   分三個類別：🟢 抽選 · 🟡 開獎 · 🔵 演出
   ============================================================= */

/* 右側功能按鈕群（同步日曆 + 排程狀態） */
.view-actions-right {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* 頂部同步日曆按鈕 */
.btn-sync-gcal-nav {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 15px;
  border: 1px solid rgba(56, 189, 248, 0.45);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.18), rgba(2, 132, 199, 0.28));
  color: #7dd3fc;
  font-size: .82rem;
  font-weight: 800;
  cursor: pointer;
  transition: all .2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 10px rgba(14, 165, 233, 0.16);
  user-select: none;
}
.btn-sync-gcal-nav:hover {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.32), rgba(2, 132, 199, 0.45));
  border-color: rgba(56, 189, 248, 0.8);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(14, 165, 233, 0.32);
}
.btn-sync-gcal-nav .sync-badge {
  padding: 1px 6px;
  border-radius: 999px;
  font-size: .68rem;
  background: rgba(56, 189, 248, 0.28);
  color: #e0f2fe;
}

/* 統計列同步按鈕 */
.btn-summary-sync {
  margin-left: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 8px;
  background: rgba(14, 165, 233, 0.12);
  color: #7dd3fc;
  font-size: .75rem;
  font-weight: 750;
  cursor: pointer;
  transition: all .16s ease;
  white-space: nowrap;
}
.btn-summary-sync:hover {
  background: rgba(14, 165, 233, 0.25);
  border-color: #38bdf8;
  color: #fff;
}

/* 卡片快速加入 Google 日曆按鈕 */
.gcal-quick-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: .72rem;
  font-weight: 750;
  text-decoration: none;
  transition: all .16s ease;
  user-select: none;
  white-space: nowrap;
}
.gcal-quick-link.is-lottery {
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
}
.gcal-quick-link.is-lottery:hover {
  background: rgba(16, 185, 129, 0.28);
  border-color: #10b981;
  color: #fff;
  transform: translateY(-1px);
}
.gcal-quick-link.is-result {
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fbbf24;
}
.gcal-quick-link.is-result:hover {
  background: rgba(245, 158, 11, 0.28);
  border-color: #f59e0b;
  color: #fff;
  transform: translateY(-1px);
}
.gcal-quick-link.is-session {
  background: rgba(14, 165, 233, 0.14);
  border: 1px solid rgba(14, 165, 233, 0.4);
  color: #38bdf8;
}
.gcal-quick-link.is-session:hover {
  background: rgba(14, 165, 233, 0.28);
  border-color: #0ea5e9;
  color: #fff;
  transform: translateY(-1px);
}
.lottery-actions-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* Google 日曆同步面板 (Sync Calendar Modal) */
.cal-sync-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 8, 14, .82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s cubic-bezier(0.16, 1, 0.3, 1);
}
.cal-sync-overlay.open {
  opacity: 1;
  pointer-events: auto;
}
.cal-sync-card {
  background: #111a24;
  border: 1px solid rgba(75, 98, 120, 0.45);
  border-radius: 18px;
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .85);
  overflow: hidden;
  transform: scale(0.96);
  transition: transform .22s cubic-bezier(0.16, 1, 0.3, 1);
}
.cal-sync-overlay.open .cal-sync-card {
  transform: scale(1);
}
.cal-sync-handle {
  display: none;
  width: 40px;
  height: 4px;
  background: rgba(255, 255, 255, .25);
  border-radius: 2px;
  margin: 10px auto 4px;
  flex-shrink: 0;
}
.cal-sync-header {
  padding: 16px 20px;
  background: rgba(255, 255, 255, .03);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}
.cal-sync-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.cal-sync-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 850;
  color: #fff;
  letter-spacing: -.2px;
}
.cal-sync-badge {
  font-size: .74rem;
  font-weight: 750;
  padding: 2px 9px;
  background: rgba(56, 189, 248, .18);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, .4);
  border-radius: 999px;
}
.cal-sync-close {
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .15);
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: .85rem;
  font-weight: bold;
  transition: all .16s ease;
}
.cal-sync-close:hover {
  background: rgba(248, 81, 73, .35);
  border-color: #f85149;
  color: #fff;
  transform: scale(1.08);
}
.cal-sync-body {
  padding: 18px 20px 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  -webkit-overflow-scrolling: touch;
}
.cal-sync-intro {
  margin: 0;
  font-size: .84rem;
  line-height: 1.5;
  color: #b0c2d3;
}
.cal-sync-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cal-sync-section-title {
  font-size: .88rem;
  font-weight: 800;
  color: #e2ecf5;
}

/* 三類時程開關項樣式 */
.sync-category-toggles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.sync-cat-checkbox {
  position: relative;
  cursor: pointer;
  user-select: none;
}
.sync-cat-checkbox input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.sync-cat-pill {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all .18s ease;
  height: 100%;
  box-sizing: border-box;
}
.sync-cat-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.sync-cat-name {
  font-size: .86rem;
  font-weight: 800;
  color: #c2d2e1;
}
.sync-cat-desc {
  font-size: .72rem;
  color: var(--muted);
  line-height: 1.35;
}
.sync-cat-dot {
  font-size: 1rem;
  line-height: 1;
}

/* 勾選啟用狀態 */
.sync-cat-checkbox.is-lottery input:checked + .sync-cat-pill {
  background: rgba(16, 185, 129, 0.16);
  border-color: rgba(16, 185, 129, 0.65);
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.22);
}
.sync-cat-checkbox.is-lottery input:checked + .sync-cat-pill .sync-cat-name {
  color: #34d399;
}

.sync-cat-checkbox.is-result input:checked + .sync-cat-pill {
  background: rgba(245, 158, 11, 0.16);
  border-color: rgba(245, 158, 11, 0.65);
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.22);
}
.sync-cat-checkbox.is-result input:checked + .sync-cat-pill .sync-cat-name {
  color: #fbbf24;
}

.sync-cat-checkbox.is-session input:checked + .sync-cat-pill {
  background: rgba(14, 165, 233, 0.16);
  border-color: rgba(14, 165, 233, 0.65);
  box-shadow: 0 0 14px rgba(14, 165, 233, 0.22);
}
.sync-cat-checkbox.is-session input:checked + .sync-cat-pill .sync-cat-name {
  color: #38bdf8;
}

/* 篩選工具列 */
.cal-sync-filters-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--line);
  border-radius: 12px;
  flex-wrap: wrap;
}
.sync-filter-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .84rem;
  color: #c2d2e1;
}
.sync-select {
  background: #0d1520;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  color: #fff;
  padding: 6px 12px;
  font-size: .84rem;
  outline: none;
  cursor: pointer;
}
.sync-select:focus {
  border-color: #38bdf8;
}
.sync-future-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: .84rem;
  color: #e2ecf5;
  user-select: none;
}
.sync-future-label input {
  accent-color: #0ea5e9;
  cursor: pointer;
}

/* 動作按鈕區 */
.cal-sync-action-box {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 16px;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.08), rgba(16, 185, 129, 0.08));
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 14px;
}
.sync-counts-banner {
  font-size: .88rem;
  font-weight: 750;
  color: #e2ecf5;
}
.sync-counts-banner strong {
  color: #38bdf8;
}
.sync-action-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* 核心同步亮點提示卡 */
.sync-highlight-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.14), rgba(5, 150, 105, 0.18));
  border: 1px solid rgba(52, 211, 153, 0.4);
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.12);
}
.sync-banner-icon {
  font-size: 1.4rem;
  line-height: 1;
}
.sync-banner-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.sync-banner-text strong {
  color: #34d399;
  font-size: .88rem;
  line-height: 1.4;
}
.sync-banner-text small {
  color: #a7f3d0;
  font-size: .74rem;
  line-height: 1.4;
}

/* 三個獨立日曆卡片 (個別三個：抽選 · 開獎 · 演出) */
.sync-three-cards-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.sync-sub-card {
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-left: 5px solid #0ea5e9;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all .2s ease;
}
.sync-sub-card:hover {
  background: rgba(255, 255, 255, 0.06);
}
.sync-sub-card.is-lottery {
  border-left-color: #10b981;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), rgba(255, 255, 255, 0.02));
  border-color: rgba(16, 185, 129, 0.28);
}
.sync-sub-card.is-lottery:hover {
  border-color: rgba(16, 185, 129, 0.55);
  box-shadow: 0 4px 18px rgba(16, 185, 129, 0.15);
}

.sync-sub-card.is-result {
  border-left-color: #f59e0b;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.08), rgba(255, 255, 255, 0.02));
  border-color: rgba(245, 158, 11, 0.28);
}
.sync-sub-card.is-result:hover {
  border-color: rgba(245, 158, 11, 0.55);
  box-shadow: 0 4px 18px rgba(245, 158, 11, 0.15);
}

.sync-sub-card.is-session {
  border-left-color: #0ea5e9;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.08), rgba(255, 255, 255, 0.02));
  border-color: rgba(14, 165, 233, 0.28);
}
.sync-sub-card.is-session:hover {
  border-color: rgba(14, 165, 233, 0.55);
  box-shadow: 0 4px 18px rgba(14, 165, 233, 0.15);
}

.sub-card-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.sub-card-badge-dot {
  font-size: 1.25rem;
  line-height: 1.2;
}
.sub-card-info {
  flex: 1;
  min-width: 0;
}
.sub-card-title {
  margin: 0 0 3px;
  font-size: .95rem;
  font-weight: 850;
  color: #fff;
  letter-spacing: -.01em;
}
.sync-sub-card.is-lottery .sub-card-title { color: #34d399; }
.sync-sub-card.is-result .sub-card-title { color: #fbbf24; }
.sync-sub-card.is-session .sub-card-title { color: #38bdf8; }

.sub-card-desc {
  margin: 0;
  font-size: .78rem;
  color: #94a3b8;
  line-height: 1.45;
}
.sub-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 4px;
}
.btn-card-gcal {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 9px;
  font-size: .82rem;
  font-weight: 850;
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  transition: all .18s ease;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}
.sync-sub-card.is-lottery .btn-card-gcal {
  background: linear-gradient(135deg, #10b981, #059669);
  border: 1px solid #34d399;
}
.sync-sub-card.is-lottery .btn-card-gcal:hover {
  background: linear-gradient(135deg, #059669, #047857);
  transform: translateY(-1px);
  box-shadow: 0 5px 16px rgba(16, 185, 129, 0.4);
}

.sync-sub-card.is-result .btn-card-gcal {
  background: linear-gradient(135deg, #d97706, #b45309);
  border: 1px solid #fbbf24;
}
.sync-sub-card.is-result .btn-card-gcal:hover {
  background: linear-gradient(135deg, #b45309, #92400e);
  transform: translateY(-1px);
  box-shadow: 0 5px 16px rgba(245, 158, 11, 0.4);
}

.sync-sub-card.is-session .btn-card-gcal {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  border: 1px solid #38bdf8;
}
.sync-sub-card.is-session .btn-card-gcal:hover {
  background: linear-gradient(135deg, #0369a1, #075985);
  transform: translateY(-1px);
  box-shadow: 0 5px 16px rgba(14, 165, 233, 0.4);
}

.btn-card-apple {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 12px;
  border-radius: 9px;
  font-size: .8rem;
  font-weight: 750;
  color: #e2ecf5;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  text-decoration: none;
  cursor: pointer;
  transition: all .16s ease;
}
.btn-card-apple:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.4);
  color: #fff;
  transform: translateY(-1px);
}

.btn-card-download {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 11px;
  border-radius: 9px;
  font-size: .8rem;
  font-weight: 750;
  color: #bae6fd;
  background: rgba(14, 165, 233, 0.12);
  border: 1px solid rgba(14, 165, 233, 0.3);
  text-decoration: none;
  cursor: pointer;
  transition: all .16s ease;
}
.btn-card-download:hover {
  background: rgba(14, 165, 233, 0.25);
  border-color: rgba(56, 189, 248, 0.6);
  color: #fff;
  transform: translateY(-1px);
}

.btn-card-copy {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 11px;
  border-radius: 9px;
  font-size: .78rem;
  font-weight: 700;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  cursor: pointer;
  transition: all .16s ease;
}
.btn-card-copy:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
  color: #fff;
}

/* 備用離線檔案動作 */
.sync-secondary-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 4px;
}
.secondary-title {
  font-size: .74rem;
  color: var(--muted);
}
.btn-download-ics {
  flex: 1 1 240px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  background: linear-gradient(135deg, #10b981, #059669);
  border-color: #34d399;
  color: #fff;
  font-weight: 850;
  font-size: .92rem;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
  transition: all .18s ease;
}
.btn-download-ics:hover {
  background: linear-gradient(135deg, #059669, #047857);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
  transform: translateY(-1px);
}
.btn-gcal-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: .86rem;
  font-weight: 750;
  border-radius: 10px;
  text-decoration: none;
  transition: all .16s ease;
}
.btn-gcal-link:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: #38bdf8;
  color: #7dd3fc;
}
.sync-guide-tips {
  font-size: .76rem;
  line-height: 1.6;
  color: #94a3b8;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 8px;
}

/* 逐筆一鍵加入清單預覽 */
.cal-sync-preview-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sync-preview-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.sync-preview-title {
  font-size: .88rem;
  font-weight: 800;
  color: #e2ecf5;
}
.sync-preview-hint {
  font-size: .74rem;
  color: var(--muted);
}
.sync-events-preview-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 260px;
  overflow-y: auto;
  padding-right: 4px;
}
.sync-event-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-left: 4px solid #38bdf8;
  border-radius: 10px;
  transition: background .14s ease;
}
.sync-event-card:hover {
  background: rgba(255, 255, 255, 0.06);
}
.sync-event-card.is-lottery { border-left-color: #10b981; }
.sync-event-card.is-result { border-left-color: #f59e0b; }
.sync-event-card.is-session { border-left-color: #0ea5e9; }

.sync-ev-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sync-ev-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.sync-ev-cat-tag {
  font-size: .7rem;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 4px;
}
.sync-ev-cat-tag.tag-lottery { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.sync-ev-cat-tag.tag-result { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.sync-ev-cat-tag.tag-session { background: rgba(14, 165, 233, 0.2); color: #38bdf8; }

.sync-ev-artist-badge {
  font-size: .72rem;
  font-weight: 750;
  color: #e2ecf5;
  background: rgba(255, 255, 255, 0.08);
  padding: 1px 6px;
  border-radius: 4px;
}
.sync-ev-name {
  font-size: .84rem;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sync-ev-meta {
  font-size: .74rem;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.btn-item-gcal {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  background: rgba(14, 165, 233, 0.16);
  border: 1px solid rgba(56, 189, 248, 0.45);
  color: #7dd3fc;
  border-radius: 8px;
  font-size: .76rem;
  font-weight: 750;
  text-decoration: none;
  transition: all .16s ease;
  white-space: nowrap;
}
.btn-item-gcal:hover {
  background: #0ea5e9;
  border-color: #38bdf8;
  color: #fff;
  transform: translateY(-1px);
}

@media (max-width: 640px) {
  .view-actions-right {
    width: 100%;
    justify-content: space-between;
  }
  .btn-sync-gcal-nav {
    flex: 1;
    justify-content: center;
  }
  .sync-category-toggles {
    grid-template-columns: 1fr;
  }
  .cal-sync-card {
    border-radius: 18px 18px 0 0;
    max-height: 92vh;
  }
  .cal-sync-overlay {
    align-items: flex-end;
    padding: 0;
  }
  .cal-sync-handle {
    display: block;
  }
}


