/* sitenav.css — 全站統一導覽列（2026-11-10）
 *
 * 為什麼
 *   站上原本有三套互不相通的導覽（subnav / reader-bar / 無），
 *   使用者喺任何一頁都無法跳去其他層。這一層補一個「永遠可見、每頁相同」的
 *   主導覽，並在手機上自動變成可橫向滑動的 chips。
 *
 * 設計原則
 *   1. 完全不依賴各頁的 CSS 變數（因為有些頁是深色主題、有些是淺色）
 *   2. 只用 .sn- 前綴，避免與既有 class 衝突
 *   3. 加在 <body> 之後第一個元素，sticky 在最頂
 *   4. 現有頁面的 subnav / reader-bar 保持不動（它們帶頁面專屬連結）
 */

.sn {
  position: sticky;
  top: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 7px 10px;
  background: rgba(255, 255, 255, .96);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #e4e8f0;
  box-shadow: 0 1px 6px rgba(15, 76, 129, .06);
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Microsoft YaHei", Roboto, Helvetica, Arial, sans-serif;
  box-sizing: border-box;
}

.sn::-webkit-scrollbar { height: 4px; }
.sn::-webkit-scrollbar-thumb { background: #c8d2e0; border-radius: 2px; }

.sn a {
  flex: 0 0 auto;
  display: inline-block;
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  color: #324a6d;
  background: #f3f6fb;
  border: 1px solid #e0e7f1;
  text-decoration: none;
  white-space: nowrap;
  transition: background .15s, color .15s, border-color .15s;
}

.sn a:hover {
  background: #e7eefb;
  border-color: #c9d8ec;
  color: #0f4c81;
  text-decoration: none;
}

.sn a.sn-on {
  background: #0f4c81;
  border-color: #0f4c81;
  color: #fff;
}

.sn a.sn-home {
  background: #fff4ee;
  border-color: #f8d8c8;
  color: #c44536;
}

.sn a.sn-home.sn-on {
  background: #c44536;
  border-color: #c44536;
  color: #fff;
}

.sn-sep {
  flex: 0 0 auto;
  width: 1px;
  height: 20px;
  background: #e0e7f1;
  margin: 0 3px;
}

/* 手機：字縮小一點，內距收窄 */
@media (max-width: 480px) {
  .sn { padding: 6px 8px; gap: 3px; }
  .sn a { font-size: 12px; padding: 5px 9px; }
}

/* 列印時隱藏 */
@media print {
  .sn { display: none !important; }
}
