/* ============================================================
   assets/css/style.css  — 前台主樣式
   設計風格：現代簡約 × 溫暖商務
   主色：深藍 #0f172a  輔助：琥珀 #f59e0b  底色：#f8f7f4
   字體：Sora（標題）/ Noto Sans TC（內文）
   ============================================================ */

/* ── Google Fonts ────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Source+Code+Pro:ital,wght@0,200..900;1,200..900&display=swap');

/* ── CSS 變數 ────────────────────────────────────────────── */
:root {
  --primary:       #0f172a;
  --primary-mid:   #1e293b;
  --accent:        #f59e0b;
  --accent-rgb:    245, 158, 11;
  --accent-dark:   #d97706;
  --accent-light:  #fef3c7;
  --success:       #10b981;
  --danger:        #ef4444;
  --warning:       #f59e0b;
  --info:          #3b82f6;

  --bg:            #f8f7f4;
  --surface:       #ffffff;
  --border:        #e2e8f0;
  --border-light:  #f1f5f9;

  --text-primary:  #0f172a;
  --text-secondary:#475569;
  --text-muted:    #94a3b8;
  --text-inverse:  #ffffff;

  --sidebar-w:     260px;
  --sidebar-collapsed: 0px;
  --topbar-h:      56px;

  --radius-sm:     6px;
  --radius:        12px;
  --radius-lg:     18px;
  --radius-xl:     24px;

  --shadow-sm:     0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow:        0 4px 16px rgba(0,0,0,.08);
  --shadow-lg:     0 10px 40px rgba(0,0,0,.12);
  --shadow-accent: 0 4px 20px rgba(245,158,11,.35);

  --transition:    .22s cubic-bezier(.4,0,.2,1);
  --font-title:    "Source Code Pro", 'Microsoft JhengHei', 'Segoe UI', sans-serif;
  --font-body:     "Source Code Pro", 'Microsoft JhengHei', 'Segoe UI', sans-serif;
}

/* ── Reset & Base ────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.65;
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font-family: inherit; }
ul, ol { list-style: none; }

/* ── Layout Shell ────────────────────────────────────────── */
.layout-wrapper {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--primary);
  color: var(--text-inverse);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  transition: width var(--transition), min-width var(--transition);
  z-index: 200;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.15) transparent;
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 99px; }

/* 收合狀態 */
.sidebar.collapsed {
  width: 0;
  min-width: 0;
  overflow: hidden;
}

/* 懸浮展開按鈕：預設隱藏，sidebar 收合後才顯示 */
#sidebarExpandFab {
  display: none;
  position: fixed;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  z-index: 400;
  width: 28px;
  height: 56px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 0 8px 8px 0;
  cursor: pointer;
  font-size: .85rem;
  align-items: center;
  justify-content: center;
  box-shadow: 2px 0 12px rgba(0,0,0,.25);
  transition: background .15s, width .15s;
}
#sidebarExpandFab:hover {
  background: #1d4ed8;
  width: 34px;
}
/* sidebar 收合時才顯示這顆按鈕 */
.sidebar.collapsed ~ #sidebarExpandFab,
body.sidebar-collapsed #sidebarExpandFab {
  display: flex;
}

/* Logo 區 */
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
}
.sidebar-logo .logo-icon {
  width: 36px; height: 36px;
  background: var(--accent);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.sidebar-logo .logo-text {
  font-family: var(--font-title);
  font-weight: 800;
  font-size: .95rem;
  line-height: 1.2;
  white-space: nowrap;
}
.sidebar-logo .logo-text small {
  display: block;
  font-size: .68rem;
  font-weight: 400;
  opacity: .55;
  margin-top: 1px;
}

.logo-img {
  width: 20px;
  height: 20px;
  display: block;
}
img.logo-img {
  width: 40px;
  height: 40px;	
}	
.logo-inline {
  /*display: flex;*/
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}
.logo-link {
  display: inline-flex;   /* 關鍵 */
  align-items: center;
  gap: 8px;

  font-family: var(--font-title);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--primary);
  text-decoration: none;
}

/* 使用者資訊 */
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  margin: 10px 12px;
  background: rgba(255,255,255,.06);
  border-radius: var(--radius);
  flex-shrink: 0;
}
.sidebar-user img {
  width: 36px; height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,.2);
  flex-shrink: 0;
}
.sidebar-user .user-info { overflow: hidden; }
.sidebar-user .user-name {
  font-size: .82rem; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-user .user-points {
  font-size: .72rem;
  color: var(--accent);
  font-weight: 500;
  margin-top: 1px;
}
.sidebar-login-btn {
  display: block;
  margin: 10px 12px;
  padding: 10px;
  text-align: center;
  background: var(--accent);
  color: var(--primary);
  border-radius: var(--radius);
  font-weight: 700;
  font-size: .82rem;
  transition: background var(--transition);
}
.sidebar-login-btn:hover { background: var(--accent-dark); }

/* 導航區 */
.sidebar-nav {
  flex: 1;
  padding: 8px 0;
  overflow-y: auto;
}
.nav-section-title {
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  opacity: .4;
  padding: 14px 20px 6px;
}
.nav-item {
  position: relative;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  font-size: .92rem;
  font-weight: 500;
  color: rgba(255,255,255,.7);
  border-radius: 0;
  transition: all var(--transition);
  cursor: pointer;
  white-space: nowrap;
}
.nav-link:hover,
.nav-link.active {
  color: #fff;
  background: rgba(255,255,255,.08);
}
.nav-link.active { border-left: 3px solid var(--accent); }
.nav-link .nav-icon {
  width: 20px; text-align: center; font-size: 1rem; flex-shrink: 0;
  opacity: .8;
}
.nav-link .nav-badge {
  margin-left: auto;
  background: var(--accent);
  color: var(--primary);
  font-size: .62rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 99px;
}
.nav-link .nav-arrow {
  margin-left: auto;
  font-size: .7rem;
  opacity: .5;
  transition: transform var(--transition);
}
.nav-item.open > .nav-link .nav-arrow { transform: rotate(90deg); }

/* 大類子選單 */
.nav-children {
  display: none;
  background: rgba(0,0,0,.18);
}
.nav-item.open > .nav-children { display: block; }
.nav-children .nav-link {
  padding-left: 36px;
  font-size: .82rem;
}
/* 小類子選單 */
.nav-sub-children {
  display: none;
  background: rgba(0,0,0,.15);
}
.nav-item.open > .nav-sub-children { display: block; }
.nav-sub-children .nav-link {
  padding-left: 52px;
  font-size: .78rem;
  color: rgba(255,255,255,.55);
}
.nav-sub-children .nav-link::before {
  content: '—';
  font-size: .65rem;
  opacity: .5;
}

/* 分隔線 */
.nav-divider {
  height: 1px;
  background: rgba(255,255,255,.07);
  margin: 8px 16px;
}

/* ── Topbar（手機版漢堡 + 搜尋） ─────────────────────────── */
.topbar {
  display: none;
  position: sticky;
  top: 0;
  z-index: 300;
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  box-shadow: var(--shadow-sm);
}
.topbar-toggle {
  background: none; border: none; cursor: pointer;
  width: 36px; height: 36px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 5px;
}
.topbar-toggle span {
  display: block; width: 22px; height: 2px;
  background: var(--primary); border-radius: 2px;
  transition: all var(--transition);
}
.topbar-logo {
  font-family: var(--font-title);
  font-weight: 800;
  font-size: 1rem;
  color: var(--primary);
}
.topbar-logo .accent { color: var(--accent); }
.topbar-search { flex: 1; }
.topbar-search form {
  display: flex;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 99px;
  overflow: hidden;
  height: 34px;
}
.topbar-search input {
  flex: 1; background: none; border: none; outline: none;
  padding: 0 14px; font-size: .82rem; color: var(--text-primary);
}
.topbar-search button {
  background: none; border: none; cursor: pointer;
  padding: 0 14px; color: var(--text-secondary); font-size: .85rem;
}

/* Sidebar 遮罩（手機版） */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 190;
  backdrop-filter: blur(2px);
}
.sidebar-overlay.active { display: block; }

/* ── 主內容區 ────────────────────────────────────────────── */
.main-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.page-container {
  flex: 1;
  padding: 28px 32px;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

/* ── 頁面標題區 ──────────────────────────────────────────── */
.page-hero {
  background: linear-gradient(135deg, var(--primary) 0%, #1e3a5f 100%);
  color: #fff;
  padding: 48px 32px;
  position: relative;
  overflow: hidden;
}
.page-hero::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.page-hero .hero-inner {
  position: relative; z-index: 1;
  max-width: 700px;
}
.page-hero h1 {
  font-family: var(--font-title);
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 10px;
}
.page-hero h1 .accent { color: var(--accent); }
.page-hero p {
  font-size: 1rem;
  opacity: .75;
  max-width: 700px;
}
.page-hero .hero-stats {
  display: flex; gap: 28px; margin-top: 24px; flex-wrap: wrap;
}
.hero-stat { text-align: center; }
.hero-stat .stat-num {
  font-family: var(--font-title);
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}
.hero-stat .stat-label {
  font-size: .72rem;
  opacity: .6;
  margin-top: 3px;
  letter-spacing: .05em;
}

/* ── Section 標題 ────────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 12px;
}
.section-title {
  font-family: var(--font-title);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex; align-items: center; gap: 8px;
}
.section-title .title-dot {
  width: 10px; height: 10px;
  background: var(--accent);
  border-radius: 50%;
  flex-shrink: 0;
}
.section-title .title-icon { color: var(--accent); font-size: 1.1rem; }
.section-link {
  font-size: .8rem;
  font-weight: 600;
  color: var(--accent-dark);
  display: flex; align-items: center; gap: 4px;
  transition: gap var(--transition);
}
.section-link:hover { gap: 8px; }

/* ── 訊息卡片 ────────────────────────────────────────────── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 18px;
  margin-bottom: 12px;
}
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition), box-shadow var(--transition);
  cursor: pointer;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
}
.card-cover {
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--bg);
}
.card-cover img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}
.card:hover .card-cover img { transform: scale(1.06); }
.card-cover .card-category {
  position: absolute; top: 8px; left: 8px;
  background: var(--accent);
  color: var(--primary);
  font-size: .62rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 99px;
  letter-spacing: .04em;
}
.card-cover .card-status {
  position: absolute; top: 8px; right: 8px;
  background: var(--success);
  color: #fff;
  font-size: .6rem;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 99px;
}
.card-body {
  padding: 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.card-title {
  font-family: var(--font-title);
  font-size: .88rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-excerpt {
  font-size: .76rem;
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-top: 1px solid var(--border-light);
  background: var(--bg);
}
.card-author {
  display: flex; align-items: center; gap: 6px;
}
.card-author img {
  width: 22px; height: 22px;
  border-radius: 50%; object-fit: cover;
}
.card-author span {
  font-size: .72rem;
  color: var(--text-secondary);
  font-weight: 500;
}
.card-meta {
  display: flex; align-items: center; gap: 8px;
}
.card-meta span {
  font-size: .68rem;
  color: var(--text-muted);
  display: flex; align-items: center; gap: 3px;
}
.card-meta .views { color: var(--accent-dark); font-weight: 600; }

/* 人氣排名 badge */
.rank-badge {
  position: absolute; top: 0; left: 0;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-title);
  font-size: .72rem; font-weight: 800;
  color: #fff;
  background: var(--primary);
  border-radius: 0 0 var(--radius-sm) 0;
}
.rank-badge.rank-1 { background: #f59e0b; color: var(--primary); }
.rank-badge.rank-2 { background: #94a3b8; }
.rank-badge.rank-3 { background: #cd7c2f; }

/* ── 無限滾動載入器 ──────────────────────────────────────── */
#infinite-loader {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 32px;
  gap: 10px;
  color: var(--text-muted);
  font-size: .85rem;
}
.spinner {
  width: 22px; height: 22px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
#infinite-end {
  text-align: center;
  padding: 32px;
  color: var(--text-muted);
  font-size: .8rem;
  display: none;
}
#infinite-end::before {
  content: '';
  display: block; width: 40px; height: 2px;
  background: var(--border);
  margin: 0 auto 12px;
}

/* ── 分類篩選列 ──────────────────────────────────────────── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 16px 20px;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}
.filter-label {
  font-size: .78rem;
  font-weight: 700;
  color: var(--text-secondary);
  white-space: nowrap;
}
.filter-tags {
  display: flex; flex-wrap: wrap; gap: 6px; flex: 1;
}
.filter-tag {
  padding: 5px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 99px;
  font-size: .76rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  color: var(--text-secondary);
  white-space: nowrap;
}
.filter-tag:hover,
.filter-tag.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--primary);
  font-weight: 700;
}

/* ── 搜尋列 ──────────────────────────────────────────────── */
.search-bar {
  display: flex;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 99px;
  overflow: hidden;
  transition: border-color var(--transition);
  margin-bottom: 28px;
  height: 50px;
}
.search-bar:focus-within { border-color: var(--accent); }
.search-bar input {
  flex: 1; border: none; outline: none;
  padding: 0 20px; font-size: .9rem;
  background: none; color: var(--text-primary);
}
.search-bar button {
  background: var(--accent); border: none; cursor: pointer;
  padding: 0 24px; color: var(--primary);
  font-weight: 700; font-size: .85rem;
  transition: background var(--transition);
  display: flex; align-items: center; gap: 6px;
}
.search-bar button:hover { background: var(--accent-dark); }

/* ── 訊息詳細頁 ──────────────────────────────────────────── */
.message-container {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  align-items: start;
}
.message-main {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.message-cover {
  width: 100%;
  max-height: 600px;
  object-fit: cover;
}
.message-body { padding: 28px 32px; }
.message-breadcrumb {
  display: flex; align-items: center; gap: 6px;
  font-size: .75rem; color: var(--text-muted);
  margin-bottom: 16px;
}
.message-breadcrumb a { color: var(--text-secondary); }
.message-breadcrumb a:hover { color: var(--accent-dark); }
.message-breadcrumb span { opacity: .4; }
.message-title {
  font-family: var(--font-title);
  font-size: 1.7rem;
  font-weight: 800;
  line-height: 1.3;
  color: var(--text-primary);
  margin-bottom: 16px;
}
.message-info-row {
  display: flex; flex-wrap: wrap; gap: 16px;
  align-items: center; margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-light);
}
.message-author {
  display: flex; align-items: center; gap: 8px;
}
.message-author img {
  width: 34px; height: 34px;
  border-radius: 50%; object-fit: cover;
  border: 2px solid var(--border);
}
.message-author .author-name {
  font-size: .85rem; font-weight: 600;
}
.message-author .author-time {
  font-size: .72rem; color: var(--text-muted); margin-top: 1px;
}
.message-stats {
  display: flex; gap: 16px; margin-left: auto; flex-wrap: wrap;
}
.message-stat {
  display: flex; align-items: center; gap: 5px;
  font-size: .78rem; color: var(--text-secondary);
}
.message-stat i { color: var(--accent); }
.message-content {
  font-size: .92rem;
  line-height: 1.9;
  color: var(--text-primary);
}
.message-content p { margin-bottom: 1em; }
.message-content h2,h3 { font-family: var(--font-title); margin: 1.5em 0 .5em; }

/* 聯絡資訊卡 */
.contact-card {
  margin-top: 28px; padding: 20px 24px;
  background: var(--accent-light);
  border: 1px solid #fde68a;
  border-radius: var(--radius);
  display: flex; align-items: center; gap: 14px;
}
.contact-card .contact-icon {
  font-size: 1.8rem; flex-shrink: 0;
}
.contact-card .contact-title {
  font-size: .75rem; color: var(--text-secondary); margin-bottom: 4px;
}
.contact-card .contact-info {
  font-size: .95rem; font-weight: 700; color: var(--text-primary);
  word-break: break-all;
}

/* 右側欄 */
.message-sidebar { display: flex; flex-direction: column; gap: 18px; }
.widget {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.widget-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-light);
  font-family: var(--font-title);
  font-size: .85rem;
  font-weight: 700;
  display: flex; align-items: center; gap: 7px;
}
.widget-header i { color: var(--accent); }
.widget-body { padding: 16px 18px; }

/* 停留時間進度條 */
.stay-tracker {
  padding: 18px;
  background: linear-gradient(135deg, var(--primary), #1e3a5f);
  color: #fff;
}
.stay-tracker .stay-label {
  font-size: .75rem; opacity: .7; margin-bottom: 8px;
}
.stay-tracker .stay-time {
  font-family: var(--font-title); font-size: 1.6rem; font-weight: 800;
  color: var(--accent); margin-bottom: 10px;
}
.stay-progress {
  height: 6px; background: rgba(255,255,255,.15);
  border-radius: 99px; overflow: hidden;
}
.stay-progress-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
  width: 0%;
  transition: width .5s ease;
}
.stay-valid-msg {
  font-size: .75rem; color: var(--success);
  margin-top: 8px; display: none;
}

/* 相關訊息列表 */
.related-list { display: flex; flex-direction: column; gap: 10px; }
.related-item {
  display: flex; gap: 10px; align-items: flex-start;
}
.related-item img {
  width: 56px; height: 44px;
  object-fit: cover; border-radius: var(--radius-sm);
  flex-shrink: 0;
}
.related-item .related-title {
  font-size: .78rem; font-weight: 600; line-height: 1.4;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color var(--transition);
}
.related-item:hover .related-title { color: var(--accent-dark); }
.related-item .related-meta {
  font-size: .68rem; color: var(--text-muted); margin-top: 3px;
}

/* ── Flash 訊息 ──────────────────────────────────────────── */
.flash-container {
  position: fixed; top: 16px; right: 16px; z-index: 9999;
  display: flex; flex-direction: column; gap: 8px;
  max-width: 360px;
}
.flash-message {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  font-size: .85rem; font-weight: 500;
  animation: slideInRight .3s ease;
  background: var(--surface);
  border-left: 4px solid var(--border);
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}
.flash-success { border-left-color: var(--success); }
.flash-error   { border-left-color: var(--danger); }
.flash-warning { border-left-color: var(--warning); }
.flash-info    { border-left-color: var(--info); }
.flash-icon    { font-size: 1rem; flex-shrink: 0; }
.flash-text    { flex: 1; }
.flash-close {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: .9rem; padding: 2px;
}

/* ── 空狀態 ──────────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 3.5rem; margin-bottom: 16px; opacity: .4; }
.empty-state h3 {
  font-family: var(--font-title); font-size: 1.1rem;
  color: var(--text-secondary); margin-bottom: 6px;
}
.empty-state p { font-size: .85rem; }

/* ── 按鈕 ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 20px; border-radius: var(--radius);
  font-size: .85rem; font-weight: 600;
  cursor: pointer; border: none;
  transition: all var(--transition);
  white-space: nowrap; text-align: center;
}
.btn-primary {
  background: var(--accent); color: var(--primary);
  box-shadow: var(--shadow-accent);
}
.btn-primary:hover { background: var(--accent-dark); transform: translateY(-1px); }
.btn-outline {
  background: transparent; color: var(--text-primary);
  border: 1.5px solid var(--border);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent-dark); }
.btn-sm { padding: 6px 14px; font-size: .78rem; }
.btn-lg { padding: 12px 28px; font-size: .95rem; }

/* ── Footer ──────────────────────────────────────────────── */
.site-footer {
  background: var(--primary);
  color: rgba(255,255,255,.55);
  padding: 24px 32px;
  font-size: .78rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  margin-top: auto;
}
.site-footer a { color: rgba(255,255,255,.55); transition: color var(--transition); }
.site-footer a:hover { color: var(--accent); }
.site-footer .footer-links { display: flex; gap: 16px; }

/* ── Skeleton Loading ────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skeleton-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
}
.skeleton-cover { aspect-ratio: 16/9; }
.skeleton-body { padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.skeleton-line { height: 12px; }
.skeleton-line.w-80 { width: 80%; }
.skeleton-line.w-60 { width: 60%; }

/* ── RWD ─────────────────────────────────────────────────── */
@media (max-width: 1280px) {
  .cards-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 1024px) {
  .cards-grid { grid-template-columns: repeat(3, 1fr); }
  .page-container { padding: 24px 24px; }
  .message-container { grid-template-columns: 1fr; }
  .message-sidebar { display: grid; grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .sidebar { position: fixed; left: -100%; top: 0; height: 100vh; transition: left var(--transition); }
  .sidebar.mobile-open { left: 0; }
  .topbar { display: flex; }
  .main-content { margin-top: 0; }
  .cards-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .page-container { padding: 16px; }
  .page-hero { padding: 32px 16px; }
  .page-hero h1 { font-size: 1.6rem; }
  .message-container { grid-template-columns: 1fr; }
  .message-sidebar { display: flex; flex-direction: column; }
  .message-body { padding: 20px; }
  .message-title { font-size: 1.3rem; }
}
@media (max-width: 480px) {
  .cards-grid { grid-template-columns: 1fr; }
  .filter-bar { padding: 12px; }
  .site-footer { flex-direction: column; text-align: center; }
}

/* ── 列表頁特定 ──────────────────────────────────────────── */
.list-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; flex-wrap: wrap; gap: 12px;
}
.list-breadcrumb {
  display: flex; align-items: center; gap: 6px;
  font-size: .78rem; color: var(--text-muted);
}
.list-breadcrumb a { color: var(--text-secondary); transition: color var(--transition); }
.list-breadcrumb a:hover { color: var(--accent-dark); }
.list-count {
  font-size: .82rem; color: var(--text-secondary);
}
.list-count strong { color: var(--text-primary); font-weight: 700; }

/* 排序選單 */
.sort-select {
  padding: 7px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .8rem;
  font-family: var(--font-body);
  color: var(--text-primary);
  cursor: pointer;
  outline: none;
  transition: border-color var(--transition);
}
.sort-select:focus { border-color: var(--accent); }

/* 卡片進入動畫 */
.card {
  animation: fadeUp .35s ease both;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.card:nth-child(2)  { animation-delay: .04s; }
.card:nth-child(3)  { animation-delay: .08s; }
.card:nth-child(4)  { animation-delay: .12s; }
.card:nth-child(5)  { animation-delay: .16s; }
.card:nth-child(6)  { animation-delay: .20s; }
.card:nth-child(7)  { animation-delay: .24s; }
.card:nth-child(8)  { animation-delay: .28s; }
.card:nth-child(9)  { animation-delay: .32s; }
.card:nth-child(10) { animation-delay: .36s; }

/* ── 分頁元件 ────────────────────────────────────────────────── */
.pagination {
  display: flex;
  justify-content: center;
  padding: 20px 0 8px;
}
.pagination ul {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}
.pagination li a,
.pagination li.ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: .82rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--text-primary);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: background .15s, border-color .15s, color .15s;
  white-space: nowrap;
}
.pagination li a:hover {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent-dark);
}
.pagination li.active a {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 700;
  cursor: default;
  pointer-events: none;
}
.pagination li.ellipsis {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: .9rem;
  min-width: 24px;
  padding: 0 2px;
}
/* ─────────────────────────────────────────────────────────────── */
/* ── login元件 ────────────────────────────────────────────────── */
.form-label { display:block; font-size:.92rem; font-weight:600; color:var(--text-primary); margin-bottom:6px; }
.form-input { width:100%; padding:10px 40px 10px 14px; border:1.5px solid var(--border); border-radius:var(--radius); font-size:.92rem; font-family:var(--font-body); color:var(--text-primary); background:var(--bg); outline:none; transition:border-color var(--transition),box-shadow var(--transition); }
.form-input:focus { border-color:var(--accent); box-shadow:0 0 0 3px rgba(245,158,11,.15); background:var(--surface); }
.form-input.is-error { border-color:var(--danger); }
.form-hint { display:block; font-size:.72rem; color:var(--text-muted); margin-top:4px; }
.form-hint.error { color:var(--danger); }
.pwd-toggle { position:absolute; right:12px; top:50%; transform:translateY(-50%); background:none; border:none; cursor:pointer; color:var(--text-muted); font-size:.9rem; }
/* ── 忘記密碼元件 ────────────────────────────────────────────────── */
.form-label { display:block; font-size:.92rem; font-weight:600; color:var(--text-primary); margin-bottom:6px; }
.form-input { width:100%; padding:10px 14px; border:1.5px solid var(--border); border-radius:var(--radius); font-size:.92rem; font-family:var(--font-body); color:var(--text-primary); background:var(--bg); outline:none; transition:border-color var(--transition),box-shadow var(--transition); }
.form-input:focus { border-color:var(--accent); box-shadow:0 0 0 3px rgba(245,158,11,.15); background:var(--surface); }
.form-input.is-error { border-color:var(--danger); }
.form-hint { display:block; font-size:.72rem; color:var(--text-muted); margin-top:4px; }
.form-hint.error { color:var(--danger); }
/* ── 註冊元件 ────────────────────────────────────────────────── */
.form-label {
  display: block;
  font-size: .92rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.form-input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: .92rem;
  font-family: var(--font-body);
  color: var(--text-primary);
  background: var(--bg);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(245,158,11,.15);
  background: var(--surface);
}
.form-input.is-error { border-color: var(--danger); }
.form-input.is-error:focus { box-shadow: 0 0 0 3px rgba(239,68,68,.15); }
.form-hint { display: block; font-size: .72rem; color: var(--text-muted); margin-top: 4px; }
.form-hint.error { color: var(--danger); }
.pwd-toggle {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: .9rem;
}
.form-input { padding-right: 40px; }
.pwd-strength {
  height: 4px; background: var(--border);
  border-radius: 99px; overflow: hidden; margin-top: 6px;
}
.pwd-strength-bar {
  height: 100%; width: 0%;
  border-radius: 99px;
  transition: width .3s ease, background .3s ease;
}
/* ── resend_verify元件 ────────────────────────────────────────────────── */
.form-input { width:100%; padding:10px 14px; border:1.5px solid var(--border); border-radius:var(--radius); font-size:.92rem; font-family:var(--font-body); color:var(--text-primary); background:var(--bg); outline:none; transition:border-color .2s; box-sizing:border-box; }
.form-input:focus { border-color:var(--accent); box-shadow:0 0 0 3px rgba(245,158,11,.15); }
.form-input.is-error { border-color:var(--danger); }

/* ── support/article.php — 支援文章閱讀頁 ────────────────────────────────────────────────── */
/* 文章內容樣式 */
.ql-editor {
    white-space: normal !important;
}
.support-content.ql-editor {
  font-family: var(--font-body);
  font-size: 1.15rem;
  line-height: 1.9;
  color: var(--text-primary);
}
.support-content.ql-editor h1 { font-size:1.55rem;font-weight:800;margin:20px 0 10px;color:var(--text-primary); }
.support-content.ql-editor h2 { font-size:1.35rem;font-weight:800;margin:18px 0 8px;color:var(--text-primary);border-bottom:4px solid var(--accent);padding-bottom:0px; }
.support-content.ql-editor h3 {
    font-size: 1.15rem;
    font-weight: 800;
    margin: 14px 0 6px;
    color: var(--text-primary);
    border-left: 4px solid var(--accent);
	/*background: rgba(var(--accent-rgb), 0.1);
	background: linear-gradient(90deg, var(--accent), #FFFFFF);*/
	background: linear-gradient(
    90deg,
    #FFDC94 0%,
    #FFFFFF 30%,
    #FFFFFF 30%,
    #FFFFFF 100%
	);
	border-radius: 6px;
    padding-left: 10px;
}
.support-content.ql-editor p  { margin:0 0 12px; }
.support-content.ql-editor ul,
.support-content.ql-editor ol { padding-left:24px;margin:8px 0 14px; }
.support-content.ql-editor li { margin-bottom:6px;line-height:1.7; }
.support-content.ql-editor blockquote {
  border-left:4px solid var(--accent);padding:10px 16px;
  background:rgba(245,158,11,.06);border-radius:0 var(--radius) var(--radius) 0;
  margin:12px 0;color:var(--text-secondary);font-size:.92rem;
}
.support-content.ql-editor table {
  width:100%;border-collapse:collapse;margin:12px 0;font-size:.88rem;
}
.support-content.ql-editor th {
  background:var(--bg);padding:9px 12px;text-align:left;font-weight:700;
  border:1px solid var(--border);color:var(--text-primary);
}
.support-content.ql-editor td {
  padding:8px 12px;border:1px solid var(--border);color:var(--text-secondary);
}
.support-content.ql-editor tr:nth-child(even) td { background:var(--bg); }
.support-content.ql-editor a { color:var(--accent-dark);text-decoration:underline; }
.support-content.ql-editor img { max-width:100%;border-radius:var(--radius);margin:6px 0; }
.support-content.ql-editor .ql-video { width:100%;aspect-ratio:16/9;border-radius:var(--radius);margin:10px 0;display:block; }
.support-content.ql-editor pre.ql-syntax {
  background:var(--bg);border:1px solid var(--border);border-radius:var(--radius);
  padding:14px 16px;font-size:.85rem;overflow-x:auto;line-height:1.6;
}
@media(max-width:680px){ .art-grid{ grid-template-columns:1fr !important; } }
@media(max-width:680px){ .sup-grid{ grid-template-columns:1fr !important; } }
/* ─────────────────────────────────────────────────────────────── */