/* ============================================================
   狂歡風格 — 霓虹 / 漸層 / 發光 / 動感
   ============================================================ */
*,
*::before,
*::after { box-sizing: border-box; }

:root {
  --bg: #0a0a14;
  --bg-2: #120a24;
  --surface: rgba(26, 20, 48, 0.72);
  --surface-2: rgba(40, 30, 72, 0.85);
  --border: rgba(140, 100, 255, 0.28);
  --text: #f1e9ff;
  --text-muted: #b9a8e6;
  --accent: #4ff0ff;
  --accent-2: #ff4fd8;
  --accent-3: #ffe14f;
  --primary: #8b5cf6;
  --primary-hover: #a78bfa;
  --danger: #ff4f6d;
  --radius: 14px;
  --glow: 0 0 18px rgba(79, 240, 255, 0.45);
  --glow-pink: 0 0 22px rgba(255, 79, 216, 0.55);
}

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, "Segoe UI", "Microsoft JhengHei",
    "PingFang TC", "Noto Sans TC", sans-serif;
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(circle at 12% 8%, rgba(139, 92, 246, 0.35), transparent 42%),
    radial-gradient(circle at 88% 12%, rgba(255, 79, 216, 0.28), transparent 40%),
    radial-gradient(circle at 50% 105%, rgba(79, 240, 255, 0.22), transparent 48%),
    linear-gradient(160deg, var(--bg) 0%, var(--bg-2) 100%);
  background-attachment: fixed;
}

/* 背景流動光點 */
body::before {
  content: "";
  position: fixed;
  inset: -20%;
  z-index: -1;
  background:
    radial-gradient(circle, rgba(79, 240, 255, 0.10) 0, transparent 42%) 20% 30% / 46vmax 46vmax no-repeat,
    radial-gradient(circle, rgba(255, 79, 216, 0.10) 0, transparent 42%) 80% 70% / 50vmax 50vmax no-repeat;
  animation: aurora 18s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes aurora {
  0%   { transform: translate3d(-2%, -1%, 0) scale(1); opacity: 0.75; }
  50%  { transform: translate3d(2%, 2%, 0) scale(1.06); opacity: 1; }
  100% { transform: translate3d(-1%, 3%, 0) scale(1.02); opacity: 0.8; }
}

a { color: var(--accent); transition: color 0.2s, text-shadow 0.2s; }
a:hover { color: #fff; text-shadow: 0 0 10px rgba(79, 240, 255, 0.9); }

code {
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 0.9em;
  background: rgba(79, 240, 255, 0.08);
  color: var(--accent);
  padding: 2px 7px;
  border-radius: 6px;
  border: 1px solid rgba(79, 240, 255, 0.35);
  word-break: break-all;
}

/* ============================================================
   版面
   ============================================================ */
.container {
  max-width: 980px;
  margin: 0 auto;
  padding: 32px 24px 72px;
}

/* ============================================================
   Header / 導航
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 22px;
  padding: 14px 24px;
  background: linear-gradient(90deg,
    rgba(20, 12, 40, 0.88),
    rgba(36, 16, 60, 0.82),
    rgba(20, 12, 40, 0.88));
  backdrop-filter: blur(12px) saturate(140%);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04),
              0 8px 32px rgba(0, 0, 0, 0.45);
}

.logo {
  font-weight: 800;
  font-size: 17px;
  letter-spacing: 0.02em;
  text-decoration: none;
  white-space: nowrap;
  background: linear-gradient(92deg, var(--accent), var(--accent-2), var(--accent-3));
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shine 6s linear infinite;
}

@keyframes shine {
  to { background-position: 200% center; }
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tabs a {
  position: relative;
  color: #d8ccff;
  text-decoration: none;
  font-size: 14px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: all 0.2s;
}

.tabs a:hover {
  color: #fff;
  border-color: rgba(79, 240, 255, 0.5);
  background: rgba(79, 240, 255, 0.08);
  box-shadow: var(--glow);
  text-shadow: none;
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 22px 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  background: linear-gradient(0deg, rgba(20, 12, 40, 0.6), transparent);
}

/* ============================================================
   標題
   ============================================================ */
h1 {
  font-size: 30px;
  margin: 0 0 24px;
  letter-spacing: 0.02em;
  background: linear-gradient(92deg, #fff, var(--accent), var(--accent-2));
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shine 8s linear infinite;
  filter: drop-shadow(0 0 14px rgba(255, 79, 216, 0.35));
}

h2 { font-size: 20px; margin: 0 0 14px; color: #fff; }
h3 { font-size: 16px; margin: 0 0 12px; color: #fff; }

.muted { color: var(--text-muted); font-size: 14px; }

/* ============================================================
   Mod 主體 / 卡片
   ============================================================ */
.mod-main,
.deps,
.step,
.release-timeline {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 26px;
  margin-bottom: 24px;
  backdrop-filter: blur(6px);
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.4),
              inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.mod-main {
  position: relative;
  overflow: hidden;
}

.mod-main::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, var(--accent), transparent 40%,
              transparent 60%, var(--accent-2));
  -webkit-mask: linear-gradient(#000 0 0) content-box,
                linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0.75;
}

.mod-main p {
  margin: 0 0 14px;
  color: var(--text-muted);
}

.mod-main .hash { color: var(--text-muted); }

/* ============================================================
   按鈕
   ============================================================ */
button {
  position: relative;
  cursor: pointer;
  border: 0;
  border-radius: 999px;
  padding: 10px 24px;
  font-size: 14px;
  font-family: inherit;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--accent-2));
  box-shadow: 0 6px 22px rgba(139, 92, 246, 0.5),
              0 0 0 1px rgba(255, 255, 255, 0.08) inset;
  transition: transform 0.12s, box-shadow 0.2s, filter 0.2s;
}

button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(255, 79, 216, 0.55),
              0 0 24px rgba(79, 240, 255, 0.35);
  filter: brightness(1.08);
}

button:active:not(:disabled) { transform: translateY(0); }

button:disabled {
  background: #2a2440;
  color: #7c6fa6;
  box-shadow: none;
  cursor: not-allowed;
}

button#cancelBtn {
  background: linear-gradient(135deg, #3a3358, #2a2440);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06) inset;
}
button#cancelBtn:hover { background: #453c6b; }

/* 下載鈕額外脈動光環 */
#dlBtn::before,
.dlBtn::before {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  filter: blur(12px);
  opacity: 0.5;
  z-index: -1;
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.35; transform: scale(1); }
  50%      { opacity: 0.7;  transform: scale(1.05); }
}

/* ============================================================
   Modal（注意事項彈窗）
   ============================================================ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(6, 4, 16, 0.75);
  backdrop-filter: blur(8px);
}

.modal.hidden { display: none; }

.modal-box {
  position: relative;
  background: linear-gradient(160deg, rgba(32, 22, 60, 0.96),
              rgba(18, 12, 38, 0.98));
  border: 1px solid rgba(255, 79, 216, 0.45);
  border-radius: 18px;
  padding: 28px 30px;
  width: 100%;
  max-width: 520px;
  box-shadow: 0 0 0 1px rgba(79, 240, 255, 0.12) inset,
              0 24px 80px rgba(139, 92, 246, 0.55),
              0 0 60px rgba(255, 79, 216, 0.25);
  animation: modal-in 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(14px) scale(0.94); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-box h3 {
  font-size: 18px;
  background: linear-gradient(92deg, var(--accent-3), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 14px;
}

.modal-box ul {
  margin: 0 0 18px;
  padding-left: 4px;
  list-style: none;
  color: #d8ccff;
}

.modal-box li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 9px;
  font-size: 14px;
}

.modal-box li::before {
  content: "✦";
  position: absolute;
  left: 0;
  color: var(--accent);
  text-shadow: 0 0 8px rgba(79, 240, 255, 0.9);
}

.modal-box label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: #d8ccff;
  cursor: pointer;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(79, 240, 255, 0.05);
  border: 1px dashed rgba(79, 240, 255, 0.3);
}

.modal-box input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent-2);
  cursor: pointer;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 20px;
}

/* ============================================================
   依賴模組列表
   ============================================================ */
.deps ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.deps li a {
  display: block;
  padding: 12px 16px;
  background: linear-gradient(135deg, rgba(79, 240, 255, 0.08),
              rgba(255, 79, 216, 0.08));
  border: 1px solid rgba(140, 100, 255, 0.3);
  border-radius: 12px;
  color: #eae0ff;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s;
}

.deps li a:hover {
  border-color: var(--accent);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: var(--glow), 0 8px 22px rgba(0, 0, 0, 0.4);
  text-shadow: none;
}

/* ============================================================
   影片（16:9 自適應）
   ============================================================ */
.video-wrap {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid rgba(255, 79, 216, 0.35);
  box-shadow: 0 0 30px rgba(255, 79, 216, 0.2),
              0 0 60px rgba(79, 240, 255, 0.12);
}

.video-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

section#video iframe {
  max-width: 100%;
  border: 0;
  border-radius: var(--radius);
}

/* ============================================================
   圖文教學
   ============================================================ */
.step {
  position: relative;
  border-left: 4px solid transparent;
  border-image: linear-gradient(180deg, var(--accent), var(--accent-2)) 1;
}

.step h2 {
  margin-bottom: 10px;
  background: linear-gradient(92deg, #fff, var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.step p { margin: 0 0 12px; color: #d8ccff; }

.step img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 12px 0;
  border-radius: 10px;
  border: 1px solid rgba(140, 100, 255, 0.35);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

/* ============================================================
   Changelog
   ============================================================ */
.changelog {
  list-style: none;
  padding: 0;
  margin: 20px 0 0;
}

.changelog-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid #4b3f78;
  border-radius: var(--radius);
  padding: 16px 22px;
  margin-bottom: 14px;
  backdrop-filter: blur(6px);
  transition: transform 0.15s, box-shadow 0.2s;
}

.changelog-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45),
              0 0 18px rgba(139, 92, 246, 0.25);
}

.changelog-item.type-feature  { border-left-color: #35f0a0; }
.changelog-item.type-fix      { border-left-color: #4f9dff; }
.changelog-item.type-breaking { border-left-color: var(--danger); }
.changelog-item.type-hotfix   { border-left-color: var(--accent-3); }

.changelog-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.changelog-head .version {
  font-weight: 800;
  font-size: 19px;
  background: linear-gradient(92deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.changelog-head time {
  color: var(--text-muted);
  font-size: 13px;
}

.badge {
  font-size: 12px;
  padding: 3px 11px;
  border-radius: 999px;
  background: var(--surface-2);
  color: #d8ccff;
  white-space: nowrap;
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-weight: 700;
}

.badge-feature  { background: rgba(53, 240, 160, 0.15); color: #7dffc4; border-color: rgba(53, 240, 160, 0.4); }
.badge-fix      { background: rgba(79, 157, 255, 0.15); color: #9cc8ff; border-color: rgba(79, 157, 255, 0.4); }
.badge-breaking { background: rgba(255, 79, 109, 0.16); color: #ff9aae; border-color: rgba(255, 79, 109, 0.45); }
.badge-hotfix   { background: rgba(255, 225, 79, 0.14); color: #ffe98a; border-color: rgba(255, 225, 79, 0.4); }

.dl-link {
  margin-left: auto;
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid rgba(79, 240, 255, 0.35);
  transition: all 0.2s;
}

.dl-link:hover {
  background: rgba(79, 240, 255, 0.12);
  color: #fff;
  box-shadow: var(--glow);
  text-shadow: none;
}

.changelog-notes {
  color: #e6dcff;
  word-break: break-word;
}

.sha {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-muted);
  word-break: break-all;
}

/* ============================================================
   版本時程（如果你有沿用）
   ============================================================ */
.release-timeline { }
.timeline { list-style: none; margin: 0; padding: 0 0 0 4px; position: relative; }

.timeline::before {
  content: "";
  position: absolute;
  left: 9px; top: 6px; bottom: 6px; width: 2px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  opacity: 0.7;
}

.timeline-item {
  position: relative;
  padding: 8px 0 8px 30px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.timeline-item .dot {
  position: absolute;
  left: 4px; top: 50%; transform: translateY(-50%);
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--surface-2);
  border: 2px solid var(--border);
}

.timeline-item.is-ready .dot {
  background: #35f0a0;
  border-color: #35f0a0;
  box-shadow: 0 0 12px rgba(53, 240, 160, 0.9);
}

.timeline-body {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  font-size: 15px;
}

.timeline-body strong { color: #fff; min-width: 84px; }

.tag {
  font-size: 12px;
  padding: 3px 11px;
  border-radius: 999px;
  white-space: nowrap;
  font-weight: 700;
}

.tag-ready {
  background: rgba(53, 240, 160, 0.16);
  color: #7dffc4;
  border: 1px solid rgba(53, 240, 160, 0.4);
}

.tag-pending {
  background: var(--surface-2);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

/* release-block（交錯版本區塊） */
.release-block { margin-bottom: 22px; }

.release-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  margin: 0 0 10px;
  padding-left: 16px;
  border-left: 4px solid #4b3f78;
}

.release-block.is-ready .release-title {
  border-left-color: var(--accent);
  box-shadow: -8px 0 22px -10px var(--accent);
}

.release-date { color: #fff; }

/* ============================================================
   響應式
   ============================================================ */
@media (max-width: 640px) {
  .site-header { padding: 12px 16px; }
  .container { padding: 22px 16px 52px; }
  h1 { font-size: 24px; }

  .dl-link { margin-left: 0; }

  .tabs a { padding: 5px 10px; font-size: 13px; }

  .mod-main,
  .deps,
  .step,
  .release-timeline { padding: 18px 18px; }

  .timeline-body strong { min-width: 0; }
}

/* 尊重減少動畫偏好 */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  html { scroll-behavior: auto; }
}

.step-block {
  background: #1e1e1e;
  border: 1px solid #333;
  border-radius: 10px;
  padding: 1.2rem 1.5rem;
  margin: 1.5rem 0;
}
.step-title {
  margin-top: 0;
  font-size: 1.25rem;
  color: #6cf;
}
.step-link {
  display: inline-block;
  margin-top: .5rem;
  padding: .5rem 1rem;
  background: #2a2a2a;
  border-radius: 6px;
  color: #6cf;
  text-decoration: none;
  transition: .2s;
}
.step-link:hover {
  background: #333;
  color: #9df;
}

.schedule-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
}
.schedule-table th,
.schedule-table td {
  padding: .6rem .8rem;
  border-bottom: 1px solid #333;
  text-align: left;
}
.schedule-table th {
  background: #1e1e1e;
  color: #6cf;
}
.schedule-table tr.is-past td { color: #777; }
.schedule-table tr.is-today td { background: #1b3a1b; }
.schedule-table tr.is-future td { color: #ddd; }

.badge {
  display: inline-block;
  padding: .15rem .5rem;
  border-radius: 4px;
  font-size: .85rem;
}
.badge-past   { background:#444; color:#bbb; }
.badge-today  { background:#1b5e20; color:#b9f6ca; }
.badge-future { background:#0d47a1; color:#bbdefb; }