/* style.css */

/* =======================
   1. 全域設定
======================= */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap');

:root {
  --color-primary: #4CB28B;
  --color-primary-dark: #189264;
  --color-secondary: #111827;
  --color-light: #ffffff;
  --color-bg: #f4f6fc;
  --color-text: #333333;
  --transition: 0.3s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body::before {
    content: "";
    position: fixed;
    top: 0; left: 0;
    width: 200%; height: 200%;
    /* 直接貼整段 SVG Data-URI，省去所有反斜線 */
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='100' height='100'><text x='15' y='30' font-size='30' fill='%23e0245e'>&#9829;</text><text x='65' y='30' font-size='30' fill='%23e0245e'>&#9830;</text><text x='15' y='80' font-size='30' fill='%23111827'>&#9827;</text><text x='65' y='80' font-size='30' fill='%23111827'>&#9824;</text></svg>");
    background-repeat: repeat;
    background-size: 100px 100px;
    transform: translate(-25%, -25%) rotate(-30deg);
    opacity: 0.08;
    pointer-events: none;
    z-index: 0;
  }
  
  /* 確保其他內容都在背景之上 */
  body > * {
    position: relative;
    z-index: 1;
  }
  
  .body-suit-background {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transform: rotate(-15deg) scale(2);
    pointer-events: none;
    opacity: 0.05;
    z-index: 0;
  }
  
  .body-suit-background .suit-card {
    font-size: 6rem;
    width: 1em; height: 1em;
    line-height: 1em;
    text-align: center;
  }
  
  .body-suit-background .heart,
  .body-suit-background .diamond { color: #e0245e; }
  .body-suit-background .club,
  .body-suit-background .spade { color: var(--color-secondary); }

  .ads{
    position: fixed;
    right: 0px;
    bottom: 250px;
    width: 150px;
    z-index: 999;
  }
  .ads img{
    width: 100%;
  }
  @media (max-width: 768px) {
    .ads{
        width: 100px;
       
       
      }
  }
/* =======================
   2. 容器設定
======================= */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* =======================
   3. Header + Nav
======================= */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background-color: var(--color-light);
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  z-index: 100;
  border-bottom: 3px solid #d97706 ;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
  padding: 0 20px;
}

/* LOGO */
.logo img {
  height: 60px;
}

/* 漢堡按鈕（預設隱藏） */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  width: 30px;
  height: 30px;
  position: absolute;
  top: 50%;
  right: 20px;
  transform: translateY(-50%);
  z-index: 110;
}

.nav-toggle .hamburger,
.nav-toggle .hamburger::before,
.nav-toggle .hamburger::after {
  content: '';
  display: block;
  height: 3px;
  background: var(--color-secondary);
  border-radius: 2px;
  transition: all var(--transition);
}

.nav-toggle .hamburger {
  position: relative;
  top: 14px;
}

.nav-toggle .hamburger::before {
  position: absolute;
  width: 100%;
  top: -8px;
}

.nav-toggle .hamburger::after {
  position: absolute;
  width: 100%;
  top: 8px;
}

.nav-toggle.open .hamburger {
  background: transparent;
}

.nav-toggle.open .hamburger::before {
  transform: translateY(8px) rotate(45deg);
}

.nav-toggle.open .hamburger::after {
  transform: translateY(-8px) rotate(-45deg);
}

/* 桌機版選單 */
.site-nav {
  display: flex;
}

.site-nav ul {
  display: flex;
  gap: 30px;
  list-style: none;
}

.site-nav a {
  color: var(--color-secondary);
  text-decoration: none;
  font-weight: 600;
  transition: color var(--transition);
}

.site-nav a:hover {
  color: var(--color-primary);
}

/* 註冊按鈕 */
.btn-register {
  padding: 8px 18px;
  background-color: var(--color-primary);
  color: var(--color-light) !important;
  border-radius: 4px;
  transition: background-color var(--transition);
}

.btn-register:hover {
  background-color: var(--color-primary-dark);
}

/* 搜尋框 */
.nav-search input {
  padding: 6px 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  transition: border-color var(--transition);
}

.nav-search input:focus {
  outline: none;
  border-color: var(--color-primary);
}

/* =======================
   4. Hero Banner
======================= */
.hero-banner {
  background: linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4)), url('../img/banner-top2.jpg') center/cover no-repeat;
  color: var(--color-light);
  padding: 200px 0;
  text-align: center;
  margin-top: 70px;
  height: 500px;
}

.hero-banner h1 {
  font-size: 2.8rem;
  margin-bottom: 16px;
  font-weight: 700;
}

.hero-banner p {
  font-size: 1.2rem;
  margin-bottom: 24px;
}

.btn-primary {
  display: inline-block;
  padding: 12px 30px;
  background-color: var(--color-primary);
  color: var(--color-light);
  border-radius: 4px;
  font-weight: 600;
  transition: background-color var(--transition);
}

.btn-primary:hover {
  background-color: var(--color-primary-dark);
}

/* =======================
   5. 文章列表 (Grid + List)
======================= */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 20px;
}

.post-card {
  background-color: var(--color-light);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  transition: transform var(--transition), box-shadow var(--transition);
}

.post-card img {
  width: 100%;
  height: 160px;
  object-fit: cover;
}

.post-card h3 {
  font-size: 1.1rem;
  margin: 12px 16px 8px;
  color: var(--color-secondary);
}

.post-card p {
  font-size: 0.95rem;
  margin: 0 0px;
  color: #555;
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(240, 111, 12, 0.775);
}

.post-list {
  list-style: none;
  margin-top: 16px;
}

.post-list li {
  padding: 10px 0;
  border-bottom: 1px solid #e0e0e0;
}

.post-list li a {
  text-decoration: none;
  color: var(--color-secondary);
  transition: color var(--transition);
}

.post-list li a:hover {
  color: var(--color-primary);
}

/* =======================
   6. FAQ 折疊效果
======================= */
/* FAQ 區塊容器 */
.faq-section {
    max-width: 1200px;
    margin: 60px auto;
    padding: 0 20px;
  }
  
  /* FAQ 標題 */
  .faq-section h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-secondary);
    text-align: center;
    margin-bottom: 32px;
    position: relative;
  }
  .faq-section h2::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background: var(--color-primary);
    margin: 8px auto 0;
    border-radius: 2px;
  }
  
/* FAQ 列表：兩欄排版 */
.faq-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
  
  /* 手機下單欄 */
  @media (max-width: 768px) {
    .faq-list {
      grid-template-columns: 1fr;
    }
  }
  
  
  /* 單一項目 Card */
  .faq-item {
    background: var(--color-light);
    border: 2px solid var(--color-primary);
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow var(--transition);
  }
  .faq-item:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  }
  
  /* 問題按鈕 */
  .faq-question {
    width: 100%;
    text-align: left;
    padding: 16px 20px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-secondary);
    background: none;
    border: none;
    position: relative;
    cursor: pointer;
  }
  .faq-question::after {
    content: '▼';
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%) rotate(0deg);
    transition: transform var(--transition);
    color: var(--color-primary);
  }
  .faq-item.active .faq-question::after {
    transform: translateY(-50%) rotate(180deg);
  }
  
  /* 答案區塊 */
  .faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition), padding var(--transition);
    padding: 0 20px;
    background: var(--color-bg);
  }
  .faq-item.active .faq-answer {
    max-height: 500px; /* 足夠大以容納內容 */
    padding: 16px 20px;
  }
  
  /* 答案文字 */
  .faq-answer p {
    margin: 0;
    color: #555;
    line-height: 1.6;
  }
  
/* =======================
   7. Footer
======================= */
.site-footer {
  background-color: var(--color-secondary);
  color: var(--color-light);
  padding: 40px 0;
  margin-top: 60px;
  text-align: center;
}

.site-footer .footer-nav ul {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 20px;
}

.site-footer .footer-nav a {
  color: var(--color-light);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition);
}

.site-footer .footer-nav a:hover {
  color: var(--color-primary);
}

.social-links a {
  margin: 0 8px;
  font-size: 1.2rem;
  color: var(--color-light);
  transition: color var(--transition);
}

.social-links a:hover {
  color: var(--color-primary);
}

.site-footer p {
  margin-top: 16px;
  font-size: 0.9rem;
  opacity: 0.8;
}

/* =======================
   8. 響應式調整
======================= */
@media (max-width: 1024px) {
  .articles-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }
}

@media (max-width: 768px) {
  /* 顯示漢堡按鈕 */
  .nav-toggle {
    display: block;
  }
  /* 隱藏桌機選單與搜尋 */
  .site-nav,
  .nav-search {
    display: none;
  }
  /* 手機版選單收合 */
  .site-nav.nav-open {
    display: flex;
    position: absolute;
    top: 70px;
    left: 0;
    right: 0;
    background: var(--color-light);
    flex-direction: column;
    align-items: center;
    max-height: 400px;
    overflow: auto;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 105;
  }
  .site-nav.nav-open ul {
    flex-direction: column;
    gap: 16px;
    padding: 20px 0;
    display: flex;
  }
  /* Hero Banner 調整 */
  .hero-banner {
    padding: 80px 0;
  }
}
/* ===== 熱門文章 Section ===== */
.hot-articles {
    margin: 60px 0;
  }
  
  .hot-articles h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-secondary);
    text-align: center;
    margin-bottom: 24px;
    position: relative;
  }
  
  .hot-articles h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--color-primary);
    margin: 8px auto 0;
    border-radius: 2px;
  }
  
  /* ===== Grid ===== */
  .articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 32px;
  }
  
  /* ===== 卡片樣式 ===== */
  .post-card {
    position: relative;
    background-color: var(--color-light);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
    transition: transform var(--transition), box-shadow var(--transition);
    text-decoration: none;
  }
  
  .post-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 12px 30px rgba(0,0,0,0.12);
  }
  
  /* 圖片區 */
  .post-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    transition: transform var(--transition);
  }
  
  .post-card:hover img {
    transform: scale(1.05);
  }
  
  /* 文字內容 */
  .post-card h3,
  .post-card p {
    padding: 0 16px;
  }
  
  .post-card h3 {
    margin: 16px 0 8px;
    font-size: 1.1rem;
    color: var(--color-secondary);
  }
  
  .post-card p {
    margin-bottom: 16px;
    font-size: 0.95rem;
    color: #555;
    line-height: 1.4;
  }
  
  /* Layered Overlay on Hover */
  .post-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(243, 210, 21, 0.286), transparent 60%);
    opacity: 0;
    transition: opacity var(--transition);
  }
  
  .post-card:hover::after {
    opacity: 1;
  }
  
  /* 連結整區點擊 */
  .post-card a {
    display: block;
    color: inherit;
    text-decoration: none;
  }
  
  /* 響應式微調 */
  @media (max-width: 480px) {
    .post-card img {
      height: 140px;
    }
  }
  /* ===== 扑克牌花色翻轉動畫 ===== */
.suit-section {
    padding: 40px 0 0;
    background: #fff;
  }
  
  .suit-container {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 20px;
  }
  
  .suit-card {
    font-size: 2.5rem;
    width: 60px;
    height: 60px;
    line-height: 60px;
    text-align: center;
    border: 2px solid var(--color-secondary);
    border-radius: 8px;
    background: var(--color-light);
    cursor: default;
    /* 3D 翻轉效果 */
    transform-style: preserve-3d;
    animation: flip 3s infinite ease-in-out;
  }
  
  /* 顏色對應 */
  .suit-card.heart,
  .suit-card.diamond {
    color: #e0245e;
  }
  .suit-card.club,
  .suit-card.spade {
    color: var(--color-secondary);
  }
  
  /* 翻轉 Keyframes */
  @keyframes flip {
    0%   { transform: rotateY(0deg);   }
    25%  { transform: rotateY(180deg); }
    50%  { transform: rotateY(180deg); }
    75%  { transform: rotateY(360deg); }
    100% { transform: rotateY(360deg); }
  }
  
  /* 手機微調 */
  @media (max-width: 480px) {
    .suit-container {
      gap: 20px;
    }
    .suit-card {
      font-size: 2rem;
      width: 50px;
      height: 50px;
      line-height: 50px;
    }
  }
  /* 最新文章卡片網格 */
.latest-articles {
    margin: 60px 0;
  }
  .latest-articles h2 {
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    color: var(--color-secondary);
    margin-bottom: 24px;
  }
  .latest-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
  }
  
  /* 單篇卡片 */
  .latest-card {
    background: var(--color-light);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    transition: transform var(--transition), box-shadow var(--transition);
  }
  .latest-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
  }
  .latest-card a {
    color: inherit;
    text-decoration: none;
    display: block;
  }
  
  /* 縮圖區 */
  .card-thumb {
    width: 100%;
    height: 140px;
    overflow: hidden;
  }
  .card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  
  /* 文字區 */
  .card-body {
    padding: 16px;
  }
  .card-body h3 {
    font-size: 1rem;
    margin: 0 0 8px;
    color: var(--color-secondary);
  }
  .card-date {
    font-size: 0.85rem;
    color: #777;
  }
  
  /* 響應式調整 */
  @media (max-width: 900px) {
    .latest-grid {
      grid-template-columns: repeat(2, 1fr);
    }
  }
  @media (max-width: 600px) {
    .latest-grid {
      grid-template-columns: 1fr;
    }
    .card-thumb {
      height: 180px;
    }
  }
  .latest-announce {
    overflow-x: auto;          /* 若瀏覽器寬度不足則出現橫向捲軸 */
  }
/* 1. 整個左右容器固定高度 */
/* 最新公告帶固定高度、左右等高、右側內部滾動完整樣式 */

/* 1. 外層左右兩欄容器 */
.latest-announce .announce-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0px;
    max-width: 1200px;
    margin: 0 auto;
    height: 500px;            /* 固定高度，可自行調整 */
  }
  
  /* 2. 左側圖片 */
  .latest-announce .latest-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-bottom-left-radius:8px ;
    border-top-left-radius:8px ;
    display: block;
  }
  
  /* 3. 右側公告外框 */
  .latest-announce .announce-box {
    border: 2px solid var(--color-primary);
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
    background: var(--color-light);
    padding: 16px;
    display: flex;
    flex-direction: column;
    height: 100%;
  }
  
  /* 4. 標題區 */
  .latest-announce .announce-header {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    margin-bottom: 16px;
  }
  .latest-announce .announce-header h2 {
    margin: 0;
    padding-right: 16px;
    font-size: 1.5rem;
    color: var(--color-secondary);
  }
  
  /* 5. 分類按鈕 */
  .latest-announce .announce-tabs {
    display: flex;
    gap: 8px;
    position: relative;
    top: -12px;               /* 浮在框線上方 */
  }
  .latest-announce .tab-btn {
    padding: 6px 12px;
    background: var(--color-light);
    border: 1px solid var(--color-primary);
    border-radius: 4px;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
  }
  .latest-announce .tab-btn.active {
    background: var(--color-primary);
    color: var(--color-light);
  }
  
  /* 6. 公告列表，超出時右側滾動 */
  .latest-announce .announce-list {
    list-style: none;
    border-left: 3px solid var(--color-primary);
    padding: 32px 0 0 20px;
    margin: 0;
    flex: 1 1 auto;
    overflow-y: auto;
  }
  
  /* 7. 公告項目（已移除小圓圈標記） */
  .latest-announce .announce-item {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
  }
  
  /* 8. 公告內容、徽章、標題 */
  .latest-announce .announce-content {
    display: flex;
    gap: 8px;
     display: flex;
  align-items: center;

  }
  .latest-announce .announce-badge {
    background: var(--color-primary);
    color: var(--color-light);
    padding: 2px 6px;
    font-size: 0.75rem;
    border-radius: 4px;
    text-transform: uppercase;
  }
  .latest-announce .announce-title {
    color: var(--color-secondary);
    font-weight: 600;
    text-decoration: none;
    transition: color var(--transition);

  }
  .latest-announce .announce-title:hover {
    color: var(--color-primary-dark);
  }
  @media (max-width: 768px) {
    /* 1. 上下排列，不要固定高度 */
    .latest-announce .announce-wrapper {
      display: block;
      max-width: 100%;
      height: auto;
      margin: 0 16px;
      gap: 0;
    }
  
    /* 2. 圖片放頂部，固定高度 */
    .latest-announce .latest-img {
      width: 100%;
      height: 200px;           /* 手機版圖片高度 */
      margin-bottom: 16px;
    }
    .latest-announce .latest-img img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      border-radius: 8px;      /* 四角圓弧 */
    }
  
    /* 3. 公告外框放下面，自動高度 */
    .latest-announce .announce-box {
      width: 100%;
      padding: 12px;
      border-radius: 8px;
      box-sizing: border-box;
      height: auto;            /* 自動撐高 */
    }
  
    /* 4. 標題 & 按鈕 */
    .latest-announce .announce-header {
      flex-direction: column;
      align-items: flex-start;
      margin-bottom: 12px;
    }
    .latest-announce .announce-header h2 {
      font-size: 1.25rem;
      padding-right: 0;
      margin-bottom: 8px;
    }
    .latest-announce .announce-tabs {
      top: 0;
    }
    .latest-announce .tab-btn {
      padding: 6px 10px;
      font-size: 0.875rem;
    }
  
    /* 5. 列表區 */
    .latest-announce .announce-list {
      border-left: 3px solid var(--color-primary);
      padding: 16px 0 0 16px;
      overflow-y: visible;     /* 不要隱藏捲軸 */
    }
    .latest-announce .announce-item {
      margin-bottom: 12px;
    }
    .latest-announce .announce-content {
      flex-wrap: wrap;
      gap: 6px;
    }
    .latest-announce .announce-badge {
      padding: 2px 6px;
      font-size: 0.7rem;
    }
    .latest-announce .announce-title {
      font-size: 0.9rem;
    }
  }
/* ———————— 搜尋表單 ———————— */
.nav-search form {
  display: flex;
  align-items: center;
  border: 2px solid #ddd;
  border-radius: 4px;
  overflow: hidden;
  max-width: 300px;
}

.nav-search input[type="search"] {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border: none;
  font-size: 1rem;
  outline: none;
}

.nav-search button {
  background: #4CB28B;
  border: none;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  transition: background 0.2s;
  color: #fff;
  font-size: 1.1rem;
}
.nav-search button:hover {
  background: #1f875f;
}

/* ———————— 搜尋結果區塊 ———————— */
.search-results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}
@media (max-width: 600px) {
  .nav-search form {
    max-width: 100%;
  }
  
}
.article-banner {
  position: relative;
  width: 100%;
  height: 300px;             /* Banner 高度，可調 */
  overflow: hidden;
  margin-bottom: 1.5rem;
  margin-top: 70px;

}

.article-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.banner-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
}
.banner-overlay h1{
  color: rgb(255, 255, 255);
}
/* 小螢幕響應 */
@media (max-width: 600px) {
  .article-banner {
    height: 160px;
  }

}
