/* ══════════════════════════════════════════════════
   BASE.CSS — 全站共用：變數、Reset、字體、按鈕、
              導覽列、頁尾、Modal、RWD
   ══════════════════════════════════════════════════ */

/* ── 設計變數 ── */
:root {
  --paper:      #fffdfd;
  --blush-50:   #fdf5f7;
  --blush-100:  #f9e9ee;
  --blush-200:  #f3d8e0;
  --blush-300:  #ecc3cf;
  --rose-300:   #e3a9b9;
  --rose-400:   #d98fa3;
  --rose-500:   #cf7991;
  --rose-600:   #bd6480;
  --rose-700:   #a44e6a;
  --rose-900:   #7c3a50;
  --ink:        #43343a;
  --ink-soft:   #8a777e;
  --rule:       #efdde3;
  --cream:      #fdfaf6;
  --gold:       #c4a574;
  --sidebar-w:  260px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 20px); }
body {
  font-family: 'Noto Sans TC', sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img {
  max-width: 100%;
  display: block;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  pointer-events: none;
}
image-slot {
  display: block;
  width: 100%; height: 100%;
  min-height: 100%;
  contain: layout paint;
  background: linear-gradient(135deg, var(--blush-100), var(--cream));
}

/* ══ 側邊欄 ══ */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: #fff;
  border-right: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  z-index: 200;
  overflow-y: auto;
  scrollbar-width: none;
}
.sidebar::-webkit-scrollbar { display: none; }

.main-content {
  margin-left: var(--sidebar-w);
  overflow-x: hidden;
  min-width: 0;
}

/* 品牌 Header */
.sidebar-header {
  padding: 32px 24px 26px;
  border-bottom: 1px solid var(--rule);
  flex-shrink: 0;
}
.brand {
  display: flex; align-items: center; gap: 12px;
  text-decoration: none; color: var(--ink);
}
.brand-mark {
  width: 44px; height: 44px;
  flex-shrink: 0;
  background: linear-gradient(145deg, var(--rose-400), var(--rose-600));
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Noto Serif TC', serif;
  font-weight: 600;
  font-size: 20px;
  box-shadow: 0 6px 18px -8px var(--rose-500);
}
.brand-name {
  font-family: 'Noto Serif TC', serif;
  font-size: clamp(14px, 1.8vw, 18px);
  font-weight: 600;
  letter-spacing: 0.14em;
  line-height: 1.2;
}
.brand-sub {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: clamp(9px, 1vw, 11px);
  color: var(--rose-600);
  letter-spacing: 0.2em;
  margin-top: 1px;
}

/* Meta */
.sidebar-meta {
  padding: 12px 24px;
  border-bottom: 1px solid var(--rule);
  display: flex; align-items: center; gap: 7px;
  flex-shrink: 0;
}
.sidebar-meta span {
  font-size: clamp(9px, 1.1vw, 11px);
  color: var(--ink-soft);
  letter-spacing: 0.08em;
}
.sidebar-meta .sep { color: var(--rose-300); font-size: 9px; }

/* 導覽連結 */
.sidebar-nav {
  flex: 1;
  padding: 12px 0;
  overflow-y: auto;
  scrollbar-width: none;
}
.sidebar-nav::-webkit-scrollbar { display: none; }

.snav-link {
  display: flex; align-items: center; gap: 13px;
  padding: 14px 24px;
  text-decoration: none;
  color: var(--ink-soft);
  font-size: clamp(12px, 1.4vw, 14px);
  letter-spacing: 0.07em;
  transition: all 0.2s;
  border-left: 2.5px solid transparent;
}
.snav-link:hover  { color: var(--rose-700); background: var(--blush-50); border-left-color: var(--blush-300); }
.snav-link.active { color: var(--rose-700); background: var(--blush-50); border-left-color: var(--rose-500); font-weight: 500; }
.snav-num {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: clamp(12px, 1.5vw, 15px);
  color: var(--rose-300);
  min-width: 22px; line-height: 1;
  transition: color 0.2s;
}
.snav-link:hover .snav-num,
.snav-link.active .snav-num { color: var(--rose-500); }

/* 底部 */
.sidebar-bottom {
  padding: 20px 24px 28px;
  border-top: 1px solid var(--rule);
  flex-shrink: 0;
  display: flex; flex-direction: column; gap: 13px;
}
.sidebar-cta {
  justify-content: center;
  font-size: clamp(11px, 1.3vw, 13px);
  letter-spacing: 0.1em;
  padding: 11px 20px;
}
.sidebar-social {
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.sidebar-social a {
  color: var(--ink-soft); text-decoration: none;
  font-size: clamp(10px, 1.2vw, 12px); letter-spacing: 0.12em;
  transition: color 0.2s;
}
.sidebar-social a:hover { color: var(--rose-600); }
.sidebar-social .sep { color: var(--rose-300); font-size: 9px; }
.sidebar-copy {
  text-align: center;
  font-size: clamp(9px, 1vw, 10.5px);
  color: var(--blush-300);
  letter-spacing: 0.1em;
}

/* 漢堡（mobile） */
.hamburger {
  display: none;
  position: fixed;
  top: 18px; left: 18px;
  z-index: 300;
  background: var(--rose-600);
  border: none;
  border-radius: 50%;
  width: 44px; height: 44px;
  cursor: pointer;
  flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  box-shadow: 0 4px 16px -6px var(--rose-500);
  transition: background 0.2s;
}
.hamburger:hover { background: var(--rose-700); }
.hamburger span {
  display: block;
  width: 18px; height: 1.5px;
  background: #fff; border-radius: 1px;
  transition: all 0.25s;
}
.hamburger.active span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.active span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* Overlay（mobile） */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(67,52,58,0.42);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 150;
}
.sidebar-overlay.open { display: block; }

/* ══ 按鈕 ══ */
.btn {
  padding: 12px 28px;
  font-family: 'Noto Sans TC', sans-serif;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex; align-items: center; gap: 8px;
  border: 1.5px solid var(--rose-600);
  border-radius: 999px;
  white-space: nowrap;
}
.btn-primary   { background: var(--rose-600); color: #fff; }
.btn-primary:hover  { background: var(--rose-700); border-color: var(--rose-700); transform: translateY(-1px); }
.btn-secondary { background: transparent; color: var(--rose-700); }
.btn-secondary:hover { background: var(--blush-100); }
.btn-line      { background: #06c755; border-color: #06c755; color: #fff; }
.btn-line:hover     { background: #05b34c; border-color: #05b34c; transform: translateY(-1px); }

/* ══ 區段共用 ══ */
section { padding: 100px 48px; }
.section-inner { max-width: 1180px; margin: 0 auto; }
.section-head  { text-align: center; margin-bottom: 64px; }
.section-eyebrow {
  color: var(--rose-500);
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: clamp(13px, 2.5vw, 18px);
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}
.section-head h2 {
  font-family: 'Noto Serif TC', serif;
  font-size: clamp(22px, 5vw, 42px);
  font-weight: 500;
  color: var(--rose-900);
  letter-spacing: 0.05em;
}
.section-head .divider {
  width: 40px; height: 1px;
  background: var(--rose-400);
  margin: 20px auto 16px;
}
.section-head p {
  color: var(--ink-soft);
  max-width: 540px;
  margin: 0 auto;
  font-size: clamp(13px, 1.8vw, 15px);
  line-height: 1.9;
}

/* ══ 頁尾 ══ */
.site-footer {
  background: var(--rose-900);
  color: var(--blush-100);
  padding: 56px 48px 28px;
  margin-left: var(--sidebar-w);
}
.footer-inner {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 36px;
  border-bottom: 1px solid rgba(255,255,255,0.14);
}
.footer-brand h4 {
  font-family: 'Noto Serif TC', serif;
  font-size: clamp(16px, 2.5vw, 21px);
  margin-bottom: 12px;
  letter-spacing: 0.1em;
}
.footer-brand p {
  font-size: clamp(11px, 1.6vw, 13px);
  line-height: 1.9;
  color: var(--blush-200);
  max-width: 280px;
}
.footer-col h5 {
  font-size: clamp(10px, 1.3vw, 11px);
  letter-spacing: 0.28em;
  color: var(--rose-300);
  margin-bottom: 16px;
}
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 10px; font-size: clamp(11px, 1.6vw, 13px); }
.footer-col a  { color: var(--blush-100); text-decoration: none; transition: color 0.2s; }
.footer-col a:hover { color: #fff; }
.footer-bottom {
  max-width: 1180px;
  margin: 26px auto 0;
  display: flex; justify-content: space-between;
  font-size: clamp(9px, 1.3vw, 11px);
  color: var(--rose-300);
  letter-spacing: 0.14em;
  flex-wrap: wrap; gap: 8px;
}

/* ══ Modal ══ */
.modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.38);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 9999;
  align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: #fff;
  border-radius: 16px;
  padding: 46px 38px 38px;
  max-width: 440px; width: 90%;
  text-align: center;
  box-shadow: 0 32px 80px -16px rgba(0,0,0,0.18);
  animation: modalIn 0.25s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes modalIn {
  from { opacity:0; transform: translateY(16px) scale(0.97); }
  to   { opacity:1; transform: translateY(0) scale(1); }
}
.modal-icon { width:64px; height:64px; margin:0 auto 22px; display:block; }
.modal-title {
  font-family: 'Noto Serif TC', serif;
  font-size: clamp(16px,2.8vw,22px);
  color: var(--rose-900);
  margin-bottom: 10px;
}
.modal-title.error { color:#7a4040; }
.modal-body {
  font-size: clamp(12px,1.8vw,14px);
  color: var(--ink-soft);
  line-height: 1.9;
  margin-bottom: 22px;
}
.modal-summary {
  background: var(--blush-50);
  border-radius: 10px;
  padding: 14px 18px;
  font-size: clamp(11px,1.6vw,13px);
  line-height: 2.1;
  color: var(--rose-900);
  margin-bottom: 26px;
  text-align: left;
}
.modal-btn {
  width:100%; max-width:240px;
  display:flex; justify-content:center;
  margin:0 auto;
  font-size: clamp(12px,1.8vw,14px);
}
.modal-line-link {
  display:block; text-align:center;
  font-size: clamp(11px,1.6vw,13px);
  color:#06c755; text-decoration:none;
  margin-bottom:14px; letter-spacing:0.04em;
}
.modal-line-link:hover { text-decoration:underline; }
.modal-actions { display:flex; gap:12px; justify-content:center; }
.modal-actions .modal-btn { flex:1; max-width:180px; }

/* ══════════════════════════════════════════
   頁面轉場 (Page Transitions)
════════════════════════════════════════════ */

/* 現代瀏覽器：CSS View Transitions API（Chrome 126+ / Edge 126+） */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: 220ms ease both _vt-out; }
::view-transition-new(root) { animation: 320ms 40ms ease both _vt-in; }
@keyframes _vt-out { to   { opacity: 0; } }
@keyframes _vt-in  { from { opacity: 0; } }

/* Fallback：JS 類別驅動淡入 / 淡出（Safari、Firefox 等） */
.js-trans body          { opacity: 0; transition: opacity 0.28s ease; }
.js-trans body.pg-ready { opacity: 1; }

/* ══ RWD ══ */
@media (max-width:1100px) {
  :root { --sidebar-w: 220px; }
  .sidebar-header { padding: 26px 18px 22px; }
  .sidebar-meta   { padding: 10px 18px; }
  .snav-link      { padding: 13px 18px; }
  .sidebar-bottom { padding: 18px 18px 24px; }
  section         { padding: 90px 32px; }
  .site-footer    { padding: 48px 32px 24px; }
  .footer-inner   { grid-template-columns: 1fr 1fr; gap: 32px; }
}
@media (max-width:900px) {
  .hamburger { display: flex; }
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.32s cubic-bezier(0.4,0,0.2,1);
    box-shadow: none;
    width: 260px;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 8px 0 40px -8px rgba(67,52,58,0.18);
  }
  .sidebar-header { padding-top: 92px; }
  .main-content   { margin-left: 0; padding-top: 64px; }
  section         { padding: 72px 24px; }
  .site-footer    { margin-left: 0; padding: 40px 24px 20px; }
  .footer-inner   { grid-template-columns: 1fr; gap: 24px; }
  .footer-bottom  { flex-direction: column; text-align: center; gap: 6px; }
}
@media (max-width:480px) {
  section { padding: 52px 16px; }
  .modal-box { padding: 32px 18px 26px; }
  .modal-actions { flex-direction: column; }
  .modal-actions .modal-btn { max-width: 100%; }
}
