/* 山伴 — modern.css（現代藝術版：油畫雙聯畫）
   版面概念：像一檔畫展的海報。奶油色畫布底、夜藍色字，標題用細襯線、英文用優雅斜體；
   顏色取自具象油畫：天空藍、夜裡的靛藍、苔綠與萊姆、赭紅膚色當點綴。
   邊角柔和、不用硬投影，圖片與插畫保留筆觸。疊在 app.css 之後，只覆寫 token 與元件外觀。 */
:root {
  --d-night: #1c2240;     /* 夜藍：字、深色底 */
  --d-indigo: #2b3566;
  --d-prussian: #3f5a93;
  --d-sky: #6f8fc4;
  --d-mist: #a9c1e0;
  --d-cream: #f3efe2;     /* 畫布 */
  --d-canvas: #e9e3d1;
  --d-card: #fbf8f0;
  --d-lime: #d5dc8c;
  --d-moss: #a8c06a;
  --d-forest: #3d5a3c;
  --d-ochre: #c6714b;     /* 赭紅點綴（大面積或大字用） */
  --d-ochre-deep: #9c4a2b;/* 小字用的深赭（奶油底對比約 5.6:1） */
  --d-peach: #e2a77a;
  --d-display: "Noto Serif TC", "Noto Serif CJK TC", "Source Han Serif TC", "Songti TC", serif;
  --d-italic: "Cormorant Garamond", "Noto Serif TC", Georgia, serif;

  /* 對應 app.css 的 token */
  --bg: var(--d-cream);
  --panel: var(--d-canvas);
  --sage: #e4e7c6;
  --sage-2: #dfe3b8;
  --sage-line: #b9c48a;
  --card: var(--d-card);
  --field: #fffdf7;
  --line: #d6cfbb;
  --line-soft: #e6e0cf;
  --forest: var(--d-indigo);
  --forest-2: var(--d-prussian);
  --forest-ink: var(--d-night);
  --ink: #252a3f;
  --ink-soft: #5b5f72;
  --ink-faint: #9a9aa3;
  --eyebrow: var(--d-ochre-deep);
  --amber: var(--d-ochre);
  --amber-2: var(--d-ochre);
  --amber-tint: #f4e2d3;
  --link-hover: var(--d-ochre-deep);
  --r-sm: 2px;
  --r: 3px;
  --r-lg: 4px;
  --serif: var(--d-display);
  --shadow-float: 0 18px 40px rgba(28, 34, 64, .22);
  --focus: 0 0 0 3px rgba(198, 113, 75, .45);
}
/* 畫布底紋：極淡的顆粒 */
body {
  color: var(--ink);
  background-color: var(--d-cream);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .3 0 0 0 0 .22 0 0 0 .08 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---- 字 ---- */
.serif-title, .cal-title, .hero-title, .page-head .serif-title { font-family: var(--d-display); font-weight: 600; letter-spacing: .06em; color: var(--d-night); }
.logo-text { font-family: var(--d-display); font-weight: 600; letter-spacing: .12em; }
.eyebrow { font-family: var(--d-italic); font-style: italic; font-weight: 500; font-size: 1.05rem; letter-spacing: .08em; text-transform: none; color: var(--d-ochre-deep); }
.section-head .serif-title, .page-head .serif-title { font-size: clamp(1.75rem, 4.4vw, 2.3rem); line-height: 1.3; text-wrap: balance; }
h1, h2, h3 { color: var(--d-night); }

/* ---- 頂欄、頁尾 ---- */
.topbar { background: rgba(243, 239, 226, .94); border-bottom: 1px solid var(--line); backdrop-filter: blur(6px); }
.logo { color: var(--d-night); }
.logo-mark path { stroke: var(--d-ochre); }
.nav-links a { color: var(--d-night); }
.nav-links a:hover { color: var(--d-ochre-deep); }
.nav-links a.active::after { background: var(--d-ochre); height: 2px; border-radius: 0; }
.btn-auth { border-radius: 999px; background: var(--d-night); color: var(--d-cream); }
.btn-auth:hover { background: var(--d-ochre-deep); color: var(--d-cream); }
.footer { background: var(--d-night); color: #d9d6e4; border-top: 0; }
.footer .logo, .footer .logo-text { color: var(--d-cream); }
.footer-tag { color: #a9abc4; font-family: var(--d-display); }
.footer-link { color: var(--d-lime); }

/* ---- 按鈕、欄位、卡片 ---- */
.btn { border-radius: 999px; font-weight: 600; letter-spacing: .04em; }
.btn-primary { background: var(--d-night); color: var(--d-cream); border-color: var(--d-night); }
.btn-primary:hover { background: var(--d-ochre-deep); border-color: var(--d-ochre-deep); color: var(--d-cream); }
.btn-outline { background: transparent; color: var(--d-night); border-color: var(--d-night); }
.btn-outline:hover { background: var(--d-night); color: var(--d-cream); }
.btn-ghost { border-radius: 999px; }
.link-btn { color: var(--d-night); text-decoration-color: var(--d-ochre); }
input, select, textarea, .rp-trigger { border: 1px solid #c9c1aa; border-radius: var(--r); background-color: var(--field); }
input:focus, select:focus, textarea:focus, .rp-trigger:focus-visible, .rp.is-open .rp-trigger { border-color: var(--d-prussian); box-shadow: var(--focus); }
.card { border: 1px solid var(--line); border-radius: var(--r); background: var(--d-card); }
.pill { border-radius: 999px; border: 1px solid #c9c1aa; background: transparent; color: var(--d-night); }
.pill:hover { background: #ebe6d4; }
.pill.active { background: var(--d-night); color: var(--d-cream); border-color: var(--d-night); }
.toast { background: var(--d-night); color: var(--d-cream); }

/* ---- 首頁 hero：整張油畫當背景，字壓在畫上（左側／手機在下方加一層夜藍漸層讓字讀得清楚） ---- */
.hero { position: relative; isolation: isolate; overflow: hidden; background: var(--d-indigo); border-radius: var(--r); padding: 0; margin: 1rem 0 1.75rem;
  display: flex; flex-direction: column; justify-content: flex-end; min-height: min(150vw, 620px); box-shadow: 0 22px 40px -26px rgba(28, 34, 64, .6); }
.hero-art { position: absolute; top: 0; bottom: 0; left: -50%; width: 160%; height: 100%; margin: 0; max-width: none; z-index: -2; } /* 手機：畫面往右移，讓山峰留在畫面中 */
.hero::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(0deg, rgba(20, 24, 50, .9) 0%, rgba(20, 24, 50, .72) 40%, rgba(20, 24, 50, 0) 70%); }
.hero-copy { max-width: 30rem; padding: 1.75rem 1.4rem 1.9rem; }
.hero .eyebrow { font-size: 1.2rem; color: #f3d2a8; }
.hero-title { color: var(--d-cream); font-size: clamp(2.2rem, 8vw, 3.4rem); font-weight: 500; line-height: 1.35; letter-spacing: .1em; margin: .35rem 0 .9rem; text-shadow: 0 2px 18px rgba(20, 24, 50, .45); }
.hero-lead { color: #ece8dc; font-size: 1.02rem; }
.hero-note { color: #d9d6e4; font-family: var(--d-italic); font-style: italic; font-size: 1rem; letter-spacing: .04em; }
.hero .btn-primary { background: var(--d-cream); color: var(--d-night); border-color: var(--d-cream); }
.hero .btn-primary:hover { background: var(--d-peach); border-color: var(--d-peach); color: var(--d-night); }
@media (min-width: 760px) {
  .hero { justify-content: center; min-height: clamp(460px, 52vw, 580px); }
  .hero-art { left: 0; width: 100%; }
  .hero::before { background: linear-gradient(90deg, rgba(20, 24, 50, .86) 0%, rgba(20, 24, 50, .66) 34%, rgba(20, 24, 50, 0) 62%); }
  .hero-copy { padding: 2.5rem 3rem; }
  .hero-title { font-size: clamp(2.4rem, 4.6vw, 3.4rem); }
}

.notice-strip { background: var(--d-night); color: #e4e2ec; border: 0; border-radius: var(--r); }
.notice-strip .ns-text { color: #e4e2ec; }
.notice-strip .ns-icon { background: var(--d-ochre); color: var(--d-cream); border-radius: 50%; }
.notice-strip .ns-link { color: var(--d-lime); }

/* ---- 月曆、約定卡 ---- */
.cal-weekdays { background: transparent; border-bottom: 1px solid var(--line); }
.cal-weekday { color: var(--ink-soft); font-family: var(--d-display); }
.cal-btn { border-radius: 999px; }
.cal-btn:hover { background: #ebe6d4; }
.cal-cell.today, .cal-cell.today:hover { background: #f1ead2; }
.cal-cell.today .cal-day { color: var(--d-night); box-shadow: inset 0 0 0 1px var(--d-night); }
.cal-cell.selected .cal-day { background: var(--d-ochre); color: var(--d-cream); }
.cal-chip { background: var(--d-indigo); color: var(--d-cream); border-radius: 2px; }
.gcard { border: 1px solid var(--line); border-radius: var(--r); background: var(--d-card); transition: transform .2s, box-shadow .2s; }
.gcard:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -18px rgba(28, 34, 64, .5); border-color: #c9c1aa; }
.gcard-title { font-family: var(--d-display); font-weight: 600; letter-spacing: .04em; }
.trip-arrow { color: var(--d-ochre); }

/* 日期票根：路線油畫縮圖 */
.ticket { background: var(--d-canvas); }
.ticket-photo::after { background: linear-gradient(180deg, rgba(28, 34, 64, 0) 40%, rgba(28, 34, 64, .3) 100%); }
.ticket-card, .ticket-photo .ticket-card { background: rgba(251, 248, 240, .94); border-radius: 2px; box-shadow: 0 4px 14px rgba(28, 34, 64, .25); }
.ticket-month { font-family: var(--d-italic); font-style: italic; font-size: .95rem; }
.ticket-day { font-family: var(--d-display); font-weight: 500; color: var(--d-night); }

/* ---- 路線選擇面板、路線卡、其他 ---- */
.rp-panel { border-radius: var(--r); border: 1px solid var(--line); background: var(--d-card); }
.rp-region { border-radius: 2px; background: #efe9d8; color: var(--d-night); }
.rp-region:hover { background: #e6dfc8; }
.rp-region[aria-expanded="true"] { background: var(--d-indigo); color: var(--d-cream); }
.rp-region[aria-expanded="true"] .rp-region-count { color: #c3c6dc; }
.rp-region[aria-expanded="true"] .rp-chev { border-color: var(--d-lime); }
.rp-opt.is-selected { background: var(--d-lime); color: var(--d-night); }
.rcard { border: 1px solid var(--line); border-radius: var(--r); background: var(--d-card); }
.progress-fill { background: var(--d-ochre); }
.join-panel { border-radius: var(--r); }

/* 徽章：油畫筆觸版（badge-modern.js 套色與濾鏡） */
.emblem-modern { filter: drop-shadow(0 2px 3px rgba(28, 34, 64, .18)); }

/* ---- 探索路線地圖：用原版（經典版）的配色 ----
   地圖區塊內把色彩 token 還原成原版的值，縣市分區色、海岸線、山名標記都回到原本的樣子 */
.map-panel {
  --panel: #edefe7;
  --sage: #e6ebe1;
  --sage-2: #dfe6d9;
  --sage-line: #b8c9b2;
  --card: #ffffff;
  --line: #dfe2da;
  --line-soft: #ebede6;
  --forest: #234a3c;
  --forest-2: #2f5c4b;
  --forest-ink: #1f3a30;
  --ink: #26332d;
  --ink-soft: #6b7a70;
  --ink-faint: #a3ada5;
  --eyebrow: #4f7a64;
  --amber: #e2b06a;
  --amber-2: #d9a566;
  --amber-tint: #f6ead6;
  --link-hover: #a8571a;
  --r-sm: 6px;
  --r: 10px;
  --r-lg: 16px;
  --serif: "Noto Serif TC", "Noto Serif CJK TC", "Source Han Serif TC", "Songti TC", "PMingLiU", serif;
}
/* 地圖外框不上底色，讓地圖直接放在畫布上 */
.map-panel { background: transparent; box-shadow: none; border: 0; }
/* 照片出處：收合 */
.credit-fold summary { cursor: pointer; font-weight: 600; color: var(--d-night); padding: .35rem 0; }
.credit-fold summary:hover { color: var(--d-ochre-deep); }
.credit-fold[open] summary { margin-bottom: .5rem; }
/* 行前提醒 */
.pretrip-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.pretrip-list li { display: grid; grid-template-columns: 6.5rem 1fr; gap: .75rem; padding-bottom: .6rem; border-bottom: 1px solid var(--line-soft); }
.pretrip-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.pretrip-list b { font-family: var(--d-display); color: var(--d-night); }
.pretrip-list span { color: var(--ink-soft); }
@media (max-width: 520px) { .pretrip-list li { grid-template-columns: 1fr; gap: .15rem; } }
/* 暫停狀態（公開，只顯示狀態） */
.badge-suspend { background: #f4dcd3; color: #8a3a22; font-weight: 700; margin-left: .25rem; }

/* ---- 得到新徽章的動畫 ---- */
.bc-overlay { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 1rem;
  background: rgba(20, 24, 50, .92); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); animation: bc-fade .25s ease-out both; }
.bc-overlay.bc-out { animation: bc-fade-out .22s ease-in both; }
.bc-box { position: relative; width: min(100%, 360px); text-align: center; color: var(--d-cream); }
.bc-close { position: absolute; z-index: 2; top: -.25rem; right: 0; width: 2.4rem; height: 2.4rem; border: 0; background: transparent; color: var(--d-cream); font-size: 1.8rem; line-height: 1; cursor: pointer; }
.bc-stage { position: relative; height: 270px; display: grid; place-items: center; }
.bc-rays { position: absolute; width: 320px; height: 320px; border-radius: 50%;
  background: repeating-conic-gradient(rgba(255, 224, 150, .28) 0 10deg, rgba(255, 224, 150, 0) 10deg 22deg);
  -webkit-mask: radial-gradient(circle, #000 30%, transparent 70%); mask: radial-gradient(circle, #000 30%, transparent 70%); }
.bc-badge { position: relative; z-index: 1; filter: drop-shadow(0 10px 22px rgba(0, 0, 0, .35)); }
.bc-badge svg { display: block; width: 210px; height: auto; }
.bc-badge::after { -webkit-mask: var(--bc-mask, none); }
.bc-badge::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, .55) 48%, transparent 60%); background-size: 260% 100%; }
.bc-confetti { position: absolute; inset: 0; pointer-events: none; }
.bc-rays { pointer-events: none; }
.bc-confetti i { position: absolute; left: 50%; top: 50%; width: 8px; height: 12px; border-radius: 2px; opacity: 0; }
.bc-eyebrow { font-family: var(--d-italic); font-style: italic; font-size: 1.15rem; letter-spacing: .08em; color: #f3d2a8; margin: .25rem 0 0; }
.bc-kind { margin: .2rem 0 0; font-size: .9rem; color: #c9cbe0; }
.bc-title { margin: .1rem 0 .2rem; font-family: var(--d-display); font-weight: 600; font-size: 2rem; letter-spacing: .08em; color: var(--d-cream); }
.bc-sub { margin: 0 0 .8rem; color: #c9cbe0; font-size: .92rem; }
.bc-dots { display: flex; justify-content: center; gap: .4rem; margin: 0 0 .9rem; }
.bc-dots span { width: 7px; height: 7px; border-radius: 50%; background: rgba(243, 239, 226, .35); }
.bc-dots span.on { background: var(--d-cream); }
.bc-next { background: var(--d-cream); color: var(--d-night); border-color: var(--d-cream); min-width: 9rem; }
.bc-next:hover { background: var(--d-peach); border-color: var(--d-peach); color: var(--d-night); }

@media (prefers-reduced-motion: no-preference) {
  .bc-play .bc-rays { animation: bc-rays-in .5s ease-out both, bc-spin 14s linear infinite; }
  .bc-play .bc-badge { animation: bc-pop .75s cubic-bezier(.2, 1.4, .4, 1) .1s both; }
  .bc-play .bc-badge::after { animation: bc-shine 1.1s ease-out .75s both; }
  .bc-play .bc-confetti i { animation: bc-burst 1.3s cubic-bezier(.15, .7, .3, 1) calc(.35s + var(--d)) both; }
  .bc-play .bc-eyebrow, .bc-play .bc-kind, .bc-play .bc-title, .bc-play .bc-sub { animation: bc-up .45s ease-out .55s both; }
}
@media (prefers-reduced-motion: reduce) {
  .bc-play .bc-badge, .bc-play .bc-title { animation: bc-fade .4s ease-out both; }
}
@keyframes bc-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes bc-fade-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes bc-spin { to { transform: rotate(360deg); } }
@keyframes bc-rays-in { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: scale(1); } }
@keyframes bc-pop { 0% { opacity: 0; transform: scale(.2) rotate(-25deg); } 60% { opacity: 1; transform: scale(1.12) rotate(4deg); } 100% { transform: scale(1) rotate(0); } }
@keyframes bc-shine { 0% { opacity: 1; background-position: 120% 0; } 85% { opacity: 1; } 100% { opacity: 0; background-position: -60% 0; } }
@keyframes bc-burst { 0% { opacity: 1; transform: translate(-50%, -50%) rotate(0); }
  80% { opacity: 1; } 100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy) + 60px)) rotate(var(--r)); } }
@keyframes bc-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.grain-overlay { mix-blend-mode: overlay; }
.danger-zone { margin-top: 2.5rem; }
.danger-zone .danger-list { font-size: .9rem; margin: .6rem 0 1rem; }
.danger-zone .inline-form { margin-top: .35rem; }
/* 徽章分享列：動畫跑完（約 1.6 秒）才淡入 */
.bc-share { margin: 0 0 1rem; }
.bc-share-label { margin: 0 0 .45rem; font-size: .8rem; letter-spacing: .08em; color: #c9cbe0; }
.bc-share-row { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem; }
.bc-share-btn { display: inline-flex; align-items: center; min-height: 2.2rem; padding: 0 .85rem; border-radius: 999px; border: 1px solid rgba(243, 239, 226, .45);
  background: rgba(243, 239, 226, .08); color: var(--d-cream); font: inherit; font-size: .85rem; text-decoration: none; cursor: pointer; }
.bc-share-btn:hover, .bc-share-btn:focus-visible { background: var(--d-cream); color: var(--d-night); border-color: var(--d-cream); }
.bc-share-btn:disabled { opacity: .6; cursor: progress; }
.bc-share-btn.is-line { border-color: #06c755; }
.bc-share-btn.is-line:hover, .bc-share-btn.is-line:focus-visible { background: #06c755; border-color: #06c755; color: #fff; }
@media (prefers-reduced-motion: no-preference) {
  .bc-play .bc-share { animation: bc-up .45s ease-out 1.6s both; }
}
/* 防詐提醒 */
.official-card { border-left: 4px solid var(--d-ochre); }
.notice-fraud { background: #fbe9e1; border: 1px solid #e3b29b; color: #6b2a12; border-radius: var(--r); padding: .7rem .9rem; font-size: .9rem; line-height: 1.6; }
.guard-hint { color: var(--d-ochre-deep); }
.line-join { display: grid; gap: .7rem; justify-items: start; }
.line-warn { max-width: 34rem; }
.line-warn-title { margin: 0 0 .35rem; font-weight: 700; }
.line-warn-list { margin: 0 0 .7rem; padding-left: 1.2rem; display: grid; gap: .25rem; font-size: .9rem; }
/* 管理後台 */
.admin-page .admin-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.admin-page .admin-table th, .admin-page .admin-table td { text-align: left; padding: .45rem .5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.admin-page .admin-table th { font-weight: 600; color: var(--d-night); white-space: nowrap; }
.admin-page .admin-scroll { overflow-x: auto; }
.admin-page .admin-actions { display: flex; flex-wrap: wrap; gap: .4rem; }
.admin-page .admin-kv { display: grid; grid-template-columns: 8.5rem 1fr; gap: .3rem .8rem; font-size: .9rem; margin: 0; }
.admin-page .admin-kv dt { color: var(--d-ochre-deep); }
.admin-page .admin-kv dd { margin: 0; word-break: break-all; }
.admin-page .tag-hidden { color: #9c2b2b; font-weight: 600; }
.admin-page .search-form { display: flex; gap: .5rem; flex-wrap: wrap; }
.admin-page .search-form input { flex: 1 1 14rem; }
.guide-card summary { cursor: pointer; }
.admin-page .ban-why { margin: .4rem 0 .6rem; }

/* 聯絡頁 */
.footer-links { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; margin: 0; }
.contact-page .contact-email { font-size: 1.15rem; margin: 0 0 .6rem; }
.contact-page .contact-email a { font-weight: 700; overflow-wrap: anywhere; }
.contact-page .about-card .btn { margin-top: .4rem; }

/* 出發／回程時間：時＋分（10 分鐘為單位） */
.time-select { display: flex; align-items: center; gap: .4rem; }
.time-select select { flex: 1 1 0; min-width: 0; }
.time-select .time-sep { font-weight: 700; color: var(--ink-soft); }

/* 團頁：完成可獲得的徽章（放在團資訊卡內） */
.route-badges-inline { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--line-soft); }
.route-badges-inline .sub { margin-top: 0; }
