/* 頁首與頁尾使用同一內容寬度，窄畫面讓導覽自然換列。 */
.shared-header,.shared-footer{box-sizing:border-box;font-family:"Noto Sans TC","Microsoft JhengHei",sans-serif}
/* 頁首保留在正常版面中，捲動時貼齊視窗頂端；較高層級讓下拉選單蓋在內容上方。 */
.shared-header{position:sticky;top:0;z-index:100;background:#fffdf8;color:#171512;border-bottom:1px solid #e8dcc6}
/* 頁內連結捲動時避開固定可見的頁首，避免目標標題被遮住。 */
html{scroll-padding-top:80px}
.shared-chrome-inner{width:min(1200px,calc(100% - 48px));margin-inline:auto;display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px 24px;padding-block:12px}
.shared-chrome-inner .shared-brand{font-family:"Noto Serif TC","Microsoft JhengHei",serif;font-size:24px;font-weight:700;line-height:1.3;text-decoration:none;color:inherit}
/* 全站頁首共用擺渡原始標誌；以裝飾圖呈現，保留品牌文字作為連結名稱。 */
.shared-header .shared-brand{display:inline-flex;align-items:center;gap:9px;white-space:nowrap}
.shared-header .shared-brand::before{content:"";display:block;flex:none;width:52px;height:36px;background:center/contain no-repeat url("tsquare-logo.png")}
.shared-nav,.shared-footer-meta{display:flex;flex-wrap:wrap;align-items:center;gap:0 16px}
.shared-nav a{display:inline-flex;min-height:44px;align-items:center;color:inherit;text-decoration:none;font-size:14px}
.shared-nav a:hover,.shared-nav a[aria-current]{text-decoration:underline;text-underline-offset:6px}
.shared-nav a[aria-current]{color:#8a5f14;font-weight:700}
/* 桌面選單浮在內容上方，窄螢幕則使用整列導覽寬度。 */
.shared-nav-group{position:relative}
.shared-nav-group summary{
  display:flex;align-items:center;gap:6px;min-height:44px;
  font-size:14px;list-style:none;cursor:pointer;
}
.shared-nav-group summary::-webkit-details-marker{display:none}
.shared-nav-group summary::after{
  content:"";width:6px;height:6px;border:solid currentColor;border-width:0 1px 1px 0;
  transform:translateY(-2px) rotate(45deg);
}
.shared-nav-group[open] summary::after{transform:translateY(2px) rotate(225deg)}
.shared-nav-group summary.is-current{color:#8a5f14;font-weight:700;text-decoration:underline;text-underline-offset:6px}
.shared-nav-group summary:focus-visible{outline:2px solid #b68420;outline-offset:3px}
.shared-nav-dropdown{
  position:absolute;z-index:30;inset-inline-end:0;top:100%;
  width:280px;box-sizing:border-box;margin:0;padding:6px;list-style:none;
  background:#fffdf8;border:1px solid #e8dcc6;border-radius:10px;
  box-shadow:0 8px 20px rgb(23 21 18 / 12%);
}
.shared-nav-dropdown a{display:flex;padding:6px 12px;line-height:1.5;border-radius:6px;box-sizing:border-box}
.shared-nav-dropdown a:hover,.shared-nav-dropdown a:focus-visible{background:#f7f2e8}
.shared-header a:focus-visible,.shared-footer a:focus-visible{outline:2px solid #b68420;outline-offset:3px}
.shared-footer{margin-top:auto;background:#171512;color:#d9d3c7;font-size:14px}
.shared-footer .shared-chrome-inner{padding-block:28px}
.shared-footer .shared-brand{color:#fffdf8;font-size:18px}
.shared-footer a{color:inherit}
@media(max-width:760px){
  html{scroll-padding-top:140px}
  .shared-chrome-inner{width:calc(100% - 32px)}
  .shared-header .shared-brand{gap:7px}
  .shared-header .shared-brand::before{width:43px;height:30px}
  .shared-nav{width:100%;gap:0 12px}
  .shared-nav{position:relative}
  .shared-nav-group{position:static}
  .shared-nav-dropdown{inset-inline:0;top:100%;width:100%}
}

/* 固定在視窗右下角，為觸控與鍵盤操作保留足夠空間。 */
a.site-back-to-top {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 20;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: #a86b08;
  color: #fff;
  text-decoration: none;
}
a.site-back-to-top[hidden] { display: none; }
a.site-back-to-top:hover { background: #8a5f14; }
/* 以粗線與圓角呈現參考圖的上箭頭。 */
a.site-back-to-top span { display: none; }
a.site-back-to-top::before {
  content: "";
  width: 24px;
  height: 24px;
  background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 20V5m-7 7 7-7 7 7'/%3E%3C/svg%3E");
}
@media (forced-colors: active) {
  a.site-back-to-top span { display: inline; }
  a.site-back-to-top::before { display: none; }
}
a.site-back-to-top:focus-visible { outline: 2px solid #171512; outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) {
  html:has(#site-top:target) { scroll-behavior: auto; }
}

/* 全站頁尾共用版型；清除各頁舊頁尾的外層留白與邊框。 */
.home-footer {
  padding: 0;
  border: 0;
  background: #171512;
  color: #d9d3c7;
  font-size: 1rem;
  line-height: 1.7;
}
.home-footer-grid, .home-footer-copyright p {
  width: min(1200px, calc(100% - 48px));
  margin-inline: auto;
}
.home-footer-grid {
  display: grid;
  grid-template-columns: 1.35fr repeat(3, 1fr);
  gap: 28px;
  padding-block: 44px 36px;
}
.home-footer a { text-underline-offset: .2em; }
.home-footer a.home-footer-brand {
  display: inline-block;
  margin-bottom: 12px;
  color: #fffdf8;
  font: 700 2rem/1.3 "Noto Serif TC", serif;
  text-decoration: none;
}
.home-footer h2 {
  margin: 0 0 12px;
  color: #d5a53b;
  font-family: var(--font-body, "Noto Sans TC", "Microsoft JhengHei", sans-serif);
  font-size: 1rem;
  line-height: 1.5;
}
.home-footer p { margin-block: 0 4px; }
.home-footer address { display: grid; gap: 4px; font-style: normal; }
.home-footer ul { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.home-footer-copyright {
  border-top: 1px solid #ffffff24;
  padding-block: 20px;
  padding-right: 64px;
  font-size: .875rem;
}
.home-footer-copyright p { margin-block: 0; }
@media (max-width: 760px) {
  .home-footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
  .home-footer-grid { grid-template-columns: 1fr; }
}

.home-footer nav a, .home-footer address a { text-decoration: none; }
.home-footer address a:hover { color: #d5a53b; }
.home-footer ul.home-footer-social { display: flex; flex-wrap: wrap; gap: 12px; }
.home-footer-social span { display: grid; place-items: center; width: 34px; height: 34px; color: #d5a53b; }
.home-footer-social svg { width: 24px; height: 24px; }

/* 外部流程尚未接通時，保留按鈕版位並顯示可用的洽詢入口。 */
.journey-note {
  margin: 0 0 12px;
  color: #514a3e;
  font-size: .9375rem;
  line-height: 1.65;
}
.journey-note a { color: #704b0e; text-underline-offset: .2em; }
/* 尚未啟用的導覽和交易按鈕，以一致的停用外觀呈現。 */
.shared-nav a[aria-disabled="true"] { color: #6f6a62; cursor: default; text-decoration: none; }
.journey-note + button:disabled,
button[aria-describedby="card-order-status"]:disabled,
#needs-form button[type="submit"]:disabled {
  background: #f1ece3;
  border: 1px solid #d7cbb6;
  color: #62584a;
  opacity: 1;
  cursor: not-allowed;
}

.journey-table-hint { display: none; }
.journey-table-scroll:focus-visible { outline: 2px solid #8a5f14; outline-offset: -3px; }

/* 窄螢幕橫滑時固定首欄，保留比較項目或課程名稱。 */
@media (max-width: 1024px) {
  .journey-table-hint { display: block; margin: 0 0 8px; font-size: .875rem; }
  .journey-table-scroll tr > :first-child {
    position: sticky;
    inset-inline-start: 0;
    z-index: 1;
    box-shadow: 1px 0 #e8dcc6;
  }
  .journey-table-scroll thead th:first-child { background: #f4ebda; }
  .journey-table-scroll tbody tr > :first-child { background: #fffdf8; }
  .journey-schedule-scroll thead th:first-child { background: #171512; }
  .journey-schedule-scroll tr > :first-child {
    min-width: 9rem;
    width: 9rem !important;
    max-width: 11rem;
  }
}

/* 共用會員入口。正式網址提供前，先保留按鈕位置。 */
.shared-nav .shared-member-login {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: #C95018;
  color: #fff;
  font: 700 14px/1.3 "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  white-space: nowrap;
}
.shared-nav .shared-member-login:disabled { opacity: 1; }
