/* ============================================
   海外華文 KOL 100強影響力榜 - 自定義樣式
   ============================================ */

/* 基礎重置 */
* {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html {
  scroll-behavior: smooth;
}

body {
  overflow-x: hidden;
}

/* 選取文字顏色 */
::selection {
  background: rgba(201, 169, 97, 0.4);
  color: #F0EDE5;
}

/* ============================================
   導航欄
   ============================================ */
.nav-header {
  transition: background-color 0.3s ease, backdrop-filter 0.3s ease, box-shadow 0.3s ease;
}

.nav-header.scrolled {
  background: rgba(10, 37, 64, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

/* 深色背景下的導航欄 */
.nav-header-dark.scrolled {
  background: rgba(10, 22, 40, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

/* ============================================
   一屏布局
   ============================================ */
.hero-onepage {
  min-height: calc(100vh - 80px - 200px);
}

/* 英雄區標題（手機端基準：縮小字距並強制單行，適配窄屏） */
.hero-subtitle {
  color: #C9A961;
  font-size: 13px;
  letter-spacing: 0.15em;
  white-space: nowrap;
}

.hero-title {
  line-height: 1.2;
  color: #F0EDE5;
  font-weight: 800;
}

/* 電腦端標題恢復大字 / 寬字距 */
@media (min-width: 768px) {
  .hero-subtitle {
    font-size: 20px;
    letter-spacing: 0.25em;
  }
}

/* 100強 樣式：數字與文字等高 */
.hero-100-text {
  display: inline-flex;
  align-items: center;
}

.hero-100-num {
  color: #deaf19;
  font-size: 1em;
  line-height: 1;
  display: inline-block;
  vertical-align: baseline;
}

.hero-100-char {
  color: #deaf19;
}

/* 榜單標題 100 拉長 */
.ranking-100-num {
  display: inline-block;
  transform: scaleY(1.4) translateY(0.06em);
  transform-origin: bottom;
  vertical-align: baseline;
}

/* ============================================
   卡片鏈接樣式（統一樣式）
   ============================================ */
.card-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #C9A961;
  font-weight: 500;
  font-size: 0.75rem;
  transition: all 0.3s ease;
}

.card-link:hover {
  color: #A88B42;
  gap: 10px;
}

.card-link svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

@media (min-width: 768px) {
  .card-link {
    font-size: 0.875rem;
  }
}

/* ============================================
   卡片通用樣式（懸浮深度感）
   ============================================ */
.card-intro,
.card-ranking,
.contact-card-small {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow:
    0 1px 2px rgba(10, 22, 40, 0.06),
    0 4px 12px rgba(10, 22, 40, 0.08),
    0 12px 32px rgba(10, 22, 40, 0.1);
  border: 1px solid rgba(201, 169, 97, 0.5);
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.4s cubic-bezier(0.22, 1, 0.36, 1),
              border-color 0.4s ease,
              background 0.4s ease;
  position: relative;
}

.card-intro::before,
.card-ranking::before,
.contact-card-small::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(201, 169, 97, 0.8) 0%, rgba(201, 169, 97, 0.3) 50%, rgba(201, 169, 97, 0.1) 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0.7;
  transition: opacity 0.4s ease;
}

.card-intro:hover,
.card-ranking:hover,
.contact-card-small:hover {
  transform: translateY(-4px);
  background: rgba(255, 255, 255, 1);
  border-color: rgba(255, 255, 255, 0.8);
  box-shadow:
    0 2px 4px rgba(10, 22, 40, 0.06),
    0 8px 20px rgba(10, 22, 40, 0.1),
    0 20px 48px rgba(10, 22, 40, 0.14),
    0 0 0 1px rgba(255, 255, 255, 0.3);
}

.card-intro:hover::before,
.card-ranking:hover::before,
.contact-card-small:hover::before {
  opacity: 1;
}

/* ============================================
   榜單卡片（前7名，簡化版）
   ============================================ */
.ranking-list-top10 {
  gap: 0 !important;
}

.rank-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 4px;
  background: transparent;
  border-bottom: 1px solid #E5E7EB;
  transition: all 0.3s ease;
}

.rank-item:last-child {
  border-bottom: none;
}

/* 電腦端只顯示前7名，手機端顯示前10名 */
@media (min-width: 768px) {
  .rank-item:nth-child(n+8) {
    display: none;
  }
  /* 第7名在電腦端是最後一個，去掉下邊框 */
  .rank-item:nth-child(7) {
    border-bottom: none;
  }
}

.rank-item:hover {
  background: #F8F9FB;
}

.rank-item-num {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  background: rgba(201, 169, 97, 0.15);
  color: #A88B42;
}

.rank-item-1 .rank-item-num {
  background: linear-gradient(135deg, #D4AF37 0%, #F0D78C 50%, #D4AF37 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(212, 175, 55, 0.3);
}

.rank-item-2 .rank-item-num {
  background: linear-gradient(135deg, #B8B8B8 0%, #E8E8E8 50%, #B8B8B8 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(184, 184, 184, 0.3);
}

.rank-item-3 .rank-item-num {
  background: linear-gradient(135deg, #CD7F32 0%, #E8A862 50%, #CD7F32 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(205, 127, 50, 0.3);
}

.rank-item-info {
  flex: 1;
  min-width: 0;
}

.rank-item-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.rank-item-name {
  font-size: 1.2rem;
  font-weight: 600;
  color: #1A1A1A;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rank-item-platforms {
  display: flex;
  align-items: center;
  gap: 6px;
}

.rank-platform-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid #D1D5DB;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.rank-platform-icon img {
  width: 18px;
  height: 18px;
  display: block;
  transform: scale(1.1);
}

.rank-item-type {
  font-size: 0.6rem;
  color: #6B7280;
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rank-item-score {
  flex-shrink: 0;
  text-align: right;
}

.rank-item-score-num {
  font-size: 1rem;
  font-weight: 700;
  color: #A88B42;
}

/* ============================================
   榜單標題區 & 標籤切換
   ============================================ */

/* 父容器開啟容器查詢，用於標題換行自動切換布局 */
.card-ranking {
  container-type: inline-size;
  container-name: rankingCard;
}

/* ===== 手機端（預設）：兩行布局 =====
   第一行：標題（獨佔一行）
   第二行：左邊標籤，右邊查看全部 */
.ranking-header {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 10px 12px;
  margin-bottom: 1rem;
}

.ranking-header-left {
  grid-column: 1 / -1;
  grid-row: 1;
  display: contents;
}

.ranking-title {
  grid-column: 1 / -1;
  grid-row: 1;
  margin: 0;
  white-space: nowrap;
}

.ranking-tabs {
  grid-column: 1;
  grid-row: 2;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: rgba(201, 169, 97, 0.1);
  border-radius: 9999px;
  padding: 3px;
  border: 1px solid rgba(201, 169, 97, 0.2);
  justify-self: start;
  align-self: center;
}

.ranking-header > .card-link {
  grid-column: 2;
  grid-row: 2;
  justify-self: end;
  align-self: center;
}

/* ===== 電腦端（>=768px）：一行布局 =====
   左側：標題 + 標籤
   右側：查看全部 */
@media (min-width: 768px) {
  .ranking-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  .ranking-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
  }

  .ranking-title {
    white-space: nowrap;
    flex-shrink: 0;
  }

  .ranking-tabs {
    justify-self: auto;
  }
}

/* ===== 容器查詢：卡片寬度不足時自動切換為兩行 =====
   當卡片寬度 <= 480px 時，即使在電腦端也自動變為手機端兩行樣式 */
@container rankingCard (max-width: 480px) {
  .ranking-header {
    display: grid !important;
    grid-template-columns: 1fr auto !important;
    grid-template-rows: auto auto !important;
    gap: 10px 12px !important;
  }

  .ranking-header-left {
    display: contents !important;
  }

  .ranking-title {
    grid-column: 1 / -1 !important;
    grid-row: 1 !important;
    white-space: nowrap !important;
  }

  .ranking-tabs {
    grid-column: 1 !important;
    grid-row: 2 !important;
    justify-self: start !important;
  }

  .ranking-header > .card-link {
    grid-column: 2 !important;
    grid-row: 2 !important;
    justify-self: end !important;
  }
}

/* ===== 標籤按鈕樣式 ===== */
.ranking-tab {
  padding: 4px 12px;
  font-size: 0.7rem;
  font-weight: 500;
  color: #6B7280;
  background: transparent;
  border: none;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
  line-height: 1.4;
}

.ranking-tab:hover {
  color: #A88B42;
}

.ranking-tab.active {
  background: linear-gradient(135deg, #C9A961 0%, #D4AF37 100%);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(201, 169, 97, 0.35);
}

@media (min-width: 768px) {
  .ranking-tab {
    padding: 5px 14px;
    font-size: 0.75rem;
  }
}

/* ============================================
   電腦端桌面版榜單（5列布局）
   ============================================ */

/* 電腦端榜單按鈕組：撐滿一行，按鈕等寬 */
.ranking-tabs-desktop {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(6, 26, 46, 0.7);
  border-radius: 9999px;
  padding: 5px;
  border: 1px solid rgba(201, 169, 97, 0.2);
  width: 100%;
}

.ranking-tab-desktop {
  flex: 1;
  padding: 8px 12px;
  font-size: 0.9rem;
  font-weight: 500;
  color: rgba(240, 237, 229, 0.7);
  background: rgba(10, 22, 40, 0.6);
  border: none;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
  line-height: 1.5;
  text-align: center;
}

.ranking-tab-desktop:hover {
  color: #F0EDE5;
  background: rgba(10, 22, 40, 0.8);
}

.ranking-tab-desktop.active {
  background: linear-gradient(135deg, #C9A961 0%, #D4AF37 100%);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(201, 169, 97, 0.35);
}

/* 桌面版榜單列表（5列 grid） */
.desktop-list {
  display: flex;
  flex-direction: column;
  gap: 0 !important;
  border-radius: 10px;
  overflow: hidden;
}

.rank-d-item {
  display: grid;
  grid-template-columns: 56px 1.3fr 0.8fr 1.5fr 0.9fr;
  align-items: center;
  gap: 10px;
  padding: 8px 8px;
  border-bottom: none;
  transition: background 0.3s ease;
}

.rank-d-item:last-child {
  border-bottom: none;
}

/* 斑馬紋：深藍 / 稍淺深藍（80%不透明度） */
.rank-d-stripe-dark {
  background: rgba(10, 22, 40, 0.8);
}

.rank-d-stripe-light {
  background: rgba(19, 34, 56, 0.8);
}

/* hover 效果：比默認狀態淺一點（微微提亮），表頭除外 */
.rank-d-item:not(.rank-d-header):hover {
  background: rgba(201, 169, 97, 0.08);
}

/* 表頭 */
.rank-d-header {
  background: #061A2E;
  padding: 10px 8px;
  border-bottom: 1px solid rgba(201, 169, 97, 0.3);
}

.rank-d-th {
  font-size: 0.75rem;
  font-weight: 500;
  color: rgba(240, 237, 229, 0.7);
  letter-spacing: 0.5px;
}

.rank-d-header .rank-d-col-rank,
.rank-d-header .rank-d-col-creator,
.rank-d-header .rank-d-col-score,
.rank-d-header .rank-d-col-platforms,
.rank-d-header .rank-d-col-location {
  display: flex;
  align-items: center;
}

.rank-d-header .rank-d-col-rank {
  justify-content: center;
}

.rank-d-header .rank-d-col-creator {
  flex-direction: row;
  justify-content: flex-start;
  align-items: center;
}

.rank-d-col-creator {
  align-items: flex-start;
  text-align: left;
}

.rank-d-col-creator .rank-d-name,
.rank-d-col-creator .rank-d-industry {
  text-align: left;
  width: 100%;
}

.rank-d-header .rank-d-col-score {
  flex-direction: row;
  justify-content: flex-start;
  align-items: center;
}

.rank-d-col-score {
  align-items: flex-start;
}

.rank-d-header .rank-d-col-platforms {
  padding-left: 30px;
}

.rank-d-col-platforms {
  padding-left: 30px;
}

.rank-d-header .rank-d-col-location {
  justify-content: flex-end;
}

/* 第1列：排名 */
.rank-d-col-rank {
  display: flex;
  align-items: center;
  justify-content: center;
}

.rank-d-num {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  background: rgba(201, 169, 97, 0.15);
  color: #C9A961;
}

/* 前三名編號：金/銀/銅漸變 */
.rank-item-1 .rank-d-num {
  background: linear-gradient(135deg, #D4AF37 0%, #F0D78C 50%, #D4AF37 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(212, 175, 55, 0.3);
}

.rank-item-2 .rank-d-num {
  background: linear-gradient(135deg, #B8B8B8 0%, #E8E8E8 50%, #B8B8B8 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(184, 184, 184, 0.3);
}

.rank-item-3 .rank-d-num {
  background: linear-gradient(135deg, #CD7F32 0%, #E8A862 50%, #CD7F32 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(205, 127, 50, 0.3);
}

/* 第2列：創作者（名字 + 行業小字） */
.rank-d-col-creator {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.rank-d-name {
  font-size: 0.9rem;
  font-weight: 400;
  color: #F0EDE5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.rank-d-industry {
  font-size: 0.68rem;
  color: rgba(240, 237, 229, 0.5);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

/* 第3列：影響力指數 */
.rank-d-col-score {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}

.rank-d-score-num {
  font-size: 0.935rem;
  font-weight: 600;
  color: #C9A961;
  line-height: 1.2;
}

/* 第4列：平台帳號（4個icon）— 金色描邊+金色填充 */
.rank-d-col-platforms {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.rank-d-platforms {
  display: flex;
  align-items: center;
  gap: 6px;
}

.rank-d-platform-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1.5px solid rgba(201, 169, 97, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: transparent;
}

.rank-d-platform-icon img {
  width: 14px;
  height: 14px;
  display: block;
  /* 金色填充 + 60%不透明度 + 放大120% */
  filter: brightness(0) saturate(100%) invert(70%) sepia(44%) saturate(420%) hue-rotate(5deg) brightness(95%) contrast(88%);
  opacity: 0.6;
  transform: scale(1.2);
}

/* 第5列：所在地（右對齊） */
.rank-d-col-location {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
}

.rank-d-location {
  font-size: 0.8rem;
  color: #F0EDE5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: right;
}

/* 確保手機端不顯示桌面版結構（已由 md:hidden / render 邏輯控制，此處做雙重保險） */
@media (max-width: 767px) {
  .ranking-header-desktop,
  .rank-d-item,
  .desktop-list .rank-d-item {
    display: none !important;
  }
}

/* ============================================
   頁腳社交圖標
   ============================================ */
.social-icon-btn img {
  filter: brightness(0) invert(1);
  opacity: 0.7;
  transition: filter 0.3s ease, opacity 0.3s ease, transform 0.3s ease;
  transform: scale(1.25);
}

.social-icon-btn:hover img {
  filter: brightness(0) invert(72%) sepia(22%) saturate(749%) hue-rotate(357deg) brightness(95%) contrast(88%);
  opacity: 1;
}

/* ============================================
   滾動條樣式
   ============================================ */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #0A1628;
}

::-webkit-scrollbar-thumb {
  background: #C9A961;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #A88B42;
}

/* ============================================
   漸入動畫基礎類
   ============================================ */
.fade-in-up {
  opacity: 0;
  transform: translateY(40px);
}

.fade-in-left {
  opacity: 0;
  transform: translateX(-40px);
}

.fade-in-right {
  opacity: 0;
  transform: translateX(40px);
}

/* ============================================
   背景漂浮光斑
   ============================================ */
.bg-orbs {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
  will-change: transform;
}

.orb-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(201, 169, 97, 0.6) 0%, transparent 70%);
  top: -150px;
  left: -100px;
  animation: float1 20s ease-in-out infinite;
}

.orb-2 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(30, 58, 95, 0.7) 0%, transparent 70%);
  top: 30%;
  right: -120px;
  animation: float2 25s ease-in-out infinite;
}

.orb-3 {
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.4) 0%, transparent 70%);
  bottom: 10%;
  left: 20%;
  animation: float3 22s ease-in-out infinite;
}

.orb-4 {
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, rgba(10, 37, 64, 0.8) 0%, transparent 70%);
  bottom: -150px;
  right: 15%;
  animation: float4 28s ease-in-out infinite;
}

@keyframes float1 {
  0%, 100% {
    transform: translate(0, 0) scale(1);
  }
  33% {
    transform: translate(80px, 60px) scale(1.1);
  }
  66% {
    transform: translate(-40px, 100px) scale(0.95);
  }
}

@keyframes float2 {
  0%, 100% {
    transform: translate(0, 0) scale(1);
  }
  33% {
    transform: translate(-60px, 80px) scale(1.15);
  }
  66% {
    transform: translate(-100px, -40px) scale(0.9);
  }
}

@keyframes float3 {
  0%, 100% {
    transform: translate(0, 0) scale(1);
  }
  33% {
    transform: translate(100px, -50px) scale(1.05);
  }
  66% {
    transform: translate(60px, -100px) scale(1.1);
  }
}

@keyframes float4 {
  0%, 100% {
    transform: translate(0, 0) scale(1);
  }
  33% {
    transform: translate(-80px, -60px) scale(1.1);
  }
  66% {
    transform: translate(40px, -90px) scale(0.95);
  }
}

/* 確保內容在光斑之上 */
header,
main,
footer {
  position: relative;
  z-index: 1;
}

/* ============================================
   背景粒子星點
   ============================================ */
.bg-particles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.particle {
  position: absolute;
  border-radius: 50%;
  background: #F0D78C;
  opacity: 0;
  will-change: transform, opacity;
  animation: particleFloat linear infinite, particleTwinkle ease-in-out infinite;
}

@keyframes particleFloat {
  0% {
    transform: translateY(0) translateX(0);
  }
  100% {
    transform: translateY(-100vh) translateX(30px);
  }
}

@keyframes particleTwinkle {
  0%, 100% {
    opacity: 0.2;
  }
  50% {
    opacity: 0.8;
  }
}

/* ============================================
   響應式調整
   ============================================ */
@media (max-width: 768px) {
  body {
    background-size: 220% auto !important;
    background-position: center top !important;
    background-repeat: no-repeat !important;
    background-color: #0a1628 !important;
  }

  .hero-onepage {
    min-height: auto;
  }

  .cards-grid {
    gap: 1.5rem;
  }

  .rank-item-name {
    font-size: 1rem;
  }
}

/* ============================================
   論壇報名彈窗
   ============================================ */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  padding: 20px;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 22, 40, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.modal-wrapper {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 720px;
  max-height: 90vh;
  transform: translateY(20px) scale(0.98);
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.modal-overlay.active .modal-wrapper {
  transform: translateY(0) scale(1);
}

.modal-content {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 12px;
  padding: 36px 40px 32px;
  box-shadow:
    0 1px 2px rgba(10, 22, 40, 0.06),
    0 4px 12px rgba(10, 22, 40, 0.08),
    0 12px 32px rgba(10, 22, 40, 0.14),
    0 24px 60px rgba(10, 22, 40, 0.2);
  border: 1px solid rgba(201, 169, 97, 0.5);
  position: relative;
  overflow-y: auto;
  max-height: 90vh;
}

.modal-content::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(201, 169, 97, 0.8) 0%, rgba(201, 169, 97, 0.3) 50%, rgba(201, 169, 97, 0.1) 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  border-radius: 12px;
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: #9CA3AF;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.3s ease;
  z-index: 2;
}

.modal-close:hover {
  color: #C9A961;
  background: rgba(201, 169, 97, 0.1);
}

.modal-title {
  font-family: "Noto Serif TC", "Songti TC", Georgia, serif;
  font-size: 1.75rem;
  font-weight: 700;
  color: #1A1A1A;
  margin-bottom: 10px;
  line-height: 1.3;
}

.modal-note {
  font-size: 0.875rem;
  color: #C9A961;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(201, 169, 97, 0.2);
  font-weight: 500;
}

/* 表單樣式 */
.forum-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-label {
  font-size: 0.9rem;
  font-weight: 500;
  color: #374151;
  letter-spacing: 0.02em;
}

.form-label .required {
  color: #EF4444;
  margin-right: 2px;
}

.form-input,
.form-textarea {
  width: 100%;
  padding: 12px 16px;
  font-size: 0.95rem;
  color: #1F2937;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid #E5E7EB;
  border-radius: 10px;
  outline: none;
  transition: all 0.3s ease;
  font-family: inherit;
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: #9CA3AF;
}

.form-input:focus,
.form-textarea:focus {
  border-color: #C9A961;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(201, 169, 97, 0.15);
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.6;
}

/* 平台複選框 */
.platform-checkboxes {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding-top: 4px;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  padding: 8px 0;
}

.checkbox-item input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.checkbox-custom {
  width: 20px;
  height: 20px;
  border: 2px solid #D1D5DB;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.8);
  flex-shrink: 0;
  position: relative;
  transition: all 0.2s ease;
}

.checkbox-item input[type="checkbox"]:checked + .checkbox-custom {
  background: linear-gradient(135deg, #C9A961 0%, #D4AF37 100%);
  border-color: #C9A961;
  box-shadow: 0 2px 8px rgba(201, 169, 97, 0.3);
}

.checkbox-item input[type="checkbox"]:checked + .checkbox-custom::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 6px;
  width: 5px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.checkbox-label {
  font-size: 0.9rem;
  color: #374151;
  font-weight: 500;
}

/* 提交按鈕 */
.form-submit-row {
  display: flex;
  justify-content: center;
  padding-top: 8px;
}

.submit-btn {
  padding: 14px 56px;
  font-size: 1rem;
  font-weight: 600;
  color: #FFFFFF;
  background: linear-gradient(135deg, #C9A961 0%, #D4AF37 100%);
  border: none;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(201, 169, 97, 0.35);
  letter-spacing: 0.05em;
}

.submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(201, 169, 97, 0.45);
  background: linear-gradient(135deg, #D4AF37 0%, #E0C48A 100%);
}

.submit-btn:active {
  transform: translateY(0);
}

/* 響應式 */
@media (max-width: 640px) {
  .modal-content {
    padding: 28px 20px 24px;
    border-radius: 12px;
  }

  .modal-title {
    font-size: 1.4rem;
    padding-right: 40px;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .platform-checkboxes {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .submit-btn {
    width: 100%;
    padding: 14px 32px;
  }

  .modal-close {
    top: 16px;
    right: 16px;
  }
}

/* 滾動條樣式（彈窗內） */
.modal-content::-webkit-scrollbar {
  width: 6px;
}

.modal-content::-webkit-scrollbar-track {
  background: transparent;
}

.modal-content::-webkit-scrollbar-thumb {
  background: rgba(201, 169, 97, 0.4);
  border-radius: 3px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
  background: rgba(201, 169, 97, 0.6);
}

/* ============================================
   手機端：4個獨立榜單卡片
   ============================================ */
.card-ranking-mobile {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow:
    0 1px 2px rgba(10, 22, 40, 0.06),
    0 4px 12px rgba(10, 22, 40, 0.08),
    0 12px 32px rgba(10, 22, 40, 0.1);
  border: 1px solid rgba(201, 169, 97, 0.5);
  position: relative;
}

.card-ranking-mobile::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(201, 169, 97, 0.8) 0%, rgba(201, 169, 97, 0.3) 50%, rgba(201, 169, 97, 0.1) 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0.7;
}

.mobile-ranking-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mobile-ranking-title {
  margin: 0;
  white-space: nowrap;
}

.mobile-ranking-list {
  gap: 0 !important;
}

.mobile-rank-item {
  display: grid;
  /* 固定4列：排名 / 创作者(弹性) / 平台账号 / 影响力指数；平台与分数列固定，平台位置不随名字长短移动 */
  grid-template-columns: 28px minmax(0, 1fr) 72px 60px;
  column-gap: 10px;
  align-items: center;
  padding: 6px 2px;
  background: transparent;
  border-bottom: 1px solid #E5E7EB;
}

.mobile-rank-item:last-child {
  border-bottom: none;
}

.mobile-rank-item-num {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  background: rgba(201, 169, 97, 0.15);
  color: #A88B42;
}

.mobile-rank-item-1 .mobile-rank-item-num {
  background: linear-gradient(135deg, #D4AF37 0%, #F0D78C 50%, #D4AF37 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(212, 175, 55, 0.3);
}

.mobile-rank-item-2 .mobile-rank-item-num {
  background: linear-gradient(135deg, #B8B8B8 0%, #E8E8E8 50%, #B8B8B8 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(184, 184, 184, 0.3);
}

.mobile-rank-item-3 .mobile-rank-item-num {
  background: linear-gradient(135deg, #CD7F32 0%, #E8A862 50%, #CD7F32 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(205, 127, 50, 0.3);
}

/* 创作者列：固定轨道；min-width:0 允许长名字省略号截断；padding-left:5px 保留名字右移5px */
.mobile-rank-item-creator {
  min-width: 0;
  padding-left: 5px;
}

.mobile-rank-item-name {
  font-size: 0.9rem;
  font-weight: 400;
  color: #1A1A1A;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mobile-rank-item-type {
  font-size: 0.65rem;
  color: #6B7280;
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 表頭 */
.mobile-rank-header {
  border-bottom: 2px solid rgba(201, 169, 97, 0.2);
  padding-bottom: 8px;
  margin-bottom: 2px;
}

.mobile-rank-header .mobile-rank-item-num {
  background: transparent;
  box-shadow: none;
  color: #9CA3AF;
  font-size: 0.7rem;
  font-weight: 500;
  width: 28px;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-rank-th-creator {
  font-size: 0.7rem;
  font-weight: 500;
  color: #9CA3AF;
  letter-spacing: 0.05em;
  padding-left: 5px;
}

.mobile-rank-th-platforms {
  font-size: 0.7rem;
  font-weight: 500;
  color: #9CA3AF;
  letter-spacing: 0.05em;
}

.mobile-rank-th-score {
  font-size: 0.7rem;
  font-weight: 500;
  color: #9CA3AF;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

/* 平台账号列：固定轨道，起始位置恒定，不随创作者名字长短左右移动 */
.mobile-rank-item-platforms-col {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

/* 平台圖標 */
.mobile-rank-platforms {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.mobile-rank-platform-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid #D1D5DB;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mobile-rank-platform-icon img {
  width: 14px;
  height: 14px;
  display: block;
  transform: scale(1.1);
}

/* 右側區域：分數 + 進度條 */
.mobile-rank-item-right {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.mobile-rank-item-score {
  flex-shrink: 0;
  text-align: right;
}

.mobile-rank-item-score-num {
  font-size: 0.9rem;
  font-weight: 700;
  color: #A88B42;
}

/* 全球總榜：所在地中間列 */
.mobile-rank-item-location-col {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-width: 70px;
}

.mobile-rank-item-location {
  font-size: 0.75rem;
  color: #6B7280;
  white-space: nowrap;
}

/* ============================================
   手機端：移除所有 hover 效果
   ============================================ */
@media (max-width: 767px) {
  /* 卡片 hover 移除 */
  .card-intro,
  .card-ranking,
  .contact-card-small,
  .card-ranking-mobile {
    transition: none !important;
  }

  .card-intro:hover,
  .card-ranking:hover,
  .contact-card-small:hover,
  .card-ranking-mobile:hover {
    transform: none !important;
    background: rgba(255, 255, 255, 0.9) !important;
    border-color: rgba(201, 169, 97, 0.5) !important;
    box-shadow:
      0 1px 2px rgba(10, 22, 40, 0.06),
      0 4px 12px rgba(10, 22, 40, 0.08),
      0 12px 32px rgba(10, 22, 40, 0.1) !important;
  }

  .card-intro:hover::before,
  .card-ranking:hover::before,
  .contact-card-small:hover::before,
  .card-ranking-mobile:hover::before {
    opacity: 0.7 !important;
  }

  /* 榜單項 hover 移除 */
  .rank-item:hover,
  .mobile-rank-item:hover {
    background: transparent !important;
  }

  /* 卡片鏈接 hover 移除 */
  .card-link:hover {
    color: #C9A961 !important;
    gap: 6px !important;
  }

  /* 小卡片圖標 hover 移除 */
  .contact-card-small:hover .w-10.h-10 {
    background: rgba(201, 169, 97, 0.2) !important;
  }

  /* group hover 箭頭動畫移除 */
  .contact-card-small .group-hover\:gap-\[10px\] {
    gap: 6px !important;
  }

  /* 頁腳郵箱按鈕 hover 移除 */
  footer a:hover {
    border-color: rgba(255, 255, 255, 0.3) !important;
  }

  footer .md:hidden {
    transform: scale(0.8);
    transform-origin: center top;
    line-height: 1.2;
  }
}

/* ============================================
   電腦端卡片：深色毛玻璃效果
   手機端不改，僅 @media (min-width: 768px) 生效
   ============================================ */
@media (min-width: 768px) {

  /* ---- 卡片整體：深色毛玻璃背景 ----
     選擇器加 main 前綴提升優先級，壓過 HTML 上 Tailwind 的
     border-gray-200 / hover:border-accent 工具類（同優先級時 Tailwind 注入更晚會覆蓋） */
  main .card-intro,
  main .card-ranking,
  main .contact-card-small {
    background: rgba(10, 22, 40, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(201, 169, 97, 0.3);
    box-shadow:
      0 1px 2px rgba(0, 0, 0, 0.2),
      0 4px 12px rgba(0, 0, 0, 0.25),
      0 12px 32px rgba(0, 0, 0, 0.3);
  }

  /* 關閉金色漸變描邊層（::before）：
     否則它會疊加在 border 之上，左上角實際透明度約 0.48，
     導致邊框看起來比 rgba(201,169,97,0.3) 更亮且不均勻 */
  main .card-intro::before,
  main .card-ranking::before,
  main .contact-card-small::before {
    display: none;
  }

  /* 卡片懸浮效果 */
  main .card-intro:hover,
  main .card-ranking:hover,
  main .contact-card-small:hover {
    background: rgba(6, 14, 31, 0.8);
    border-color: rgba(201, 169, 97, 0.6);
    box-shadow:
      0 2px 4px rgba(0, 0, 0, 0.25),
      0 8px 20px rgba(0, 0, 0, 0.3),
      0 20px 48px rgba(0, 0, 0, 0.35),
      0 0 0 1px rgba(201, 169, 97, 0.2);
  }

  /* ---- 卡片標題文字 ---- */
  .card-intro h3,
  .card-ranking .ranking-title,
  .contact-card-small h3 {
    color: #F0EDE5 !important;
  }

  /* ---- 卡片正文文字 ---- */
  .card-intro p,
  .contact-card-small p {
    color: rgba(240, 237, 229, 0.72) !important;
  }

  /* ---- 卡片鏈接 ---- */
  .card-link {
    color: #C9A961;
  }

  .card-link:hover {
    color: #E0C48A;
  }

  /* ---- 小卡片圖標背景 ---- */
  .contact-card-small .w-10.h-10 {
    background: rgba(201, 169, 97, 0.18) !important;
  }

  .contact-card-small:hover .w-10.h-10 {
    background: rgba(201, 169, 97, 0.28) !important;
  }

  /* ---- 榜單卡片：排名項 ---- */
  .card-ranking .rank-item {
    border-bottom-color: rgba(201, 169, 97, 0.12);
  }

  .card-ranking .rank-item:hover {
    background: rgba(201, 169, 97, 0.06);
  }

  /* 排名名字 */
  .card-ranking .rank-item-name {
    color: #F0EDE5;
  }

  /* 排名分類文字 */
  .card-ranking .rank-item-type {
    color: rgba(240, 237, 229, 0.55);
  }

  /* 排名分數 */
  .card-ranking .rank-item-score-num {
    color: #E0C48A;
  }

  /* 平台圖標邊框 */
  .card-ranking .rank-platform-icon {
    border-color: rgba(201, 169, 97, 0.3);
    background: rgba(201, 169, 97, 0.05);
  }

  /* ---- 榜單標籤切換 ---- */
  .card-ranking .ranking-tabs {
    background: rgba(201, 169, 97, 0.08);
    border-color: rgba(201, 169, 97, 0.2);
  }

  .card-ranking .ranking-tab {
    color: rgba(240, 237, 229, 0.6);
  }

  .card-ranking .ranking-tab:hover {
    color: #E0C48A;
  }

  .card-ranking .ranking-tab.active {
    color: #0A1628;
    background: linear-gradient(135deg, #C9A961 0%, #D4AF37 100%);
    box-shadow: 0 2px 8px rgba(201, 169, 97, 0.35);
  }

  /* ---- 排名數字方塊（4-7名） ---- */
  .card-ranking .rank-item-num {
    background: rgba(201, 169, 97, 0.18);
    color: #E0C48A;
  }

  /* 第1名金色（保持漸變，調整對比） */
  .card-ranking .rank-item-1 .rank-item-num {
    background: linear-gradient(135deg, #D4AF37 0%, #F0D78C 50%, #D4AF37 100%);
    color: #0A1628;
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.4);
  }

}
