/* ============================================
   Eve Creative Studio - 夜空敘事 Editorial Night Sky
   ============================================ */

:root {
  --deep-night: #060c24;
  --deep-sea: #0d1a40;
  --nebula: #1a2d5e;
  --moon-gold: #d4a850;
  --stardust-gold: #e8c570;
  --moonlight-white: #fff4e0;
  --cool-text: #a8b8d4;
  --soft-text: #8a9ab8;
  --line-color: rgba(212, 168, 80, 0.3);

  --font-serif-zh: "Noto Serif TC", "Songti TC", serif;
  --font-sans-zh: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  --font-serif-en: "Cormorant Garamond", "Noto Serif TC", serif;
  --font-sans-en: "Inter", "Noto Sans TC", sans-serif;

  --max-w: 1200px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans-zh);
  background: var(--deep-night);
  color: var(--moonlight-white);
  line-height: 1.7;
  letter-spacing: 0.02em;
  overflow-x: hidden;
  position: relative;
}

/* ============ 時序漸變 ‧ Night to Dawn ============
   Hero/About: 深夜 02:30
   Works:      凌晨 03:15
   Research:   將曉 04:00
   Awards:     拂曉 04:45
   Contact:    破曉 05:30
============================================== */
#about {
  background: linear-gradient(180deg,
    rgba(6, 12, 36, 0) 0%,
    rgba(10, 20, 52, 0.45) 100%);
}
#works {
  background: linear-gradient(180deg,
    rgba(10, 20, 52, 0.45) 0%,
    rgba(15, 30, 72, 0.6) 100%);
}
#research {
  background: linear-gradient(180deg,
    rgba(15, 30, 72, 0.6) 0%,
    rgba(28, 42, 90, 0.7) 100%);
}
#awards {
  background: linear-gradient(180deg,
    rgba(28, 42, 90, 0.7) 0%,
    rgba(58, 50, 100, 0.78) 60%,
    rgba(90, 62, 105, 0.82) 100%);
}
#journey {
  background: linear-gradient(180deg,
    rgba(90, 62, 105, 0.82) 0%,
    rgba(115, 72, 110, 0.84) 50%,
    rgba(140, 82, 112, 0.85) 100%);
}
#contact {
  background: linear-gradient(180deg,
    rgba(140, 82, 112, 0.85) 0%,
    rgba(165, 100, 118, 0.87) 50%,
    rgba(195, 130, 125, 0.88) 100%);
  position: relative;
}
/* 地平線光暈 ‧ 太陽即將升起 */
#contact::after {
  content: ''; position: absolute;
  bottom: 0; left: 50%; transform: translateX(-50%);
  width: 80%; height: 220px;
  background: radial-gradient(ellipse at center bottom,
    rgba(255, 200, 130, 0.45) 0%,
    rgba(255, 170, 110, 0.25) 25%,
    rgba(255, 140, 100, 0.1) 50%,
    transparent 75%);
  filter: blur(20px);
  pointer-events: none;
  z-index: 0;
  animation: horizon-pulse 8s ease-in-out infinite;
}
@keyframes horizon-pulse {
  0%, 100% { opacity: 0.7; transform: translateX(-50%) scaleY(1); }
  50% { opacity: 1; transform: translateX(-50%) scaleY(1.08); }
}
.footer {
  background: linear-gradient(180deg,
    rgba(180, 115, 120, 0.9) 0%,
    rgba(210, 150, 135, 0.95) 100%) !important;
}

/* 時間標記 */
.section-time {
  display: block;
  font-family: var(--font-serif-en);
  font-style: italic;
  font-size: 13px;
  color: var(--cool-text);
  letter-spacing: 0.25em;
  margin: 0.4rem 0 1.2rem;
  opacity: 0.65;
  position: relative;
}
.section-time::before, .section-time::after {
  content: '·';
  display: inline-block;
  margin: 0 0.8em;
  color: var(--moon-gold);
  font-style: normal;
  vertical-align: middle;
}

/* 後段區塊（拂曉到破曉）的字體與裝飾色彩微調 */
#awards .section-time { color: #e8b8a0; opacity: 0.8; }
#awards .section-num { color: #f5d0a0; }
#awards .section-title { color: #fff8e8; }
#awards .award-card { background: rgba(40, 45, 90, 0.4); }
#awards .award-card.highlight {
  background: linear-gradient(135deg, rgba(212, 168, 80, 0.15), rgba(60, 50, 100, 0.4));
}

/* Journey 區塊（介於拂曉與破曉之間）的色彩微調 */
#journey .section-time { color: #f5c8a8; opacity: 0.82; }
#journey .section-num { color: #f0c098; }
#journey .section-title { color: #fff8e8; }
#journey .section-desc { color: #ffd8c0; }
#journey .constellation-decor g[stroke] { stroke: #f0b888; }
#journey .constellation-decor g[fill] circle { fill: #f8d0a0; }
#journey .constellation-decor text { fill: #f0b888; }

#contact .section-time { color: #ffd8c0; opacity: 0.85; }
#contact .section-num { color: #ffcc88; }
#contact .section-title { color: #ffffff; }
#contact .section-desc { color: #fff0e0; }
#contact .contact-card {
  background: rgba(80, 50, 75, 0.45);
  border-color: rgba(255, 200, 150, 0.4);
}
#contact .contact-card:hover {
  background: rgba(110, 70, 95, 0.6);
  border-color: #ffd0a0;
}
#contact .contact-label { color: #ffd0a0; }
#contact .contact-value { color: #ffffff; }
#contact .contact-arrow { color: #ffd0a0; }

.footer { color: #1a0810; border-top-color: rgba(26, 8, 16, 0.45); }
.footer .brand-tag { color: #1a0810; font-weight: 500; }
.footer-brand p { color: #1a0810; font-weight: 500; }
.footer-meta { color: #1a0810; font-weight: 500; }
.footer-meta a { color: #1a0810; text-decoration: none; }
.footer-meta a:hover { color: #1a0810; text-decoration: underline; text-underline-offset: 3px; }
.footer .dot { color: #1a0810; }

/* 星座在後段轉暖色 */
#awards .constellation-decor g[stroke] { stroke: #e8b878; }
#awards .constellation-decor g[fill] circle { fill: #f5d090; }
#awards .constellation-decor text { fill: #e8b878; }

#contact .constellation-decor g[stroke] { stroke: #ffc488; }
#contact .constellation-decor g[fill] circle { fill: #ffe0b0; }
#contact .constellation-decor text { fill: #ffc488; }

img { max-width: 100%; height: auto; display: block; }

a { color: inherit; text-decoration: none; transition: color .25s ease, opacity .25s ease; }

/* ============ 互動 UI ‧ 望遠鏡 / 收集 / 訊息 ============ */

/* 望遠鏡按鈕 */
.telescope-toggle {
  position: fixed;
  bottom: 1.5rem; right: 1.5rem;
  z-index: 200;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px;
  background: rgba(13, 26, 64, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 0.5px solid rgba(212, 168, 80, 0.5);
  color: var(--moon-gold);
  font-family: var(--font-sans-en);
  font-size: 11px;
  letter-spacing: 3px;
  font-weight: 500;
  cursor: pointer;
  transition: all .35s ease;
}
.telescope-toggle:hover {
  background: rgba(26, 45, 94, 0.85);
  border-color: var(--moon-gold);
  transform: translateY(-2px);
}
.telescope-toggle .tel-icon {
  width: 18px; height: 18px;
  display: inline-block;
}
.telescope-toggle.active {
  background: var(--moon-gold);
  color: var(--deep-night);
  border-color: var(--moon-gold);
}
.telescope-toggle.active .tel-icon { animation: tel-spin 8s linear infinite; }
@keyframes tel-spin { to { transform: rotate(360deg); } }

/* 望遠鏡透鏡 ‧ 鏡內亮化 + 飽和（不再壓暗鏡外） */
.telescope-lens {
  position: fixed;
  top: 0; left: 0;
  width: 280px; height: 280px;
  margin-left: -140px; margin-top: -140px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 150;
  opacity: 0;
  transition: opacity .35s ease;
  will-change: transform;
  /* 鏡圈光暈，無鏡外暗化 */
  box-shadow:
    inset 0 0 0 1.5px rgba(232, 197, 112, 0.7),
    inset 0 0 0 6px rgba(232, 197, 112, 0.08),
    inset 0 0 50px rgba(232, 197, 112, 0.18),
    0 0 30px rgba(232, 197, 112, 0.3);
  /* 鏡內：提亮 + 飽和 + 些微對比，達到「看得更清楚」的望遠鏡感 */
  backdrop-filter: brightness(1.2) saturate(1.25) contrast(1.05);
  -webkit-backdrop-filter: brightness(1.2) saturate(1.25) contrast(1.05);
}
.telescope-lens.active { opacity: 1; }

/* ============ 鏡內元素 ‧ 物理放大效果 ============ */
/* 鏡頭範圍內的星星實際變大、變亮 */

.float-star {
  transition: width .25s ease, height .25s ease, box-shadow .25s ease;
}
.float-star::before, .float-star::after {
  transition: width .25s ease, height .25s ease, top .25s ease, left .25s ease, background .25s ease;
}
.float-star.lens-zoomed {
  width: 8px; height: 8px;
  box-shadow: 0 0 18px 4px rgba(232, 197, 112, 0.95);
}
.float-star.lens-zoomed::before {
  height: 32px; top: -14px;
  background: rgba(232, 197, 112, 1);
  width: 1.5px;
}
.float-star.lens-zoomed::after {
  width: 32px; left: -14px;
  background: rgba(232, 197, 112, 1);
  height: 1.5px;
}
.float-star-small.lens-zoomed {
  width: 5px; height: 5px;
  box-shadow: 0 0 12px 2px rgba(255, 244, 224, 0.95);
}
.float-star-small.lens-zoomed::before { height: 22px; top: -9px; }
.float-star-small.lens-zoomed::after { width: 22px; left: -9px; }

.hidden-star {
  transition: opacity .35s ease, width .25s ease, height .25s ease, box-shadow .25s ease;
}
.hidden-star.revealed.lens-zoomed {
  width: 5px; height: 5px;
  box-shadow: 0 0 14px 3px rgba(255, 244, 224, 0.95);
}

.clickable-star.lens-zoomed {
  r: 3.5;
  filter: drop-shadow(0 0 8px rgba(255, 244, 224, 1));
}
.lens-ring {
  position: absolute; inset: -14px;
  border-radius: 50%;
  border: 0.5px solid rgba(232, 197, 112, 0.3);
  animation: lens-rotate 12s linear infinite;
}
.lens-ring::before {
  content: ''; position: absolute;
  top: -3px; left: 50%; transform: translateX(-50%);
  width: 5px; height: 5px; border-radius: 50%;
  background: #e8c570;
  box-shadow: 0 0 6px rgba(232, 197, 112, 0.8);
}
@keyframes lens-rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.lens-crosshair {
  position: absolute;
  top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 40px; height: 40px;
}
.lens-crosshair .ch-h, .lens-crosshair .ch-v {
  position: absolute; background: rgba(232, 197, 112, 0.5);
}
.lens-crosshair .ch-h {
  top: 50%; left: 0; width: 100%; height: 1px; transform: translateY(-50%);
}
.lens-crosshair .ch-v {
  left: 50%; top: 0; width: 1px; height: 100%; transform: translateX(-50%);
}

/* 望遠鏡模式啟用時 */
body.telescope-on { cursor: none; }
body.telescope-on a,
body.telescope-on button { cursor: none; }
/* 鏡頭內的星空更亮 (整體小幅提亮 + 隱藏星顯現) */
body.telescope-on .float-star { opacity: 1; }

/* 主視覺星座 ‧ 可點擊星 */
.clickable-star {
  cursor: pointer;
  transition: r .25s ease, filter .25s ease;
  filter: drop-shadow(0 0 2px rgba(232, 197, 112, 0.5));
}
.clickable-star:hover {
  r: 4;
  filter: drop-shadow(0 0 8px rgba(255, 244, 224, 1));
}
.clickable-star.collected {
  animation: star-burst .8s ease-out forwards;
  pointer-events: none;
}
@keyframes star-burst {
  0%   { r: 2; opacity: 1; filter: drop-shadow(0 0 4px rgba(232, 197, 112, 0.8)); }
  35%  { r: 8; opacity: 1; filter: drop-shadow(0 0 16px rgba(255, 244, 224, 1)); }
  100% { r: 0; opacity: 0; }
}

/* 星數計數器 */
.star-counter {
  position: fixed;
  bottom: 1.5rem; left: 1.5rem;
  z-index: 199;
  display: flex; align-items: center; gap: 8px;
  padding: 9px 16px;
  background: rgba(13, 26, 64, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 0.5px solid rgba(212, 168, 80, 0.4);
  color: var(--moon-gold);
  font-family: var(--font-sans-en);
  font-size: 12px; letter-spacing: 2px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .4s ease, transform .4s ease, background .4s ease, border-color .4s ease;
  pointer-events: none;
}
.star-counter.show { opacity: 1; transform: translateY(0); }
.star-counter.complete {
  background: rgba(232, 197, 112, 0.9);
  color: var(--deep-night);
  border-color: var(--moon-gold);
}
.counter-icon { font-size: 14px; }
.counter-num {
  font-family: var(--font-serif-en); font-style: italic;
  font-size: 16px; font-weight: 500;
  min-width: 14px; text-align: center;
  display: inline-block;
}
.counter-num.bounce { animation: counter-bounce .45s ease-out; }
@keyframes counter-bounce {
  0%, 100% { transform: scale(1); }
  40%  { transform: scale(1.5); color: #fff4e0; }
}
.counter-sep { opacity: 0.6; }
.counter-label { font-size: 10px; letter-spacing: 3px; margin-left: 6px; opacity: 0.7; }

/* 集滿訊息 */
.constellation-message {
  position: fixed; inset: 0;
  z-index: 300;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity .6s ease;
}
.constellation-message.show { opacity: 1; pointer-events: auto; }
.msg-backdrop {
  position: absolute; inset: 0;
  background: rgba(6, 12, 36, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.msg-inner {
  position: relative;
  background: linear-gradient(160deg, rgba(26, 45, 94, 0.95), rgba(13, 26, 64, 0.95));
  border: 0.5px solid rgba(212, 168, 80, 0.5);
  padding: 3.5rem 3.5rem;
  max-width: 480px;
  width: calc(100% - 3rem);
  text-align: center;
  box-shadow: 0 0 60px rgba(212, 168, 80, 0.15);
  transform: scale(0.92);
  transition: transform .6s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.constellation-message.show .msg-inner { transform: scale(1); }
.msg-eyebrow {
  display: block;
  font-family: var(--font-sans-en); font-size: 14px;
  letter-spacing: 8px;
  color: var(--moon-gold);
  margin-bottom: 1.2rem;
}
.msg-title {
  font-family: var(--font-serif-zh); font-weight: 400;
  font-size: 2rem; letter-spacing: 0.15em;
  color: var(--moonlight-white);
  margin-bottom: 0.4rem;
}
.msg-en {
  font-family: var(--font-serif-en); font-style: italic;
  font-size: 1.1rem;
  color: var(--stardust-gold);
  margin-bottom: 1.5rem;
  letter-spacing: 0.05em;
}
.msg-divider {
  width: 60px; height: 1px;
  background: var(--moon-gold);
  margin: 0 auto 1.5rem;
  position: relative;
}
.msg-divider::before {
  content: ''; position: absolute;
  top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 6px; height: 6px;
  background: var(--moon-gold); border-radius: 50%;
  box-shadow: 0 0 10px rgba(212, 168, 80, 0.8);
}
.msg-body {
  font-family: var(--font-serif-zh);
  font-size: 15px; line-height: 1.9;
  color: var(--cool-text);
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}
.msg-sign {
  font-family: var(--font-serif-en); font-style: italic;
  font-size: 14px;
  color: var(--moon-gold);
  margin-top: 1.5rem;
  letter-spacing: 0.1em;
}
.msg-close {
  margin-top: 2rem;
  padding: 10px 28px;
  background: transparent;
  border: 0.5px solid var(--moon-gold);
  color: var(--moon-gold);
  font-family: var(--font-sans-en);
  font-size: 11px; letter-spacing: 3px;
  cursor: pointer;
  transition: all .3s ease;
}
.msg-close:hover {
  background: var(--moon-gold);
  color: var(--deep-night);
}

/* ============ 詳細頁 Modal ============ */
.detail-modal {
  position: fixed; inset: 0;
  z-index: 280;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity .45s ease;
  padding: 2rem 1rem;
}
.detail-modal.show {
  opacity: 1;
  pointer-events: auto;
}
.detail-backdrop {
  position: absolute; inset: 0;
  background: rgba(6, 12, 36, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  cursor: pointer;
}
.detail-content {
  position: relative;
  background: linear-gradient(165deg, rgba(20, 35, 78, 0.97), rgba(10, 18, 48, 0.97));
  border: 0.5px solid rgba(212, 168, 80, 0.5);
  max-width: 880px; width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  padding: 3.5rem 3rem 3rem;
  transform: translateY(40px) scale(0.96);
  transition: transform .55s cubic-bezier(0.2, 0.7, 0.2, 1);
  box-shadow: 0 0 60px rgba(212, 168, 80, 0.15), 0 30px 80px rgba(0, 0, 0, 0.6);
  /* 自訂滾動條 */
  scrollbar-width: thin;
  scrollbar-color: rgba(212, 168, 80, 0.4) transparent;
}
.detail-content::-webkit-scrollbar { width: 6px; }
.detail-content::-webkit-scrollbar-track { background: transparent; }
.detail-content::-webkit-scrollbar-thumb {
  background: rgba(212, 168, 80, 0.4);
  border-radius: 3px;
}
.detail-modal.show .detail-content {
  transform: translateY(0) scale(1);
}

.detail-close {
  position: absolute;
  top: 1rem; right: 1rem;
  width: 42px; height: 42px;
  background: rgba(13, 26, 64, 0.7);
  backdrop-filter: blur(6px);
  border: 0.5px solid rgba(212, 168, 80, 0.4);
  color: var(--moon-gold);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .35s ease;
  z-index: 2;
}
.detail-close:hover {
  background: var(--moon-gold);
  color: var(--deep-night);
  transform: rotate(90deg);
}

.detail-decor {
  position: absolute;
  top: 1.2rem; left: 1.2rem;
  width: 180px; height: auto;
  opacity: 0.55;
  pointer-events: none;
}

/* 詳細頁內部排版 */
.detail-eyebrow {
  font-family: var(--font-sans-en);
  font-size: 11px;
  letter-spacing: 5px;
  color: var(--moon-gold);
  margin-bottom: 0.6rem;
  display: block;
}
.detail-num-big {
  font-family: var(--font-serif-en);
  font-style: italic;
  font-size: clamp(3.5rem, 7vw, 5rem);
  font-weight: 300;
  color: var(--moon-gold);
  opacity: 0.4;
  line-height: 1;
  margin-bottom: 0.5rem;
}
.detail-title {
  font-family: var(--font-serif-zh);
  font-weight: 400;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  color: var(--moonlight-white);
  letter-spacing: 0.08em;
  margin-bottom: 0.4rem;
  line-height: 1.3;
}
.detail-title-en {
  font-family: var(--font-serif-en);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--stardust-gold);
  letter-spacing: 0.05em;
  margin-bottom: 1.5rem;
}
.detail-divider {
  width: 60px; height: 1px;
  background: var(--moon-gold);
  margin: 1.5rem 0 2rem;
  position: relative;
}
.detail-divider::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 5px; height: 5px;
  background: var(--moon-gold);
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(212, 168, 80, 0.7);
}

.detail-cover {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--deep-night);
  border: 0.5px solid rgba(212, 168, 80, 0.3);
  margin-bottom: 2rem;
  overflow: hidden;
  position: relative;
}
.detail-cover img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.detail-cover::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(6, 12, 36, 0.5), transparent 60%);
  pointer-events: none;
}

.detail-desc {
  font-family: var(--font-serif-zh);
  font-size: 16px;
  line-height: 1.95;
  color: var(--moonlight-white);
  letter-spacing: 0.04em;
  margin-bottom: 1.8rem;
}
.detail-desc p { margin-bottom: 1rem; }
.detail-desc p:last-child { margin-bottom: 0; }

.detail-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem 2rem;
  padding: 1.5rem 0;
  border-top: 0.5px solid rgba(212, 168, 80, 0.2);
  border-bottom: 0.5px solid rgba(212, 168, 80, 0.2);
  margin-bottom: 2rem;
}
.detail-meta-row .meta-label {
  display: block;
  font-family: var(--font-sans-en);
  font-size: 10px; letter-spacing: 3px;
  color: var(--moon-gold);
  margin-bottom: 0.3rem;
}
.detail-meta-row .meta-value {
  font-size: 14px;
  color: var(--cool-text);
  line-height: 1.6;
}
.detail-meta-row .meta-value a {
  color: var(--stardust-gold);
  text-decoration: underline;
  text-decoration-color: rgba(232, 197, 112, 0.4);
  text-underline-offset: 3px;
}
.detail-meta-row .meta-value a:hover {
  color: var(--moon-gold);
}

.detail-section-title {
  font-family: var(--font-serif-zh);
  font-weight: 500;
  font-size: 1.1rem;
  color: var(--stardust-gold);
  letter-spacing: 0.1em;
  margin: 1.8rem 0 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 0.5px solid rgba(212, 168, 80, 0.2);
}

.detail-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
}
.detail-list li {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 1.5rem;
  padding: 0.6rem 0;
  border-bottom: 0.5px solid rgba(212, 168, 80, 0.1);
  font-size: 14px;
  color: var(--cool-text);
  line-height: 1.7;
}
.detail-list li .li-year {
  font-family: var(--font-serif-en);
  font-style: italic;
  font-size: 14px;
  color: var(--moon-gold);
  letter-spacing: 0.05em;
}

.detail-tag {
  display: inline-block;
  padding: 4px 10px;
  background: rgba(212, 168, 80, 0.12);
  border: 0.5px solid rgba(212, 168, 80, 0.4);
  color: var(--moon-gold);
  font-family: var(--font-sans-en);
  font-size: 10px;
  letter-spacing: 2px;
  margin: 0 6px 6px 0;
}
.detail-tag.featured {
  background: var(--moon-gold);
  color: var(--deep-night);
  font-weight: 500;
}

.detail-cta {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 0.5px solid rgba(212, 168, 80, 0.2);
  display: flex; gap: 1rem; flex-wrap: wrap;
}
.detail-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 22px;
  background: transparent;
  border: 0.5px solid var(--moon-gold);
  color: var(--moon-gold);
  font-family: var(--font-sans-en);
  font-size: 11px; letter-spacing: 3px; font-weight: 500;
  cursor: pointer;
  transition: all .3s ease;
  text-decoration: none;
}
.detail-btn:hover {
  background: var(--moon-gold);
  color: var(--deep-night);
}

/* 互動指示符 ‧ clickable cards 加上"→"與微妙提示 */
.work-card, .award-card, .pub-item {
  cursor: pointer;
}
.work-card::after {
  content: '→';
  position: absolute;
  bottom: 1rem; right: 1.2rem;
  font-family: var(--font-serif-en);
  font-size: 1.4rem;
  color: var(--moon-gold);
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity .3s ease, transform .3s ease;
  z-index: 3;
}
.work-card:hover::after {
  opacity: 1;
  transform: translateX(0);
}

.award-card::after {
  content: 'VIEW';
  position: absolute;
  bottom: 0.6rem; right: 0.8rem;
  font-family: var(--font-sans-en);
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--moon-gold);
  opacity: 0;
  transition: opacity .3s ease;
}
.award-card { position: relative; }
.award-card:hover::after { opacity: 0.7; }

/* ============ 作品兩層詳細頁 ============ */

/* 內容切換動畫：淡出 → 換內容 → 淡入 */
.detail-body {
  transition: opacity .22s ease;
}
.detail-body.fading { opacity: 0; }

/* 子作品提示 */
.detail-sub-hint {
  font-family: var(--font-serif-en); font-style: italic;
  font-size: 12px; letter-spacing: 0.1em;
  color: var(--soft-text);
  margin: 0.5rem 0 1.5rem;
}

/* ============ 作品 Masonry 瀑布流網格 ============ */
.works-masonry {
  /* CSS columns 實作 masonry，瀏覽器原生支援度高 */
  column-count: 3;
  column-gap: 1.2rem;
  margin-top: 1rem;
  margin-bottom: 1rem;
}
@media (max-width: 768px) {
  .works-masonry { column-count: 2; column-gap: 0.8rem; }
}
@media (max-width: 480px) {
  .works-masonry { column-count: 1; }
}

.masonry-item {
  display: inline-block;
  width: 100%;
  margin: 0 0 1.2rem;
  break-inside: avoid;
  background: rgba(13, 26, 64, 0.4);
  border: 0.5px solid rgba(212, 168, 80, 0.2);
  overflow: hidden;
  transition: border-color .35s ease, transform .35s ease;
}
.masonry-item:hover {
  border-color: var(--moon-gold);
  transform: translateY(-2px);
}
.masonry-item img {
  width: 100%;
  height: auto;
  display: block;
  cursor: zoom-in;
  transition: transform .6s ease, filter .35s ease;
}
.masonry-item:hover img {
  transform: scale(1.03);
}
.masonry-placeholder {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, var(--nebula), var(--deep-sea));
}
.masonry-item figcaption {
  padding: 0.85rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.masonry-item figcaption h4 {
  font-family: var(--font-serif-zh); font-weight: 400;
  font-size: 0.95rem;
  color: var(--moonlight-white);
  letter-spacing: 0.03em;
  line-height: 1.4;
  margin: 0;
}
.masonry-item .masonry-year {
  font-family: var(--font-serif-en);
  font-style: italic;
  font-size: 13px;
  color: var(--stardust-gold);
  opacity: 0.85;
  letter-spacing: 0.05em;
}

/* ============ Journey 影像札記 Masonry ============ */
.journey-masonry {
  column-count: 6;
  column-gap: 0.7rem;
  margin-top: 2rem;
}
@media (max-width: 1280px) {
  .journey-masonry { column-count: 5; }
}
@media (max-width: 1024px) {
  .journey-masonry { column-count: 4; column-gap: 0.6rem; }
}
@media (max-width: 760px) {
  .journey-masonry { column-count: 3; column-gap: 0.5rem; }
}
@media (max-width: 480px) {
  .journey-masonry { column-count: 2; column-gap: 0.4rem; }
}

.journey-item {
  display: inline-block;
  width: 100%;
  margin: 0 0 0.7rem;
  break-inside: avoid;
  background: rgba(13, 26, 64, 0.3);
  border: 0.5px solid rgba(255, 200, 150, 0.2);
  overflow: hidden;
  transition: border-color .35s ease, transform .35s ease, box-shadow .35s ease;
  position: relative;
}
.journey-item:hover {
  border-color: #f0c098;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(195, 130, 125, 0.18);
}
.journey-item img {
  width: 100%;
  height: auto;
  display: block;
  cursor: zoom-in;
  transition: transform .6s ease, filter .35s ease;
  filter: saturate(0.92);
}
.journey-item:hover img {
  transform: scale(1.04);
  filter: saturate(1.0);
}
.journey-item figcaption {
  display: none;
}
.j-year {
  font-family: var(--font-serif-en);
  font-style: italic;
  font-size: 12px;
  color: #f0c098;
  opacity: 0.75;
  letter-spacing: 0.1em;
}

/* 作者待補的視覺提示 */
.meta-value em.placeholder {
  color: var(--soft-text);
  font-family: var(--font-serif-en);
  font-style: italic;
  letter-spacing: 0.05em;
  opacity: 0.6;
  font-size: 12px;
}

/* ============ 證書圖片 ============ */
.cert-image {
  margin: 1rem 0 2rem;
  padding: 1rem;
  background: #fafaf5;
  border: 0.5px solid rgba(212, 168, 80, 0.4);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  text-align: center;
}
.cert-image img {
  max-width: 100%;
  height: auto;
  cursor: zoom-in;
  transition: transform .35s ease;
  display: block;
  margin: 0 auto;
}
.cert-image img:hover { transform: scale(1.02); }
.cert-image figcaption {
  margin-top: 0.8rem;
  font-family: var(--font-serif-en);
  font-style: italic;
  font-size: 11px;
  color: var(--soft-text);
  letter-spacing: 0.1em;
  opacity: 0.8;
}

/* 證書圖待上傳 placeholder (圖檔不存在時自動顯示) */
.cert-pending-box {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 3.5rem 2rem;
  border: 0.5px dashed rgba(212, 168, 80, 0.4);
  background: rgba(212, 168, 80, 0.05);
  color: var(--moon-gold);
}
.cert-pending-icon { opacity: 0.55; }
.cert-pending-text {
  font-family: var(--font-sans-en);
  font-size: 12px;
  letter-spacing: 3px;
  font-weight: 500;
  color: var(--moon-gold);
}
.cert-pending-filename {
  font-family: var(--font-mono, 'SF Mono', Menlo, monospace);
  font-size: 11px;
  color: var(--soft-text);
  background: rgba(13, 26, 64, 0.45);
  padding: 4px 10px;
  letter-spacing: 0.5px;
  border: 0.5px solid rgba(212, 168, 80, 0.2);
}
.cert-image.cert-pending {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}
.cert-image.cert-pending img,
.cert-image.cert-pending figcaption { display: none; }
.cert-image.cert-pending .cert-pending-box { display: flex; }

/* Lightbox 待上傳訊息 */
.lightbox-pending-box {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 3rem 3.5rem;
  border: 0.5px dashed rgba(212, 168, 80, 0.5);
  background: rgba(13, 26, 64, 0.65);
  color: var(--moon-gold);
  position: relative;
  z-index: 1;
}
.lb-pending-text {
  font-family: var(--font-sans-en);
  font-size: 13px;
  letter-spacing: 4px;
  font-weight: 500;
}
.lb-pending-hint {
  font-family: var(--font-serif-zh);
  font-style: italic;
  font-size: 12px;
  color: var(--soft-text);
  letter-spacing: 0.05em;
  max-width: 320px;
  text-align: center;
}
.lightbox.lb-pending .lightbox-img { display: none; }
.lightbox.lb-pending .lightbox-pending-box { display: flex; }

/* 證照連結（About 區） */
.cert-links a {
  color: var(--moonlight-white);
  text-decoration: underline;
  text-decoration-color: rgba(212, 168, 80, 0.4);
  text-underline-offset: 3px;
  transition: color .25s ease, text-decoration-color .25s ease;
  cursor: pointer;
}
.cert-links a:hover {
  color: var(--moon-gold);
  text-decoration-color: var(--moon-gold);
}
.cert-hint {
  display: block;
  margin-top: 0.4rem;
  font-family: var(--font-serif-en);
  font-style: italic;
  font-size: 11px;
  color: var(--soft-text);
  letter-spacing: 0.05em;
  opacity: 0.7;
}

/* ============ Lightbox 圖片燈箱 ============ */
.lightbox {
  position: fixed; inset: 0;
  z-index: 400;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 1rem;
  padding: 2rem;
  pointer-events: none;
  opacity: 0;
  transition: opacity .35s ease;
}
.lightbox.show {
  opacity: 1;
  pointer-events: auto;
}
.lightbox-backdrop {
  position: absolute; inset: 0;
  background: rgba(6, 12, 36, 0.95);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  cursor: zoom-out;
}
.lightbox-img {
  position: relative;
  max-width: 95vw;
  max-height: 85vh;
  object-fit: contain;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  background: white;
  transform: scale(0.95);
  transition: transform .4s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.lightbox.show .lightbox-img { transform: scale(1); }
.lightbox-caption {
  position: relative;
  color: var(--moon-gold);
  font-family: var(--font-serif-zh);
  font-style: italic;
  font-size: 14px;
  letter-spacing: 0.05em;
  max-width: 80vw;
  text-align: center;
}
.lightbox-close {
  position: absolute;
  top: 1.5rem; right: 1.5rem;
  width: 44px; height: 44px;
  background: rgba(13, 26, 64, 0.7);
  border: 0.5px solid rgba(212, 168, 80, 0.5);
  color: var(--moon-gold);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .3s ease;
  z-index: 2;
}
.lightbox-close:hover {
  background: var(--moon-gold);
  color: var(--deep-night);
  transform: rotate(90deg);
}

/* ============ APA 引用區塊 ============ */
.detail-citation {
  margin: 2rem 0 1rem;
  padding: 1.5rem 1.75rem;
  background: rgba(13, 26, 64, 0.55);
  border-left: 2px solid var(--moon-gold);
  border-right: 0.5px solid rgba(212, 168, 80, 0.2);
  border-top: 0.5px solid rgba(212, 168, 80, 0.2);
  border-bottom: 0.5px solid rgba(212, 168, 80, 0.2);
  position: relative;
}
.citation-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.8rem;
  border-bottom: 0.5px solid rgba(212, 168, 80, 0.2);
}
.citation-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-sans-en);
  font-size: 11px;
  letter-spacing: 3.5px;
  color: var(--moon-gold);
  font-weight: 500;
}
.cite-icon {
  font-family: var(--font-serif-en);
  font-style: italic;
  font-size: 24px;
  line-height: 0;
  color: var(--moon-gold);
  opacity: 0.6;
  margin-right: 2px;
  font-weight: 400;
}
.citation-copy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: transparent;
  border: 0.5px solid rgba(212, 168, 80, 0.5);
  color: var(--moon-gold);
  font-family: var(--font-sans-en);
  font-size: 10px;
  letter-spacing: 2px;
  font-weight: 500;
  cursor: pointer;
  transition: all .3s ease;
}
.citation-copy:hover {
  background: rgba(212, 168, 80, 0.15);
  border-color: var(--moon-gold);
}
.citation-copy.copied {
  background: var(--moon-gold);
  color: var(--deep-night);
  border-color: var(--moon-gold);
}
.citation-copy svg { flex-shrink: 0; }

.citation-text {
  font-family: var(--font-serif-en);
  font-size: 13px;
  line-height: 1.85;
  color: var(--moonlight-white);
  letter-spacing: 0.02em;
  word-break: break-word;
  margin-bottom: 0.7rem;
  /* 讓 user 可選取文字 */
  user-select: text;
  -webkit-user-select: text;
}
/* 中文引用採宋體呈現 */
.citation-text:lang(zh-Hant),
.citation-text:lang(zh) {
  font-family: var(--font-serif-zh);
}
.citation-hint {
  font-size: 11px;
  font-family: var(--font-serif-en);
  font-style: italic;
  color: var(--soft-text);
  letter-spacing: 0.05em;
  opacity: 0.7;
}

/* Body 鎖定滾動時 */
body.modal-open { overflow: hidden; }

/* 隱藏星 (望遠鏡才會發現) */
.hidden-star {
  position: fixed;
  width: 3px; height: 3px;
  background: #fff4e0;
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  z-index: 5;
  transition: opacity .35s ease;
  box-shadow: 0 0 8px rgba(255, 244, 224, 0.8);
}
.hidden-star::after {
  content: attr(data-label);
  position: absolute;
  top: 10px; left: 50%; transform: translateX(-50%);
  font-family: var(--font-sans-en);
  font-size: 9px; letter-spacing: 3px;
  color: var(--moon-gold);
  white-space: nowrap;
  opacity: 0;
  transition: opacity .35s ease .1s;
}
.hidden-star.revealed { opacity: 1; }
.hidden-star.revealed::after { opacity: 0.85; }

/* ============ Starfield background ============ */
.starfield {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(ellipse at 70% 20%, rgba(26, 45, 94, 0.6) 0%, transparent 50%),
    radial-gradient(ellipse at 20% 80%, rgba(13, 26, 64, 0.5) 0%, transparent 50%),
    var(--deep-night);
  overflow: hidden;
}
#stars { width: 100%; height: 100%; display: block; }

/* ---- Nebulas 星雲光斑 ---- */
.nebula {
  position: absolute; border-radius: 50%;
  filter: blur(60px);
  opacity: 0.45;
  animation: nebula-drift 30s ease-in-out infinite;
}
.nebula-purple {
  top: 15%; left: -10%;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(122, 77, 190, 0.35) 0%, rgba(122, 77, 190, 0.1) 50%, transparent 70%);
  animation-delay: 0s;
}
.nebula-blue {
  top: 60%; right: -8%;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(77, 109, 190, 0.3) 0%, rgba(77, 109, 190, 0.08) 50%, transparent 70%);
  animation-delay: -10s;
}
.nebula-gold {
  top: 35%; left: 40%;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(212, 168, 80, 0.12) 0%, rgba(212, 168, 80, 0.04) 50%, transparent 70%);
  animation-delay: -20s;
}
@keyframes nebula-drift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(40px, -30px) scale(1.08); }
  66% { transform: translate(-30px, 50px) scale(0.95); }
}

/* ---- Meteors 流星 (左上 → 右下) ---- */
.meteor {
  position: absolute;
  width: 140px; height: 1px;
  /* 拖尾在左 (來源方向)，亮頭在右 (前進方向) */
  background: linear-gradient(90deg, transparent 0%, rgba(255, 244, 224, 0.6) 50%, rgba(232, 197, 112, 1) 100%);
  border-radius: 50%;
  opacity: 0;
  transform-origin: right center;
  filter: drop-shadow(0 0 4px rgba(232, 197, 112, 0.8));
}
.meteor::after {
  content: ''; position: absolute;
  right: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 3px;
  background: #fff4e0;
  border-radius: 50%;
  box-shadow: 0 0 6px 1px rgba(255, 244, 224, 0.9);
}
.meteor-1 {
  top: 8%; left: -150px;
  animation: meteor-fall 8s ease-in 3s infinite;
}
.meteor-2 {
  top: 28%; left: -150px;
  animation: meteor-fall 11s ease-in 7s infinite;
  animation-name: meteor-fall-2;
}
.meteor-3 {
  top: 50%; left: -150px;
  animation: meteor-fall 9s ease-in 11s infinite;
  width: 100px;
}
.meteor-4 {
  top: 70%; left: -150px;
  animation: meteor-fall 13s ease-in 15s infinite;
  animation-name: meteor-fall-2;
}
@keyframes meteor-fall {
  0% { opacity: 0; transform: translate(0, 0) rotate(20deg); }
  3% { opacity: 1; }
  10% { opacity: 1; }
  15% { opacity: 0; transform: translate(110vw, 55vh) rotate(20deg); }
  100% { opacity: 0; transform: translate(110vw, 55vh) rotate(20deg); }
}
@keyframes meteor-fall-2 {
  0% { opacity: 0; transform: translate(0, 0) rotate(25deg); }
  3% { opacity: 1; }
  10% { opacity: 1; }
  15% { opacity: 0; transform: translate(110vw, 60vh) rotate(25deg); }
  100% { opacity: 0; transform: translate(110vw, 60vh) rotate(25deg); }
}

/* ---- Wish stars 許願星 ---- */
.wish-star {
  position: absolute;
  width: 3px; height: 3px;
  background: #fff4e0;
  border-radius: 50%;
  box-shadow:
    0 0 10px 2px rgba(255, 244, 224, 0.8),
    0 0 20px 4px rgba(232, 197, 112, 0.4);
  animation: wish-pulse 4s ease-in-out infinite;
}
.wish-star::before, .wish-star::after {
  content: ''; position: absolute;
  background: rgba(255, 244, 224, 0.6);
}
.wish-star::before {
  top: -8px; left: 50%; transform: translateX(-50%);
  width: 1px; height: 18px;
}
.wish-star::after {
  top: 50%; left: -8px; transform: translateY(-50%);
  width: 18px; height: 1px;
}
.wish-star-1 { top: 22%; left: 15%; animation-delay: 0s; }
.wish-star-2 { top: 68%; right: 22%; animation-delay: 2s; }
@keyframes wish-pulse {
  0%, 100% { opacity: 0.5; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1.15); }
}

/* ---- Float Stars 漂浮小星 ---- */
.float-star {
  position: absolute;
  width: 4px; height: 4px;
  background: #e8c570;
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(232, 197, 112, 0.7);
  z-index: 1;
  pointer-events: none;
  animation:
    float-drift var(--d, 14s) ease-in-out var(--delay, 0s) infinite,
    float-glow 4s ease-in-out var(--delay, 0s) infinite;
}
.float-star::before, .float-star::after {
  content: ''; position: absolute;
  background: rgba(232, 197, 112, 0.7);
  pointer-events: none;
}
.float-star::before {
  top: -8px; left: 50%; transform: translateX(-50%);
  width: 1px; height: 20px;
}
.float-star::after {
  top: 50%; left: -8px; transform: translateY(-50%);
  width: 20px; height: 1px;
}
.float-star-small {
  width: 2.5px; height: 2.5px;
  box-shadow: 0 0 5px rgba(255, 244, 224, 0.6);
  background: #fff4e0;
}
.float-star-small::before, .float-star-small::after {
  background: rgba(255, 244, 224, 0.5);
}
.float-star-small::before { height: 12px; top: -5px; }
.float-star-small::after { width: 12px; left: -5px; }

@keyframes float-drift {
  0%   { transform: translate(0, 0); }
  20%  { transform: translate(18px, -22px); }
  40%  { transform: translate(-12px, -10px); }
  60%  { transform: translate(-22px, 16px); }
  80%  { transform: translate(10px, 20px); }
  100% { transform: translate(0, 0); }
}
@keyframes float-glow {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

/* ---- Hover 噴星塵 ---- */
.sparkle-particle {
  position: absolute;
  left: var(--x, 50%); top: var(--y, 50%);
  width: 5px; height: 5px;
  background: radial-gradient(circle, #fff4e0 0%, #e8c570 60%, transparent 100%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 10;
  opacity: 0;
  animation: sparkle-burst 1s ease-out var(--delay, 0s) forwards;
}
.sparkle-particle::before, .sparkle-particle::after {
  content: ''; position: absolute;
  background: rgba(255, 244, 224, 0.8);
  pointer-events: none;
}
.sparkle-particle::before {
  top: -7px; left: 50%; transform: translateX(-50%);
  width: 1px; height: 18px;
}
.sparkle-particle::after {
  top: 50%; left: -7px; transform: translateY(-50%);
  width: 18px; height: 1px;
}
@keyframes sparkle-burst {
  0%   { opacity: 0; transform: scale(0) translateY(0) rotate(0deg); }
  25%  { opacity: 1; transform: scale(1.4) translateY(-6px) rotate(45deg); }
  60%  { opacity: 0.7; transform: scale(0.9) translateY(-16px) rotate(90deg); }
  100% { opacity: 0; transform: scale(0.3) translateY(-30px) rotate(135deg); }
}

/* ============ Navigation ============ */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  padding: 1.5rem 2rem;
  transition: background .3s ease, padding .3s ease, border-color .3s ease;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(6, 12, 36, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 1rem 2rem;
  border-bottom-color: rgba(212, 168, 80, 0.15);
}
.nav-inner {
  max-width: var(--max-w); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
}
.brand-sub {
  font-family: var(--font-sans-en);
  font-size: 11px; letter-spacing: 3px; font-weight: 400;
  color: var(--moon-gold);
}
.menu { display: flex; gap: 2.5rem; }
.menu a {
  font-size: 14px; letter-spacing: 1.5px; color: var(--cool-text);
  position: relative; padding: 4px 0;
}
.menu a:hover { color: var(--moon-gold); }
.menu a::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0;
  height: 1px; background: var(--moon-gold);
  transform: scaleX(0); transform-origin: left;
  transition: transform .3s ease;
}
.menu a:hover::after { transform: scaleX(1); }

.menu-toggle {
  display: none; background: none; border: none; cursor: pointer;
  width: 28px; height: 22px; position: relative;
}
.menu-toggle span {
  position: absolute; left: 0; right: 0; height: 1px;
  background: var(--moon-gold); transition: transform .3s ease, opacity .3s ease;
}
.menu-toggle span:nth-child(1) { top: 4px; }
.menu-toggle span:nth-child(2) { top: 10px; }
.menu-toggle span:nth-child(3) { top: 16px; }

/* ============ Hero ============ */
.hero {
  position: relative; min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 8rem 2rem 4rem;
  z-index: 1;
  overflow: hidden;
}
.hero-bg {
  position: absolute; inset: 0; pointer-events: none; overflow: hidden;
}

/* ============ 巨型監寫字母背景 ============ */
.hero-monogram {
  position: absolute;
  top: 50%; left: 50%;
  /* 滑鼠視差: translate(-50%, -50%) 維持置中，疊加 mx/my 位移 */
  transform: translate(-50%, -50%)
             translate(calc(var(--mx, 0) * -28px), calc(var(--my, 0) * -18px));
  font-family: var(--font-serif-en);
  font-style: italic; font-weight: 300;
  font-size: clamp(11rem, 28vw, 24rem);
  line-height: 0.85; letter-spacing: -0.04em;
  color: transparent;
  -webkit-text-stroke: 1px rgba(212, 168, 80, 0.10);
  white-space: nowrap;
  user-select: none;
  z-index: 1;
  will-change: transform;
}
.hero-monogram .mono-amp {
  font-size: 0.4em; vertical-align: 0.35em;
  -webkit-text-stroke: 1px rgba(212, 168, 80, 0.2);
}

/* ============ 月相系統 ============ */
.moon-system {
  position: absolute;
  top: 14%; right: 9%;
  width: 240px; height: 240px;
  z-index: 2;
  /* 滑鼠視差：月亮跟著滑鼠走（同方向，最近層） */
  transform: translate(calc(var(--mx, 0) * 32px), calc(var(--my, 0) * 22px));
  will-change: transform;
}
.moon-ring {
  position: absolute; border-radius: 50%;
  border: 0.5px solid rgba(212, 168, 80, 0.18);
  animation: ring-rotate 60s linear infinite;
}
.moon-ring-outer { inset: -70px; }
.moon-ring-outer::before {
  content: ''; position: absolute;
  top: -3px; left: 50%; transform: translateX(-50%);
  width: 6px; height: 6px; border-radius: 50%;
  background: #e8c570;
  box-shadow: 0 0 8px rgba(232, 197, 112, 0.6);
}
.moon-ring-mid {
  inset: -36px;
  border-color: rgba(212, 168, 80, 0.25);
  animation-duration: 40s;
  animation-direction: reverse;
}
.moon-ring-mid::before {
  content: ''; position: absolute;
  bottom: -2px; left: 30%;
  width: 4px; height: 4px; border-radius: 50%;
  background: #fff4e0;
  box-shadow: 0 0 6px rgba(255, 244, 224, 0.7);
}
@keyframes ring-rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.moon-glow-new {
  position: absolute; inset: -10px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(232, 197, 112, 0.32) 0%, rgba(212, 168, 80, 0.08) 45%, transparent 75%);
  animation: moon-pulse 8s ease-in-out infinite;
}
.moon-new {
  position: absolute; inset: 30px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 30%, #fff8dc 0%, #f5d090 35%, #d4a850 75%, #a07840 100%);
  box-shadow:
    inset -10px -10px 30px rgba(120, 80, 30, 0.4),
    0 0 80px rgba(232, 197, 112, 0.4);
}
.crater {
  position: absolute; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(120, 80, 30, 0.5), rgba(80, 50, 15, 0.3));
}
.crater-1 { width: 22px; height: 22px; top: 28%; left: 24%; }
.crater-2 { width: 12px; height: 12px; top: 55%; left: 48%; }
.crater-3 { width: 16px; height: 16px; top: 38%; left: 62%; }

.moon-phase {
  position: absolute;
  bottom: -34px; left: 50%; transform: translateX(-50%);
  font-family: var(--font-sans-en);
  font-size: 10px; letter-spacing: 4px;
  color: var(--moon-gold);
  white-space: nowrap;
  opacity: 0.7;
}

@keyframes moon-pulse {
  0%, 100% { opacity: 0.85; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.04); }
}

/* ============ 主視覺星座 ============ */
.hero-constellation {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  opacity: 0.6;
  z-index: 1;
  /* 滑鼠視差：中層，反向移動 */
  transform: translate(calc(var(--mx, 0) * -45px), calc(var(--my, 0) * -28px));
  will-change: transform;
}

/* ============ 底部薄霧 ============ */
.hero-fog {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 280px;
  background: linear-gradient(to top, rgba(6, 12, 36, 0.85) 0%, rgba(6, 12, 36, 0.4) 50%, transparent 100%);
  pointer-events: none;
  z-index: 1;
}

/* ============ 編輯欄 ‧ 垂直文字 ============ */
.hero-sidebar {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  z-index: 3; pointer-events: none;
}
.hero-sidebar-left { left: 1.5rem; }
.hero-sidebar-right { right: 1.5rem; }
.hero-sidebar .sidebar-text {
  display: block;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-family: var(--font-sans-en);
  font-size: 11px;
  letter-spacing: 6px;
  color: var(--moon-gold);
  opacity: 0.45;
  white-space: nowrap;
}
.hero-sidebar-left .sidebar-text { transform: rotate(180deg); }

/* ============ 轉角飾紋 ============ */
.corner-orn {
  position: absolute;
  width: 70px; height: 70px;
  color: var(--moon-gold);
  opacity: 0.55;
  z-index: 2;
  pointer-events: none;
}
.corner-tl { top: 6rem; left: 2.5rem; }
.corner-br { bottom: 2.5rem; right: 2.5rem; }
.corner-orn svg { width: 100%; height: 100%; }

/* ============ 標題分隔 ============ */
.title-divider {
  display: inline-block;
  width: 50px; height: 1px;
  background: var(--moon-gold);
  vertical-align: middle;
  margin: 0 1.2rem;
  opacity: 0.7;
  position: relative;
}
.title-divider::before {
  content: ''; position: absolute;
  top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 5px; height: 5px;
  background: var(--moon-gold);
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(212, 168, 80, 0.6);
}

.brand-line .line { width: 50px; height: 1px; background: var(--moon-gold); }
.brand-line .line-right { width: 30px; }

/* ============ 主視覺進場動畫 ============ */
.brand-line, .hero-title, .hero-eyebrow, .hero-sub, .hero-cta {
  opacity: 0;
  transform: translateY(20px);
  animation: hero-enter 1.1s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
}
.brand-line { animation-delay: 0.2s; }
.hero-title { animation-delay: 0.4s; }
.hero-eyebrow { animation-delay: 0.8s; }
.hero-sub { animation-delay: 1.0s; }
.hero-cta { animation-delay: 1.2s; }
.moon-system, .hero-constellation, .hero-monogram, .corner-orn, .hero-sidebar {
  opacity: 0;
  animation: hero-fade-bg 1.6s ease-out forwards;
}
.hero-monogram { animation-delay: 0.1s; }
.hero-constellation { animation-delay: 0.3s; }
.moon-system { animation-delay: 0.5s; }
.corner-orn, .hero-sidebar { animation-delay: 1.4s; }

@keyframes hero-enter {
  to { opacity: 1; transform: translateY(0); }
}
@keyframes hero-fade-bg {
  to { opacity: 1; }
}

.hero-content {
  position: relative; z-index: 2;
  max-width: 720px; width: 100%;
}
.brand-line {
  display: flex; align-items: center; gap: 12px; margin-bottom: 2.5rem;
}
.brand-line .line {
  width: 60px; height: 1px; background: var(--moon-gold);
}
.brand-tag {
  font-family: var(--font-sans-en);
  font-size: 12px; letter-spacing: 4px;
  color: var(--moon-gold); font-weight: 400;
}
.hero-title {
  font-family: var(--font-serif-zh);
  font-weight: 400;
  font-size: clamp(2rem, 4.4vw, 3.4rem);
  line-height: 1.15;
  letter-spacing: 0.04em;
  margin-bottom: 1.5rem;
}
.hero-title .zh {
  color: var(--moonlight-white);
  margin-right: 1.2rem;
}
.hero-title .en {
  font-family: var(--font-serif-en);
  font-style: italic;
  font-weight: 300;
  color: var(--stardust-gold);
  font-size: 0.92em;
}
.hero-eyebrow {
  font-family: var(--font-sans-en);
  font-size: 13px; letter-spacing: 4px;
  color: var(--cool-text); margin-bottom: .5rem;
}
.hero-sub {
  font-family: var(--font-serif-zh); font-style: italic;
  font-size: clamp(1rem, 1.4vw, 1.2rem);
  color: var(--soft-text); margin-bottom: 3rem;
  letter-spacing: 0.1em;
}
.hero-cta { display: flex; gap: 1rem; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 28px;
  font-family: var(--font-sans-en);
  font-size: 12px; letter-spacing: 3px; font-weight: 500;
  border: 0.5px solid var(--moon-gold);
  color: var(--moon-gold);
  background: transparent;
  cursor: pointer;
  transition: all .3s ease;
  position: relative;
  overflow: hidden;
}
.btn::before {
  content: ''; position: absolute; inset: 0;
  background: var(--moon-gold);
  transform: scaleX(0); transform-origin: right;
  transition: transform .35s ease; z-index: -1;
}
.btn:hover::before { transform: scaleX(1); transform-origin: left; }
.btn-primary:hover { color: var(--deep-night); }
.btn-ghost { border-color: rgba(168, 184, 212, 0.4); color: var(--cool-text); }
.btn-ghost::before { background: var(--cool-text); }
.btn-ghost:hover { color: var(--deep-night); border-color: var(--cool-text); }

.scroll-cue {
  position: absolute; bottom: 2rem; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  font-family: var(--font-sans-en);
  font-size: 11px; letter-spacing: 3px;
  color: var(--soft-text);
}
.cue-line {
  width: 1px; height: 50px; background: var(--moon-gold);
  position: relative; overflow: hidden;
}
.cue-line::after {
  content: ''; position: absolute; top: -100%; left: 0; width: 100%; height: 50%;
  background: var(--deep-night);
  animation: scrollPulse 2s ease-in-out infinite;
}
@keyframes scrollPulse {
  0% { top: -50%; } 100% { top: 100%; }
}

/* ============ Section common ============ */
.section { position: relative; z-index: 1; padding: 8rem 2rem; overflow: hidden; }
.container { max-width: var(--max-w); margin: 0 auto; position: relative; z-index: 2; }

/* 區塊角落星座裝飾 */
.constellation-decor {
  position: absolute;
  width: clamp(180px, 22vw, 280px);
  height: auto;
  opacity: 0.55;
  pointer-events: none;
  z-index: 1;
  animation: constellation-fade 12s ease-in-out infinite;
}
.constellation-tr { top: 4rem; right: 3rem; }
.constellation-tl { top: 4rem; left: 3rem; }
@keyframes constellation-fade {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.7; }
}
.section-head { text-align: center; margin-bottom: 5rem; }
.section-num {
  display: block;
  font-family: var(--font-serif-en); font-style: italic;
  font-size: clamp(4rem, 10vw, 7rem); font-weight: 300;
  color: var(--moon-gold); opacity: 0.25;
  line-height: 1; margin-bottom: -0.5rem;
}
.section-eyebrow {
  display: inline-block;
  font-family: var(--font-sans-en); font-size: 12px;
  letter-spacing: 5px; color: var(--moon-gold);
  margin-bottom: 1rem; position: relative; padding: 0 24px;
}
.section-eyebrow::before, .section-eyebrow::after {
  content: ''; position: absolute; top: 50%; width: 16px; height: 1px;
  background: var(--moon-gold); opacity: 0.5;
}
.section-eyebrow::before { right: 100%; }
.section-eyebrow::after { left: 100%; }
.section-title {
  font-family: var(--font-serif-zh); font-weight: 400;
  font-size: clamp(2rem, 4vw, 2.8rem);
  color: var(--moonlight-white); letter-spacing: 0.05em;
  margin-bottom: 1rem;
}
.section-desc {
  max-width: 600px; margin: 0 auto;
  color: var(--cool-text); font-size: 15px;
  font-family: var(--font-serif-zh); font-style: italic;
  letter-spacing: 0.05em;
}
.sub-title {
  font-family: var(--font-serif-zh); font-weight: 400;
  font-size: 1.5rem; color: var(--stardust-gold);
  margin-bottom: 2rem; letter-spacing: 0.1em;
}

/* ============ About ============ */
.about-grid {
  display: grid; grid-template-columns: 280px 1fr; gap: 4rem;
  align-items: start; margin-bottom: 5rem;
}
.about-photo { text-align: center; }
.photo-frame {
  width: 220px; height: 220px; border-radius: 50%;
  margin: 0 auto 1rem;
  background: var(--nebula);
  border: 1px solid var(--line-color);
  padding: 8px;
  position: relative;
}
.photo-frame::before {
  content: ''; position: absolute; inset: -8px;
  border-radius: 50%; border: 0.5px solid var(--moon-gold);
  opacity: 0.4;
}
.photo-frame img {
  width: 100%; height: 100%; border-radius: 50%;
  object-fit: cover; object-position: center;
}
.photo-caption {
  font-family: var(--font-serif-zh); font-style: italic;
  color: var(--stardust-gold); letter-spacing: 0.1em;
  font-size: 14px;
}
.about-text .lead {
  font-family: var(--font-serif-zh);
  font-size: 1.15rem; line-height: 1.9;
  color: var(--moonlight-white); margin-bottom: 1.5rem;
  letter-spacing: 0.05em;
}
.about-text p { color: var(--cool-text); margin-bottom: 2rem; font-size: 15px; }
.info-rows { border-top: 0.5px solid var(--line-color); padding-top: 1.5rem; }
.info-row {
  display: grid; grid-template-columns: 80px 1fr; gap: 1.5rem;
  padding: 0.8rem 0; border-bottom: 0.5px solid rgba(212, 168, 80, 0.1);
  font-size: 14px;
}
.info-label {
  font-family: var(--font-sans-en); font-size: 11px;
  letter-spacing: 2px; color: var(--moon-gold);
  padding-top: 4px;
}
.info-value { color: var(--cool-text); }

.timeline { max-width: 880px; margin: 0 auto; }
.career-list { list-style: none; }
.career-list li {
  display: grid; grid-template-columns: 140px 1fr; gap: 2rem;
  padding: 1.2rem 0;
  border-bottom: 0.5px solid rgba(212, 168, 80, 0.12);
  align-items: baseline;
  font-size: 14px;
}
.career-list .year {
  font-family: var(--font-sans-en); font-size: 12px;
  letter-spacing: 2px; color: var(--moon-gold);
}
.career-list .entry { color: var(--cool-text); line-height: 1.7; }

/* ============ Works grid (4 欄 × 桌機，共 9 張：2 列 4 + 1 張) ============ */
.works-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.3rem;
}
@media (max-width: 1024px) {
  .works-grid { grid-template-columns: repeat(3, 1fr); gap: 1.1rem; }
}
@media (max-width: 760px) {
  .works-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
}
@media (max-width: 480px) {
  .works-grid { grid-template-columns: 1fr; gap: 1rem; }
}
/* w09 數位創作/剪輯 ‧ 影片封面 (YouTube 縮圖 + 播放疊層) */
.work-video-cover {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--deep-night);
  position: relative;
}
.work-video-cover img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .6s ease;
}
.work-card:hover .work-video-cover img { transform: scale(1.05); }
.work-video-cover::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(6, 12, 36, 0.4), transparent 50%);
  pointer-events: none;
}
.play-icon-overlay {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 64px; height: 64px;
  border-radius: 50%;
  background: rgba(6, 12, 36, 0.55);
  border: 1px solid var(--moon-gold);
  display: flex; align-items: center; justify-content: center;
  color: var(--moon-gold);
  z-index: 2;
  transition: transform .4s ease, background .4s ease;
}
.play-icon-overlay svg { width: 22px; height: 22px; margin-left: 3px; }
.work-card:hover .play-icon-overlay {
  transform: translate(-50%, -50%) scale(1.1);
  background: rgba(212, 168, 80, 0.25);
}
/* w09 數位創作/剪輯 ‧ 影片佔位封面 (尚無縮圖時的視覺) */
.work-img-placeholder {
  aspect-ratio: 4 / 3;
  background:
    radial-gradient(circle at 30% 40%, rgba(212, 168, 80, 0.18), transparent 50%),
    radial-gradient(circle at 70% 60%, rgba(122, 158, 224, 0.18), transparent 55%),
    linear-gradient(135deg, var(--nebula), var(--deep-sea));
  display: flex; align-items: center; justify-content: center;
  position: relative;
  overflow: hidden;
}
.work-img-placeholder::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(6, 12, 36, 0.4), transparent 50%);
}
.work-img-placeholder .play-icon {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: rgba(212, 168, 80, 0.15);
  border: 1px solid var(--moon-gold);
  display: flex; align-items: center; justify-content: center;
  color: var(--moon-gold);
  position: relative; z-index: 1;
  transition: transform .4s ease, background .4s ease;
}
.work-card:hover .work-img-placeholder .play-icon {
  transform: scale(1.1);
  background: rgba(212, 168, 80, 0.25);
}
.work-img-placeholder .play-icon svg { width: 22px; height: 22px; margin-left: 3px; }
/* ============ 作品詳細頁影片嵌入 (YouTube iframe) ============ */
.masonry-item.video-item {
  break-inside: avoid;
  margin-bottom: 1rem;
  background: rgba(0, 0, 0, 0.3);
  border: 0.5px solid var(--line-color);
}
.masonry-item.video-item .video-wrap {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 */
  height: 0;
  overflow: hidden;
  background: #000;
}
.masonry-item.video-item .video-wrap iframe {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border: 0;
}
.video-caption {
  padding: 0.75rem 0.85rem 0.9rem;
}
.video-caption h4 {
  font-family: var(--font-serif-zh);
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--moonlight-white);
  letter-spacing: 0.03em;
  line-height: 1.45;
  margin: 0 0 0.3rem;
}
.video-title-quote { color: var(--moonlight-white); }
.video-subtitle {
  font-size: 0.82rem;
  color: var(--cool-text);
  opacity: 0.85;
  font-weight: 300;
}
.video-meta {
  font-family: var(--font-sans-en);
  font-size: 10.5px;
  letter-spacing: 1.8px;
  color: var(--moon-gold);
  opacity: 0.75;
  margin: 0;
  text-transform: uppercase;
}
.masonry-item.video-pending {
  break-inside: avoid;
  margin-bottom: 1rem;
  aspect-ratio: 16 / 9;
  background:
    repeating-linear-gradient(45deg,
      rgba(212, 168, 80, 0.04) 0 12px,
      transparent 12px 24px),
    linear-gradient(135deg, var(--nebula), var(--deep-sea));
  border: 1px dashed rgba(212, 168, 80, 0.35);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  padding: 1rem;
  color: var(--cool-text);
}
.masonry-item.video-pending .pending-icon {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(212, 168, 80, 0.45);
  display: flex; align-items: center; justify-content: center;
  color: var(--moon-gold);
  margin-bottom: 0.8rem;
}
.masonry-item.video-pending .pending-title {
  font-family: var(--font-serif-zh);
  color: var(--moonlight-white);
  font-size: 1rem;
  letter-spacing: 0.04em;
  margin-bottom: 0.3rem;
}
.masonry-item.video-pending .pending-hint {
  font-family: var(--font-sans-en);
  font-size: 10px;
  letter-spacing: 1.5px;
  color: var(--cool-text-faint);
  opacity: 0.8;
}
.work-card {
  position: relative;
  background: linear-gradient(135deg, var(--nebula), var(--deep-sea));
  border: 0.5px solid var(--line-color);
  overflow: hidden;
  transition: transform .4s ease, border-color .4s ease;
  cursor: pointer;
}
.work-card:hover {
  transform: translateY(-6px);
  border-color: var(--moon-gold);
}
.work-num {
  position: absolute; top: 0.7rem; right: 0.9rem; z-index: 2;
  font-family: var(--font-serif-en); font-style: italic;
  font-size: 1.9rem; font-weight: 300;
  color: var(--moon-gold); opacity: 0.3;
  line-height: 1;
}
.work-img {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--deep-night);
  position: relative;
}
.work-img::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(6, 12, 36, 0.4), transparent 50%);
}
.work-img img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .6s ease;
}
.work-card:hover .work-img img { transform: scale(1.05); }
.work-meta { padding: 1rem 1.1rem 1.15rem; position: relative; z-index: 1; }
.work-cat {
  display: block;
  font-family: var(--font-sans-en); font-size: 9px;
  letter-spacing: 2px; color: var(--moon-gold);
  margin-bottom: 0.35rem;
  opacity: 0.85;
}
.work-meta h3 {
  font-family: var(--font-serif-zh); font-weight: 400;
  font-size: 1.02rem; letter-spacing: 0.05em;
  color: var(--moonlight-white); margin-bottom: 0.25rem;
  line-height: 1.4;
}
.work-meta p {
  font-size: 11.5px; color: var(--soft-text);
  font-family: var(--font-serif-zh); font-style: italic;
  letter-spacing: 0.04em;
  opacity: 0.9;
}

/* ============ Nav 工具區（語言切換 + 鍵盤說明） ============ */
.nav-utils {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-left: 1.2rem;
}
.lang-toggle, .kbd-help-btn {
  background: transparent;
  border: 0.5px solid rgba(212, 168, 80, 0.3);
  color: var(--cool-text);
  border-radius: 999px;
  cursor: pointer;
  transition: all .25s ease;
  display: inline-flex;
  align-items: center;
  font-family: var(--font-sans-en);
}
.lang-toggle {
  padding: 0.35rem 0.75rem;
  font-size: 11px;
  letter-spacing: 1.5px;
  gap: 0.3rem;
}
.lang-toggle .lang-sep {
  opacity: 0.4;
  font-weight: 300;
}
.lang-toggle .lang-zh,
.lang-toggle .lang-en {
  transition: color .25s ease;
  font-weight: 400;
}
.lang-toggle .lang-zh.active,
.lang-toggle .lang-en.active {
  color: var(--moon-gold);
  font-weight: 500;
}
.lang-toggle:hover {
  border-color: var(--moon-gold);
  background: rgba(212, 168, 80, 0.08);
}
.kbd-help-btn {
  padding: 0.42rem 0.55rem;
  width: 32px;
  height: 32px;
  justify-content: center;
}
.kbd-help-btn:hover {
  border-color: var(--moon-gold);
  color: var(--moon-gold);
  background: rgba(212, 168, 80, 0.08);
}

/* 行動裝置：隱藏 nav-utils 文字、僅保留圖標式 */
@media (max-width: 768px) {
  .nav-utils { margin-left: 0.6rem; gap: 0.4rem; }
  .lang-toggle { padding: 0.3rem 0.55rem; font-size: 10px; letter-spacing: 1px; }
}

/* ============ 鍵盤快捷鍵說明 Overlay ============ */
.kbd-overlay {
  position: fixed;
  inset: 0;
  z-index: 250;
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s ease, visibility .3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.kbd-overlay.show {
  opacity: 1;
  visibility: visible;
}
.kbd-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 12, 36, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.kbd-panel {
  position: relative;
  z-index: 1;
  background: linear-gradient(135deg, #0d1a40, #06091e);
  border: 0.5px solid rgba(212, 168, 80, 0.35);
  border-radius: 8px;
  padding: 2rem 2.2rem 1.8rem;
  width: 100%;
  max-width: 460px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  transform: translateY(20px) scale(0.96);
  transition: transform .35s cubic-bezier(0.2, 0.9, 0.3, 1.3);
  max-height: 90vh;
  overflow-y: auto;
}
.kbd-overlay.show .kbd-panel { transform: translateY(0) scale(1); }
.kbd-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
  gap: 1rem;
}
.kbd-title {
  font-family: var(--font-serif-zh);
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--moonlight-white);
  margin: 0 0 0.3rem;
  letter-spacing: 0.04em;
}
.kbd-sub {
  font-family: var(--font-sans-en);
  font-size: 10.5px;
  letter-spacing: 2px;
  color: var(--moon-gold);
  margin: 0;
  text-transform: uppercase;
  opacity: 0.85;
}
.kbd-close {
  background: transparent;
  border: 0.5px solid rgba(212, 168, 80, 0.3);
  color: var(--cool-text);
  width: 32px; height: 32px;
  border-radius: 50%;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  transition: all .25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.kbd-close:hover {
  border-color: var(--moon-gold);
  color: var(--moon-gold);
}
.kbd-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.kbd-list li {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.5rem 0;
  font-family: var(--font-serif-zh);
  font-size: 0.95rem;
  color: var(--moonlight-white);
  border-bottom: 0.5px dashed rgba(212, 168, 80, 0.08);
}
.kbd-list li.kbd-sep {
  border-bottom: 0;
  height: 0.4rem;
  padding: 0;
}
.kbd-list li:last-child { border-bottom: 0; }
.kbd-list kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 28px;
  padding: 0 0.5rem;
  background: rgba(212, 168, 80, 0.12);
  border: 0.5px solid rgba(212, 168, 80, 0.4);
  border-radius: 4px;
  font-family: var(--font-sans-en);
  font-size: 12px;
  font-weight: 500;
  color: var(--moon-gold);
  letter-spacing: 0;
}
.kbd-tip {
  font-family: var(--font-sans-en);
  font-size: 10.5px;
  letter-spacing: 1.5px;
  color: var(--soft-text);
  margin: 1.3rem 0 0;
  text-align: center;
  opacity: 0.7;
}

/* ============ 跳區塊閃光提示 (鍵盤快捷鍵觸發後的視覺回饋) ============ */
.section-flash {
  animation: section-flash-anim 0.8s ease-out;
}
@keyframes section-flash-anim {
  0% { box-shadow: inset 0 0 0 0 rgba(232, 197, 112, 0); }
  20% { box-shadow: inset 0 0 100px 20px rgba(232, 197, 112, 0.18); }
  100% { box-shadow: inset 0 0 0 0 rgba(232, 197, 112, 0); }
}

/* ============ 無障礙：跳至主要內容 ============ */
.skip-to-content {
  position: absolute;
  top: -100px;
  left: 1rem;
  background: var(--moon-gold);
  color: #0a1230;
  padding: 0.7rem 1.2rem;
  border-radius: 4px;
  font-family: var(--font-sans-en);
  font-size: 12px;
  letter-spacing: 1.5px;
  text-decoration: none;
  font-weight: 500;
  z-index: 1000;
  transition: top .2s ease;
}
.skip-to-content:focus {
  top: 1rem;
  outline: 2px solid var(--moonlight-white);
  outline-offset: 2px;
}

/* ============ 無障礙：清楚的鍵盤焦點環 ============ */
:focus-visible {
  outline: 2px solid var(--moon-gold);
  outline-offset: 2px;
  border-radius: 3px;
}
button:focus-visible,
a:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--moon-gold);
  outline-offset: 3px;
  box-shadow: 0 0 0 4px rgba(212, 168, 80, 0.18);
}
/* 滑鼠點擊不顯示焦點環，只有鍵盤 Tab 才顯示 */
:focus:not(:focus-visible) { outline: none; }

/* 降低動畫對怕暈眩使用者的影響 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .meteor, .wish-star, .star-rail { display: none !important; }
}

/* ============ 回頂端按鈕 ============ */
.back-to-top {
  position: fixed;
  bottom: 1.6rem;
  left: 1.6rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  width: 48px;
  height: 48px;
  background: rgba(10, 18, 48, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 0.5px solid rgba(212, 168, 80, 0.4);
  border-radius: 50%;
  color: var(--moon-gold);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: opacity .4s ease, visibility .4s ease, transform .4s ease, background .25s ease, border-color .25s ease;
  z-index: 100;
  font-family: var(--font-sans-en);
  font-size: 8.5px;
  letter-spacing: 1px;
  padding: 0;
}
.back-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.back-to-top:hover {
  background: rgba(212, 168, 80, 0.18);
  border-color: var(--moon-gold);
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(212, 168, 80, 0.2);
}
.back-to-top:active { transform: translateY(0); }
.back-to-top svg { display: block; }
.btt-label {
  font-size: 7.5px;
  letter-spacing: 1.5px;
  opacity: 0.85;
  margin-top: 1px;
}

/* 手機調整 */
@media (max-width: 768px) {
  .back-to-top {
    bottom: 1rem; left: 1rem;
    width: 42px; height: 42px;
  }
  .btt-label { display: none; }
}

/* ============ 滾動進度條 (頂部金色細線) ============ */
.scroll-progress {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: rgba(212, 168, 80, 0.08);
  z-index: 200;
  pointer-events: none;
}
.scroll-progress-bar {
  height: 100%;
  width: 100%;
  transform-origin: left center;
  transform: scaleX(0);
  background: linear-gradient(90deg,
    rgba(232, 197, 112, 0.6) 0%,
    rgba(232, 197, 112, 1) 50%,
    rgba(244, 200, 130, 1) 100%);
  box-shadow: 0 0 8px rgba(232, 197, 112, 0.5);
  transition: transform 0.08s linear;
  will-change: transform;
}

/* ============ Portfolio Flipbook (電子書翻閱) ============ */
.section.portfolio {
  background:
    radial-gradient(ellipse at 80% 20%, rgba(212, 168, 80, 0.06), transparent 60%),
    radial-gradient(ellipse at 20% 80%, rgba(122, 158, 224, 0.05), transparent 55%);
}
.flipbook-stage {
  position: relative;
  margin-top: 2.5rem;
  padding: 1.5rem 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 500px;
}
.flipbook {
  position: relative;
  margin: 0 auto;
  /* StPageFlip 會自行寫入寬高 */
  filter: drop-shadow(0 30px 60px rgba(0, 0, 0, 0.45))
          drop-shadow(0 10px 20px rgba(0, 0, 0, 0.25));
}
.fb-page {
  background-color: #fffaf2;
  width: 100%;
  height: 100%;
  overflow: hidden;
  display: block;
}
.fb-page img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fffaf2;
  -webkit-user-drag: none;
  user-drag: none;
  pointer-events: none;
}

/* 控制列 */
.flipbook-controls {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 1.6rem;
  padding: 0.7rem 1.1rem;
  background: rgba(13, 26, 64, 0.55);
  border: 0.5px solid rgba(212, 168, 80, 0.25);
  border-radius: 999px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: opacity .4s ease;
}
.flipbook-controls[aria-hidden="true"] {
  opacity: 0;
  pointer-events: none;
}
.fb-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: transparent;
  border: 0.5px solid rgba(212, 168, 80, 0.35);
  color: var(--moonlight-white);
  font-family: var(--font-sans-en);
  font-size: 11px;
  letter-spacing: 1.5px;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all .25s ease;
  text-decoration: none;
}
.fb-btn:hover {
  background: rgba(212, 168, 80, 0.12);
  border-color: var(--moon-gold);
  color: var(--moon-gold);
}
.fb-btn.fb-prev, .fb-btn.fb-next {
  padding: 0.45rem 0.7rem;
}
.fb-counter {
  font-family: var(--font-serif-en);
  font-style: italic;
  color: var(--moon-gold);
  font-size: 14px;
  min-width: 60px;
  text-align: center;
  letter-spacing: 0.05em;
}
.fb-counter-sep {
  margin: 0 0.3em;
  opacity: 0.5;
}
.fb-divider {
  width: 1px;
  height: 18px;
  background: rgba(212, 168, 80, 0.3);
  margin: 0 0.2rem;
}
.fb-btn-label {
  display: inline;
}

/* 載入指示器 */
.flipbook-loading {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--cool-text);
}
.fb-loader-ring {
  width: 44px; height: 44px;
  border: 1.5px solid rgba(212, 168, 80, 0.2);
  border-top-color: var(--moon-gold);
  border-radius: 50%;
  margin: 0 auto 1.2rem;
  animation: fb-spin 1.1s linear infinite;
}
@keyframes fb-spin { to { transform: rotate(360deg); } }
.fb-loader-text {
  font-family: var(--font-serif-zh);
  color: var(--moonlight-white);
  font-size: 0.95rem;
  margin: 0 0 0.4rem;
  letter-spacing: 0.04em;
}
.fb-loader-text #fbLoadProgress {
  color: var(--moon-gold);
  font-family: var(--font-serif-en);
  font-style: italic;
  margin-left: 0.4em;
}
.fb-loader-hint {
  font-family: var(--font-sans-en);
  font-size: 10.5px;
  letter-spacing: 1.5px;
  color: var(--soft-text);
  margin: 0;
  opacity: 0.65;
}

/* 全螢幕模式樣式 */
.flipbook-stage:fullscreen,
.flipbook-stage:-webkit-full-screen {
  background: radial-gradient(ellipse at center, #0a1230 0%, #06091e 100%);
  padding: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

/* 行動裝置調整 */
@media (max-width: 760px) {
  .flipbook-controls {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.6rem 0.8rem;
  }
  .fb-btn-label { display: none; }
  .fb-btn.fb-download .fb-btn-label,
  .fb-btn.fb-fullscreen .fb-btn-label { display: none; }
  .flipbook { filter: drop-shadow(0 12px 30px rgba(0, 0, 0, 0.5)); }
}

/* ============ Research ============ */
.research-subtitle {
  display: flex; align-items: baseline; gap: 1rem;
  margin: 4rem 0 2rem;
  padding-bottom: 1rem;
  border-bottom: 0.5px solid var(--line-color);
}
.research-subtitle:first-of-type { margin-top: 0; }
.rs-num {
  font-family: var(--font-serif-en); font-style: italic;
  font-size: 1.5rem; color: var(--moon-gold);
  letter-spacing: 0.05em;
}
.rs-en {
  font-family: var(--font-sans-en); font-size: 11px;
  letter-spacing: 4px; color: var(--moon-gold);
  margin-left: auto; order: 2;
}
.rs-zh {
  font-family: var(--font-serif-zh); font-weight: 400;
  font-size: 1.4rem; color: var(--moonlight-white);
  letter-spacing: 0.1em;
}

/* Master's Thesis */
.thesis-block {
  display: grid; grid-template-columns: 100px 1fr; gap: 2rem;
  align-items: start;
  padding: 2rem;
  background: linear-gradient(135deg, rgba(26, 45, 94, 0.5), rgba(13, 26, 64, 0.3));
  border-left: 2px solid var(--moon-gold);
  margin-bottom: 1rem;
}
.thesis-title {
  font-family: var(--font-serif-zh); font-weight: 500;
  font-size: 1.25rem; color: var(--moonlight-white);
  letter-spacing: 0.05em; line-height: 1.5;
  margin-bottom: 0.5rem;
}
.thesis-en {
  font-family: var(--font-serif-en); font-style: italic;
  font-size: 1rem; color: var(--stardust-gold);
  line-height: 1.5; margin-bottom: 0.8rem;
  letter-spacing: 0.02em;
}

.research-year {
  font-family: var(--font-serif-en); font-style: italic;
  font-size: 1.8rem; font-weight: 300;
  color: var(--moon-gold);
  letter-spacing: 0.05em; line-height: 1;
  white-space: nowrap;
}
.research-meta {
  font-size: 13px; color: var(--soft-text);
  letter-spacing: 0.1em;
  font-family: var(--font-sans-en);
}

/* Publications */
.pub-group-title {
  font-family: var(--font-sans-en); font-size: 12px;
  letter-spacing: 3px; color: var(--moon-gold);
  margin: 2rem 0 1rem;
  padding-left: 1rem;
  border-left: 1px solid var(--moon-gold);
}
.pub-list { list-style: none; }
.pub-item {
  display: grid; grid-template-columns: 80px 1fr; gap: 2rem;
  padding: 1.5rem 1rem;
  border-bottom: 0.5px solid rgba(212, 168, 80, 0.1);
  align-items: start;
  transition: background .25s ease, padding-left .25s ease;
}
.pub-item:hover {
  background: rgba(212, 168, 80, 0.05);
  padding-left: 1.5rem;
}
.pub-item:last-child { border-bottom: none; }
.pub-item .research-year { font-size: 1.4rem; }
.pub-body { min-width: 0; }
.pub-title {
  font-family: var(--font-serif-zh); font-weight: 400;
  font-size: 15px; line-height: 1.6;
  color: var(--moonlight-white); margin-bottom: 0.5rem;
  letter-spacing: 0.02em;
}
.pub-venue {
  font-family: var(--font-serif-en); font-style: italic;
  font-size: 13px; line-height: 1.6;
  color: var(--cool-text);
  letter-spacing: 0.02em;
}
.pub-tag {
  display: inline-block;
  font-family: var(--font-sans-en); font-style: normal;
  font-size: 10px; letter-spacing: 2px;
  padding: 2px 8px;
  margin-left: 8px;
  border: 0.5px solid var(--moon-gold);
  color: var(--moon-gold);
  border-radius: 2px;
  vertical-align: middle;
}
.pub-tag.award {
  background: var(--moon-gold);
  color: var(--deep-night);
  border-color: var(--moon-gold);
  font-weight: 500;
}

/* Research projects */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1.5rem;
}
.project-card {
  padding: 1.75rem 1.5rem;
  background: rgba(13, 26, 64, 0.4);
  border: 0.5px solid var(--line-color);
  position: relative;
  transition: background .3s ease, border-color .3s ease, transform .3s ease;
}
.project-card:hover {
  background: rgba(26, 45, 94, 0.55);
  border-color: var(--moon-gold);
  transform: translateY(-3px);
}
.project-card.featured {
  border-color: var(--moon-gold);
  background: linear-gradient(135deg, rgba(26, 45, 94, 0.6), rgba(13, 26, 64, 0.4));
}
.project-card.featured::before {
  content: 'PI'; position: absolute; top: -1px; right: -1px;
  font-family: var(--font-sans-en); font-size: 10px;
  letter-spacing: 2px; font-weight: 500;
  padding: 4px 10px;
  background: var(--moon-gold);
  color: var(--deep-night);
}
.project-year {
  display: block;
  font-family: var(--font-serif-en); font-style: italic;
  font-size: 1.3rem; font-weight: 400;
  color: var(--stardust-gold);
  margin-bottom: 0.3rem;
  letter-spacing: 0.05em;
}
.project-org {
  display: block;
  font-family: var(--font-sans-en); font-size: 10px;
  letter-spacing: 3px; color: var(--moon-gold);
  margin-bottom: 0.8rem;
}
.project-card h4 {
  font-family: var(--font-serif-zh); font-weight: 500;
  font-size: 0.95rem; line-height: 1.6;
  color: var(--moonlight-white);
  margin-bottom: 0.8rem;
  letter-spacing: 0.03em;
}
.project-role {
  font-size: 12px; color: var(--cool-text);
  letter-spacing: 0.05em;
  padding-top: 0.6rem;
  border-top: 0.5px solid rgba(212, 168, 80, 0.15);
}

.project-pending {
  margin-top: 3rem;
  padding: 1.5rem 2rem;
  border: 0.5px dashed var(--line-color);
  text-align: center;
}
.pending-label {
  display: inline-block;
  font-family: var(--font-sans-en); font-size: 10px;
  letter-spacing: 3px; color: var(--moon-gold);
  margin-bottom: 0.6rem;
  padding: 3px 10px;
  border: 0.5px solid var(--moon-gold);
}
.project-pending p {
  font-family: var(--font-serif-zh); font-style: italic;
  font-size: 14px; color: var(--cool-text);
  line-height: 1.7;
  letter-spacing: 0.02em;
}

/* Highlighted award card */
.award-card.highlight {
  background: linear-gradient(135deg, rgba(212, 168, 80, 0.08), rgba(26, 45, 94, 0.45));
  border-color: rgba(212, 168, 80, 0.5);
}
.award-card.highlight .award-year { color: var(--moon-gold); }

/* ============ Awards ============ */
.awards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}
.award-card {
  padding: 1.75rem 1.5rem;
  border: 0.5px solid var(--line-color);
  background: rgba(13, 26, 64, 0.4);
  transition: background .3s ease, border-color .3s ease;
}
.award-card:hover {
  background: rgba(26, 45, 94, 0.5);
  border-color: var(--moon-gold);
}
.award-year {
  display: block;
  font-family: var(--font-serif-en); font-style: italic;
  font-size: 1.5rem; font-weight: 400;
  color: var(--stardust-gold);
  margin-bottom: 0.6rem;
}
.award-card h4 {
  font-family: var(--font-serif-zh); font-weight: 500;
  font-size: 1rem; color: var(--moonlight-white);
  margin-bottom: 0.4rem; letter-spacing: 0.03em;
}
.award-card p { font-size: 13px; color: var(--cool-text); line-height: 1.6; }
.awards-note {
  text-align: center; font-size: 13px; color: var(--soft-text);
  font-family: var(--font-serif-zh); font-style: italic;
  letter-spacing: 0.1em; padding-top: 2rem;
  border-top: 0.5px solid var(--line-color);
}

/* ============ Contact (圖示版) ============ */
.contact-icons {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 3rem;
  flex-wrap: wrap;
  margin: 0 auto;
  max-width: 700px;
  padding: 1rem 0;
}
.contact-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
  color: var(--cool-text);
  transition: transform .3s cubic-bezier(0.2, 0.9, 0.3, 1.3);
}
.contact-icon:hover { transform: translateY(-4px); }
.ci-circle {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(13, 26, 64, 0.55);
  border: 0.5px solid rgba(212, 168, 80, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--moon-gold);
  transition: all .3s ease;
  position: relative;
  overflow: hidden;
}
.ci-circle::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 30%, rgba(212, 168, 80, 0.18), transparent 60%);
  opacity: 0;
  transition: opacity .35s ease;
}
.contact-icon:hover .ci-circle {
  border-color: var(--moon-gold);
  background: rgba(26, 45, 94, 0.7);
  box-shadow: 0 8px 24px rgba(212, 168, 80, 0.25),
              inset 0 0 0 1px rgba(232, 197, 112, 0.2);
}
.contact-icon:hover .ci-circle::before { opacity: 1; }
.ci-circle svg {
  width: 32px;
  height: 32px;
  position: relative;
  z-index: 1;
  transition: transform .35s ease;
}
.contact-icon:hover .ci-circle svg { transform: scale(1.08); }
.ci-label {
  font-family: var(--font-sans-en);
  font-size: 11px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--soft-text);
  transition: color .25s ease;
}
.contact-icon:hover .ci-label {
  color: var(--moon-gold);
}

/* 手機調整 */
@media (max-width: 600px) {
  .contact-icons { gap: 2rem; }
  .ci-circle { width: 60px; height: 60px; }
  .ci-circle svg { width: 26px; height: 26px; }
  .ci-label { font-size: 10px; letter-spacing: 2px; }
}

/* Footer icon links */
.footer-icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border-radius: 50%;
  transition: all .25s ease;
  background: transparent;
  border: 0;
  color: inherit;
  cursor: pointer;
  padding: 0;
}
.footer-icon-link:hover {
  background: rgba(26, 8, 16, 0.15);
  transform: translateY(-1px);
}
.footer-icon-link svg { display: block; }

/* contact-icon 也可能是 button (非 a 標籤) */
button.contact-icon {
  background: transparent;
  border: 0;
  cursor: pointer;
  font: inherit;
  padding: 0;
}

/* ============ 聯絡表單 Modal ============ */
.contact-form-overlay {
  position: fixed;
  inset: 0;
  z-index: 260;
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s ease, visibility .3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  overflow-y: auto;
}
.contact-form-overlay.show {
  opacity: 1;
  visibility: visible;
}
.cf-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(6, 9, 30, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.cf-panel {
  position: relative;
  z-index: 1;
  background: linear-gradient(135deg, #0d1a40, #06091e);
  border: 0.5px solid rgba(212, 168, 80, 0.35);
  border-radius: 10px;
  padding: 2.5rem 2.4rem 2.2rem;
  width: 100%;
  max-width: 520px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  transform: translateY(24px) scale(0.96);
  transition: transform .4s cubic-bezier(0.2, 0.9, 0.3, 1.3);
  max-height: 92vh;
  overflow-y: auto;
}
.contact-form-overlay.show .cf-panel {
  transform: translateY(0) scale(1);
}
.cf-close {
  position: absolute;
  top: 1rem;
  right: 1.1rem;
  background: transparent;
  border: 0.5px solid rgba(212, 168, 80, 0.3);
  color: var(--cool-text);
  width: 32px; height: 32px;
  border-radius: 50%;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition: all .25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}
.cf-close:hover {
  border-color: var(--moon-gold);
  color: var(--moon-gold);
  background: rgba(212, 168, 80, 0.1);
}

.cf-header {
  margin-bottom: 1.6rem;
}
.cf-eyebrow {
  display: block;
  font-family: var(--font-sans-en);
  font-size: 10.5px;
  letter-spacing: 3px;
  color: var(--moon-gold);
  margin-bottom: 0.5rem;
  opacity: 0.85;
}
.cf-title {
  font-family: var(--font-serif-zh);
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--moonlight-white);
  margin: 0 0 0.4rem;
  letter-spacing: 0.05em;
}
.cf-sub {
  font-family: var(--font-serif-zh);
  font-style: italic;
  font-size: 0.92rem;
  color: var(--cool-text);
  margin: 0;
  opacity: 0.85;
}

.cf-form {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}
.cf-row {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.cf-label {
  font-family: var(--font-sans-en);
  font-size: 10.5px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--soft-text);
}
.cf-input {
  background: rgba(6, 12, 36, 0.5);
  border: 0.5px solid rgba(212, 168, 80, 0.2);
  border-radius: 4px;
  color: var(--moonlight-white);
  padding: 0.75rem 0.9rem;
  font-family: var(--font-serif-zh);
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  transition: all .2s ease;
  width: 100%;
}
.cf-input:focus {
  outline: none;
  border-color: var(--moon-gold);
  background: rgba(13, 26, 64, 0.6);
  box-shadow: 0 0 0 3px rgba(212, 168, 80, 0.12);
}
.cf-input::placeholder {
  color: var(--soft-text);
  opacity: 0.55;
}
.cf-textarea {
  resize: vertical;
  min-height: 110px;
  line-height: 1.65;
  font-family: var(--font-serif-zh);
}
.cf-input[type="email"] {
  font-family: var(--font-serif-en);
}
select.cf-input {
  appearance: none;
  -webkit-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--moon-gold) 50%),
    linear-gradient(135deg, var(--moon-gold) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 50%,
    calc(100% - 13px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
  padding-right: 2rem;
  cursor: pointer;
}

.cf-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  padding: 0.95rem 1.5rem;
  background: var(--moon-gold);
  color: #0a1230;
  border: 0;
  border-radius: 999px;
  font-family: var(--font-sans-en);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all .25s ease;
}
.cf-submit:hover {
  background: var(--stardust-gold);
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(212, 168, 80, 0.35);
}
.cf-submit:active { transform: translateY(0); }
.cf-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.cf-privacy {
  font-family: var(--font-sans-en);
  font-size: 10px;
  letter-spacing: 1.2px;
  color: var(--soft-text);
  text-align: center;
  margin: 0.3rem 0 0;
  opacity: 0.6;
}

/* 送出成功面板 */
.cf-success {
  text-align: center;
  padding: 1rem 0 0.5rem;
  animation: cf-success-in .5s cubic-bezier(0.2, 0.9, 0.3, 1.3);
}
@keyframes cf-success-in {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}
.cf-success-icon {
  width: 70px; height: 70px;
  margin: 0 auto 1rem;
  background: rgba(212, 168, 80, 0.15);
  border: 1px solid var(--moon-gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--moon-gold);
}
.cf-success-title {
  font-family: var(--font-serif-zh);
  font-size: 1.3rem;
  color: var(--moonlight-white);
  margin: 0 0 0.5rem;
  letter-spacing: 0.04em;
}
.cf-success-text {
  font-family: var(--font-serif-zh);
  color: var(--cool-text);
  font-size: 0.95rem;
  margin: 0 0 1rem;
}

/* 手機調整 */
@media (max-width: 600px) {
  .cf-panel {
    padding: 2rem 1.5rem 1.5rem;
    border-radius: 8px;
  }
  .cf-title { font-size: 1.3rem; }
  .cf-input { padding: 0.65rem 0.8rem; font-size: 0.9rem; }
}

/* ============ Footer ============ */
.footer {
  position: relative; z-index: 1;
  border-top: 0.5px solid var(--line-color);
  padding: 3rem 2rem 2rem;
  background: rgba(6, 12, 36, 0.6);
}
.footer-inner {
  display: flex; justify-content: space-between; align-items: center; gap: 2rem;
  flex-wrap: wrap;
}
.footer-brand .brand-tag { display: block; margin-bottom: 0.5rem; color: #1a0810; }
.footer-brand p { font-size: 13px; color: #1a0810; letter-spacing: 0.06em; font-weight: 500; }
.footer-meta {
  display: flex; align-items: center; gap: 1rem;
  font-size: 13.5px; color: #1a0810; font-weight: 500; flex-wrap: wrap;
}
.footer-meta a { color: #1a0810; text-decoration: none; }
.footer-meta a:hover { color: #1a0810; text-decoration: underline; text-underline-offset: 3px; }
.footer .dot, .dot { color: #1a0810; }

/* ============ Responsive ============ */
@media (max-width: 768px) {
  .menu-toggle {
    display: block;
    position: relative;
    z-index: 102;
    transition: transform .3s ease;
  }
  body.menu-open .menu-toggle { transform: rotate(180deg); }
  .menu-toggle span {
    transition: transform .3s ease, opacity .25s ease;
    background: var(--moonlight-white);
  }
  /* 手機版選單 + 背景遮罩 */
  .menu {
    position: fixed; top: 0; right: 0;
    width: 82%; max-width: 340px; height: 100vh; height: 100dvh;
    background: linear-gradient(135deg, rgba(13, 26, 64, 0.98), rgba(6, 9, 30, 0.98));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 0;
    padding: 5rem 2.5rem 2rem;
    transform: translateX(100%);
    transition: transform .42s cubic-bezier(0.2, 0.8, 0.2, 1);
    border-left: 0.5px solid rgba(212, 168, 80, 0.25);
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.4);
    z-index: 101;
  }
  /* 背景遮罩 (點擊外面關閉選單) */
  body::before {
    content: '';
    position: fixed; inset: 0;
    background: rgba(6, 9, 30, 0.55);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .35s ease, visibility .35s ease;
    z-index: 100;
    pointer-events: none;
  }
  body.menu-open::before {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }
  body.menu-open { overflow: hidden; }
  body.menu-open .menu { transform: translateX(0); }
  body.menu-open .menu-toggle span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
    background: var(--moon-gold);
  }
  body.menu-open .menu-toggle span:nth-child(2) { opacity: 0; transform: translateX(20px); }
  body.menu-open .menu-toggle span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
    background: var(--moon-gold);
  }
  /* 選單項目逐一進場 */
  .menu a {
    font-family: var(--font-serif-zh);
    font-size: 1.15rem;
    font-weight: 300;
    letter-spacing: 0.08em;
    padding: 0.7rem 0;
    width: 100%;
    border-bottom: 0.5px solid rgba(212, 168, 80, 0.12);
    opacity: 0;
    transform: translateX(20px);
    transition: opacity .4s ease, transform .4s ease, color .25s ease;
  }
  body.menu-open .menu a {
    opacity: 1;
    transform: translateX(0);
  }
  body.menu-open .menu a:nth-child(1) { transition-delay: .15s; }
  body.menu-open .menu a:nth-child(2) { transition-delay: .20s; }
  body.menu-open .menu a:nth-child(3) { transition-delay: .25s; }
  body.menu-open .menu a:nth-child(4) { transition-delay: .30s; }
  body.menu-open .menu a:nth-child(5) { transition-delay: .35s; }
  body.menu-open .menu a:nth-child(6) { transition-delay: .40s; }
  body.menu-open .menu a:nth-child(7) { transition-delay: .45s; }

  .hero { padding: 7rem 1.5rem 4rem; }

  /* 手機版精簡主視覺裝飾 */
  .moon-system {
    width: 130px; height: 130px; top: 8%; right: 5%;
  }
  .moon-ring-outer { inset: -40px; }
  .moon-ring-mid { inset: -20px; }
  .moon-new { inset: 20px; }
  .crater-1 { width: 14px; height: 14px; }
  .crater-2 { width: 8px; height: 8px; }
  .crater-3 { width: 10px; height: 10px; }
  .moon-phase { font-size: 8px; letter-spacing: 2px; bottom: -22px; }

  .hero-monogram { font-size: 32vw; -webkit-text-stroke-width: 0.5px; }
  .hero-sidebar { display: none; }
  .corner-orn { width: 40px; height: 40px; }
  .corner-tl { top: 5rem; left: 1rem; }
  .corner-br { bottom: 1.5rem; right: 1rem; }
  .hero-fog { height: 180px; }
  .hero-constellation { opacity: 0.35; }

  .section { padding: 5rem 1.5rem; }
  .section-head { margin-bottom: 3rem; }

  /* 手機版縮小星座、調整位置 */
  .constellation-decor {
    width: 120px; opacity: 0.3;
  }
  .constellation-tr { top: 1.5rem; right: 1rem; }
  .constellation-tl { top: 1.5rem; left: 1rem; }

  /* 手機版降低裝飾效果 */
  .nebula { opacity: 0.3; }
  .meteor { width: 80px; }

  .about-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .photo-frame { width: 180px; height: 180px; }

  .career-list li {
    grid-template-columns: 1fr; gap: 0.4rem; padding: 1rem 0;
  }
  .info-row { grid-template-columns: 70px 1fr; gap: 1rem; }

  /* (移除舊的 .works-grid 1 欄覆蓋，改由上方 1024px/600px 雙斷點處理) */

  .research-subtitle { flex-wrap: wrap; gap: 0.5rem; }
  .rs-en { margin-left: 0; order: 0; flex-basis: 100%; }
  .thesis-block { grid-template-columns: 1fr; gap: 1rem; padding: 1.5rem; }
  .pub-item { grid-template-columns: 1fr; gap: 0.5rem; padding: 1.2rem 0; }
  .pub-item .research-year { font-size: 1.2rem; }
  .project-grid { grid-template-columns: 1fr; }

  .footer-inner { flex-direction: column; text-align: center; }
}

@media (max-width: 480px) {
  .hero-title { font-size: 1.9rem; letter-spacing: 0.05em; }
  .hero-title .zh { display: block; margin-right: 0; margin-bottom: 0.3rem; }
  .title-divider { display: none; }
  .hero-title .en { display: block; }
  .hero-cta { flex-direction: column; align-items: stretch; }
  .btn { justify-content: center; }
}

/* Reveal animations */
.reveal {
  opacity: 0; transform: translateY(30px);
  transition: opacity .8s ease, transform .8s ease;
}
.reveal.in { opacity: 1; transform: translateY(0); }

/* ============ Print friendly (列印友善) ============ */
@media print {
  /* 重設為白底深字 */
  * {
    background: transparent !important;
    color: #1a0810 !important;
    text-shadow: none !important;
    box-shadow: none !important;
    filter: none !important;
    backdrop-filter: none !important;
  }
  html, body {
    background: white !important;
    font-size: 11pt;
    line-height: 1.6;
  }

  /* 隱藏裝飾與互動元素 */
  .nav, .header,
  #stars, canvas, .starfield,
  .meteor, .wish-star, .nebula, .star-rail,
  .hero-monogram, .moon-system, .hero-constellation, .hero-fog,
  .constellation-decor,
  .telescope-toggle, .telescope-lens,
  .scroll-cue, .scroll-progress,
  .back-to-top,
  .star-counter, .completion-msg,
  .nav-utils, .menu-toggle,
  .corner-orn, .hero-sidebar,
  .lightbox, .detail-modal, .kbd-overlay,
  .floating-stars, .hidden-star, .clickable-star, .float-star,
  .work-card::after,
  .play-icon-overlay,
  .sparkle-particle {
    display: none !important;
  }

  /* 隱藏 Hero 部分 (列印時不需要主視覺) */
  #home { display: none !important; }

  /* 區塊間留白 */
  .section {
    padding: 1.2rem 0 !important;
    page-break-inside: avoid;
    break-inside: avoid;
  }
  .section-head { margin-bottom: 1rem !important; }

  /* 統一字型 */
  body, h1, h2, h3, h4, p, li, span, a {
    font-family: 'Noto Serif TC', Georgia, serif !important;
  }

  /* 標題 */
  .section-title {
    font-size: 18pt !important;
    border-bottom: 1px solid #888 !important;
    padding-bottom: 4pt;
    margin-bottom: 8pt;
  }
  .section-eyebrow, .section-time, .section-num {
    display: none !important;
  }
  .sub-title {
    font-size: 13pt !important;
    margin-top: 12pt;
  }
  h3, h4 { font-size: 11pt !important; }

  /* 連結用實字顯示網址 */
  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 9pt;
    color: #555 !important;
    word-break: break-all;
  }
  a[href^="#"]::after, a[href^="mailto"]::after { content: ""; }

  /* 圖片 */
  img {
    max-width: 100% !important;
    page-break-inside: avoid;
  }

  /* 列印時版面：將 grid 拍平 */
  .works-grid, .award-grid, .project-grid, .contact-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10pt !important;
  }
  .work-card, .award-card, .project-card, .pub-item, .contact-card {
    border: 0.5pt solid #888 !important;
    page-break-inside: avoid;
    padding: 8pt !important;
  }
  .work-img { max-height: 100pt !important; }

  /* 經歷清單緊湊 */
  .career-list li {
    padding: 3pt 0 !important;
    border-bottom: 0.5pt dotted #ccc !important;
  }

  /* 不要顯示作品集翻書、影像札記、影片 */
  #portfolio .flipbook-stage, #journey .journey-masonry,
  .video-item, .video-pending {
    display: none !important;
  }
  #portfolio::after {
    content: "（電子作品集請於線上瀏覽）";
    display: block;
    font-style: italic;
    color: #666 !important;
    padding: 8pt 0;
  }

  /* Footer */
  .footer {
    border-top: 1px solid #888 !important;
    margin-top: 20pt;
    padding-top: 10pt;
  }

  /* 全頁邊距 */
  @page {
    margin: 1.5cm;
    size: A4;
  }
}
