/* ==========================================================================
   綠吔實業 LUYE FOODS (RWD Stylesheet)
   視覺風格承襲自官方網站 (https://spiceking.com.tw)
   ========================================================================== */

:root {
  /* 品牌核心色系 (取自綠吔官網 Logo 與 Header/Footer) */
  --luye-green-dark: #095d40;
  --luye-green-primary: #096443;
  --luye-green-hover: #074d33;
  --luye-green-muted: #3f7863;
  --luye-green-light: #87a59a;
  --luye-green-tint: #eef6f2;
  --luye-leaf-green: #82b536;
  --luye-spice-orange: #f39800;
  --luye-accent-red: #eb5c45;
  --luye-accent-red-dark: #d64e3c;

  /* 中性色系 */
  --bg-page: #f7f9f8;
  --bg-surface: #ffffff;
  --bg-subtle: #fcfcfc;
  --text-primary: #2c3531;
  --text-secondary: #585757;
  --text-muted: #737373;
  --border-color: #e2e8e5;

  /* 尺寸與陰影 */
  --max-width: 1280px;
  --header-height: 76px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 2px 8px rgba(9, 93, 64, 0.06);
  --shadow-md: 0 6px 20px rgba(9, 93, 64, 0.1);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.16);
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 基礎重置與字體設定 (承襲官網字體與字距) */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: "PingFang TC", "PingFangTC-Regular", "Microsoft JhengHei", "微軟正黑體", "Helvetica Neue", "Heiti TC", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: var(--text-primary);
  background-color: var(--bg-page);
  line-height: 1.65;
  letter-spacing: 0.8px;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition);
}

img {
  max-width: 100%;
  vertical-align: middle;
}

button,
input,
select {
  font-family: inherit;
  font-size: inherit;
  letter-spacing: inherit;
}

/* 跳到主要內容 (無障礙支援) */
.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  background: var(--luye-green-primary);
  color: #fff;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  z-index: 10000;
  font-weight: 600;
}
.skip-link:focus {
  top: 16px;
}

/* ==========================================================================
   頂部波浪裝飾條 (承襲官網 .HeaderImg)
   ========================================================================== */
.top-wave-banner {
  height: 46px;
  width: 100%;
  position: relative;
  background-color: var(--bg-surface);
  overflow: hidden;
}

.top-wave-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center bottom;
  display: block;
}

/* ==========================================================================
   導覽列 Header (Sticky 置頂 + RWD 漢堡選單)
   ========================================================================== */
.site-header {
  background-color: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid var(--border-color);
  transition: var(--transition);
}

.site-header.scrolled {
  box-shadow: var(--shadow-sm);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 40px;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

/* 品牌識別區 */
.brand-link {
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
}

.brand-logo {
  height: 54px;
  width: auto;
  object-fit: contain;
  transition: transform 0.25s ease;
}

.brand-link:hover .brand-logo {
  transform: scale(1.04);
}

.brand-titles {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--luye-green-dark);
  letter-spacing: 1.5px;
  line-height: 1.2;
}

.brand-sub {
  font-size: 0.78rem;
  color: var(--luye-green-muted);
  font-weight: 500;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

/* 導覽選單 (承襲官網 #dataSiteTree.Hori 並強化頁籤互動) */
.main-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 1.02rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.nav-tab svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
  opacity: 0.8;
  transition: var(--transition);
}

.nav-tab:hover {
  color: var(--luye-green-primary);
  background-color: var(--luye-green-tint);
}

.nav-tab.active {
  color: var(--luye-green-primary);
  font-weight: 700;
  background-color: var(--luye-green-tint);
}

.nav-tab.active::after {
  content: "";
  position: absolute;
  bottom: -14px;
  left: 16px;
  right: 16px;
  height: 3px;
  background-color: var(--luye-green-primary);
  border-radius: 3px 3px 0 0;
}

.nav-badge {
  background-color: var(--luye-accent-red);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 12px;
  line-height: 1.4;
}

/* 右側狀態與快速工具區 */
.header-tools {
  display: flex;
  align-items: center;
  gap: 14px;
}

.current-date-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  background: var(--bg-page);
  border: 1px solid var(--border-color);
  padding: 6px 14px;
  border-radius: 999px;
}

.intranet-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--luye-green-primary);
  background: var(--luye-green-tint);
  padding: 6px 12px;
  border-radius: 999px;
}

.status-dot {
  width: 8px;
  height: 8px;
  background-color: var(--luye-leaf-green);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(130, 181, 54, 0.22);
}

/* 手機版漢堡按鈕 */
.mobile-menu-btn {
  display: none;
  background: none;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--luye-green-dark);
}

/* ==========================================================================
   Hero 橫幅區塊 (融合綠吔自然香辛料精神與企業核心價值)
   ========================================================================== */
.hero-section {
  position: relative;
  background: linear-gradient(125deg, #063f2b 0%, #095d40 55%, #167a57 100%);
  color: #ffffff;
  overflow: hidden;
}

.hero-bg-overlay {
  position: absolute;
  inset: 0;
  background-image: url("assets/images/hero-banner.jpg");
  background-size: cover;
  background-position: center;
  opacity: 0.14;
  mix-blend-mode: luminosity;
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 44px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}

.hero-content {
  max-width: 680px;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.24);
  padding: 4px 14px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  margin-bottom: 14px;
  color: #e6f4ee;
}

.hero-kicker span.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--luye-spice-orange);
}

.hero-title {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 2px;
  line-height: 1.3;
  margin-bottom: 10px;
}

.hero-desc {
  font-size: 0.98rem;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.7;
}

/* 核心價值徽章卡片 */
.hero-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(140px, 1fr));
  gap: 12px;
}

.stat-card {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(6px);
  padding: 14px 18px;
  border-radius: var(--radius-md);
  text-align: left;
  transition: var(--transition);
}

.stat-card:hover {
  background: rgba(255, 255, 255, 0.16);
  transform: translateY(-2px);
}

.stat-num {
  font-size: 1.45rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.2;
}

.stat-num small {
  font-size: 0.82rem;
  font-weight: 400;
  opacity: 0.85;
  margin-left: 4px;
}

.stat-label {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.8);
  margin-top: 4px;
}

/* 跑馬燈緊急通知列 */
.ticker-bar {
  background-color: #fff8eb;
  border-bottom: 1px solid #f5dfc0;
  color: #7c4d00;
  font-size: 0.9rem;
}

.ticker-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 10px 40px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.ticker-tag {
  background-color: var(--luye-spice-orange);
  color: #fff;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}

.ticker-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}

.ticker-action {
  color: var(--luye-green-primary);
  font-weight: 700;
  font-size: 0.85rem;
  white-space: nowrap;
  cursor: pointer;
  background: none;
  border: none;
  text-decoration: underline;
}

/* ==========================================================================
   主要內容容器與 SPA 視圖切換
   ========================================================================== */
.main-container {
  flex: 1;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 36px 40px 64px;
}

.spa-view {
  display: none;
  animation: fadeIn 0.3s ease-out;
}

.spa-view.active {
  display: block;
}

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

/* ==========================================================================
   視圖一：最新公告與置頂通知 (Announcements View)
   ========================================================================== */
.toolbar-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

/* 分類篩選按鈕群 (參考官網 .memTab 與 FAQ 色調) */
.category-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.cat-btn {
  border: 1px solid var(--border-color);
  background: var(--bg-subtle);
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.cat-btn:hover {
  border-color: var(--luye-green-primary);
  color: var(--luye-green-primary);
}

.cat-btn.active {
  background-color: var(--luye-green-primary);
  border-color: var(--luye-green-primary);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 3px 10px rgba(9, 100, 67, 0.22);
}

.cat-count {
  font-size: 0.75rem;
  padding: 1px 6px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.07);
}

.cat-btn.active .cat-count {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

/* 搜尋框 */
.search-box {
  position: relative;
  min-width: 280px;
  flex: 1;
  max-width: 360px;
}

.search-box svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 10px 36px 10px 40px;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  background-color: var(--bg-page);
  color: var(--text-primary);
  font-size: 0.92rem;
  transition: var(--transition);
}

.search-input:focus {
  outline: none;
  border-color: var(--luye-green-primary);
  background-color: #fff;
  box-shadow: 0 0 0 3px rgba(9, 100, 67, 0.12);
}

.clear-search-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  display: none;
  padding: 2px 6px;
}

/* 公告版面配置 (左主欄 + 右側快速資訊欄，承襲官網 #id_MemoLeft 66% / #id_MemoRight 34%) */
.board-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(290px, 1fr);
  gap: 32px;
  align-items: start;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--luye-green-dark);
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 22px;
  background-color: var(--luye-green-primary);
  border-radius: 3px;
}

.result-summary {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* 公告卡片列表 */
.announcement-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.announcement-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 22px 24px;
  transition: var(--transition);
  cursor: pointer;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.announcement-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: #bdd4c9;
}

.announcement-card.is-pinned {
  border-left: 5px solid var(--luye-accent-red);
  background: linear-gradient(to right, #fffaf9 0%, #ffffff 12%);
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.badge-pin {
  background-color: var(--luye-accent-red);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-cat {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 4px;
}

.badge-cat.cat-hr {
  background-color: #e6f4ee;
  color: #096443;
}
.badge-cat.cat-food {
  background-color: #fff3e0;
  color: #d97706;
}
.badge-cat.cat-admin {
  background-color: #e8f0fe;
  color: #1e62d0;
}
.badge-cat.cat-it {
  background-color: #f3e8ff;
  color: #7e22ce;
}

.badge-new {
  background-color: var(--luye-leaf-green);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
  letter-spacing: 0.5px;
}

.card-date {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-left: auto;
}

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.45;
  transition: color 0.2s;
}

.announcement-card:hover .card-title {
  color: var(--luye-green-primary);
}

.card-excerpt {
  font-size: 0.93rem;
  color: var(--text-secondary);
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  margin-top: 4px;
  border-top: 1px dashed var(--border-color);
  font-size: 0.83rem;
  color: var(--text-muted);
}

.card-dept {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}

.read-more-link {
  color: var(--luye-green-primary);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* 右側邊欄小工具 */
.sidebar-stack {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.widget-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}

.widget-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--luye-green-dark);
  padding-bottom: 12px;
  margin-bottom: 16px;
  border-bottom: 2px solid var(--luye-green-tint);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* 員工守則快速入口卡片 */
.handbook-promo-card {
  background: linear-gradient(145deg, #095d40 0%, #0d7a55 100%);
  color: #fff;
  border-radius: var(--radius-md);
  padding: 24px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.handbook-promo-card h3 {
  font-size: 1.2rem;
  margin-bottom: 8px;
  letter-spacing: 1px;
}

.handbook-promo-card p {
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.86);
  margin-bottom: 18px;
  line-height: 1.6;
}

.promo-chapters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
}

.promo-chip {
  font-size: 0.78rem;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: var(--transition);
}

.promo-chip:hover {
  background: rgba(255, 255, 255, 0.28);
}

.btn-primary-light {
  width: 100%;
  background: #ffffff;
  color: var(--luye-green-dark);
  border: none;
  padding: 11px 18px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition);
}

.btn-primary-light:hover {
  background: var(--luye-spice-orange);
  color: #ffffff;
}

/* 工廠食安與值班資訊清單 */
.info-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.info-list li {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.9rem;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--bg-page);
}

.info-list li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.info-label {
  color: var(--text-secondary);
  font-weight: 500;
}

.info-val {
  font-weight: 700;
  color: var(--text-primary);
  text-align: right;
}

/* 內部單位聯絡分機表 */
.ext-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.ext-item {
  background: var(--bg-page);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.ext-dept {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.ext-num {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--luye-green-primary);
  margin-top: 2px;
}

/* ==========================================================================
   視圖二：公司員工守則專頁 (Employee Handbook View)
   ========================================================================== */
.handbook-header-banner {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-left: 6px solid var(--luye-green-primary);
  border-radius: var(--radius-md);
  padding: 24px 28px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.hb-meta-info h2 {
  font-size: 1.5rem;
  color: var(--luye-green-dark);
  margin-bottom: 6px;
}

.hb-meta-tags {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 0.86rem;
  color: var(--text-secondary);
}

.hb-meta-tags span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.hb-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-outline {
  border: 1px solid var(--luye-green-primary);
  background: transparent;
  color: var(--luye-green-primary);
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
}

.btn-outline:hover {
  background: var(--luye-green-primary);
  color: #fff;
}

/* 守則雙欄架構：左側目錄導覽 + 右側條文內容 */
.handbook-layout {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}

.toc-sidebar {
  position: sticky;
  top: calc(var(--header-height) + 20px);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.toc-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--luye-green-dark);
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.toc-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.toc-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
  transition: var(--transition);
  text-align: left;
  border: none;
  background: transparent;
  cursor: pointer;
  width: 100%;
}

.toc-link:hover {
  background-color: var(--luye-green-tint);
  color: var(--luye-green-primary);
}

.toc-link.active {
  background-color: var(--luye-green-primary);
  color: #ffffff;
  font-weight: 600;
}

.toc-num {
  font-size: 0.76rem;
  opacity: 0.8;
  font-weight: 700;
  min-width: 24px;
}

/* 守則搜尋與重點過濾工具列 */
.handbook-filter-bar {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.filter-toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  user-select: none;
}

.filter-toggle-label input {
  accent-color: var(--luye-green-primary);
  width: 17px;
  height: 17px;
  cursor: pointer;
}

/* 章節卡片與條文樣式 */
.chapters-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.chapter-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  scroll-margin-top: calc(var(--header-height) + 24px);
}

.chapter-header {
  background: linear-gradient(to right, var(--luye-green-tint), #ffffff);
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}

.chapter-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chapter-badge {
  background-color: var(--luye-green-primary);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
}

.chapter-title {
  font-size: 1.18rem;
  font-weight: 700;
  color: var(--luye-green-dark);
}

.chapter-toggle-icon {
  color: var(--luye-green-primary);
  font-size: 0.9rem;
  font-weight: 600;
}

.chapter-body {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.chapter-card.collapsed .chapter-body {
  display: none;
}

.rule-item {
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  transition: var(--transition);
}

.rule-item:hover {
  border-color: #c5d8cf;
  background-color: #fff;
}

.rule-item.is-important {
  border-left: 4px solid var(--luye-spice-orange);
  background-color: #fffdf9;
}

.rule-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.rule-no {
  font-weight: 700;
  color: var(--luye-green-primary);
  font-size: 0.95rem;
}

.rule-Heading {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 1.02rem;
}

.badge-important {
  background-color: #fff0d6;
  color: #b45309;
  border: 1px solid #fbd38d;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 1px 8px;
  border-radius: 4px;
}

.rule-text {
  font-size: 0.94rem;
  color: var(--text-secondary);
  line-height: 1.75;
}

.rule-text ul {
  margin-top: 8px;
  padding-left: 20px;
}

.rule-text li {
  margin-bottom: 4px;
}

mark.highlight {
  background-color: #fef08a;
  color: #1f2937;
  padding: 0 3px;
  border-radius: 3px;
}

/* 空狀態顯示 */
.empty-state {
  text-align: center;
  padding: 56px 24px;
  background: var(--bg-surface);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-muted);
}

.empty-state h4 {
  font-size: 1.1rem;
  color: var(--text-primary);
  margin-bottom: 8px;
}

/* ==========================================================================
   彈出視窗 Modal (承襲官網 .meWelcomeBlock 圓角白底深陰影風格)
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 28, 21, 0.65);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.modal-backdrop.open {
  display: flex;
  opacity: 1;
}

.modal-dialog {
  background: #ffffff;
  width: 100%;
  max-width: 680px;
  max-height: 86vh;
  border-radius: 12px;
  box-shadow: 0px 12px 80px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  transform: translateY(12px);
  transition: transform 0.25s ease;
}

.modal-backdrop.open .modal-dialog {
  transform: translateY(0);
}

.modal-header {
  padding: 24px 28px 18px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

/* 承襲官網 #808a66 關閉按鈕色調 */
.modal-close-btn {
  background: #f3f6f4;
  border: none;
  color: #5b695d;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  font-size: 1.2rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: var(--transition);
}

.modal-close-btn:hover {
  background: var(--luye-green-primary);
  color: #fff;
}

.modal-body {
  padding: 24px 28px;
  overflow-y: auto;
  font-size: 0.98rem;
  color: var(--text-primary);
  line-height: 1.8;
}

.modal-body p {
  margin-bottom: 14px;
}

.modal-body ul {
  padding-left: 22px;
  margin-bottom: 16px;
}

.modal-info-box {
  background: var(--luye-green-tint);
  border-left: 4px solid var(--luye-green-primary);
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  margin-top: 16px;
  font-size: 0.9rem;
}

.modal-footer {
  padding: 16px 28px;
  background: var(--bg-page);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* ==========================================================================
   頁尾 Footer (完整還原綠吔官網 #ns_Footer 深綠底色與三欄結構)
   ========================================================================== */
.site-footer {
  background-color: var(--luye-green-dark);
  color: #ffffff;
  margin-top: auto;
  padding: 48px 0 32px;
  border-top: 4px solid var(--luye-green-muted);
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 40px;
  display: grid;
  grid-template-columns: 220px 1fr 280px;
  gap: 40px;
  align-items: start;
}

.footer-logo-col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.footer-logo-col img {
  max-width: 145px;
  height: auto;
}

.footer-info-col h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: #ffffff;
  padding-bottom: 16px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--luye-green-muted);
  letter-spacing: 1.5px;
}

.footer-contact-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 0.94rem;
}

.contact-row {
  display: flex;
  align-items: baseline;
  gap: 14px;
}

.contact-label {
  font-weight: 700;
  color: #ffffff;
  min-width: 52px;
  display: inline-block;
}

.contact-val {
  color: rgba(255, 255, 255, 0.9);
}

.contact-val a:hover {
  text-decoration: underline;
}

.footer-quick-links {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(63, 120, 99, 0.6);
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  font-size: 0.88rem;
}

.footer-quick-links a {
  color: #d1e5dc;
}

.footer-quick-links a:hover {
  color: #ffffff;
  text-decoration: underline;
}

.footer-right-col {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  height: 100%;
  text-align: right;
}

.footer-slogan-badge {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--luye-green-muted);
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  letter-spacing: 2px;
  color: #e2f1eb;
  margin-bottom: 16px;
}

.copyright-text {
  font-size: 0.82rem;
  color: var(--luye-green-light);
  line-height: 1.6;
}

/* 回到頂端懸浮按鈕 */
.back-to-top {
  position: fixed;
  right: 28px;
  bottom: 28px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background-color: var(--luye-green-primary);
  color: #ffffff;
  border: 2px solid #ffffff;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: var(--transition);
  z-index: 900;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background-color: var(--luye-spice-orange);
  transform: translateY(-3px);
}

/* ==========================================================================
   RWD 響應式斷點設計 (承襲官網 1200px / 800px / 768px / 600px 並優化行動端體驗)
   ========================================================================== */
@media (max-width: 1100px) {
  .board-layout {
    grid-template-columns: 1fr;
  }

  .handbook-layout {
    grid-template-columns: 1fr;
  }

  .toc-sidebar {
    position: static;
  }

  .toc-nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
  }

  .toc-link {
    width: auto;
    border: 1px solid var(--border-color);
    padding: 7px 14px;
  }

  .footer-inner {
    grid-template-columns: 180px 1fr;
  }

  .footer-right-col {
    grid-column: 1 / -1;
    align-items: center;
    text-align: center;
    border-top: 1px solid var(--luye-green-muted);
    padding-top: 24px;
  }
}

@media (max-width: 820px) {
  .header-inner {
    padding: 0 20px;
  }

  .current-date-pill {
    display: none;
  }

  .mobile-menu-btn {
    display: inline-flex;
  }

  .main-nav {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: #ffffff;
    flex-direction: column;
    padding: 16px 20px;
    border-bottom: 2px solid var(--luye-green-primary);
    box-shadow: var(--shadow-md);
    align-items: stretch;
  }

  .main-nav.open {
    display: flex;
  }

  .nav-tab {
    justify-content: flex-start;
    padding: 12px 16px;
  }

  .nav-tab.active::after {
    display: none;
  }

  .hero-inner {
    padding: 32px 20px;
  }

  .hero-title {
    font-size: 1.55rem;
  }

  .hero-stats {
    width: 100%;
    grid-template-columns: repeat(2, 1fr);
  }

  .ticker-inner {
    padding: 10px 20px;
  }

  .main-container {
    padding: 24px 20px 48px;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    text-align: center;
    padding: 0 24px;
    gap: 28px;
  }

  .footer-logo-col {
    align-items: center;
  }

  .contact-row {
    justify-content: center;
    flex-direction: column;
    align-items: center;
    gap: 2px;
  }

  .footer-quick-links {
    justify-content: center;
  }
}

@media (max-width: 600px) {
  .top-wave-banner {
    height: 32px;
  }

  .brand-name {
    font-size: 1.1rem;
  }

  .intranet-status span:not(.status-dot) {
    display: none;
  }

  .intranet-status {
    padding: 6px;
  }

  .toolbar-card {
    padding: 16px;
  }

  .search-box {
    max-width: 100%;
    width: 100%;
  }

  .announcement-card {
    padding: 18px;
  }

  .card-date {
    width: 100%;
    margin-left: 0;
    margin-top: 2px;
  }

  .handbook-header-banner {
    padding: 18px;
  }

  .chapter-header {
    padding: 14px 18px;
  }

  .chapter-body {
    padding: 16px;
  }

  .modal-header,
  .modal-body,
  .modal-footer {
    padding: 18px;
  }
}

/* 列印樣式支援 (方便員工列印員工守則或公告) */
@media print {
  .top-wave-banner,
  .site-header,
  .hero-section,
  .ticker-bar,
  .toolbar-card,
  .sidebar-stack,
  .toc-sidebar,
  .handbook-filter-bar,
  .hb-actions,
  .site-footer,
  .back-to-top {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }

  .main-container {
    padding: 0;
    max-width: 100%;
  }

  .handbook-layout,
  .board-layout {
    display: block;
  }

  .chapter-card {
    break-inside: avoid;
    margin-bottom: 20px;
    box-shadow: none;
    border: 1px solid #ccc;
  }

  .chapter-card.collapsed .chapter-body {
    display: flex !important;
  }
}
