/* === ZZZ 風格定義 === */
:root {
  --bg-dark: #0a0a0a;
  --card-bg: rgba(20, 20, 23, 0.7);
  --card-border: rgba(255, 255, 255, 0.1);
  --accent: #D6FC42;
  /* ZZZ 標誌性的螢光綠 */
  --accent-glow: rgba(214, 252, 66, 0.4);
  --secondary: #38bdf8;
  --text-main: #ffffff;
  --text-sub: #a1a1aa;
  --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Inter', system-ui, sans-serif;
  background-color: var(--bg-dark);
  background-image:
    radial-gradient(circle at 50% 0%, #1a1a1a 0%, #000 100%),
    linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%),
    linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
  background-size: 100% 100%, 100% 2px, 3px 100%;
  /* 模擬 CRT 掃描線 */
  color: var(--text-main);
  min-height: 100vh;
  overscroll-behavior: none;
  /* 防止下拉刷新 */
  touch-action: pan-y;
  /* 只允許垂直滾動 */
  overflow-x: hidden;
}

/* 裝飾性背景雜訊 */
.noise-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 50;
  background: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0IiBoZWlnaHQ9IjQiPgo8cmVjdCB3aWR0aD0iNCIgaGVpZ2h0PSI0IiBmaWxsPSIjZmZmIiBmaWxsLW9wYWNpdHk9IjAuMDIiLz4KPC9zdmc+');
}

/* 斜向跑馬燈背景裝飾 */
.marquee-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
  opacity: 0.15;
}

.marquee-line {
  position: absolute;
  white-space: nowrap;
  font-family: 'Kanit', monospace;
  font-weight: 700;
  font-style: italic;
  letter-spacing: 0.1em;
  width: 100%;
  overflow: hidden;
  left: 0;
  transform: rotate(-15deg);
}

.marquee-line-1 {
  top: 8%;
  font-size: 3.5rem;
  color: var(--accent);
  text-shadow: 0 0 20px var(--accent-glow);
}

.marquee-line-1 .marquee-content {
  animation: marqueeRight 25s linear infinite;
}

.marquee-line-2 {
  top: 28%;
  font-size: 1.4rem;
  color: #fff;
  opacity: 0.2;
  letter-spacing: 0.15em;
}

.marquee-line-2 .marquee-content {
  animation: marqueeLeft 70s linear infinite;
}

.marquee-line-3 {
  top: 50%;
  font-size: 3rem;
  color: var(--accent);
  text-shadow: 0 0 15px var(--accent-glow);
}

.marquee-line-3 .marquee-content {
  animation: marqueeRight 28s linear infinite;
}

.marquee-line-4 {
  top: 72%;
  font-size: 1.3rem;
  color: #fff;
  opacity: 0.18;
  letter-spacing: 0.12em;
}

.marquee-line-4 .marquee-content {
  animation: marqueeLeft 75s linear infinite;
}

.marquee-line-5 {
  top: 88%;
  font-size: 2.8rem;
  color: var(--accent);
  text-shadow: 0 0 18px var(--accent-glow);
}

.marquee-line-5 .marquee-content {
  animation: marqueeRight 30s linear infinite;
}

.marquee-content {
  display: inline-block;
  will-change: transform;
}

.marquee-item {
  display: inline-block;
}

@keyframes marqueeRight {
  0% {
    transform: translateX(0);
  }

  100% {
    transform: translateX(-50%);
  }
}

@keyframes marqueeLeft {
  0% {
    transform: translateX(-50%);
  }

  100% {
    transform: translateX(0);
  }
}

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px 80px;
  position: relative;
  z-index: 1;
}

/* === Header === */
header {
  margin-bottom: 40px;
  position: relative;
  opacity: 0;
  text-align: center;
}

h1 {
  font-family: 'Kanit', sans-serif;
  font-weight: 800;
  font-style: italic;
  font-size: clamp(2.5rem, 5vw, 4rem);
  margin: 0;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  background: linear-gradient(180deg, #fff 0%, #ccc 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0px 4px 20px rgba(0, 0, 0, 0.5);
  position: relative;
  display: inline-block;
}

/* 標題裝飾線 */
h1::after {
  content: '';
  position: absolute;
  bottom: 5px;
  right: -20px;
  width: 60px;
  height: 8px;
  background: var(--accent);
  transform: skewX(-20deg);
}

.subtitle {
  margin-top: 20px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.8;
}

.subtitle-code {
  font-family: 'Courier New', monospace;
  font-size: 1.1rem;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.typewriter-line {
  opacity: 0;
  min-height: 1.5em;
}

.typewriter-line.active {
  opacity: 1;
}

.typewriter-text {
  display: inline-block;
  border-right: 2px solid var(--accent);
  padding-right: 4px;
  animation: blink 1s step-end infinite;
}

.typewriter-text.finished {
  border-right: none;
  animation: none;
}

@keyframes blink {
  50% {
    border-color: transparent;
  }
}

.subtitle-desc {
  font-size: 0.95rem;
  color: var(--text-sub);
  margin-top: 8px;
  text-align: center;
}

.version-count {
  margin-top: 8px;
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 600;
  font-family: 'Kanit', sans-serif;
  letter-spacing: 0.05em;
  text-align: center;
}

/* Search Bar */
.search-bar {
  max-width: 600px;
  margin: 32px auto;
  position: relative;
  opacity: 0;
}

.search-input {
  width: 100%;
  padding: 14px 20px 14px 48px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  color: var(--text-main);
  font-size: 0.95rem;
  font-family: 'Inter', sans-serif;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all 0.3s ease;
}

.search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(214, 252, 66, 0.1);
}

.search-input::placeholder {
  color: var(--text-sub);
}

.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent);
  width: 20px;
  height: 20px;
  pointer-events: none;
  z-index: 1;
  opacity: 0.7;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-input:focus~.search-icon {
  opacity: 1;
  filter: drop-shadow(0 0 6px var(--accent));
  transform: translateY(-50%) rotate(90deg);
}

.search-result-count {
  margin-top: 8px;
  font-size: 0.85rem;
  color: var(--text-sub);
}

.card.hidden {
  display: none;
}

/* === Grid Layout === */
.version-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

/* === Card Design === */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  /* 稍微大一點的圓角 */
  overflow: hidden;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform 0.3s var(--ease-spring), box-shadow 0.3s ease, border-color 0.3s ease;
  opacity: 0;
}

.card:hover {
  transform: translateY(-8px) scale(1.02);
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.8), 0 0 20px rgba(214, 252, 66, 0.1);
  z-index: 2;
}

/* 卡片頂部裝飾條 */
.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), transparent);
  opacity: 0.6;
  z-index: 1;
}

/* 橫幅圖片區域 */
.card-banner {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  position: relative;
  background: linear-gradient(135deg, #1a1a1a 0%, #0a0a0a 100%);
}

.card-banner img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.4s ease;
}

.card:hover .card-banner img {
  transform: scale(1.05);
}

.card-banner::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(to top, rgba(20, 20, 23, 0.9), transparent);
  pointer-events: none;
}

.card-header {
  padding: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.version-number {
  font-family: 'Kanit', sans-serif;
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1;
  color: #fff;
  font-style: italic;
}

.version-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 4px;
  position: relative;
  display: inline-block;
  overflow: hidden;
}

.version-name::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, rgba(214, 252, 66, 0.2), rgba(214, 252, 66, 0.05));
  transform: translateX(-100%);
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover .version-name::before {
  transform: translateX(100%);
}

.agents-list {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.agent-tag {
  font-size: 0.7rem;
  padding: 3px 8px;
  background: rgba(214, 252, 66, 0.15);
  border: 1px solid rgba(214, 252, 66, 0.3);
  border-radius: 4px;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: all 0.2s ease;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.agent-tag::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(120deg, transparent, rgba(214, 252, 66, 0.4), transparent);
  transform: translateX(-100%) skewX(-15deg);
  transition: transform 0.4s ease-out;
}

.agent-tag:hover {
  background: rgba(214, 252, 66, 0.25);
  border-color: var(--accent);
  transform: translateY(-1px);
}

.agent-tag:hover::before {
  transform: translateX(100%) skewX(-15deg);
}

.badge {
  font-family: 'Kanit', sans-serif;
  font-size: 0.75rem;
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  color: var(--text-sub);
  transform: skewX(-10deg);
}

/* === Preview Strip (The Avatars) === */
.preview-strip {
  padding: 16px 20px;
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) transparent;
  mask-image: linear-gradient(to right, black 85%, transparent 100%);
  /* 邊緣淡出 */
}

.preview-strip::-webkit-scrollbar {
  height: 4px;
}

.preview-strip::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 2px;
}

.preview-item {
  flex: 0 0 70px;
  height: 70px;
  border-radius: 14px;
  position: relative;
  cursor: pointer;
  overflow: hidden;
  border: 2px solid transparent;
  transition: all 0.2s ease;
  background: #000;
}

.preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

/* 懸停時頭像效果 */
.preview-item:hover {
  border-color: var(--accent);
  box-shadow: 0 0 15px var(--accent-glow);
}

.preview-item:hover img {
  transform: scale(1.1);
}

/* 角色名標籤 (半透明遮罩) */
.char-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  font-size: 0.6rem;
  text-align: center;
  padding: 2px 0;
  transform: translateY(100%);
  transition: transform 0.2s ease;
}

.preview-item:hover .char-label {
  transform: translateY(0);
}

/* === Footer Actions === */
.card-footer {
  margin-top: auto;
  padding: 16px 20px;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  gap: 10px;
  align-items: center;
}

.btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.2s var(--ease-spring);
  position: relative;
  overflow: hidden;
  text-transform: uppercase;
  font-family: 'Kanit', sans-serif;
}

/* 按鈕光澤效果 */
.btn::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(135deg,
      transparent 30%,
      rgba(255, 255, 255, 0.5) 50%,
      transparent 70%);
  transform: translateX(-100%) translateY(-100%) rotate(45deg);
  transition: transform 0.6s ease;
  pointer-events: none;
}

.btn:hover::before {
  transform: translateX(100%) translateY(100%) rotate(45deg);
}

.btn-primary {
  background: var(--accent);
  color: #000;
  border: 1px solid var(--accent);
}

.btn-primary::before {
  background: linear-gradient(135deg,
      transparent 30%,
      rgba(255, 255, 255, 0.6) 50%,
      transparent 70%);
}

.btn-primary:hover {
  background: #c3e63b;
  box-shadow: 0 0 20px var(--accent-glow), 0 4px 15px rgba(214, 252, 66, 0.3);
  transform: translateY(-2px);
}

.btn-primary:active {
  transform: translateY(0) scale(0.98);
  box-shadow: 0 0 10px var(--accent-glow);
}

.btn-secondary {
  background: transparent;
  color: var(--text-main);
  border: 1px solid rgba(255, 255, 255, 0.2);
  position: relative;
}

.btn-secondary::before {
  background: linear-gradient(135deg,
      transparent 30%,
      rgba(214, 252, 66, 0.3) 50%,
      transparent 70%);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(214, 252, 66, 0.5);
  box-shadow: 0 0 15px rgba(214, 252, 66, 0.2);
}

.btn-secondary:active {
  transform: scale(0.98);
  background: rgba(255, 255, 255, 0.08);
}

/* === Modal (Lightbox) === */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-wrapper {
  display: flex;
  align-items: center;
  gap: 30px;
  transform: scale(0.9);
  transition: transform 0.4s var(--ease-spring);
}

.modal-backdrop.active .modal-wrapper {
  transform: scale(1);
}

.modal-content {
  background: #111;
  padding: 8px;
  border-radius: 20px;
  border: 1px solid var(--card-border);
  box-shadow: 0 50px 100px -20px rgba(0, 0, 0, 1);
  max-width: 80vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.modal-backdrop.active .modal-content {
  transform: scale(1);
}

.modal-img-wrapper {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: radial-gradient(circle, #333, #000);
  perspective: 1000px;
}

.modal-img-wrapper img {
  display: block;
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  backface-visibility: hidden;
}

/* 圖片導航箭頭 - 放在框框外面 */
.modal-nav {
  background: rgba(214, 252, 66, 0.9);
  color: #000;
  border: none;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  font-size: 2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  font-weight: bold;
  flex-shrink: 0;
}

.modal-nav:hover {
  background: var(--accent);
  box-shadow: 0 0 20px var(--accent-glow);
  transform: scale(1.15);
}

.modal-nav:active {
  transform: scale(0.9);
}

.modal-nav:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  transform: scale(1);
}

.modal-nav:disabled:hover {
  background: rgba(214, 252, 66, 0.9);
  box-shadow: none;
}

.modal-center {
  display: flex;
  flex-direction: column;
  max-width: 90vw;
}

/* 圖片計數器 */
.modal-counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--accent);
  padding: 8px 16px;
  border-radius: 20px;
  font-family: 'Kanit', sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  border: 1px solid rgba(214, 252, 66, 0.3);
}

.modal-info {
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #fff;
}

.modal-title {
  font-family: 'Kanit';
  font-size: 1.2rem;
}

.close-btn {
  background: none;
  border: none;
  color: var(--text-sub);
  font-size: 2rem;
  cursor: pointer;
  line-height: 0.5;
  transition: color 0.2s;
  position: relative;
  z-index: 20;
}

.close-btn::before {
  display: none !important;
}

.close-btn:hover {
  color: var(--accent);
}

/* Footer */
footer {
  text-align: center;
  margin-top: 60px;
  font-size: 0.8rem;
  color: var(--text-sub);
  opacity: 0;
}

/* Loading Text Fill Animation */
.loading-spinner {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1000;
  transition: opacity 0.3s ease;
  text-align: center;
}

.loading-text-wrapper {
  position: relative;
  display: inline-block;
}

.loading-text {
  font-family: 'Kanit', sans-serif;
  font-size: 4rem;
  font-weight: 900;
  font-style: italic;
  letter-spacing: 0.05em;
  color: transparent;
  -webkit-text-stroke: 2px rgba(214, 252, 66, 0.3);
  position: relative;
  line-height: 1;
}

.loading-text-fill {
  position: absolute;
  top: 0;
  left: 0;
  color: var(--accent);
  -webkit-text-stroke: 0;
  overflow: hidden;
  white-space: nowrap;
  text-shadow: 0 0 20px var(--accent);
}

.loading-subtext {
  margin-top: 20px;
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  color: var(--text-sub);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.8;
}

.loading-progress {
  margin-top: 12px;
  font-family: 'Kanit', sans-serif;
  font-size: 1.2rem;
  color: var(--accent);
  font-weight: 700;
  text-shadow: 0 0 10px var(--accent);
}

/* 為 loading 添加掃描線效果 */
.loading-spinner::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 120%;
  height: 120%;
  border: 1px solid rgba(214, 252, 66, 0.1);
  border-radius: 4px;
  pointer-events: none;
}

.loading-spinner::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 140%;
  height: 140%;
  border: 1px solid rgba(214, 252, 66, 0.05);
  border-radius: 4px;
  pointer-events: none;
}

/* Back to Top Button */
.back-to-top {
  position: fixed;
  bottom: 40px;
  right: 40px;
  width: 50px;
  height: 50px;
  background: var(--accent);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: all 0.3s var(--ease-spring);
  z-index: 100;
}

.back-to-top.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.back-to-top:hover {
  background: #c3e63b;
  box-shadow: 0 6px 20px var(--accent-glow);
  transform: translateY(-4px);
}

.back-to-top::before {
  content: '▲';
  color: #000;
  font-size: 1.2rem;
  font-weight: bold;
}

/* Skeleton Loading */
.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
  margin-bottom: 40px;
  transition: opacity 0.3s ease;
}

.skeleton-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  overflow: hidden;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  height: 450px;
  position: relative;
}

.skeleton-shimmer {
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  to {
    left: 100%;
  }
}

.skeleton-banner {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: rgba(255, 255, 255, 0.05);
}

.skeleton-header {
  padding: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.skeleton-title {
  width: 60%;
  height: 24px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  margin-bottom: 8px;
}

.skeleton-tags {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.skeleton-tag {
  width: 60px;
  height: 20px;
  background: rgba(214, 252, 66, 0.1);
  border-radius: 4px;
}

.skeleton-preview {
  padding: 16px 20px;
  display: flex;
  gap: 12px;
}

.skeleton-avatar {
  width: 70px;
  height: 70px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 14px;
}

/* 手機版響應式設計 */
@media (max-width: 768px) {

  /* Modal 佈局調整 */
  .modal-wrapper {
    flex-direction: column;
    gap: 0;
    width: 100vw;
    height: 100vh;
    justify-content: center;
  }

  .modal-content {
    max-width: 100vw;
    max-height: 100vh;
    border: none;
    border-radius: 0;
    background: #000;
    padding: 0;
    position: relative;
  }

  .modal-img-wrapper {
    border-radius: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .modal-img-wrapper img {
    max-width: 100vw;
    max-height: 100vh;
    width: 100%;
    height: 100%;
    object-fit: contain;
  }

  /* 按鈕疊在圖片上 */
  .modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 45px;
    height: 45px;
    font-size: 1.5rem;
    z-index: 10;
  }

  #modalPrev {
    left: 15px;
  }

  #modalNext {
    right: 15px;
  }

  /* 手機版按鈕互動效果 - 保留垂直置中 */
  .modal-nav:hover {
    transform: translateY(-50%) scale(1.15);
  }

  .modal-nav:active {
    transform: translateY(-50%) scale(0.9);
  }

  /* 標題和關閉按鈕 */
  .modal-title {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 1rem;
  }

  .close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 11;
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
  }

  /* 計數器 */
  .modal-counter {
    bottom: 30px;
    font-size: 0.9rem;
    padding: 6px 16px;
  }

  /* 搜尋框 */
  .search-bar {
    flex-direction: row;
    padding: 16px;
  }

  #searchInput {
    font-size: 16px;
    /* 防止 iOS 自動縮放 */
  }

  .search-icon {
    left: 28px;
    top: 46%;
  }

  /* 卡片網格 */
  .versions-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  /* 回到頂部按鈕 */
  .back-to-top {
    bottom: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
  }
}
