/* 量子電競公開站 — design tokens（對齊 hero：電青主色＋霓虹紫輔色） */
:root {
  --qe-brand: #00d4ff;
  --qe-brand-dim: rgba(0, 212, 255, 0.14);
  --qe-brand-glow: rgba(0, 212, 255, 0.45);
  --qe-accent: #b24bff;
  --qe-accent-dim: rgba(178, 75, 255, 0.16);
  --qe-accent-glow: rgba(178, 75, 255, 0.42);
  --qe-bg: #050505;
  --qe-surface: #111827;
  --qe-surface-2: #1f2937;
  --qe-text: #f3f4f6;
  --qe-muted: #9ca3af;
  --qe-border: rgba(255, 255, 255, 0.1);
  --qe-radius: 12px;
  --qe-nav-h: 64px;
  --qe-font-display: "Segoe UI", "PingFang TC", "Noto Sans TC", sans-serif;
  --qe-font-body: "Segoe UI", "PingFang TC", "Noto Sans TC", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }
body.qe-body {
  margin: 0;
  min-height: 100vh;
  background: var(--qe-bg);
  color: var(--qe-text);
  font-family: var(--qe-font-body);
  overflow-x: hidden;
}

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #1a1a1a; }
::-webkit-scrollbar-thumb { background: var(--qe-brand); border-radius: 4px; }

.qe-hero-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  filter: brightness(0.4);
}
.qe-hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(5, 5, 5, 0.2) 0%,
    rgba(5, 5, 5, 0.35) 55%,
    rgba(5, 5, 5, 0.75) 100%
  );
  pointer-events: none;
}

.qe-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  height: var(--qe-nav-h);
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #1f2937;
}
.qe-nav__inner {
  width: 100%;
  max-width: none;
  margin: 0;
  height: 100%;
  /* 左右貼齊視窗；含 safe-area，避免右側按鈕溢出 */
  padding-top: 0;
  padding-bottom: 0;
  padding-left: max(0.85rem, env(safe-area-inset-left, 0px));
  padding-right: max(0.85rem, env(safe-area-inset-right, 0px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
@media (min-width: 768px) {
  .qe-nav__inner {
    padding-left: max(1.25rem, env(safe-area-inset-left, 0px));
    padding-right: max(1.25rem, env(safe-area-inset-right, 0px));
  }
}
.qe-brand-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}
.qe-brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.06em;
  font-size: 1.05rem;
  min-width: 0;
}
.qe-brand img { height: 2.1rem; width: auto; object-fit: contain; flex-shrink: 0; }
.qe-brand span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.qe-brand:hover { color: var(--qe-brand); }

.qe-news-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  flex-shrink: 0;
  height: 2.15rem;
  min-width: 2.15rem;
  padding: 0 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(178, 75, 255, 0.5);
  background: var(--qe-accent-dim);
  color: #e9d5ff;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.15s, box-shadow 0.2s;
}
.qe-news-btn:hover {
  background: rgba(178, 75, 255, 0.28);
  border-color: var(--qe-accent);
  color: #fff;
  box-shadow: 0 0 16px var(--qe-accent-glow);
}
.qe-news-btn:active { transform: scale(0.96); }
.qe-news-btn__text { display: none; }
.qe-news-btn__dot {
  position: absolute;
  top: 0.2rem;
  right: 0.2rem;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  background: #ff4d6d;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.55);
  pointer-events: none;
}
.qe-news-btn__dot[hidden] { display: none !important; }
@media (min-width: 480px) {
  .qe-news-btn__text { display: inline; }
}

/* 公告彈層 */
.qe-news-modal[hidden] { display: none !important; }
.qe-news-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}
.qe-news-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(3px);
}
.qe-news-modal__panel {
  position: relative;
  z-index: 1;
  width: min(100%, 32rem);
  max-height: min(78vh, 36rem);
  background: #111827;
  border: 1px solid #374151;
  border-radius: 16px 16px 0 0;
  display: flex;
  flex-direction: column;
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.45);
  animation: qe-news-up 0.28s ease;
}
@keyframes qe-news-up {
  from { transform: translateY(16px); opacity: 0.6; }
  to { transform: translateY(0); opacity: 1; }
}
.qe-news-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.1rem;
  border-bottom: 1px solid #1f2937;
  flex-shrink: 0;
}
.qe-news-modal__head h2 {
  margin: 0;
  font-size: 1.05rem;
  color: var(--qe-brand);
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.qe-news-modal__close {
  border: none;
  background: transparent;
  color: #9ca3af;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.15rem 0.4rem;
}
.qe-news-modal__close:hover { color: #fff; }
.qe-news-modal__body {
  overflow-y: auto;
  padding: 0.75rem 1rem 1.25rem;
  -webkit-overflow-scrolling: touch;
}
.qe-news-modal__empty {
  margin: 1rem 0;
  text-align: center;
  color: var(--qe-muted);
  font-size: 0.9rem;
}
.qe-news-item {
  border: 1px solid var(--qe-border);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.25);
  margin-bottom: 0.5rem;
  overflow: hidden;
}
.qe-news-item summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.8rem 0.9rem;
  user-select: none;
}
.qe-news-item summary::-webkit-details-marker { display: none; }
.qe-news-item summary span {
  font-weight: 700;
  font-size: 0.92rem;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.qe-news-item summary small {
  color: var(--qe-muted);
  font-size: 0.72rem;
  flex-shrink: 0;
}
.qe-news-item__body {
  padding: 0 0.9rem 0.85rem;
  color: #d1d5db;
  font-size: 0.88rem;
  line-height: 1.65;
  white-space: pre-wrap;
  border-top: 1px solid var(--qe-border);
  padding-top: 0.7rem;
}
@media (min-width: 640px) {
  .qe-news-modal {
    align-items: center;
    padding: 1.5rem;
  }
  .qe-news-modal__panel {
    border-radius: 14px;
    max-height: min(70vh, 34rem);
  }
}

.qe-nav__links {
  display: none;
  align-items: center;
  flex-shrink: 0;
  gap: 1.25rem;
  min-width: 0;
}
.qe-nav__links a {
  color: #e5e7eb;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.qe-nav__links a:hover,
.qe-nav__links a.is-active { color: var(--qe-brand); }
.qe-nav__links .qe-btn {
  flex-shrink: 0;
  white-space: nowrap;
}

/* 小工具下拉：用 padding 銜接，避免 margin 空隙導致無法點選 */
.qe-nav-games {
  position: relative;
  align-self: stretch;
  display: flex;
  align-items: center;
}
.qe-nav-games__trigger {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  color: #e5e7eb;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
}
.qe-nav-games__trigger:hover,
.qe-nav-games__trigger[aria-expanded="true"] {
  color: var(--qe-brand);
}
.qe-games-dd {
  position: absolute;
  right: 0;
  top: 100%;
  z-index: 60;
  min-width: 10rem;
  /* 透明銜接區，滑鼠可從按鈕移到選項而不觸發 mouseleave */
  padding-top: 0.45rem;
  background: transparent;
  border: 0;
}
.qe-games-dd[hidden] { display: none !important; }
.qe-games-dd a {
  display: block;
  padding: 0.65rem 1rem;
  background: #111827;
  border-left: 1px solid #374151;
  border-right: 1px solid #374151;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.85rem;
  font-weight: 600;
}
.qe-games-dd a:first-child {
  border-top: 1px solid #374151;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
}
.qe-games-dd a:last-child {
  border-bottom: 1px solid #374151;
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
}
.qe-games-dd a:hover {
  background: #1f2937;
  color: var(--qe-brand);
}

.qe-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.7rem 1.25rem;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid transparent;
  transition: 0.2s ease;
  cursor: pointer;
  font-size: 0.95rem;
}
.qe-btn--primary {
  background: #0aa8cc;
  color: #041018;
  box-shadow: none;
}
.qe-btn--primary:hover {
  background: var(--qe-brand);
  box-shadow: none;
  transform: translateY(-1px);
  filter: none;
}
/* 導覽列 CTA：低調描邊，避免右上角整塊過亮 */
.qe-btn--nav {
  background: transparent;
  color: var(--qe-brand);
  border-color: rgba(0, 212, 255, 0.4);
  box-shadow: none;
}
.qe-btn--nav:hover {
  background: rgba(0, 212, 255, 0.12);
  border-color: var(--qe-brand);
  color: #fff;
  box-shadow: none;
  transform: none;
  filter: none;
}
.qe-btn--ghost {
  border-color: rgba(0, 212, 255, 0.45);
  color: var(--qe-brand);
  background: transparent;
}
.qe-btn--ghost:hover {
  background: rgba(0, 212, 255, 0.12);
  border-color: var(--qe-brand);
  color: #fff;
  box-shadow: none;
}
.qe-btn--accent {
  background: var(--qe-accent);
  color: #fff;
  box-shadow: none;
}
.qe-btn--accent:hover {
  box-shadow: none;
  transform: translateY(-1px);
  filter: brightness(1.05);
}
.qe-btn--block { width: 100%; }

.qe-menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: #d1d5db;
  font-size: 1.5rem;
  padding: 0.4rem;
  cursor: pointer;
  transition: color 0.2s ease;
}
.qe-menu-btn:hover { color: var(--qe-brand); }
.qe-menu-btn i {
  display: inline-block;
  transition: transform 0.3s ease;
}
.qe-menu-btn.is-open i {
  transform: rotate(90deg);
}

/* 手機抽屜：顯示／高度全由 JS 控制，CSS 只負責外觀 */
.qe-drawer {
  position: fixed;
  top: var(--qe-nav-h);
  left: 0; right: 0; bottom: 0;
  z-index: 40;
  display: none;
}
.qe-drawer__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  border: none;
  padding: 0;
  cursor: pointer;
}
.qe-drawer__panel {
  position: relative;
  z-index: 1;
  overflow: hidden;
  height: 0;
  background: #111827;
  border-bottom: 1px solid #1f2937;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.45);
  will-change: height;
}
.qe-drawer__inner {
  padding: 0.75rem 1rem 1.25rem;
}
.qe-drawer a {
  display: block;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  padding: 0.85rem 0.5rem;
  border-bottom: 1px solid #1f2937;
  transition: color 0.2s ease;
}
.qe-drawer a:hover { color: var(--qe-brand); }
.qe-drawer__label {
  color: var(--qe-brand);
  font-size: 0.8rem;
  font-weight: 700;
  margin: 0.75rem 0 0.25rem;
  padding: 0 0.5rem;
}

.qe-main { padding-top: var(--qe-nav-h); min-height: calc(100vh - 5rem); }
.qe-footer {
  background: #111827;
  border-top: 1px solid #1f2937;
  padding: 1.75rem 1rem;
  text-align: center;
  color: #6b7280;
  font-size: 0.85rem;
  position: relative;
  z-index: 1;
}
.qe-footer p { margin: 0 0 0.65rem; }
.qe-footer__links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem 0.45rem;
}
.qe-footer__links a,
.qe-footer__links button {
  color: #9ca3af;
  text-decoration: none;
  transition: color 0.15s;
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
}
.qe-footer__links a:hover,
.qe-footer__links button:hover { color: var(--qe-brand); }
.qe-footer__links span { color: #4b5563; }

/* 法律彈層：沿用公告結構，略加寬 */
.qe-legal-modal__panel {
  width: min(100%, 40rem);
  max-height: min(85vh, 44rem);
}
.qe-legal-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.65rem 0.9rem 0.75rem;
  border-bottom: 1px solid #1f2937;
  flex-shrink: 0;
}
.qe-legal-tab {
  border: 1px solid transparent;
  background: transparent;
  color: #9ca3af;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  cursor: pointer;
  transition: 0.15s;
}
.qe-legal-tab:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}
.qe-legal-tab.is-active {
  color: #041018;
  background: var(--qe-brand);
  border-color: var(--qe-brand);
}
.qe-legal-modal__body {
  font-size: 0.9rem;
}
.qe-legal-panel[hidden] { display: none !important; }
.qe-legal-panel h3 {
  margin: 1.1rem 0 0.4rem;
  font-size: 0.95rem;
  color: var(--qe-brand);
}
.qe-legal-panel p,
.qe-legal-panel li {
  color: #d1d5db;
  line-height: 1.7;
}
.qe-legal-panel p { margin: 0 0 0.75rem; }
.qe-legal-panel ul,
.qe-legal-panel ol {
  margin: 0 0 0.75rem;
  padding-left: 1.2rem;
}
.qe-legal-panel li + li { margin-top: 0.3rem; }
.qe-legal-panel code {
  font-size: 0.86em;
  padding: 0.1em 0.35em;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.35);
  color: var(--qe-brand);
}
.qe-legal-updated {
  margin: 0 0 0.85rem !important;
  color: var(--qe-muted) !important;
  font-size: 0.8rem !important;
}
.qe-legal-note {
  color: #9ca3af !important;
  font-size: 0.85rem !important;
}
.qe-legal-panel a {
  color: var(--qe-brand);
  text-decoration: none;
}
.qe-legal-panel a:hover { text-decoration: underline; }

.qe-page-pad {
  padding: 2rem 1rem 3rem;
  max-width: 80rem;
  margin: 0 auto;
}
@media (min-width: 768px) {
  .qe-page-pad { padding-bottom: 3rem; }
  .qe-menu-btn { display: none; }
  .qe-nav__links { display: flex; }
  .qe-drawer {
    display: none !important;
  }
}

.qe-title {
  font-family: var(--qe-font-display);
  font-weight: 800;
  letter-spacing: 0.04em;
  text-align: center;
  margin: 1.5rem 0 0.5rem;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
}
.qe-subtitle {
  text-align: center;
  color: var(--qe-muted);
  margin: 0 0 2rem;
}

.qe-chips {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.25rem 0 1.25rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.qe-chips::-webkit-scrollbar { display: none; }
.qe-chip {
  flex: 0 0 auto;
  border: 1px solid var(--qe-border);
  background: rgba(255,255,255,0.05);
  color: #cbd5e1;
  border-radius: 999px;
  padding: 0.45rem 1rem;
  font-size: 0.9rem;
  cursor: pointer;
  transition: 0.2s;
}
.qe-chip:hover { background: rgba(255,255,255,0.12); color: #fff; }
.qe-chip.is-active {
  background: var(--qe-brand);
  border-color: var(--qe-brand);
  color: #041018;
  font-weight: 700;
  box-shadow: 0 0 14px var(--qe-brand-dim);
}

.qe-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) { .qe-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .qe-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1280px) { .qe-grid--hitters { grid-template-columns: repeat(4, 1fr); } }

.qe-card {
  position: relative;
  border-radius: var(--qe-radius);
  overflow: hidden;
  border: 1px solid var(--qe-border);
  background: #111;
  aspect-ratio: 16 / 9;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: transform 0.25s, border-color 0.25s;
}
.qe-card:hover {
  transform: translateY(-3px);
  border-color: var(--qe-brand);
}
.qe-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.qe-card__meta {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 0.85rem 1rem;
  background: linear-gradient(to top, rgba(0,0,0,0.92), transparent);
}
.qe-card__name { font-weight: 700; font-size: 1.05rem; }
.qe-card__badge {
  display: inline-block;
  margin-top: 0.25rem;
  font-size: 0.7rem;
  font-weight: 700;
  color: #000;
  background: var(--qe-brand);
  border-radius: 999px;
  padding: 0.1rem 0.55rem;
}

.qe-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0,0,0,0.95);
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.qe-lightbox.is-open { display: flex; }
.qe-lightbox img {
  max-width: 95vw;
  max-height: 90vh;
  border-radius: 8px;
  object-fit: contain;
}
.qe-lightbox__close {
  position: absolute;
  top: 1rem; right: 1.25rem;
  color: #fff;
  font-size: 2rem;
  background: none;
  border: none;
  cursor: pointer;
}
.qe-lightbox__close:hover { color: var(--qe-brand); }

.qe-neon { text-shadow: 0 0 14px var(--qe-brand-glow), 0 0 28px rgba(178, 75, 255, 0.25); }

.qe-section-title {
  font-size: 1.5rem;
  font-weight: 800;
  border-left: 4px solid var(--qe-brand);
  padding-left: 0.75rem;
  margin: 0 0 1.25rem;
}

.qe-steps {
  display: grid;
  gap: 1rem;
}
@media (min-width: 768px) {
  .qe-steps { grid-template-columns: repeat(3, 1fr); }
}
.qe-step {
  background: rgba(17, 24, 39, 0.85);
  border: 1px solid var(--qe-border);
  border-radius: var(--qe-radius);
  padding: 1.25rem;
}
.qe-step__n {
  color: var(--qe-brand);
  font-weight: 800;
  font-size: 0.85rem;
  margin-bottom: 0.35rem;
}
