/* ============================================================
   前台設計系統 —— 仿 SMU Library 視覺（白底 / 深藍主色 / 橙強調）
   配色變量由 inc/header.php 從 config.php 注入（--primary/--accent/--gold）
   ============================================================ */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Source Sans 3", "Source Sans Pro", "Noto Sans HK", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "PingFang HK", "Microsoft JhengHei", sans-serif;
  color: #1c2733;
  background: #fff;
  line-height: 1.65;
  font-size: 16px;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
.container { width: min(1200px, 92vw); margin: 0 auto; }

/* ---------- 頂部工具條 ---------- */
.topbar { background: var(--primary); color: #fff; font-size: 14px; }
.topbar-inner { display: flex; align-items: center; gap: 16px; padding: 10px 0; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 8px;
  background: var(--accent); color: var(--primary);
  display: grid; place-items: center; font-weight: 800; letter-spacing: .5px;
}
.brand-name { font-size: 17px; }
.brand-logo { height: 32px; width: auto; max-width: 220px; object-fit: contain; background:#fff; padding:5px 9px; border-radius:8px; }
.footer-logo { height: 40px; width: auto; margin-bottom: 12px; background:#fff; padding:6px 10px; border-radius:8px; }
.topbar-search { margin-left: auto; display: flex; }
.topbar-search input {
  border: 0; border-radius: 20px 0 0 20px; padding: 7px 14px; width: 220px; outline: none;
}
.topbar-search button {
  border: 0; background: var(--accent); color: var(--primary);
  border-radius: 0 20px 20px 0; padding: 0 14px; cursor: pointer; font-size: 16px;
}
.topbar-right { display: flex; align-items: center; gap: 14px; }
.lang-toggle { color: #fff; border: 1px solid rgba(255,255,255,.5); padding: 5px 12px; border-radius: 20px; }
.lang-toggle:hover { background: rgba(255,255,255,.12); text-decoration: none; }

/* ---------- 主導航 ---------- */
.navbar { background: #fff; border-bottom: 1px solid #eef1f5; position: sticky; top: 0; z-index: 50; }
.nav-inner { display: flex; align-items: center; min-height: 60px; }
.nav-menu { list-style: none; display: flex; gap: 6px; margin: 0; padding: 0; margin-left: auto; }
.nav-menu li a {
  display: block; padding: 10px 16px; color: #2a3642; font-weight: 600; border-radius: 8px;
}
.nav-menu li a:hover { background: #f3f6fa; text-decoration: none; color: var(--primary); }
.nav-menu li.active a { color: var(--primary); background: #eef4fb; }
.nav-toggle { display: none; background: none; border: 0; font-size: 22px; cursor: pointer; color: var(--primary); margin-left: auto; }

/* ---------- 通用區塊 ---------- */
.section { padding: 56px 0; }
.section.alt { background: #f6f8fb; }
.section-head { margin-bottom: 28px; }
.section-head h2 { font-size: 28px; margin: 0 0 6px; color: var(--primary); }
.section-head p { margin: 0; color: #5b6776; }
.eyebrow { color: var(--accent); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; font-size: 13px; }

/* ---------- 按鈕 ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px; border-radius: 10px; font-weight: 700; cursor: pointer;
  border: 2px solid transparent; transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn-primary { background: var(--accent); color: var(--primary); }
.btn-primary:hover { box-shadow: 0 8px 20px rgba(0,160,223,.35); }
.btn-outline { background: transparent; color: #fff; border-color: rgba(255,255,255,.7); }
.btn-outline:hover { background: rgba(255,255,255,.12); }
.btn-ghost { background: var(--primary); color: #fff; }
.btn-ghost:hover { box-shadow: 0 8px 20px rgba(0,43,73,.3); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  background: linear-gradient(135deg, var(--primary) 0%, #063a5e 60%, var(--accent) 160%);
  color: #fff; padding: 72px 0;
}
.hero.hero-image {
  background: var(--hero-image) center/cover no-repeat var(--primary);
  padding: 110px 0 96px;
}
.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(0,43,73,.92) 0%, rgba(0,43,73,.72) 50%, rgba(0,43,73,.35) 100%);
}
.hero-content { position: relative; z-index: 1; }
.hero h1 { font-size: clamp(30px, 5vw, 48px); margin: 0 0 14px; line-height: 1.15; max-width: 720px; }
.hero p { font-size: 18px; max-width: 640px; color: rgba(255,255,255,.85); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 26px; }
.hero-stats { display: flex; gap: 36px; margin-top: 40px; flex-wrap: wrap; }
.hero-stats div span { display: block; font-size: 30px; font-weight: 800; color: #fff; }
.hero-stats div small { color: rgba(255,255,255,.7); }

/* ---------- 卡片網格 ---------- */
.grid { display: grid; gap: 22px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.card {
  background: #fff; border: 1px solid #eef1f5; border-radius: 14px; overflow: hidden;
  box-shadow: 0 4px 14px rgba(20,40,70,.06); transition: transform .18s ease, box-shadow .18s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 14px 30px rgba(20,40,70,.12); }
.card .thumb { aspect-ratio: 16/9; background: linear-gradient(135deg, var(--primary), var(--accent)); display: grid; place-items: center; color: #fff; font-size: 28px; font-weight: 800; overflow: hidden; }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card .body { padding: 18px 20px 22px; }
.card .body h3 { margin: 0 0 8px; font-size: 19px; color: var(--primary); }
.card .body p { margin: 0 0 12px; color: #5b6776; font-size: 15px; }
.card .tag { display: inline-block; font-size: 12px; color: var(--accent); background: #eaf6fd; padding: 3px 10px; border-radius: 20px; margin-bottom: 10px; font-weight: 700; }
.card .more { font-weight: 700; color: var(--primary); }

/* ---------- 三欄快捷入口（仿 SMU Get It For Me 等） ---------- */
.quick-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 8px; }
.quick {
  display: flex; flex-direction: column; gap: 8px; padding: 24px;
  background: #fff; border: 1px solid #eef1f5; border-left: 4px solid var(--accent);
  border-radius: 12px; box-shadow: 0 4px 14px rgba(20,40,70,.05); transition: transform .15s ease;
}
.quick:hover { transform: translateY(-3px); text-decoration: none; }
.quick h3 { margin: 0; color: var(--primary); font-size: 18px; }
.quick p { margin: 0; color: #5b6776; font-size: 14px; }
.quick .arrow { color: var(--accent); font-weight: 800; }

/* ---------- 子頁 Banner ---------- */
.banner { background: var(--primary); color: #fff; padding: 48px 0; }
.banner h1 { margin: 0; font-size: 34px; }
.banner p { margin: 8px 0 0; color: rgba(255,255,255,.8); }

/* ---------- 表單 ---------- */
.form-grid { display: grid; gap: 16px; max-width: 640px; }
.field label { display: block; font-weight: 600; margin-bottom: 6px; }
.field input, .field textarea, .field select {
  width: 100%; padding: 11px 14px; border: 1px solid #cfd8e3; border-radius: 10px; font: inherit; outline: none;
}
.field input:focus, .field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0,160,223,.15); }
.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; }
.alert-ok { background: #e8f7ee; color: #1c7a45; border: 1px solid #bfe9cf; }
.alert-err { background: #fdecec; color: #b42318; border: 1px solid #f6c9c9; }
.muted { color: #5b6776; }

/* ---------- 文章詳情 ---------- */
.article { max-width: 820px; margin: 0 auto; }
.article h1 { color: var(--primary); }
.article .meta { color: #8a95a3; font-size: 14px; margin-bottom: 20px; }
.article p { margin: 0 0 16px; }

/* ---------- 頁腳 ---------- */
.site-footer { background: var(--primary); color: #cdd6e0; margin-top: 60px; padding-top: 44px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 28px; padding-bottom: 32px; }
.footer-col h4 { color: #fff; margin: 0 0 14px; font-size: 15px; }
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: 8px; }
.footer-col a { color: #cdd6e0; }
.footer-col a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); padding: 16px 0; font-size: 13px; color: #9fb0c2; }

/* ---------- 響應式 ---------- */
@media (max-width: 900px) {
  .grid-3, .quick-grid { grid-template-columns: 1fr 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .topbar-search input { width: 130px; }
  .nav-toggle { display: block; }
  .nav-menu { display: none; position: absolute; left: 0; right: 0; top: 100%; background: #fff; flex-direction: column; padding: 10px; box-shadow: 0 10px 24px rgba(0,0,0,.12); }
  .nav-menu.open { display: flex; }
  .grid-3, .quick-grid, .footer-grid { grid-template-columns: 1fr; }
}
