:root {
  /* =========================================
     全新的 Cozy Minimalist 溫暖可愛調色盤
     ========================================= */
  
  /* 奶油白浮雕面板，大幅降低透明度，更接近實體感 */
  --panel: rgba(253, 251, 252, 0.96);
  --panel-strong: #ffffff;
  
  /* 柔和的莫蘭迪粉藍與溫柔粉，降低飽和度 */
  --accent-cyan: #b6f0fc;
  --accent-pink: #ffdfef;
  --accent-soft: rgba(167, 230, 246, 0.15);
  
  /* 深可可棕文字，取代冰冷的灰藍色 */
  --text: #4a3e3e;
  --muted: #8c7e7e;
  
  /* 邊框顏色改為更淡、偏暖的淺灰藍 */
  --border: rgba(200, 220, 230, 0.5);
  --border-active: rgba(255, 179, 198, 0.8);
  
  /* 陰影更蓬鬆、擴散，像雲朵一樣 */
  --shadow: 0 10px 40px rgba(130, 100, 110, 0.06);
  --shadow-glow: 0 0 25px rgba(255, 203, 242, 0.3);
  
  /* 圓角加大，增加鈍感與無攻擊性 */
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 8px;
  --max-width: 1240px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Noto Sans TC", system-ui, -apple-system, sans-serif;
  color: var(--text);
  
  /* =========================================
     移除科技點陣，改用溫暖雲朵漸層背景
     ========================================= */
  background-color: #fff9fc;
  background-image: 
    linear-gradient(135deg, #fff9fc 0%, #f4f6f9 40%, #fff9fc 80%, #f4f6f9 100%);
  min-height: 100vh;
}

img { display: block; max-width: 100%; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; padding: 0;}
input { border: none; }

.page-shell {
  width: min(calc(100% - 24px), var(--max-width));
  margin: 0 auto;
  padding: 32px 0 100px;
}

.hero { text-align: center; padding: 50px 22px 40px; }

.hero__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 18px;
  border-radius: 999px;
  background: var(--panel-strong);
  border: 1px solid var(--border);
  color: var(--muted);
  box-shadow: var(--shadow);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 20px 0 14px;
  font-size: clamp(2rem, 4.5vw, 3.6rem);
  line-height: 1.15;
  color: var(--text);
  /* 移除科技漸層字體，直接使用棕色 */
  -webkit-background-clip: unset;
  -webkit-text-fill-color: unset;
}

.hero p {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.9;
}

.discord-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 32px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-pink));
  color: #1e293b;
  font-weight: 700;
  text-decoration: none;
  border-radius: 999px;
  box-shadow: 0 8px 25px rgba(167, 230, 246, 0.4);
  transition: all 0.35s cubic-bezier(0.18, 0.89, 0.32, 1.28);
  border: 3px solid #ffffff;
}

.discord-btn:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 10px 30px rgba(255, 203, 242, 0.5);
  background: linear-gradient(135deg, #b0ebf8, #f8cfe6);
}

.discord-icon { width: 22px; height: 22px; }

.card {
  background: var(--panel);
  /* 大幅降低 blur 程度 */
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: var(--shadow);
  transition: box-shadow 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}

.toolbar {
  position: sticky;
  top: 14px;
  z-index: 20;
  border-radius: var(--radius-xl);
  padding: 24px;
  margin-bottom: 30px;
}

.search-box input {
  width: 100%;
  border: 3px solid var(--border);
  border-radius: 999px;
  padding: 16px 26px;
  background: #ffffff;
  outline: none;
  color: var(--text);
  font-weight: 500;
  transition: all 0.3s ease;
}

.search-box input:focus {
  border-color: var(--border-active);
  box-shadow: var(--shadow-glow);
}

.filter-row {
  display: flex;
  justify-content: space-between;
  align-items: center; /* 改為靠中 */
  gap: 16px;
  margin-top: 20px;
}

.toolbar-meta {
  white-space: nowrap;
  color: var(--muted);
  /* 移除 monospace字體，改用一般Sans */
  font-family: inherit;
  font-size: 0.9rem;
}

.chips { display: flex; flex-wrap: wrap; gap: 12px; }

.chip {
  border: 2px solid var(--border);
  background: #ffffff;
  border-radius: 999px;
  padding: 9px 18px;
  color: var(--muted);
  font-weight: 500;
  transition: all 0.2s ease;
}

.chip:hover { 
  transform: translateY(-2px); 
  border-color: var(--border-active);
}

.chip.is-active {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-pink));
  border-color: transparent;
  color: #1e293b;
  box-shadow: 0 5px 15px rgba(167, 230, 246, 0.3);
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 22px;
}

/* 加上上方分頁後的 gallery 間距調整 */
.gallery--w-top-pagi { margin-top: 30px; }

.gif-card {
  overflow: hidden;
  border-radius: var(--radius-lg);
}

.gif-card:hover {
  border-color: var(--border-active);
  box-shadow: var(--shadow-glow);
  transform: translateY(-4px);
}

.gif-card__media {
  width: 100%;
  display: block;
}

.gif-card__img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: var(--accent-soft);
}

.gif-card__body {
  padding: 18px;
  background: rgba(255, 255, 255, 0.7);
}

.gif-card__top {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  justify-content: space-between;
}

.gif-card__title {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.45;
  margin: 0;
}

.gif-card__category {
  flex-shrink: 0;
  border-radius: 8px;
  background: var(--muted); /* 改為較柔和的顏色，取代死板的黑 */
  color: #fff;
  padding: 5px 10px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.gif-card__tags, .lightbox__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.tag {
  font-size: 0.75rem;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border);
  color: var(--muted);
  /* 移除monospace字體 */
  font-family: inherit;
}

.empty-state {
  margin-top: 20px;
  border-radius: var(--radius-xl);
  text-align: center;
  padding: 60px 20px;
}

.empty-state__icon {
  font-size: 3rem;
  margin-bottom: 12px;
  color: var(--accent-pink);
}

.hidden { display: none !important; }

.lightbox {
  width: min(1000px, calc(100% - 30px));
  border: 1px solid var(--border);
  padding: 0;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--panel-strong);
  box-shadow: 0 30px 90px rgba(51, 65, 85, 0.2);
}

.lightbox::backdrop {
  background: rgba(40, 30, 30, 0.5); /* 棕色調遮罩 */
  backdrop-filter: blur(8px);
}

.lightbox__close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: rgba(255,255,255,0.95);
  color: var(--text);
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
  z-index: 2;
  font-size: 1.2rem;
  transition: transform 0.2s;
}

.lightbox__close:hover {
  transform: scale(1.1);
  background: var(--accent-pink);
  color: #fff;
}

.lightbox__content {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
  align-items: stretch;
}

.lightbox__content img {
  width: 100%;
  height: 100%;
  max-height: 75vh;
  object-fit: contain;
  background: #f8f8f8;
}

.lightbox__info {
  padding: 40px 30px;
  background: rgba(255, 255, 255, 0.7);
}

.lightbox__info h2 {
  margin: 0 0 14px;
  font-size: 2rem;
  color: var(--text);
}

.lightbox__info p {
  margin: 0;
  color: var(--muted);
  line-height: 1.9;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* =========================================
   分頁系統樣式 (Pagination) 
   ========================================= */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

/* 上方分頁額外間距 */
.pagination--top { margin-bottom: 20px; margin-top: 0; }
/* 下方分頁額外間距 */
.pagination--bottom { margin-top: 50px; }

.page-btn {
  padding: 12px 22px;
  border: 2px solid var(--border);
  background: #ffffff;
  border-radius: var(--radius-md);
  color: var(--text);
  font-weight: 700;
  transition: all 0.25s ease;
  box-shadow: 0 4px 10px rgba(100, 116, 139, 0.05);
}

.page-btn:hover:not(:disabled) {
  border-color: var(--border-active);
  box-shadow: 0 8px 18px rgba(255, 203, 242, 0.35);
  transform: translateY(-3px);
}

.page-btn.is-active {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-pink));
  border-color: transparent;
  color: #1e293b;
  box-shadow: 0 6px 15px rgba(167, 230, 246, 0.3);
}

.page-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
  background: #f1f5f9;
}

/* 手機版適配加大 */
@media (max-width: 860px) {
  .hero { padding-top: 30px; }
  .hero p { line-height: 1.7; font-size: 1rem; }
  .filter-row { flex-direction: column; align-items: flex-start; }
  .toolbar-meta { padding-top: 0; margin-top: -10px; }
  .lightbox__content { grid-template-columns: 1fr; }
  .lightbox__content img { max-height: 50vh; }
}

@media (max-width: 640px) {
  .page-shell { width: min(calc(100% - 16px), var(--max-width)); padding-top: 18px; }
  .toolbar { top: 10px; padding: 18px; }
  .search-box input { padding: 14px 22px; }
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .gif-card__body { padding: 14px; }
  .gif-card__title { font-size: 0.95rem; }
  .page-btn { padding: 10px 16px; font-size: 0.95rem; gap: 8px;}
  .pagination { gap: 8px; }
}