@import './player/player.css';
@import './catalog/catalog.css';
@import './ads/ads.css';

/* 霓虹櫻粉 (Cyber Sakura) 主題色票系統 */
:root {
  --bg: #0b0c14;
  --surface: #141624;
  --surface-elevated: #1c1f33;
  --border: #262940;
  --text: #f8fafc;
  --muted: #94a3b8;
  --accent: #f43f5e;
  --accent-hover: #ec4899;
  --accent-gradient: linear-gradient(135deg, #f43f5e 0%, #ec4899 100%);
  --badge-2d-gradient: linear-gradient(135deg, #a855f7 0%, #6366f1 100%);
  --badge-3d-gradient: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
  --font-stack: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-stack);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* 頂部導航列 */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(11, 12, 20, 0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 12px 24px;
}

.header-container {
  max-width: 1600px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand-link {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.brand-logo {
  height: 38px;
  width: auto;
}

.search-box {
  flex: 1;
  max-width: 520px;
  position: relative;
}

.search-input {
  width: 100%;
  padding: 10px 16px 10px 40px;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

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

.search-input:focus {
  border-color: var(--accent);
  background-color: var(--surface-elevated);
  box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.22);
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  stroke: var(--muted);
}

/* 8 大快捷標籤列 */
.filter-bar {
  background-color: #0e101c;
  border-bottom: 1px solid var(--border);
  padding: 10px 24px;
  overflow-x: auto;
  white-space: nowrap;
}

.filter-container {
  max-width: 1600px;
  margin: 0 auto;
  display: flex;
  gap: 10px;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  background-color: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-chip:hover {
  color: var(--text);
  border-color: var(--accent);
}

.filter-chip.active {
  background: var(--accent-gradient);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(244, 63, 94, 0.35);
}

.filter-chip.chip-priority {
  border-color: rgba(244, 63, 94, 0.5);
}

/* 主內容區 */
.main-layout {
  max-width: 1600px;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* 播放器英雄區 */
.hero-player-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

.player-info-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.player-video-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.4;
}

.player-video-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--muted);
}

.player-seller-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 12px;
  background: rgba(244, 63, 94, 0.16);
  border: 1px solid rgba(244, 63, 94, 0.45);
  color: #fda4af;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.player-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.player-tag {
  padding: 4px 10px;
  background-color: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  color: #e2e8f0;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.player-tag:hover {
  border-color: var(--accent-hover);
  background-color: rgba(236, 72, 153, 0.16);
}

/* 區塊標題 */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-title {
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}

.section-title::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 20px;
  background: var(--accent-gradient);
  border-radius: 2px;
}

/* 頁尾與蜘蛛層 */
.site-footer {
  margin-top: 48px;
  border-top: 1px solid var(--border);
  background-color: #080910;
  padding: 32px 24px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}

.seo-static-links {
  border-top: 1px solid var(--border);
  padding: 24px;
  font-size: 12px;
  color: #64748b;
  background-color: #07080e;
}

.seo-static-links h3 {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
}

.seo-static-links a {
  color: #94a3b8;
  text-decoration: none;
  margin-right: 14px;
  display: inline-block;
  line-height: 2;
}

.seo-static-links a:hover {
  color: var(--accent-hover);
}

/* 18+ 年齡驗證彈窗 */
.age-gate-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background-color: rgba(6, 7, 13, 0.9);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.age-gate-content {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  max-width: 460px;
  width: 100%;
  padding: 32px;
  text-align: center;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.85);
}

.age-gate-icon {
  margin-bottom: 16px;
  color: var(--accent);
}

.age-gate-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 12px;
}

.age-gate-desc {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 24px;
}

.age-gate-btn {
  width: 100%;
  padding: 12px;
  font-size: 16px;
  font-weight: 700;
  border-radius: 8px;
  border: none;
  background: var(--accent-gradient);
  color: #ffffff;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.age-gate-btn:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.age-gate-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.age-gate-btn-secondary {
  width: 100%;
  padding: 10px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  border: 1px solid var(--border);
  background-color: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.age-gate-btn-secondary:hover {
  color: var(--text);
  border-color: var(--accent);
  background-color: var(--surface-elevated);
}

/* ==========================================================================
   版型 2~5 視覺系統（依據 WebData/wg-video3/DESIGN.md Stitch 設計系統實作）
   ========================================================================== */

/* 版型 2：LoliFan／裡番社 (lifanpro / Stitch Cyberpunk Arcade Broadcast) */
body[data-site-code="lifanpro"] {
  --bg: #10131a;
  --surface: #191b23;
  --surface-elevated: #272a32;
  --border: #3a494b;
  --text: #e1e2ec;
  --muted: #b9cacb;
  --accent: #00f3ff;
  --accent-hover: #ec4899;
  --accent-gradient: linear-gradient(135deg, #00f3ff 0%, #ec4899 100%);
  --font-stack: "Manrope", "Noto Sans TC", system-ui, sans-serif;
}

body[data-site-code="lifanpro"] .site-header {
  background: rgba(16, 19, 26, 0.86);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(0, 243, 255, 0.25);
}

body[data-site-code="lifanpro"] .header-container {
  flex-direction: column;
  gap: 12px;
}

@media (min-width: 760px) {
  body[data-site-code="lifanpro"] .header-container {
    flex-direction: row;
  }
}

body[data-site-code="lifanpro"] .search-input {
  border-radius: 6px;
  border-color: #3a494b;
  background-color: #0b0e15;
}

body[data-site-code="lifanpro"] .search-input:focus {
  border-color: #00f3ff;
  box-shadow: 0 0 10px rgba(0, 243, 255, 0.3);
}

body[data-site-code="lifanpro"] .filter-bar {
  background-color: #0b0e15;
}

body[data-site-code="lifanpro"] .filter-chip {
  font-family: "Space Grotesk", "Noto Sans TC", sans-serif;
  border-radius: 4px;
  transform: skewX(-8deg);
  border-color: #3a494b;
}

body[data-site-code="lifanpro"] .filter-chip.active {
  background: #00f3ff;
  color: #05070a;
  font-weight: 700;
  border-color: #6ff6ff;
  box-shadow: 0 0 14px rgba(0, 243, 255, 0.42);
}

.brand-hero-spotlight {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  min-height: 260px;
  border: 1px solid rgba(0, 243, 255, 0.38);
  box-shadow: 0 0 28px rgba(0, 243, 255, 0.16);
  cursor: pointer;
  display: flex;
  align-items: flex-end;
}

@media (min-width: 760px) {
  .brand-hero-spotlight {
    min-height: 360px;
  }
}

.spotlight-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.68);
  transition: transform 0.6s ease;
}

.brand-hero-spotlight:hover .spotlight-backdrop {
  transform: scale(1.04);
}

.spotlight-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(11, 14, 21, 0.96) 0%, rgba(16, 19, 26, 0.72) 55%, rgba(0, 243, 255, 0.14) 100%);
}

.spotlight-content {
  position: relative;
  z-index: 1;
  padding: 28px;
  max-width: 720px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.spotlight-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  padding: 4px 12px;
  border-radius: 4px;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  background: linear-gradient(135deg, #aa0266, #ec4899);
  color: #ffffff;
}

.spotlight-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #00f3ff;
  box-shadow: 0 0 8px #00f3ff;
}

.spotlight-title {
  font-family: "Space Grotesk", "Noto Sans TC", sans-serif;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
  color: #f8fafc;
}

@media (min-width: 760px) {
  .spotlight-title {
    font-size: 28px;
  }
}

.spotlight-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.spotlight-id {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  font-weight: 700;
  color: #00f3ff;
  background: rgba(0, 243, 255, 0.12);
  border: 1px solid rgba(0, 243, 255, 0.45);
  padding: 2px 8px;
  border-radius: 4px;
}

.spotlight-tag {
  font-size: 12px;
  color: #e2e8f0;
  background: rgba(168, 85, 247, 0.25);
  padding: 2px 8px;
  border-radius: 4px;
}

.spotlight-play-btn {
  align-self: flex-start;
  margin-top: 6px;
  padding: 10px 22px;
  border: none;
  border-radius: 4px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: #05070a;
  background: #00f3ff;
  cursor: pointer;
  box-shadow: 0 0 18px rgba(0, 243, 255, 0.38);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.spotlight-play-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 24px rgba(0, 243, 255, 0.65);
}

/* 版型 3：ACG 同人極樂廳 (doujinclub / Stitch Mythic Gold Collectors Cinema) */
body[data-site-code="doujinclub"] {
  --bg: #0b0812;
  --surface: #151022;
  --surface-elevated: #1e182f;
  --border: #413754;
  --text: #f3f0f7;
  --muted: #a79fb4;
  --accent: #f59e0b;
  --accent-hover: #a855f7;
  --accent-gradient: linear-gradient(135deg, #f59e0b 0%, #a855f7 100%);
  --font-stack: "Plus Jakarta Sans", "Noto Sans TC", system-ui, sans-serif;
}

body[data-site-code="doujinclub"] .site-header {
  background: rgba(11, 8, 18, 0.94);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid #292137;
}

body[data-site-code="doujinclub"] .search-input {
  border-radius: 8px;
  border-color: #413754;
  background-color: #06040a;
}

body[data-site-code="doujinclub"] .filter-bar {
  background-color: #090610;
}

body[data-site-code="doujinclub"] .filter-chip {
  border-radius: 0;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 8px 12px;
}

body[data-site-code="doujinclub"] .filter-chip.active {
  background: transparent;
  color: #f59e0b;
  border-bottom: 2px solid #f59e0b;
  font-weight: 700;
  box-shadow: none;
}

.brand-vip-ranking {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.vip-ranking-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-bottom: 1px solid #413754;
  padding-bottom: 10px;
}

.vip-ranking-heading {
  font-family: "Cinzel", "Bodoni Moda", "Noto Serif TC", Georgia, serif;
  font-size: 22px;
  font-weight: 800;
  background: linear-gradient(135deg, #fef3c7, #f59e0b, #a855f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.vip-ranking-sub {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 2px;
  color: #f59e0b;
}

.vip-ranking-track {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  padding: 6px 2px 14px;
  scrollbar-width: thin;
}

.vip-rank-card {
  position: relative;
  flex: 0 0 230px;
  display: flex;
  align-items: flex-end;
  cursor: pointer;
}

@media (min-width: 760px) {
  .vip-rank-card {
    flex: 0 0 280px;
  }
}

.vip-rank-number {
  font-family: "Bodoni Moda", "Cinzel", Georgia, serif;
  font-style: italic;
  font-size: 62px;
  font-weight: 900;
  line-height: 0.8;
  margin-right: -14px;
  z-index: 2;
  background: linear-gradient(180deg, #fef3c7 0%, #f59e0b 65%, #a855f7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.92));
  user-select: none;
}

.vip-rank-poster {
  position: relative;
  flex: 1;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #413754;
  background: #151022;
}

.vip-rank-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.vip-rank-card:hover .vip-rank-poster img {
  transform: scale(1.06);
}

.vip-rank-overlay {
  position: absolute;
  inset: auto 0 0 0;
  padding: 20px 10px 8px;
  background: linear-gradient(180deg, transparent, rgba(11, 8, 18, 0.96));
}

.vip-rank-code {
  display: inline-block;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  font-weight: 700;
  color: #f59e0b;
  margin-bottom: 2px;
}

.vip-rank-title {
  font-size: 12px;
  font-weight: 600;
  color: #f3f0f7;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 版型 4：裡番誌 (animook / Stitch Mint Teal Anime Zine Journal) */
body[data-site-code="animook"] {
  --bg: #061110;
  --surface: #081716;
  --surface-elevated: #0c2322;
  --border: #134e4a;
  --text: #f0fdfa;
  --muted: #99f6e4;
  --accent: #14b8a6;
  --accent-hover: #2dd4bf;
  --accent-gradient: linear-gradient(135deg, #14b8a6 0%, #f59e0b 100%);
  --font-stack: "Geist", "Noto Sans TC", system-ui, sans-serif;
}

body[data-site-code="animook"] .site-header {
  background: rgba(6, 17, 16, 0.94);
  border-bottom: 1px solid #134e4a;
}

body[data-site-code="animook"] .search-input {
  border-radius: 0;
  border-color: #134e4a;
  background-color: #081716;
}

body[data-site-code="animook"] .filter-bar {
  background-color: #050d0c;
}

body[data-site-code="animook"] .filter-chip {
  border-radius: 0;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  border-color: #134e4a;
  color: #99f6e4;
}

body[data-site-code="animook"] .filter-chip.active {
  background-color: #14b8a6;
  color: #061110;
  border-color: #2dd4bf;
  font-weight: 700;
  box-shadow: none;
}

.brand-magazine-hero {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.mag-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
}

.mag-heading {
  font-family: "Newsreader", "Noto Serif TC", Georgia, serif;
  font-size: 22px;
  font-weight: 600;
  color: #2dd4bf;
}

.mag-sub {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: #f59e0b;
}

.mag-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 760px) {
  .mag-grid {
    grid-template-columns: 1.45fr 1fr;
  }
}

.mag-lead-card,
.mag-side-card {
  position: relative;
  border-radius: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  cursor: pointer;
  background: var(--surface);
  aspect-ratio: 16 / 9;
  transition: border-color 0.2s ease;
}

.mag-lead-card:hover,
.mag-side-card:hover {
  border-color: #2dd4bf;
}

.mag-side-stack {
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 14px;
}

.mag-lead-card img,
.mag-side-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mag-card-overlay {
  position: absolute;
  inset: auto 0 0 0;
  padding: 28px 16px 14px;
  background: linear-gradient(180deg, transparent, rgba(6, 17, 16, 0.95));
}

.mag-card-code {
  display: inline-block;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  font-weight: 700;
  color: #f59e0b;
  margin-bottom: 4px;
}

.mag-card-title {
  font-family: "Newsreader", "Noto Serif TC", Georgia, serif;
  font-size: 16px;
  font-weight: 500;
  color: #f0fdfa;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 版型 5：H-Lite (hanimelite / Stitch Coral Sakura Quick Index) */
body[data-site-code="hanimelite"] {
  --bg: #0a0a0c;
  --surface: #121216;
  --surface-elevated: #18181b;
  --border: #1f1f23;
  --text: #fafafa;
  --muted: #71717a;
  --accent: #fb7185;
  --accent-hover: #ffe4e6;
  --accent-gradient: linear-gradient(135deg, #fb7185 0%, #f43f5e 100%);
  --font-stack: "Geist", "Noto Sans TC", system-ui, sans-serif;
}

body[data-site-code="hanimelite"] .site-header {
  padding: 8px 20px;
  background: rgba(10, 10, 12, 0.96);
  border-bottom: 1px solid #1f1f23;
}

body[data-site-code="hanimelite"] .filter-bar {
  padding: 6px 20px;
}

body[data-site-code="hanimelite"] .filter-chip {
  border-radius: 3px;
  padding: 4px 10px;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
}

body[data-site-code="hanimelite"] .filter-chip.active {
  background-color: #fb7185;
  color: #0a0a0c;
  border-color: #ffe4e6;
  font-weight: 700;
  box-shadow: none;
}

body[data-layout-variant="minimal"] .ad-desktop-only,
body[data-layout-variant="minimal"] .ad-mobile-only {
  display: none !important;
}

@media (max-width: 759px) {
  .site-header {
    padding: 10px 14px;
  }

  .brand-logo {
    height: 30px;
  }

  .filter-bar {
    padding: 8px 14px;
  }

  .main-layout {
    padding: 16px 14px;
    gap: 20px;
  }
}
