/*
Theme Name: YS Entertainment Forum
Theme URI: https://ys89.com
Author: YS Team
Author URI: https://ys89.com
Description: YS 娛樂城論壇主題
Version: 1.0.0
Text Domain: ys-entertainment-forum
*/

/* 隱藏 WordPress 管理工具列 */
#wpadminbar {
  display: none !important;
}

html,
html.admin-bar {
  margin-top: 0 !important;
}

body,
html.admin-bar body {
  padding-top: 0 !important;
  margin-top: 0 !important;
}

/* ============================================
   基礎樣式與變數
   ============================================ */

:root {
  --color-slate-950: #0f172a;
  --color-slate-900: #0f172a;
  --color-slate-800: #1e293b;
  --color-slate-700: #334155;
  --color-slate-600: #475569;
  --color-slate-500: #64748b;
  --color-slate-400: #94a3b8;
  --color-slate-300: #cbd5e1;
  --color-slate-200: #e2e8f0;
  --color-cyan-500: #06b6d4;
  --color-cyan-400: #22d3ee;
  --color-cyan-300: #67e8f9;
  --color-blue-600: #2563eb;
  --color-fuchsia-600: #c026d3;
  --color-fuchsia-400: #e879f9;
  --color-amber-400: #fbbf24;
  --color-red-500: #ef4444;
}

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

body {
  font-family: 'Noto Sans TC', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: var(--color-slate-950);
  color: var(--color-slate-300);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   自訂滾動條
   ============================================ */

::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--color-slate-950);
}

::-webkit-scrollbar-thumb {
  background: var(--color-slate-700);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-slate-600);
}

/* ============================================
   動畫
   ============================================ */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in-up {
  animation: fadeInUp 0.6s ease-out forwards;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: .5;
  }
}

.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ============================================
   特殊效果
   ============================================ */

.drop-shadow-2xl {
  filter: drop-shadow(0 25px 50px -12px rgba(0, 0, 0, 0.25));
}

.drop-shadow-md {
  filter: drop-shadow(0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06));
}

.shadow-cyan-900\/10 {
  box-shadow: 0 0 0 1px rgba(22, 78, 99, 0.1);
}

.shadow-cyan-900\/20 {
  box-shadow: 0 0 0 1px rgba(22, 78, 99, 0.2);
}

.shadow-\[0_0_15px_rgba\(34\,211\,238\,0\.5\)\] {
  box-shadow: 0 0 15px rgba(34, 211, 238, 0.5);
}

.shadow-\[0_0_20px_rgba\(34\,211\,238\,0\.5\)\] {
  box-shadow: 0 0 20px rgba(34, 211, 238, 0.5);
}

.shadow-lg {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.shadow-fuchsia-900\/50 {
  box-shadow: 0 0 0 1px rgba(112, 26, 117, 0.5);
}

/* ============================================
   Prose（文章內容樣式）
   ============================================ */

.prose {
  color: var(--color-slate-300);
  max-width: 65ch;
}

.prose h1,
.prose h2,
.prose h3 {
  color: #ffffff;
  font-weight: 700;
  margin-top: 2em;
  margin-bottom: 1em;
}

.prose h1 {
  font-size: 2.25em;
}

.prose h2 {
  font-size: 1.875em;
}

.prose h3 {
  font-size: 1.5em;
}

.prose p {
  margin-top: 1.25em;
  margin-bottom: 1.25em;
}

.prose a {
  color: var(--color-cyan-400);
  text-decoration: underline;
}

.prose a:hover {
  color: var(--color-cyan-300);
}

.prose strong {
  font-weight: 700;
  color: #ffffff;
}

.prose ul,
.prose ol {
  margin-top: 1.25em;
  margin-bottom: 1.25em;
  padding-left: 1.625em;
}

.prose li {
  margin-top: 0.5em;
  margin-bottom: 0.5em;
}

.prose img {
  margin-top: 2em;
  margin-bottom: 2em;
  border-radius: 0.5rem;
}

/* ============================================
   行動選單 JavaScript 功能
   ============================================ */

.mobile-menu {
  display: none;
}

.mobile-menu.active {
  display: block;
}

.close-icon {
  display: none;
}

.mobile-menu-toggle.active .menu-icon {
  display: none;
}

.mobile-menu-toggle.active .close-icon {
  display: block;
}

/* ============================================
   響應式圖片
   ============================================ */

img {
  max-width: 100%;
  height: auto;
}

/* ============================================
   連結樣式
   ============================================ */

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  text-decoration: none;
}

/* ============================================
   按鈕樣式
   ============================================ */

button,
.button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

button:focus,
.button:focus {
  outline: 2px solid var(--color-cyan-400);
  outline-offset: 2px;
}

/* ============================================
   表單元素
   ============================================ */

input[type="email"],
input[type="text"],
textarea {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
}

input:focus,
textarea:focus {
  outline: 2px solid var(--color-cyan-400);
  outline-offset: 2px;
}

/* ============================================
   分頁樣式 (Pagination Styles)
   ============================================ */

/* 分頁容器 */
.pagination,
.navigation {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin: 2rem 0;
  flex-wrap: wrap;
}

/* 分頁連結 */
.page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0 0.75rem;
  background-color: rgb(30 41 59); /* slate-800 */
  border: 1px solid rgb(51 65 85); /* slate-700 */
  border-radius: 0.5rem;
  color: rgb(203 213 225); /* slate-300 */
  font-weight: 600;
  font-size: 0.875rem;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
}

.page-numbers:hover {
  background-color: rgb(51 65 85); /* slate-700 */
  border-color: rgb(6 182 212); /* cyan-500 */
  color: rgb(6 182 212); /* cyan-500 */
  transform: translateY(-1px);
}

.page-numbers:focus {
  outline: none;
  ring: 2px;
  ring-color: rgb(6 182 212); /* cyan-500 */
  ring-offset: 2px;
  ring-offset-color: rgb(15 23 42); /* slate-950 */
}

/* 當前頁 */
.page-numbers.current {
  background: linear-gradient(to right, rgb(6 182 212), rgb(37 99 235)); /* cyan-500 to blue-600 */
  border-color: rgb(6 182 212); /* cyan-500 */
  color: white;
  font-weight: 700;
  box-shadow: 0 0 15px rgba(6, 182, 212, 0.3);
}

.page-numbers.current:hover {
  background: linear-gradient(to right, rgb(8 145 178), rgb(30 64 175)); /* cyan-600 to blue-700 */
  transform: translateY(-1px);
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.5);
}

/* 上一頁/下一頁按鈕 */
.page-numbers.prev,
.page-numbers.next {
  padding: 0 1rem;
  font-weight: 700;
}

.page-numbers.prev:hover,
.page-numbers.next:hover {
  background-color: rgb(6 182 212); /* cyan-500 */
  border-color: rgb(6 182 212); /* cyan-500 */
  color: white;
}

/* 省略號 */
.page-numbers.dots {
  background-color: transparent;
  border: none;
  color: rgb(148 163 184); /* slate-400 */
  cursor: default;
  min-width: auto;
  padding: 0 0.5rem;
}

.page-numbers.dots:hover {
  background-color: transparent;
  border: none;
  color: rgb(148 163 184); /* slate-400 */
  transform: none;
}

/* 響應式設計 */
@media (max-width: 640px) {
  .page-numbers {
    min-width: 2.25rem;
    height: 2.25rem;
    padding: 0 0.5rem;
    font-size: 0.75rem;
  }
  
  .page-numbers.prev,
  .page-numbers.next {
    padding: 0 0.75rem;
    font-size: 0.75rem;
  }
}

/* ============================================
   打印樣式 (Print Styles)
   ============================================ */

@media print {
  /* 隱藏不需要打印的元素 */
  nav,
  .site-header,
  footer,
  .social-share,
  .search-form,
  button,
  .no-print {
    display: none !important;
  }
  
  /* 頁面設置 */
  @page {
    margin: 2cm;
  }
  
  body {
    background: white !important;
    color: black !important;
    font-size: 12pt;
    line-height: 1.6;
  }
  
  /* 標題樣式 */
  h1, h2, h3, h4, h5, h6 {
    color: black !important;
    page-break-after: avoid;
    margin-top: 1em;
    margin-bottom: 0.5em;
  }
  
  /* 連結樣式 */
  a {
    color: black !important;
    text-decoration: underline;
  }
  
  a[href^="http"]:after {
    content: " (" attr(href) ")";
    font-size: 0.9em;
    color: #666;
  }
  
  /* 圖片 */
  img {
    max-width: 100% !important;
    height: auto !important;
    page-break-inside: avoid;
  }
  
  /* 文章內容 */
  article {
    page-break-inside: avoid;
  }
  
  /* 避免在標題前分頁 */
  h1, h2, h3 {
    page-break-after: avoid;
  }
  
  /* 表格 */
  table {
    page-break-inside: avoid;
    border-collapse: collapse;
  }
  
  /* 目錄樣式 */
  #table-of-contents {
    border: 1px solid #ccc !important;
    background: white !important;
    page-break-after: always;
  }
  
  #table-of-contents h2 {
    color: black !important;
  }
  
  #table-of-contents a {
    color: black !important;
  }
  
  /* 頁碼 */
  @page {
    @bottom-center {
      content: "第 " counter(page) " 頁";
      font-size: 10pt;
      color: #666;
    }
  }
}

/* ============================================
   文章目錄樣式 (Table of Contents)
   ============================================ */

#table-of-contents {
  position: relative;
}

#table-of-contents ul {
  list-style: none;
  padding-left: 0;
}

#table-of-contents li {
  position: relative;
  padding-left: 1rem;
}

#table-of-contents li:before {
  content: "▸";
  position: absolute;
  left: 0;
  color: rgb(6 182 212); /* cyan-500 */
  font-size: 0.75rem;
}

#table-of-contents a {
  display: block;
  padding: 0.25rem 0;
  transition: all 0.2s ease;
}

#table-of-contents a:hover {
  padding-left: 0.5rem;
}

/* 平滑滾動 */
html {
  scroll-behavior: smooth;
}

/* 標題錨點樣式 */
h2[id],
h3[id] {
  scroll-margin-top: 100px; /* 為固定導航欄留出空間 */
  position: relative;
}

h2[id]:hover::before,
h3[id]:hover::before {
  content: "#";
  position: absolute;
  left: -1.5rem;
  color: rgb(6 182 212); /* cyan-500 */
  opacity: 0.5;
  font-weight: normal;
}

/* ===== 文章內表格樣式 ===== */
.entry-content table,
.post-content table,
article table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 0.95rem;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.10);
}

.entry-content table thead th,
.post-content table thead th,
article table thead th {
  background: #0d2444;
  color: #ffffff;
  padding: 12px 16px;
  text-align: left;
  font-weight: 700;
  letter-spacing: 0.03em;
  font-size: 0.9rem;
}

.entry-content table tbody tr:nth-child(odd) td,
.post-content table tbody tr:nth-child(odd) td,
article table tbody tr:nth-child(odd) td {
  background: #ffffff;
  color: #1a1a2e;
  padding: 11px 16px;
  border-bottom: 1px solid #e8e0f0;
}

.entry-content table tbody tr:nth-child(even) td,
.post-content table tbody tr:nth-child(even) td,
article table tbody tr:nth-child(even) td {
  background: #f0f4ff;
  color: #1a1a2e;
  padding: 11px 16px;
  border-bottom: 1px solid #e8e0f0;
}

.entry-content table tbody tr:hover td,
.post-content table tbody tr:hover td,
article table tbody tr:hover td {
  background: #dde8ff;
}

.entry-content table th,
.entry-content table td,
.post-content table th,
.post-content table td,
article table th,
article table td {
  border: 1px solid #d0d8e8;
  vertical-align: middle;
}

/* 評分星號顏色 */
.entry-content table td .star,
.entry-content table td:contains(★) {
  color: #f59e0b;
}

/* 手機版表格橫向捲動 */
.entry-content .table-wrap,
.post-content .table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 640px) {
  .entry-content table,
  .post-content table,
  article table {
    font-size: 0.82rem;
    display: block;
    overflow-x: auto;
  }
  .entry-content table th,
  .entry-content table td {
    padding: 8px 10px;
  }
}

/* ===== Prose 表格樣式修正（覆蓋 Tailwind prose-invert）===== */
.prose table {
  width: 100% !important;
  border-collapse: collapse !important;
  margin: 24px 0 !important;
  font-size: 0.95rem !important;
  border-radius: 10px !important;
  overflow: hidden !important;
  box-shadow: 0 2px 16px rgba(0,0,0,0.25) !important;
}

.prose table thead tr {
  background: #1e3a6e !important;
}

.prose table thead th {
  background: #1e3a6e !important;
  color: #ffffff !important;
  padding: 13px 16px !important;
  text-align: left !important;
  font-weight: 700 !important;
  font-size: 0.92rem !important;
  border: none !important;
  letter-spacing: 0.02em !important;
}

.prose table tbody tr:nth-child(odd) {
  background: #1a1f35 !important;
}

.prose table tbody tr:nth-child(even) {
  background: #222845 !important;
}

.prose table tbody td {
  padding: 11px 16px !important;
  color: #e2e8f0 !important;
  border: none !important;
  border-bottom: 1px solid rgba(255,255,255,0.08) !important;
  font-size: 0.92rem !important;
  vertical-align: middle !important;
}

.prose table tbody tr:hover td {
  background: #2a3558 !important;
  color: #ffffff !important;
}

@media (max-width: 640px) {
  .prose table {
    display: block !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
  .prose table th,
  .prose table td {
    padding: 9px 11px !important;
    font-size: 0.83rem !important;
  }
}

/* ===== 強制修正 prose-invert 表格文字顏色（最終版）===== */
.prose-invert table,
.prose-slate table,
.prose table {
  width: 100% !important;
  border-collapse: collapse !important;
  margin: 24px 0 !important;
  border-radius: 10px !important;
  overflow: hidden !important;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4) !important;
  background: transparent !important;
}

.prose-invert thead th,
.prose-slate thead th,
.prose thead th {
  background: #1e3a6e !important;
  color: #ffffff !important;
  padding: 13px 16px !important;
  text-align: left !important;
  font-weight: 700 !important;
  font-size: 0.93rem !important;
  border: none !important;
  border-bottom: 2px solid #4a7fd4 !important;
}

.prose-invert tbody tr,
.prose-slate tbody tr,
.prose tbody tr {
  background: transparent !important;
}

.prose-invert tbody tr:nth-child(odd) td,
.prose-slate tbody tr:nth-child(odd) td,
.prose tbody tr:nth-child(odd) td {
  background: #16213e !important;
  color: #e2e8f0 !important;
  padding: 12px 16px !important;
  border: none !important;
  border-bottom: 1px solid rgba(255,255,255,0.06) !important;
  font-size: 0.92rem !important;
}

.prose-invert tbody tr:nth-child(even) td,
.prose-slate tbody tr:nth-child(even) td,
.prose tbody tr:nth-child(even) td {
  background: #1a2744 !important;
  color: #e2e8f0 !important;
  padding: 12px 16px !important;
  border: none !important;
  border-bottom: 1px solid rgba(255,255,255,0.06) !important;
  font-size: 0.92rem !important;
}

.prose-invert tbody tr:hover td,
.prose-slate tbody tr:hover td,
.prose tbody tr:hover td {
  background: #243560 !important;
  color: #ffffff !important;
}
