/* Live2D 頁與插畫頁共用：深色、襯線字、細線框。兩頁排版相同，只換配色（變數） */
.l2d-page {
  /* 夜間版：和插畫頁同一套玫瑰色系 */
  --bg: #1e1719; --bar: rgba(30, 23, 25, 0.92); --hover-bg: #34282b;
  --line: #3d2f32; --line2: #5c464a;
  --accent: #e58b98; --accent-rgb: 229, 139, 152; --accent-strong: #f4adb7;
  --title: #faefe6; --brand: #faefe6; --text: #f0e3da; --body: #d3c2b9; --dd: #e8dad1;
  --soft: #c3b0a7; --muted: #8f7c75;
  background: var(--bg); color: var(--text);
}
/* 插畫頁：同樣的排版，淺色＋玫瑰粉 */
.l2d-page.ill-page {
  --bg: #faf6ef; --bar: rgba(250, 246, 239, 0.94); --hover-bg: #efe6d8;
  --line: #e6dccd; --line2: #d9cbb6;
  --accent: #d66a78; --accent-rgb: 214, 106, 120; --accent-strong: #c4505f;
  --title: #2f2620; --brand: #2f2620; --text: #2f2620; --body: #5d5048; --dd: #3a2f27;
  --soft: #7b6d61; --muted: #9a8c7e;
}
.ill-page .topbar nav a:hover { color: var(--title); }
.ill-page .topbar nav a.is-here { color: #fff; background: var(--title); }
.ill-page .contact-links a { background: #fff; }
.ill-page .contact-links .ico { color: #fff; }
.ill-page .masonry figure { background: #fff; box-shadow: 0 10px 26px rgba(80, 60, 40, 0.1); }
.l2d-page .topbar { background: var(--bar); border-bottom-color: var(--line); }
.l2d-page .brand { color: var(--brand); }
.l2d-page .topbar nav a { color: var(--soft); }
.l2d-page .topbar nav a:hover { color: var(--title); background: var(--hover-bg); }
.l2d-page .topbar nav a.is-here { color: var(--bg); background: var(--title); }
.l2d-page .foot { border-top-color: var(--line); color: var(--muted); }

.l2d {
  max-width: 1240px; margin: 0 auto; padding: 72px 32px 40px;
  background: radial-gradient(ellipse at 70% 0%, rgba(var(--accent-rgb), 0.12), transparent 55%);
}
.l2d-head { text-align: center; max-width: 720px; margin: 0 auto 56px; }
.eyebrow { font: 500 12px/1 var(--sans); letter-spacing: 6px; color: var(--accent); margin: 0 0 18px; }
.l2d-head h1 { font: 600 clamp(36px, 5vw, 56px)/1.15 var(--serif); margin: 0 0 18px; color: var(--title); letter-spacing: 3px; }
.l2d-head h1::after { content: ""; display: block; width: 64px; height: 1px; background: var(--accent); margin: 22px auto 0; }
.intro { color: var(--soft); font-size: 17px; margin: 0; }

.work { display: grid; grid-template-columns: 1.75fr 1fr; gap: 48px; align-items: center; }
.video-frame { position: relative; }
.video-wrap {
  position: relative; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden;
  background: #000; box-shadow: 0 30px 60px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(var(--accent-rgb), 0.35);
}
.video-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-off { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; padding: 24px; color: var(--soft); font-size: 15px; }
.video-note { font-size: 13px; color: var(--muted); margin: 14px 0 0; text-align: right; }

.work-no { font: 500 13px/1 var(--serif); letter-spacing: 4px; color: var(--accent); margin: 0 0 14px; }
.work-info h2 { font: 600 40px/1.15 var(--serif); margin: 0 0 16px; color: var(--title); }
.work-info h2 small { display: block; font-size: 17px; color: var(--soft); letter-spacing: 6px; margin-top: 8px; font-weight: 500; }
.work-info > p { color: var(--body); margin: 0 0 26px; }
.specs { margin: 0; border-top: 1px solid var(--line); }
.specs div { display: grid; grid-template-columns: 64px 1fr; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.specs dt { font: 500 14px/1.6 var(--serif); color: var(--accent); letter-spacing: 2px; }
.specs dd { margin: 0; font-size: 15px; color: var(--dd); }
.more { text-align: center; color: var(--muted); margin: 72px 0 0; font: 500 15px var(--serif); letter-spacing: 3px; }

/* 插畫：瀑布流，照原比例排 */
.masonry { columns: 3 300px; column-gap: 20px; }
.masonry figure { break-inside: avoid; margin: 0 0 20px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: rgba(255, 255, 255, 0.03); }
.masonry img { display: block; width: 100%; height: auto; }
.masonry figcaption { padding: 10px 14px; font-size: 14px; color: var(--soft); }
.empty { text-align: center; padding: 96px 20px; border: 1px dashed var(--line2); border-radius: 18px; color: var(--soft); font: 500 16px var(--serif); letter-spacing: 4px; }

/* 最後的聯絡區 */
.l2d-page .page-contact { border-top: 1px solid var(--line); margin-top: 64px; }
.l2d-page .page-contact h2 { font: 600 32px/1.3 var(--serif); color: var(--title); letter-spacing: 2px; }
.l2d-page .page-contact p { color: var(--soft); }
.l2d-page .contact-links a { background: transparent; color: var(--brand); border: 1px solid var(--line2); box-shadow: none; }
.l2d-page .contact-links a:hover { border-color: var(--accent); }
.l2d-page .contact-links .ico { background: var(--accent); color: var(--bg); }
.l2d-page .contact-links small { color: var(--soft); }
.l2d-page .flow-link a { color: var(--accent); }

/* 委託價格 */
.price { text-align: center; margin: 96px auto 24px; max-width: 980px; }
.price h2 { font: 600 clamp(28px, 4vw, 40px)/1.2 var(--serif); color: var(--title); margin: 0 0 12px; letter-spacing: 2px; }
.price-note { display: inline-block; margin: 0 0 40px; padding: 4px 16px; border: 1px solid var(--accent); color: var(--accent); font: 500 14px/1.6 var(--serif); letter-spacing: 4px; }
.plans { display: grid; grid-template-columns: 1fr 1.12fr 1fr; gap: 20px; align-items: center; }
.plan { position: relative; padding: 34px 24px 30px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255, 255, 255, 0.02); }
.plan h3 { font: 600 20px/1.3 var(--serif); color: var(--dd); margin: 0 0 14px; letter-spacing: 3px; }
.amount { font: 600 36px/1 var(--serif); color: var(--title); margin: 0 0 16px; }
.amount small { font-size: 15px; color: var(--soft); font-weight: 500; margin: 0 2px; }
.plan-desc { margin: 0; font-size: 14px; color: var(--soft); }
.plan-main { padding: 46px 26px 40px; border-color: var(--accent); background: linear-gradient(180deg, rgba(var(--accent-rgb), 0.14), rgba(var(--accent-rgb), 0.03)); box-shadow: 0 24px 50px rgba(0, 0, 0, 0.35); }
.plan-main .amount { font-size: 44px; color: var(--accent-strong); }
.plan-tag { position: absolute; top: -13px; left: 50%; transform: translateX(-50%); background: var(--accent); color: var(--bg); font: 700 13px/1 var(--sans); padding: 7px 16px; border-radius: 99px; letter-spacing: 2px; }
.price-foot { margin: 32px 0 0; color: var(--muted); font-size: 14px; }
.price-foot a { color: var(--accent); }

/* 插畫頁：價格四欄、篩選、作品說明、放大 */
.plans-4 { grid-template-columns: repeat(4, 1fr); align-items: stretch; }
.plans-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: stretch; gap: 14px; }
.ill-price { margin: 0 auto 64px; }
.ill-filters { display: flex; justify-content: center; gap: 10px; margin: 0 0 26px; flex-wrap: wrap; }
.ill-filters button { font: 500 15px var(--sans); color: var(--soft); background: transparent; border: 1px solid var(--line2); border-radius: 99px; padding: 8px 20px; cursor: pointer; }
.ill-filters button:hover { color: var(--title); border-color: var(--accent); }
.ill-filters button.is-on { color: #fff; background: var(--accent); border-color: var(--accent); }
.masonry figure { cursor: zoom-in; transition: transform 0.2s; }
.masonry figure:hover { transform: translateY(-4px); }
.masonry img { height: auto; }
.masonry figcaption { display: flex; justify-content: space-between; gap: 10px; }
.masonry figcaption span { color: var(--title); }
.ill-lb { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; }
.ill-lb::backdrop { background: rgba(30, 24, 20, 0.88); }
.ill-lb figure { margin: 0; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 40px 24px; }
.ill-lb img { max-width: 100%; max-height: calc(100vh - 120px); border-radius: 6px; }
.ill-lb figcaption { color: #fff; font-size: 15px; }
.ill-lb .lb-close { position: fixed; top: 14px; right: 14px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: #fff; font-size: 18px; cursor: pointer; }

/* 插畫頁分區 */
.ill-sec { margin: 0 0 96px; text-align: center; }
.sec-h { font: 600 clamp(26px, 3.6vw, 36px)/1.2 var(--serif); color: var(--title); margin: 0 0 10px; letter-spacing: 2px; }
.sec-p { color: var(--soft); margin: 0 auto 34px; max-width: 620px; font-size: 15px; }
.ill-sec .masonry { text-align: left; }

/* 航空明信片：紅藍斜紋外框，郵票貼上去 */
.postcard {
  position: relative; max-width: 1060px; margin: 0 auto; padding: 18px; border-radius: 6px;
  background: repeating-linear-gradient(-45deg, #c9453f 0 26px, #fdfaf3 26px 40px, #3c6fa1 40px 66px, #fdfaf3 66px 80px);
  box-shadow: 0 26px 50px rgba(80, 55, 35, 0.22); transform: rotate(-1deg);
}
.pc-inner {
  position: relative; aspect-ratio: 16 / 10.5; background: #f6efe2;
  background-image: radial-gradient(rgba(150, 120, 80, 0.07) 1px, transparent 1.2px); background-size: 6px 6px;
}
.stamp { position: absolute; margin: 0; transform: rotate(var(--r)); filter: drop-shadow(3px 5px 4px rgba(60, 40, 20, 0.32)); cursor: zoom-in; transition: transform 0.25s, filter 0.25s; z-index: 1; }
.stamp:hover { transform: rotate(0deg) scale(1.06) translateY(-4px); filter: drop-shadow(6px 12px 10px rgba(60, 40, 20, 0.35)); z-index: 3; }
.stamp img { display: block; width: 100%; height: auto; }
.pc-lines { display: none; position: absolute; right: 4%; top: 46%; width: 18%; gap: 34px; }
.pc-lines i { display: block; height: 2px; background: rgba(120, 95, 70, 0.35); }
.pc-mark {
  position: absolute; z-index: 2; pointer-events: none; right: 4.5%; top: 7%; width: 16%; aspect-ratio: 1; border-radius: 50%;
  border: 3px double rgba(110, 80, 60, 0.55); color: rgba(110, 80, 60, 0.6); transform: rotate(-12deg);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font: 600 12px/1 var(--serif); letter-spacing: 3px;
}
.pc-mark b { font-size: 15px; padding: 5px 0; border-top: 1px solid currentColor; border-bottom: 1px solid currentColor; }
.pc-sign { position: absolute; right: 4%; bottom: 4%; margin: 0; font: italic 600 16px var(--serif); color: rgba(110, 80, 60, 0.75); }

/* 立繪：去背，一排排站著；Q 版和寵物小一號 */
.stand-row { display: flex; justify-content: center; align-items: flex-end; gap: 18px 30px; flex-wrap: wrap; max-width: 1180px; margin: 0 auto; }
.stand-small { margin-top: 36px; }
.stand { margin: 0; height: 400px; padding: 0 4px 14px; background: radial-gradient(ellipse 55% 6% at 50% 97%, rgba(120, 85, 60, 0.18), transparent 70%); cursor: zoom-in; transition: transform 0.25s; }
.stand-small .stand { height: 230px; }
.stand:hover { transform: translateY(-6px); }
.stand img { display: block; height: 100%; width: auto; }
@media (max-width: 560px) { .stand { height: 300px; } .stand-small .stand { height: 170px; } }

/* 卡片、食物補充圖 */
.card-one { margin: 0 auto; max-width: 380px; cursor: zoom-in; border-radius: 14px; overflow: hidden; box-shadow: 0 24px 48px rgba(80, 55, 35, 0.22); transform: rotate(-1.5deg); transition: transform 0.25s; }
.card-one:hover { transform: rotate(0) translateY(-4px); }
.card-one img, .food-extra img { display: block; width: 100%; height: auto; }
.food-extra { margin: 40px auto 0; max-width: 360px; cursor: zoom-in; }

/* 菜單翻頁 */
.menu-book { position: relative; display: flex; align-items: center; justify-content: center; gap: 18px; outline: none; }
.mb-spread { display: flex; justify-content: center; background: #fff; padding: 10px; border-radius: 6px; box-shadow: 0 24px 48px rgba(80, 55, 35, 0.2); max-width: 900px; width: 100%; }
.mb-spread img { display: block; width: 50%; height: auto; cursor: zoom-in; }
.mb-spread:not(.single) img:first-child { box-shadow: inset -18px 0 22px -18px rgba(0, 0, 0, 0.25); border-right: 1px solid #eee; }
.mb-spread.single { max-width: 455px; }
.mb-spread.single img { width: 100%; }
.mb-spread.flip-next { animation: flipNext 0.45s ease; }
.mb-spread.flip-prev { animation: flipPrev 0.45s ease; }
@keyframes flipNext { from { transform: perspective(1600px) rotateY(-14deg) translateX(30px); opacity: 0.3; } }
@keyframes flipPrev { from { transform: perspective(1600px) rotateY(14deg) translateX(-30px); opacity: 0.3; } }
.mb-btn { flex: none; width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--line2); background: #fff; color: var(--title); font-size: 26px; line-height: 1; cursor: pointer; }
.mb-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.mb-btn:disabled { opacity: 0.3; cursor: default; }
.mb-count { margin: 16px 0 0; color: var(--muted); font-size: 14px; letter-spacing: 2px; }

@media (max-width: 760px) {
  .postcard { padding: 10px; transform: none; }
  .pc-inner { aspect-ratio: 3 / 4; }
  .pc-lines, .pc-sign { display: none; }
  .pc-mark { width: 26%; top: 3%; right: 3%; }
  .mb-btn { width: 38px; height: 38px; font-size: 20px; }
  .menu-book { gap: 8px; }
}
@media (max-width: 960px) {
  .plans-4, .plans-5 { grid-template-columns: 1fr 1fr; max-width: none; }
  .work { grid-template-columns: 1fr; gap: 32px; }
  .plans { grid-template-columns: 1fr; max-width: 420px; margin: 0 auto; }
  .plan-main { order: -1; }
}
@media (max-width: 560px) {
  .l2d { padding: 48px 16px 32px; }
  .work-info h2 { font-size: 32px; }
}

/* 輪播：桌機一次兩張，手機一張；可滑動 */
.carousel { position: relative; display: flex; align-items: center; gap: 14px; max-width: 1180px; margin: 0 auto; }
.cr-track { flex: 1; display: flex; gap: 28px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; scrollbar-width: none; padding: 20px 6px 30px; }
.cr-track::-webkit-scrollbar { display: none; }
.cr-track > * { flex: 0 0 calc((100% - 28px) / 2); scroll-snap-align: start; margin: 0; display: flex; justify-content: center; align-items: flex-end; }
.cr-btn { flex: none; width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--line2); background: var(--card-bg, #fff); color: var(--title); font-size: 26px; line-height: 1; cursor: pointer; }
.cr-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.cr-btn:disabled { opacity: 0.3; cursor: default; }
.cr-track img { display: block; max-width: 100%; height: auto; cursor: zoom-in; }
.cr-stand img { height: 520px; width: auto; object-fit: contain; filter: drop-shadow(0 16px 14px rgba(80, 55, 35, 0.16)); }
.cr-card img { max-height: 560px; width: auto; border-radius: 14px; box-shadow: 0 22px 44px rgba(80, 55, 35, 0.22); }
.cr-post img { width: 100%; filter: drop-shadow(0 18px 24px rgba(80, 55, 35, 0.22)); }
.cr-post > :nth-child(odd) img { transform: rotate(-3deg); }
.cr-post > :nth-child(even) img { transform: rotate(2deg); }
@media (max-width: 760px) {
  .cr-track > * { flex-basis: 100%; }
  .cr-btn { width: 38px; height: 38px; font-size: 20px; }
  .carousel { gap: 6px; }
  .cr-stand img { height: 380px; }
}

/* 飯友：去背圖排成格子 */
.food-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px 30px; max-width: 1100px; margin: 56px auto 0; align-items: center; }
.food-grid figure { margin: 0; }
.food-grid img { display: block; width: 100%; height: auto; cursor: zoom-in; transition: transform 0.25s; }
.food-grid img:hover { transform: translateY(-5px) scale(1.02); }
.bg-masonry img { cursor: zoom-in; }
@media (max-width: 760px) { .food-grid { grid-template-columns: 1fr 1fr; gap: 14px; } }
.plans-5 .amount { white-space: nowrap; font-size: clamp(26px, 2.6vw, 34px); }

/* 飯友區：菜單下的大圖與 Q 版 */
.bg-hero { margin: 0 0 20px; }
.bg-hero img { display: block; width: 100%; height: auto; border-radius: 14px; box-shadow: 0 24px 48px rgba(80, 55, 35, 0.2); cursor: zoom-in; }
.chibi-row { display: flex; justify-content: center; align-items: flex-end; gap: 40px; margin: 56px auto 0; flex-wrap: wrap; }
.chibi-row figure { margin: 0; }
.chibi-row img { display: block; height: 240px; width: auto; cursor: zoom-in; filter: drop-shadow(0 12px 10px rgba(80, 55, 35, 0.15)); transition: transform 0.25s; }
.chibi-row img:hover { transform: translateY(-5px); }
@media (max-width: 560px) { .chibi-row img { height: 180px; } }
.cr-chibi img { height: calc(330px * var(--k, 1)); width: auto; object-fit: contain; filter: drop-shadow(0 14px 12px rgba(80, 55, 35, 0.15)); }
@media (max-width: 760px) { .cr-chibi img { height: calc(260px * var(--k, 1)); } }

/* 價格卡：示意圖＋點了跳到作品區 */
.plan-link { text-decoration: none; color: inherit; display: flex; flex-direction: column; align-items: center; transition: transform 0.2s, border-color 0.2s; }
.plan-link:hover { transform: translateY(-4px); border-color: var(--accent); }
.plan-thumb { display: block; width: 100%; aspect-ratio: 4 / 3; margin: 0 0 14px; border-radius: 10px; overflow: hidden; background: #fff; }
.plan-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; display: block; }
.plan-go { margin-top: auto; padding-top: 10px; font-size: 13px; color: var(--accent); letter-spacing: 1px; }
.ill-sec { scroll-margin-top: 80px; }
.plan-thumb.thumb-top img { object-position: center 0; }
.plan-thumb.thumb-contain img { object-fit: contain; padding: 8px; }
