/* ============================================================
   飛行巧思第二批（2026-11-04）：夜航模式／天空郵簡／行李吊牌／
   航線式延伸閱讀／飛行高度進度。class 前綴 xh-fly-，獨立檔案。
   色票：晨光奶油 #F7F1E7・墨綠 #2F453C・鼠尾草 #97A48B・
   日落金 #DFA050・陶土 #C08552・海霧藍 #A9C2CF
   ============================================================ */

.xh-fly-en {
  font-family: var(--mono, "IBM Plex Mono", monospace);
  font-size: .6rem; letter-spacing: .3em; font-weight: 600;
}

/* ---------- 1. 夜航模式切換鈕 ---------- */
.xh-fly-night-btn::before { content: "☾ "; color: #C08552; }
.xh-fly-night-btn[aria-pressed="true"] {
  background: #2F453C; color: #F7F1E7; border-color: #2F453C;
}
.xh-fly-night-btn[aria-pressed="true"]::before { color: #DFA050; }

/* ---------- 1. 夜航模式（僅文章頁 body.xh-night 作用域） ---------- */
body.xh-night {
  color-scheme: dark;
  background: #1D2E25;
  color: #EDE4CE;
}
body.xh-night::before {
  background-image: radial-gradient(rgba(247,241,231,.06) 1px, transparent 1.4px);
}
body.xh-night .post-cover { background: #22382E; }
body.xh-night .post-cover .cover-shade {
  background: linear-gradient(180deg, rgba(29,46,37,.08) 0%, rgba(29,46,37,.42) 55%, #1D2E25 100%);
}
body.xh-night .post-head h1 { color: #F7F1E7; }
body.xh-night .post-head p { color: #D8DCC8 !important; }
body.xh-night .back-link { color: #DFA050; }
body.xh-night .data-panel {
  background: #22382E; border-color: rgba(247,241,231,.16); color: #EDE4CE;
}
body.xh-night .data-panel-head { color: #DFA050; border-color: rgba(247,241,231,.14); }
body.xh-night .data-grid .cell .dl { color: #97A48B; }
body.xh-night .data-grid .cell .dv { color: #F7F1E7; }
body.xh-night .post-inst { color: #EDE4CE; }
body.xh-night .post-inst .dl { color: #97A48B; }
body.xh-night .post-inst .dv { color: #F7F1E7; }
body.xh-night .post-tools .share-btn {
  background: transparent; border-color: rgba(247,241,231,.4); color: #F7F1E7;
}
body.xh-night .route-track { color: #EDE4CE; }
body.xh-night .brief {
  background: #22382E; border-color: rgba(247,241,231,.16); color: #EDE4CE;
}
body.xh-night .brief .dl { color: #97A48B; }
body.xh-night .brief .bf-val { color: #F7F1E7; }
body.xh-night .sharp-panel {
  background: #22382E; border-color: rgba(247,241,231,.16); color: #EDE4CE;
}
body.xh-night .sharp-panel .track { background: rgba(247,241,231,.14); }
body.xh-night .post-body { color: #E8DFC9; }
body.xh-night .post-body h2,
body.xh-night .post-body h3,
body.xh-night .post-body h4 { color: #F7F1E7; }
body.xh-night .post-body a { color: #DFA050; }
body.xh-night .post-body strong { color: #F7F1E7; }
body.xh-night .post-body blockquote { color: #F1EADA; border-left-color: #DFA050; }
body.xh-night .post-body img { filter: brightness(.92); }
body.xh-night .post-body figcaption { color: #B9BFA9; }
body.xh-night .post-body figcaption .cap-label { color: #EDE4CE; }
body.xh-night .post-body hr { border-color: rgba(247,241,231,.18); }
body.xh-night .post-body table { color: #EDE4CE; }
body.xh-night .share-row .lbl { color: #97A48B; }
body.xh-night .share-row .share-btn {
  background: transparent; border-color: rgba(247,241,231,.4); color: #F7F1E7;
}
body.xh-night .pn-card {
  background: #22382E; border-color: rgba(247,241,231,.16);
}
body.xh-night .pn-title { color: #F7F1E7; }
body.xh-night .pn-date { color: #97A48B; }
body.xh-night .pn-label { color: #DFA050; }
body.xh-night .res-passport { color: #EDE4CE; }
body.xh-night .res-passport a { color: #DFA050; }
body.xh-night .related h2 { color: #E8C98F; }
body.xh-night .bp-card {
  background: #22382E; border-color: rgba(247,241,231,.14);
}
body.xh-night .bp-body h3 { color: #F7F1E7; }
body.xh-night .bp-excerpt { color: #C9CFBC; }
body.xh-night .bp-stub { color: #97A48B; border-color: rgba(247,241,231,.12); }
body.xh-night .xh-fly-tag { background: #22382E; border-color: rgba(247,241,231,.3); }
body.xh-night .xh-fly-tag-title { color: #F7F1E7; }
body.xh-night .xh-fly-tags-head { color: #E8C98F; }

/* ---------- 2. 天空郵簡（航空郵簡包裝） ---------- */
.xh-fly-airmail { position: relative; }
.post-sub-cta.xh-fly-airmail {
  border: 3px solid transparent;
  background:
    linear-gradient(var(--matcha, #2F453C), var(--matcha, #2F453C)) padding-box,
    repeating-linear-gradient(45deg, #DFA050 0 12px, #F7F1E7 12px 24px, #A9C2CF 24px 36px, #F7F1E7 36px 48px) border-box;
  padding-top: 58px;
}
.xh-fly-mailwrap {
  position: relative;
  max-width: 580px; margin: 30px auto 0;
  padding: 40px 28px 28px;
  border: 3px solid transparent; border-radius: 16px;
  background:
    linear-gradient(#FFFDF6, #FFFDF6) padding-box,
    repeating-linear-gradient(45deg, #DFA050 0 12px, #F7F1E7 12px 24px, #A9C2CF 24px 36px, #F7F1E7 36px 48px) border-box;
  text-align: center;
}
.xh-fly-air-label {
  position: absolute; top: 13px; left: 18px;
  font-family: var(--mono, "IBM Plex Mono", monospace);
  font-size: .62rem; letter-spacing: .32em; font-weight: 600;
  color: #DFA050; text-transform: uppercase; pointer-events: none;
}
.xh-fly-mailwrap .xh-fly-air-label { color: #C08552; }
.xh-fly-air-stamp {
  position: absolute; top: 12px; right: 94px;
  width: 42px; height: 50px;
  border: 1.5px dashed rgba(247,241,231,.55);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-family: var(--mono, "IBM Plex Mono", monospace);
  font-size: .48rem; letter-spacing: .12em; line-height: 1.3;
  color: rgba(247,241,231,.85); pointer-events: none;
}
.xh-fly-air-plane { font-size: .9rem; line-height: 1; }
.xh-fly-mailwrap .xh-fly-air-stamp {
  border-color: rgba(47,69,60,.4); color: rgba(47,69,60,.65);
}
.xh-fly-air-postmark {
  position: absolute; top: 10px; right: 14px;
  width: 66px; height: 66px; border-radius: 50%;
  border: 1.5px solid rgba(247,241,231,.55);
  outline: 1px solid rgba(247,241,231,.28); outline-offset: -5px;
  transform: rotate(-11deg);
  display: flex; align-items: center; justify-content: center; text-align: center;
  font-family: var(--mono, "IBM Plex Mono", monospace);
  font-size: .52rem; letter-spacing: .18em; line-height: 1.55;
  color: rgba(247,241,231,.78); pointer-events: none;
}
.xh-fly-mailwrap .xh-fly-air-postmark {
  border-color: rgba(47,69,60,.45); color: rgba(47,69,60,.62);
  outline-color: rgba(47,69,60,.25);
}
@media (max-width: 560px) {
  .xh-fly-air-stamp { display: none; }
  .xh-fly-air-postmark { width: 52px; height: 52px; font-size: .44rem; }
  .xh-fly-air-label { font-size: .54rem; letter-spacing: .24em; }
}

/* ---------- 3. 行李吊牌標籤 ---------- */
.xh-fly-tags { margin: 54px 0 4px; }
.xh-fly-tags-head {
  font-family: var(--serif, "Noto Serif TC", serif);
  font-size: 1.02rem; letter-spacing: .14em; color: var(--matcha, #2F453C);
  display: flex; align-items: baseline; gap: 14px; margin: 0 0 18px;
}
.xh-fly-tags-head .xh-fly-en { color: #C08552; }
.xh-fly-tags-row { display: flex; flex-wrap: wrap; gap: 14px; }
.xh-fly-tag {
  position: relative; flex: 1 1 180px; max-width: 320px;
  display: flex; flex-direction: column; gap: 3px;
  text-decoration: none;
  background: #FFFDF6;
  border: 1px solid rgba(47,69,60,.3); border-radius: 8px;
  padding: 13px 18px 13px 36px;
  transition: transform .25s ease, box-shadow .25s ease;
}
.xh-fly-tag::before {
  content: ""; position: absolute; left: 11px; top: 50%;
  transform: translateY(-50%);
  width: 11px; height: 11px; border-radius: 50%;
  background: #F7F1E7;
  border: 2px solid #C6A15B;
  box-shadow: inset 0 0 0 1.5px rgba(47,69,60,.35);
}
.xh-fly-tag::after {
  content: ""; position: absolute; left: 15px; top: -6px;
  width: 24px; height: 1.5px;
  background: linear-gradient(90deg, #C6A15B, rgba(198,161,91,0));
  transform: rotate(-22deg); transform-origin: left center;
}
.xh-fly-tag:hover {
  transform: rotate(-1.2deg) translateY(-2px);
  box-shadow: 0 10px 22px rgba(46,51,42,.13);
}
.xh-fly-tag-title {
  font-family: var(--serif, "Noto Serif TC", serif); font-weight: 700;
  font-size: .98rem; line-height: 1.5; color: var(--ink, #2E332A);
}
.xh-fly-tag-date {
  font-family: var(--mono, "IBM Plex Mono", monospace);
  font-size: .66rem; letter-spacing: .22em; color: #97A48B;
}

/* ---------- 4. 航線式延伸閱讀 ---------- */
.xh-fly-route-head { margin: 0 0 6px; }
.xh-fly-route-kicker {
  display: block;
  font-family: var(--mono, "IBM Plex Mono", monospace);
  font-size: .66rem; letter-spacing: .34em; font-weight: 600;
  color: #C08552; text-transform: uppercase; margin: 0 0 8px;
}
.xh-fly-route-from {
  display: block; margin-top: 6px;
  font-family: var(--mono, "IBM Plex Mono", monospace);
  font-size: .68rem; letter-spacing: .22em; color: var(--muted, #8A927E);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.xh-fly-route-grid { position: relative; padding-top: 28px; }
.xh-fly-route-grid::before {
  content: ""; position: absolute; top: 9px; left: 2%; right: 2%;
  border-top: 2px dashed rgba(192,133,82,.55);
}
.xh-fly-route-grid > a { position: relative; }
.xh-fly-route-grid > a::before {
  content: ""; position: absolute; top: -24px; left: 50%;
  transform: translateX(-50%);
  width: 9px; height: 9px; border-radius: 50%;
  background: #F7F1E7; border: 2px solid #C08552; z-index: 2;
}

/* ---------- 5. 飛行高度進度（journey 專屬固定細條） ---------- */
.xh-fly-altbar {
  position: fixed; right: 14px; top: 50%; transform: translateY(-50%);
  z-index: 90;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 14px 8px 12px;
  background: rgba(38,54,44,.9); color: #F7F1E7;
  border: 1px solid rgba(216,197,165,.38); border-radius: 999px;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  font-family: var(--mono, "IBM Plex Mono", monospace);
  box-shadow: 0 8px 20px rgba(28,36,30,.22);
}
.xh-fly-alt-label { font-size: .55rem; letter-spacing: .24em; color: #DFA050; font-weight: 700; }
.xh-fly-alt-val { font-size: .64rem; font-weight: 700; letter-spacing: .04em; text-align: center; line-height: 1.45; }
.xh-fly-alt-track {
  position: relative; width: 4px; height: 110px;
  background: rgba(247,241,231,.18); border-radius: 2px; overflow: hidden;
}
.xh-fly-alt-track i {
  position: absolute; left: 0; bottom: 0; width: 100%; height: 0%;
  background: linear-gradient(180deg, #DFA050, #C08552);
  display: block;
}
.xh-fly-alt-phase {
  writing-mode: vertical-rl;
  font-size: .55rem; letter-spacing: .16em; color: #C9CFBC;
}
@media (max-width: 640px) {
  .xh-fly-altbar { right: 8px; padding: 10px 6px 9px; gap: 6px; }
  .xh-fly-alt-track { height: 72px; }
  .xh-fly-alt-val { font-size: .58rem; }
  .xh-fly-alt-phase { font-size: .5rem; }
}
@media (prefers-reduced-motion: reduce) {
  .xh-fly-tag { transition: none; }
}

/* ===== 訂閱頁版面修正（2026-11-04）：表單三件擠同一列致破版＋整頁溢出，改為輸入＋按鈕一列、告知全文整行；福利卡圖示列高收緊、手機內距與行距美化 ===== */
.sub-form { flex-wrap: wrap; }
.sub-form .sub-notice { flex: 1 1 100%; order: 3; margin: 6px 0 0; font-size: .8rem; line-height: 1.7; color: var(--muted); text-align: left; }
.perk .pi { line-height: 1; margin-bottom: 14px; }
.perk p { line-height: 1.75; }
@media (max-width: 700px) {
  .perk { padding: 24px 20px; }
  .perk h3 { margin-bottom: 6px; }
}

/* 2026-11-04 subfix2: .sub-page 的 padding 蓋掉 .wrap-narrow 左右 22px,手機上卡片貼齊螢幕邊被裁 — 補回左右內距,標題行高收緊 */
.sub-page { padding-left: 22px; padding-right: 22px; }
.perk h3 { line-height: 1.4; }

/* 2026-11-04 subfix3: iOS 上 .sub-form 彈性排版的子項寬度會溢出郵簡框 — 700px 以下改 grid 單欄(minmax(0,1fr))堆疊,子項寬度鎖死不溢出 */
@media (max-width: 700px) {
  .sub-form { display: grid; grid-template-columns: minmax(0, 1fr); width: 100%; max-width: 100%; }
  .sub-form > * { min-width: 0; max-width: 100%; }
  .sub-form input, .sub-form .btn { width: 100%; box-sizing: border-box; }
}
