/* 設計：明亮・參考 Apple Music。所有文字對比 ≥4.5:1，主要文字 ≥7:1（數字見 CLAUDE.md） */
:root {
  color-scheme: light;
  --bg: #FFFFFF; --bg-2: #F5F5F7; --fill: #F2F2F7; --fill-2: #E8E8ED;
  --text: #1D1D1F; --text-2: #515154; --line: #D2D2D7;
  --red: #D60017; --red-2: #B00013; --red-soft: #FDECEE;
  --warn-bg: #FFF4E0; --warn: #7A4A00; --err: #9B0012; --info-bg: #EEF4FF;
  --r: 14px; --ease: cubic-bezier(.2, .8, .2, 1);
  --font: 'Noto Sans TC', -apple-system, BlinkMacSystemFont, 'PingFang TC', 'Microsoft JhengHei', sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; } /* 頂列固定時，聚焦或跳轉的元素不要被蓋住 */
h1, h2, .hero, .h2 { text-wrap: balance; }
a, button, input, select, label, summary { touch-action: manipulation; -webkit-tap-highlight-color: rgba(214, 0, 23, .15); }
.skip { position: absolute; left: 12px; top: -60px; z-index: 99; background: var(--text); color: #fff; padding: 10px 16px; border-radius: 10px; font-weight: 700; }
.skip:focus { top: 12px; }
body { margin: 0; background: var(--bg); color: var(--text); font: 17px/1.65 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--red); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; border-radius: 6px; }
/* main 只是換頁後程式移焦點的目標（讓讀螢幕軟體從新內容開始念），不是可操作元件：不畫外框（記憶 feedback-spa-main-focus-ring） */
#main:focus, #main:focus-visible { outline: none; }
/* 包著隱藏檔案欄位的按鈕（選音樂檔）：鍵盤選到時也要看得到外框（審查 L7） */
label.btn:focus-within { outline: 3px solid var(--red); outline-offset: 2px; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 24px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ── 頂列 ── */
.top { position: sticky; top: 0; z-index: 30; background: rgba(255, 255, 255, .92); backdrop-filter: saturate(180%) blur(16px); border-bottom: 1px solid var(--line); }
.top .wrap { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; grid-template-areas: "logo nav tools lang"; align-items: center; gap: 12px; height: 64px; }
.logo { grid-area: logo; display: flex; align-items: center; gap: 10px; font-weight: 900; font-size: 22px; letter-spacing: .02em; text-decoration: none; color: var(--text); white-space: nowrap; }
.site-nav { grid-area: nav; display: flex; gap: 2px; }
.site-nav a { padding: 8px 12px; border-radius: 999px; font-weight: 700; font-size: 15px; color: var(--text); text-decoration: none; white-space: nowrap; }
.site-nav a:hover { background: var(--fill); }
.site-nav a[aria-current] { color: var(--red); background: var(--red-soft); }
.lang { grid-area: lang; font-weight: 700; font-size: 14px; padding: 7px 12px; border: 1.5px solid var(--line); border-radius: 999px; color: var(--text); text-decoration: none; white-space: nowrap; }
.lang:hover { border-color: var(--text); }
.logo .mark { width: 36px; height: 36px; border-radius: 10px; background: var(--red); display: grid; place-items: center; }
.seg { display: flex; background: var(--fill); border-radius: 999px; padding: 4px; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.seg button { border: 0; background: transparent; border-radius: 999px; padding: 6px 14px; font-size: 15px; font-weight: 500; color: var(--text); cursor: pointer; white-space: nowrap; }
.seg button[aria-current="step"] { background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .14); font-weight: 700; }
.seg button:disabled { color: #6E6E73; cursor: not-allowed; } /* 4.6:1，看得清楚但看得出還不能按 */

/* ── 等化器小動畫 ── */
.eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 16px; }
.eq i { width: 3px; height: 100%; background: currentColor; border-radius: 2px; transform-origin: bottom; transform: scaleY(.35); }
.eq.live i { animation: eq .9s var(--ease) infinite alternate; }
.eq.live i:nth-child(2) { animation-delay: .15s; } .eq.live i:nth-child(3) { animation-delay: .3s; } .eq.live i:nth-child(4) { animation-delay: .45s; }
@keyframes eq { 0% { transform: scaleY(.3); } 50% { transform: scaleY(1); } 100% { transform: scaleY(.5); } }
.logo .eq { color: #fff; height: 18px; }
.logo .eq.live i { animation-iteration-count: 6; } /* 開場跳幾下就停，不一直動 */

/* ── 版面 ── */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 40px; align-items: start; padding: 8px 0 80px; }
.layout.full { grid-template-columns: minmax(0, 1fr); }
main { min-width: 0; }
.hero { font-size: clamp(38px, 6.2vw, 72px); font-weight: 900; line-height: 1.08; letter-spacing: -.01em; margin: 36px 0 10px; }
.h2 { font-size: clamp(26px, 3.4vw, 34px); font-weight: 900; line-height: 1.2; margin: 44px 0 4px; }
.lead { font-size: 19px; color: var(--text-2); margin: 0 0 8px; max-width: 42em; }
.muted { color: var(--text-2); font-size: 15px; }

/* ── 按鈕 ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 24px; border: 0; border-radius: 999px;
  background: var(--red); color: #fff; font-size: 17px; font-weight: 700; cursor: pointer; transition: transform .15s var(--ease), background .15s; text-decoration: none; }
.btn:hover { background: var(--red-2); }
.btn:active { transform: scale(.96); }
.btn.gray { background: var(--fill); color: var(--text); }
.btn.gray:hover { background: var(--fill-2); }
.btn.sm { min-height: 38px; padding: 0 16px; font-size: 15px; }
.btn .ic { font-size: 14px; }
.navrow { display: flex; justify-content: space-between; gap: 12px; margin-top: 36px; flex-wrap: wrap; }
.linkbtn { background: none; border: 0; color: var(--red); font-weight: 700; cursor: pointer; padding: 4px 6px; font-size: 15px; text-decoration: underline; text-underline-offset: 3px; }

/* ── 歌單封面 ── */
.shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 28px 20px; margin-top: 16px; }
.album { text-align: left; background: none; border: 0; padding: 0; cursor: pointer; display: flex; flex-direction: column; gap: 8px; animation: rise .5s var(--ease) both; animation-delay: calc(var(--i, 0) * 22ms); }
.cover { position: relative; display: block; aspect-ratio: 1; border-radius: 12px; background: var(--c); color: #fff; overflow: hidden; padding: 14px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .1); transition: transform .25s var(--ease), box-shadow .25s var(--ease); }
.cover::after { /* 黑膠紋路放右上，避開下方白字，不拉低文字對比 */
  content: ''; position: absolute; right: -30%; top: -30%; width: 74%; aspect-ratio: 1; border-radius: 50%;
  background: repeating-radial-gradient(circle, rgba(255, 255, 255, .14) 0 2px, transparent 2px 7px); }
.cover .cv-ico { font-size: 40px; line-height: 1; display: block; }
.cover .cv-t { position: absolute; left: 14px; right: 14px; bottom: 12px; font-size: 20px; font-weight: 900; line-height: 1.2; z-index: 1; }
.album:hover .cover { transform: translateY(-4px); box-shadow: 0 14px 30px rgba(0, 0, 0, .18); }
.album .q { font-size: 15px; color: var(--text-2); line-height: 1.45; }
.album .tag { font-size: 13px; font-weight: 700; color: var(--text-2); }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
.group-title { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.group-title .muted { font-size: 16px; }

/* ── 表單 ── */
.occ-head { display: flex; gap: 20px; align-items: center; margin-top: 28px; }
.occ-head .cover { width: 132px; flex: none; }
.occ-head .cover .cv-t { font-size: 16px; }
.occ-head .kicker { font-size: 13px; font-weight: 700; color: var(--red); letter-spacing: .08em; }
.occ-head h1 { font-size: clamp(30px, 4.4vw, 48px); font-weight: 900; margin: 2px 0 4px; line-height: 1.15; }
.qa { margin-top: 26px; max-width: 720px; }
.qa > label, .qa > .label { display: block; font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.qa input[type=text], .qa input[type=password], .qa input[type=number], .qa textarea, .qa select {
  width: 100%; min-height: 50px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; padding: 11px 14px; font-size: 17px; outline: none; transition: border-color .15s, box-shadow .15s; }
.qa input:focus, .qa textarea:focus, .qa select:focus { border-color: var(--red); box-shadow: 0 0 0 4px rgba(214, 0, 23, .14); }
.qa input::placeholder, .qa textarea::placeholder { color: #6E6E73; }
.qa textarea { min-height: 110px; resize: vertical; line-height: 1.6; }
.hint { font-size: 15px; color: var(--text-2); margin-top: 6px; }
.check { display: flex; gap: 12px; align-items: flex-start; margin-top: 26px; max-width: 720px; cursor: pointer; font-size: 17px; }
.check input { width: 24px; height: 24px; margin-top: 3px; accent-color: var(--red); flex: none; }

/* ── 膠囊（語氣、感覺、調性…） ── */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 0; background: var(--fill); color: var(--text); border-radius: 999px; padding: 8px 16px; cursor: pointer; font-size: 16px; font-weight: 500; line-height: 1.3;
  display: inline-flex; flex-direction: column; align-items: flex-start; text-align: left; transition: background .15s, transform .15s var(--ease); }
.chip:hover { background: var(--fill-2); }
.chip:active { transform: scale(.96); }
.chip .en { font-size: 13px; font-weight: 400; color: var(--text-2); }
.chip[aria-pressed="true"] { background: var(--red); color: #fff; }
.chip[aria-pressed="true"] .en { color: #fff; }
.chip[aria-pressed="true"] > span:first-child::before { content: '✓ '; }
.xp { font-size: 12px; font-weight: 700; color: var(--red); }
.chip[aria-pressed="true"] .xp, .tile .xp { color: #fff; }

/* ── 分類方塊（曲風、樂器、人聲） ── */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tile { position: relative; }
.tile-main { width: 100%; min-height: 84px; border: 0; border-radius: 12px; background: var(--c); color: #fff; text-align: left; padding: 12px 40px 12px 14px; cursor: pointer;
  display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; transition: transform .15s var(--ease), box-shadow .15s; }
.tile-main:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(0, 0, 0, .18); }
.tile-main:active { transform: scale(.97); }
.tile-main b { font-size: 17px; font-weight: 900; line-height: 1.25; }
.tile-main .en { font-size: 13px; opacity: .95; }
.tile-main .tip { font-size: 13px; line-height: 1.4; }
.tile-main[aria-pressed="true"] { box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--text); }
.tile-main[aria-pressed="true"]::after { content: '✓'; position: absolute; right: 11px; bottom: 10px; width: 24px; height: 24px; border-radius: 50%; background: #fff; color: var(--text);
  display: grid; place-items: center; font-size: 14px; font-weight: 900; animation: pop .3s var(--ease); }
@keyframes pop { from { transform: scale(0); } }
.play { position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .95); color: var(--text);
  font-size: 11px; cursor: pointer; display: grid; place-items: center; padding-left: 2px; }
.play::after { content: ''; position: absolute; inset: -7px; border-radius: 50%; } /* 看起來 30px，手指可點範圍 44px（審查 L7） */
.play:hover { background: #fff; transform: scale(1.08); }

.play.on { background: var(--red); color: #fff; font-size: 12px; }

/* ── 調音樂：像設定清單的分組 ── */
.intro-bar { background: var(--bg-2); border-radius: var(--r); padding: 16px 20px; margin-top: 18px; font-size: 17px; }
.panel { border-bottom: 1px solid var(--line); }
.panel:first-of-type { border-top: 1px solid var(--line); margin-top: 22px; }
.panel > summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 44px 1fr auto; gap: 16px; align-items: center; padding: 18px 4px; }
.panel > summary::-webkit-details-marker { display: none; }
.panel > summary .ic { width: 44px; height: 44px; border-radius: 12px; background: var(--c, var(--text)); color: #fff; display: grid; place-items: center; font-size: 20px; }
.panel > summary .h3 { display: block; font-size: 21px; font-weight: 900; }
.panel > summary .sum { display: block; color: var(--text-2); font-size: 16px; line-height: 1.5; }
.panel > summary .chev { font-size: 18px; color: var(--text-2); transition: transform .25s var(--ease); }
.panel[open] > summary .chev { transform: rotate(90deg); }
.panel-body { padding: 0 4px 26px 64px; }
.sub { margin-top: 20px; }
.sub > .label { display: block; font-size: 17px; font-weight: 700; margin-bottom: 10px; }
.fam { margin-top: 10px; border-radius: 12px; background: var(--bg-2); }
.fam > summary { cursor: pointer; padding: 12px 16px; font-weight: 700; font-size: 16px; }
.fam > .tiles, .fam > .chips, .fam > .inner { padding: 4px 14px 16px; }
.why { margin: 14px 0 0; padding: 12px 16px; background: var(--bg-2); border-radius: 12px; font-size: 16px; }
.sel-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 6px; }
.sel-item { display: flex; align-items: center; gap: 12px; background: var(--bg-2); border-radius: 12px; padding: 8px 12px; }
.sel-item .dot { width: 14px; height: 14px; border-radius: 4px; background: var(--c); flex: none; }
.sel-item .grow { flex: 1; font-weight: 500; }
.lead-badge { font-size: 12px; font-weight: 700; background: var(--red); color: #fff; border-radius: 999px; padding: 2px 9px; }

/* 情緒地圖 */
.pad-wrap { display: grid; grid-template-columns: minmax(0, 360px) 1fr; gap: 24px; align-items: start; }
.pad { position: relative; aspect-ratio: 1; border-radius: 18px; cursor: crosshair; overflow: hidden; touch-action: manipulation; border: 1px solid var(--line);
  background: linear-gradient(to right, transparent 49.8%, rgba(29, 29, 31, .18) 50%, transparent 50.2%), linear-gradient(to bottom, transparent 49.8%, rgba(29, 29, 31, .18) 50%, transparent 50.2%),
    conic-gradient(from 0deg at 50% 50%, #FFE3E3 0 25%, #E3F7EC 25% 50%, #E3EEFF 50% 75%, #EDE3FF 75% 100%); }
.pad .ax { position: absolute; font-size: 13px; font-weight: 900; color: var(--text); background: #fff; padding: 1px 8px; border-radius: 999px; pointer-events: none; }
.pad .m { position: absolute; transform: translate(-50%, -50%); font-size: 12.5px; font-weight: 500; color: var(--text); pointer-events: none; white-space: nowrap; }
.pad .m.on { background: var(--red); color: #fff; font-weight: 700; border-radius: 999px; padding: 1px 7px; }
.pad .pin { position: absolute; width: 22px; height: 22px; border-radius: 50%; background: var(--red); border: 3px solid #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .35);
  transform: translate(-50%, -50%); pointer-events: none; animation: pop .3s var(--ease); }

/* 速度 */
.bpm-out { font-size: 44px; font-weight: 900; line-height: 1.1; }
.bpm-out small { font-size: 17px; font-weight: 500; color: var(--text-2); margin-left: 10px; }
input[type=range] { width: 100%; max-width: 560px; accent-color: var(--red); height: 32px; }
.tl-row { display: grid; grid-template-columns: 100px 1fr auto; gap: 8px; margin-top: 8px; max-width: 720px; }
.tagbar { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 10px; }
.tagbar .chip { padding: 6px 12px; font-size: 15px; flex-direction: row; gap: 6px; align-items: baseline; }

/* ── 點歌單（桌機右側「接下來播放」／手機底部迷你播放列） ── */
.slip { position: sticky; top: 84px; }
.slip-card { border: 1px solid var(--line); border-radius: 18px; padding: 18px; background: #fff; }
.slip-head { display: flex; gap: 12px; align-items: center; }
.slip-head .cover { width: 56px; padding: 0; border-radius: 8px; display: grid; place-items: center; }
.slip-head .cover .cv-ico { font-size: 26px; }
.slip-head .cover::after { display: none; }
.slip-head .t { font-weight: 900; font-size: 18px; line-height: 1.3; }
.slip-head .s { font-size: 14px; color: var(--text-2); }
.slip-head .eq { color: var(--red); margin-left: auto; }
.slots { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; margin: 14px 0; font-size: 15px; }
.slots span::before { content: '○ '; color: var(--text-2); }
.slots span.ok { font-weight: 700; }
.slots span.ok::before { content: '● '; color: var(--red); }
.slip .preview { background: var(--bg-2); border-radius: 12px; padding: 12px 14px; font: 14px/1.6 var(--font); line-height: 1.6; max-height: 300px; overflow: auto; white-space: pre-wrap; word-break: break-word; margin: 0; }
.slip .warn-note { font-size: 15px; color: var(--warn); font-weight: 700; margin: 12px 0 0; }
.mini { display: none; }

/* ── 完成頁：歌曲頁 ── */
.song { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 36px; align-items: end; margin-top: 32px; }
.song .cover { width: 100%; box-shadow: 0 20px 44px rgba(0, 0, 0, .22); animation: drop .6s var(--ease) both; }
.song .cover .cv-ico { font-size: 64px; }
.song .cover .cv-t { font-size: 30px; }
@keyframes drop { from { opacity: 0; transform: translateY(-16px) scale(.96); } }
.song .kicker { font-size: 14px; font-weight: 700; color: var(--red); letter-spacing: .1em; }
.song h1 { font-size: clamp(34px, 5vw, 56px); font-weight: 900; line-height: 1.12; margin: 4px 0 6px; }
.song .meta { font-size: 17px; color: var(--text-2); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
.btn.play-btn { min-height: 54px; padding: 0 30px; font-size: 18px; animation: ring 1.6s var(--ease) .8s 2; }
@keyframes ring { 0% { box-shadow: 0 0 0 0 rgba(214, 0, 23, .45); } 100% { box-shadow: 0 0 0 16px rgba(214, 0, 23, 0); } }
.checks { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-direction: column; gap: 10px; max-width: 860px; }
.checks li { border-radius: 12px; padding: 12px 16px; font-size: 16px; background: var(--info-bg); display: flex; gap: 10px; align-items: flex-start; flex-wrap: wrap; }
.checks li.warn { background: var(--warn-bg); color: var(--warn); }
.checks li.error { background: var(--red-soft); color: var(--err); }
.checks li b { font-weight: 900; }
.checks li .grow { flex: 1 1 260px; }
.ok-note { background: #E3F7EC; color: #0B5A2A; border-radius: 12px; padding: 12px 16px; font-weight: 700; max-width: 860px; }
.lyrics { margin-top: 12px; max-width: 900px; }
.lyrics .ln { padding: 10px 0; border-bottom: 1px solid var(--fill-2); }
.lyrics .en { font-size: 20px; font-weight: 700; line-height: 1.45; word-break: break-word; }
.lyrics .zh { font-size: 16px; color: var(--text-2); margin-top: 2px; }
.lyrics .tag { display: inline-block; font-size: 12px; font-weight: 700; color: #fff; background: var(--c); border-radius: 999px; padding: 1px 9px; margin-bottom: 4px; }
.lyrics pre { font: 700 19px/1.7 var(--font); white-space: pre-wrap; margin: 12px 0 0; background: var(--bg-2); border-radius: 12px; padding: 16px 18px; }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 12px 0 0; max-width: 860px; }
.steps li { counter-increment: s; position: relative; padding: 6px 0 12px 54px; font-size: 17px; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 2px; width: 38px; height: 38px; border-radius: 50%; background: var(--text); color: #fff; font-weight: 900; display: grid; place-items: center; }
.tips { margin: 12px 0 0; padding-left: 1.2em; max-width: 860px; }
.tips li { margin: 6px 0; }

.manual { margin-top: 14px; max-width: 860px; }
.manual textarea { width: 100%; min-height: 170px; border: 2px solid var(--red); border-radius: 12px; padding: 12px 14px; font: 15px/1.6 var(--font); background: #fff; }
/* ── 第 2 段：Key、AI、直接做歌 ── */
.topright { grid-area: tools; justify-self: end; max-width: 100%; display: flex; align-items: center; gap: 10px; min-width: 0; }
.topright:empty { display: none; }
.seg { min-width: 0; }
.keybtn { border: 0; background: var(--fill); color: var(--text); border-radius: 999px; padding: 8px 14px; font-size: 15px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.keybtn:hover { background: var(--fill-2); }
.keybtn.on { background: #E3F7EC; color: #0B5A2A; }
dialog { border: 0; border-radius: 22px; padding: 0; width: min(640px, calc(100vw - 24px)); max-height: calc(100vh - 32px); color: var(--text); box-shadow: 0 30px 80px rgba(0, 0, 0, .35); }
dialog::backdrop { background: rgba(0, 0, 0, .45); }
.dlg { padding: 26px 26px 22px; overflow: auto; overscroll-behavior: contain; }
.dlg .steps li { font-size: 16px; }
.dlg h3 { font-size: 18px; font-weight: 900; margin: 18px 0 4px; }
.dlg p { margin: 4px 0; }
.keystatus { font-weight: 700; margin: 12px 0 0; min-height: 1.5em; }
.keystatus.ok { color: #0B5A2A; } .keystatus.bad { color: var(--err); }
.ai-card { background: var(--bg-2); border-radius: 18px; padding: 18px 20px; margin-top: 22px; max-width: 860px; }
.ai-card .h3 { font-size: 20px; font-weight: 900; }
.ai-card textarea { width: 100%; min-height: 84px; border: 1.5px solid var(--line); border-radius: 12px; padding: 11px 14px; margin: 10px 0 12px; font-size: 17px; background: #fff; }
.ai-card textarea:focus { border-color: var(--red); outline: none; box-shadow: 0 0 0 4px rgba(214, 0, 23, .14); }
.suggest { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; margin-top: 14px; }
.suggest ul { margin: 6px 0 10px; padding-left: 1.2em; }
.busy { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; color: var(--text); margin-top: 12px; }
.busy .eq { color: var(--red); }
.btn[disabled] { background: var(--fill-2); color: #6E6E73; cursor: wait; transform: none; }
.thumbs { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.thumbs figure { margin: 0; position: relative; width: 84px; height: 84px; border-radius: 10px; overflow: hidden; background: var(--fill); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.thumbs button { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .7); color: #fff; cursor: pointer; }
.thumbs .ph-up { top: auto; bottom: 4px; font-size: 18px; font-weight: 900; line-height: 1; }
.thumbs button:hover { background: #000; }
.thumbs button::after { content: ''; position: absolute; inset: -6px; } /* 看起來 26px，手指可點範圍 38px */
.results { display: flex; flex-direction: column; gap: 14px; margin-top: 16px; max-width: 860px; }
.result { border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; }
.result .rh { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 17px; }
.result audio { width: 100%; margin: 10px 0 8px; }
.result pre { font: 16px/1.8 var(--font); white-space: pre-wrap; margin: 8px 0 0; }
.toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%) translateY(16px); opacity: 0; background: var(--text); color: #fff; font-weight: 500;
  padding: 12px 22px; border-radius: 999px; transition: .25s var(--ease); z-index: 60; pointer-events: none; max-width: calc(100vw - 32px); text-align: center; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
footer { border-top: 1px solid var(--line); padding: 26px 0 120px; font-size: 15px; color: var(--text-2); background: var(--bg-2); }
footer b { color: var(--text); }
footer ul { margin: 8px 0; padding-left: 1.2em; }

/* ── 平板與手機 ── */
@media (max-width: 1080px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .slip { position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 40; }
  .slip-card { display: none; border-radius: 18px 18px 0 0; max-height: 76vh; overflow: auto; overscroll-behavior: contain; border-bottom: 0; box-shadow: 0 -10px 30px rgba(0, 0, 0, .16); }
  .slip { padding-bottom: env(safe-area-inset-bottom); background: rgba(255, 255, 255, .96); }
  .slip.open .slip-card { display: block; }
  .mini { display: flex; align-items: center; gap: 12px; width: 100%; border: 0; border-top: 1px solid var(--line); background: rgba(255, 255, 255, .96);
    backdrop-filter: saturate(180%) blur(16px); padding: 10px 16px; min-height: 68px; cursor: pointer; text-align: left; }
  .slip.open .mini { border-top: 0; }
  .mini .cover { width: 46px; padding: 0; border-radius: 8px; display: grid; place-items: center; flex: none; }
  .mini .cover::after { display: none; }
  .mini .cover .cv-ico { font-size: 22px; }
  .mini .t { font-weight: 900; font-size: 16px; line-height: 1.3; }
  .mini .s { font-size: 14px; color: var(--text-2); }
  .mini .grow { flex: 1; min-width: 0; }
  .mini .eq { color: var(--red); }
  .layout.full .slip { display: none; }
  .pad-wrap { grid-template-columns: minmax(0, 1fr); }
  .pad { max-width: 380px; }
}
@media (max-width: 640px) {
  .top { position: static; } /* 手機頂列不固定，畫面留給內容；底部有迷你播放列 */
  .wrap { padding: 0 16px; }
  .top .wrap { height: auto; padding-top: 10px; padding-bottom: 10px; grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "logo key lang" "nav nav nav" "tools tools tools"; gap: 8px 10px; }
  .logo { font-size: 19px; gap: 8px; }
  .logo .mark { width: 32px; height: 32px; }
  .site-nav a { padding: 8px 9px; font-size: 14px; }
  .topright { justify-self: stretch; }
  .seg button { flex: 1; padding: 6px 8px; font-size: 14px; }
  /* 手機：Key 鈕移到第一列、縮小（2026-10-03 審查 M12：整列寬的大按鈕讓第一次來的人以為要先設 Key，其實免費路線不用） */
  .topright { display: contents; }
  .seg { grid-area: tools; }
  .keybtn { grid-area: key; padding: 7px 12px; font-size: 14px; }
  .dlg { padding: 20px 18px 18px; }
  .shelf { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 14px; }
  .cover .cv-t { font-size: 17px; }
  .panel > summary { grid-template-columns: 40px 1fr auto; gap: 12px; }
  .panel > summary .ic { width: 40px; height: 40px; }
  .panel-body { padding-left: 4px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .song { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .song .cover { max-width: 260px; }
  .occ-head .cover { width: 96px; }
  .lyrics .en { font-size: 18px; }
}
/* ── 第 1 步：新功能入口 ── */
.feat-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; margin-top: 22px; max-width: 980px; }
.feat { display: flex; gap: 14px; align-items: center; padding: 16px 18px; border: 0; border-radius: 18px; background: var(--bg-2); color: var(--text); text-align: left; text-decoration: none; cursor: pointer; transition: background .15s, transform .15s var(--ease); }
.feat:hover { background: var(--fill-2); transform: translateY(-2px); }
.feat .ic { width: 52px; height: 52px; flex: none; border-radius: 14px; background: var(--c); color: #fff; display: grid; place-items: center; font-size: 24px; }
.feat b { display: block; font-size: 18px; font-weight: 900; line-height: 1.3; }
.feat .muted { display: block; line-height: 1.5; }
.new-tag { display: inline-block; font-size: 12px; font-weight: 700; color: #fff; background: var(--red); border-radius: 999px; padding: 1px 8px; margin-left: 6px; vertical-align: 2px; }

/* ── 照片（看圖作曲） ── */
.photo-card { border-radius: 18px; padding: 18px 20px; background: var(--bg-2); max-width: 860px; margin-top: 22px; }
.photo-card .h3 { font-size: 20px; font-weight: 900; }
.drop { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-top: 12px; padding: 18px; border-radius: 14px; background: #fff; border: 2px dashed var(--line); cursor: pointer; text-align: center; transition: border-color .15s, background .15s; }
.drop:hover, .drop.over { border-color: var(--red); }
.drop.over { background: var(--red-soft); }
.drop:focus-within { outline: 3px solid var(--red); outline-offset: 2px; }
.drop b { font-size: 17px; }
.thumbs figure figcaption { position: absolute; left: 4px; bottom: 4px; min-width: 22px; height: 22px; border-radius: 999px; background: rgba(0, 0, 0, .72); color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; padding: 0 6px; }
.lab { display: inline-block; font-size: 12px; font-weight: 700; color: #0B5A2A; background: #E3F7EC; border-radius: 999px; padding: 1px 9px; vertical-align: 2px; }

/* ── 時間軸 ── */
.tl-bar { display: flex; height: 44px; border-radius: 12px; overflow: hidden; margin: 14px 0 4px; background: var(--fill); max-width: 860px; }
.tl-bar > * { flex: none; min-width: 0; display: flex; align-items: center; justify-content: center; padding: 0 4px; color: #fff; font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: var(--c); border: 0; border-right: 2px solid #fff; font-family: inherit; }
.tl-bar > *:last-child { border-right: 0; }
.tl-bar button { cursor: pointer; }
.tl-bar button:hover { filter: brightness(1.12); }
.tl-axis { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-2); max-width: 860px; font-variant-numeric: tabular-nums; }
.tl-row { grid-template-columns: 84px 160px minmax(0, 1fr) auto; align-items: center; max-width: 860px; }
.tl-row input, .tl-row select { min-height: 46px; border: 1.5px solid var(--line); border-radius: 10px; padding: 8px 10px; background: #fff; color: var(--text); font-size: 16px; min-width: 0; width: 100%; }
.tl-row input:focus, .tl-row select:focus { border-color: var(--red); outline: none; box-shadow: 0 0 0 4px rgba(214, 0, 23, .14); }
.tl-head { display: grid; grid-template-columns: 84px 160px minmax(0, 1fr) auto; gap: 8px; margin-top: 14px; max-width: 860px; font-size: 14px; font-weight: 700; color: var(--text-2); }
.tl-end { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.tl-btns { display: flex; align-items: center; gap: 2px; white-space: nowrap; }
/* 幫影片配樂：使用者自己的影片（只在本機播放） */
.vidbox { margin-top: 14px; max-width: 860px; }
.vid { display: block; width: 100%; max-width: 860px; max-height: 60vh; aspect-ratio: 16 / 9; background: #000; border-radius: 14px; }
.tryout { margin-top: 14px; max-width: 860px; }
.tl-end input { width: 96px; min-height: 46px; border: 1.5px solid var(--line); border-radius: 10px; padding: 8px 10px; font-size: 16px; }

/* ── MV 創作（作品頁） ── */
.works-top { display: flex; align-items: end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.feature { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); border-radius: 24px; overflow: hidden; background: #1D1D1F; color: #fff; margin-top: 28px; box-shadow: 0 24px 60px rgba(0, 0, 0, .18); }
.feature .shot { position: relative; display: block; aspect-ratio: 16 / 9; background: #000; border: 0; padding: 0; cursor: pointer; }
.feature .shot img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .6s var(--ease); }
.feature .shot:hover img { transform: scale(1.03); }
.feature .info { padding: 28px 30px; display: flex; flex-direction: column; justify-content: center; gap: 8px; min-width: 0; }
.feature .kicker { color: #FF8A93; font-size: 14px; font-weight: 700; letter-spacing: .08em; }
.feature h2 { font-size: clamp(30px, 3.6vw, 46px); font-weight: 900; line-height: 1.12; margin: 0; }
.feature .meta { color: #C7C7CC; font-size: 16px; }
.feature p { margin: 4px 0 0; color: #E5E5EA; font-size: 16px; line-height: 1.7; }
.feature .actions { margin-top: 14px; }
.feature .btn.gray { background: #3A3A3C; color: #fff; }
.feature .btn.gray:hover { background: #48484A; }
.bigplay { position: absolute; left: 50%; top: 50%; width: 76px; height: 76px; margin: -38px 0 0 -38px; border-radius: 50%; background: rgba(255, 255, 255, .94); color: var(--red); display: grid; place-items: center; font-size: 26px; padding-left: 5px; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); transition: transform .2s var(--ease); pointer-events: none; }
.feature .shot:hover .bigplay, .work-card:hover .bigplay { transform: scale(1.08); }
.works-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 30px 22px; margin-top: 18px; }
/* 作品牆的篩選、搜尋、排序、顯示更多（作品多了才出現） */
.works-filter { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.works-count:empty { display: none; }
.works-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.works-tools input[type=search] { flex: 1 1 260px; min-width: 0; min-height: 48px; border: 1.5px solid var(--line); border-radius: 999px; background: #fff; padding: 0 18px; font-size: 16px; outline: none; }
.works-tools input::placeholder { color: #6E6E73; }
.works-tools label { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; color: var(--text-2); }
.works-tools select { min-height: 48px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; color: var(--text); padding: 0 12px; font-size: 16px; outline: none; }
.works-tools input:focus, .works-tools select:focus { border-color: var(--red); box-shadow: 0 0 0 4px rgba(214, 0, 23, .14); }
.works-count { margin: 12px 0 0; }
.works-more { display: flex; justify-content: center; margin-top: 28px; }
.work-card { text-align: left; background: none; border: 0; padding: 0; cursor: pointer; display: flex; flex-direction: column; gap: 6px; color: var(--text); text-decoration: none; animation: rise .5s var(--ease) both; animation-delay: calc(var(--i, 0) * 60ms); }
.work-card .thumb { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: 16px; overflow: hidden; background: #000; box-shadow: 0 1px 2px rgba(0, 0, 0, .1); transition: box-shadow .25s var(--ease), transform .25s var(--ease); }
.work-card .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s var(--ease); }
.work-card:hover .thumb { transform: translateY(-4px); box-shadow: 0 14px 30px rgba(0, 0, 0, .2); }
.work-card:hover .thumb img { transform: scale(1.04); }
.work-card .bigplay { width: 54px; height: 54px; margin: -27px 0 0 -27px; font-size: 18px; opacity: 0; transition: opacity .2s; }
.work-card:hover .bigplay, .work-card:focus-visible .bigplay { opacity: 1; }
.pill { position: absolute; font-size: 12px; font-weight: 700; color: #fff; background: rgba(0, 0, 0, .74); border-radius: 999px; padding: 3px 10px; }
.pill.tl { left: 10px; top: 10px; } .pill.br { right: 10px; bottom: 10px; font-variant-numeric: tabular-nums; }
.work-card .t { font-size: 21px; font-weight: 900; line-height: 1.3; margin-top: 6px; }
.work-card .s { color: var(--text-2); font-size: 15px; line-height: 1.5; }
.cta-band { display: flex; justify-content: space-between; align-items: center; gap: 16px 24px; flex-wrap: wrap; background: var(--bg-2); border-radius: 22px; padding: 26px 28px; margin-top: 56px; }
.cta-band b { font-size: 22px; font-weight: 900; display: block; }
.backlink { display: inline-flex; align-items: center; gap: 6px; margin-top: 22px; font-weight: 700; color: var(--text); text-decoration: none; padding: 6px 10px 6px 0; }
.backlink:hover { color: var(--red); }
.player { margin-top: 12px; aspect-ratio: 16 / 9; width: 100%; background: #000; border-radius: 20px; overflow: hidden; box-shadow: 0 24px 60px rgba(0, 0, 0, .22); }
.player video, .player iframe { width: 100%; height: 100%; display: block; background: #000; border: 0; }
/* 按了才載入 YouTube（審查 L11）：先放封面＋播放鈕 */
.player .ytcover { position: relative; width: 100%; height: 100%; padding: 0; border: 0; background: #000; cursor: pointer; display: block; }
.player .ytcover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.player .ytcover .ytbtn { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 76px; height: 76px; border-radius: 50%; background: var(--red); color: #fff;
  font-size: 30px; display: grid; place-items: center; padding-left: 5px; box-shadow: 0 8px 24px rgba(0, 0, 0, .35); transition: transform .2s var(--ease); }
.player .ytcover:hover .ytbtn { transform: translate(-50%, -50%) scale(1.06); }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 40px; align-items: start; margin-top: 26px; }
.detail-grid h1 { font-size: clamp(32px, 4.6vw, 54px); font-weight: 900; line-height: 1.12; margin: 2px 0 6px; }
.detail-grid .kicker { font-size: 14px; font-weight: 700; color: var(--red); letter-spacing: .08em; }
.detail-grid .lead { margin-top: 10px; }
.facts { border: 1px solid var(--line); border-radius: 18px; padding: 18px 20px; position: sticky; top: 84px; }
.facts h2 { font-size: 17px; font-weight: 900; margin: 0 0 10px; }
.facts dl { margin: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 14px; font-size: 15px; }
.facts dt { color: var(--text-2); white-space: nowrap; }
.facts dd { margin: 0; font-weight: 500; }
.facts .total { font-size: 22px; font-weight: 900; }
.setgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-top: 14px; }
.setcard { border-radius: 16px; background: var(--bg-2); padding: 14px 16px; }
.setcard .k { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; color: var(--text-2); }
.setcard .v { font-size: 17px; font-weight: 700; margin-top: 4px; line-height: 1.5; }
.kw { display: inline-block; font-size: 13px; font-weight: 500; color: var(--text-2); background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 0 8px; margin: 4px 4px 0 0; }
.scene-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin-top: 14px; }
.scene { width: 100%; text-align: left; background: none; border: 0; padding: 0; cursor: pointer; color: var(--text); display: flex; flex-direction: column; gap: 6px; }
.scene img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 12px; display: block; background: var(--fill); transition: transform .25s var(--ease); }
.scene:hover img { transform: translateY(-3px); }
.scene .time { font-size: 13px; font-weight: 700; color: var(--red); font-variant-numeric: tabular-nums; }
.scene .d { font-size: 15px; line-height: 1.5; }
.prompt-box { background: #1D1D1F; color: #F5F5F7; font: 14px/1.75 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; border-radius: 16px; padding: 16px 18px; white-space: pre-wrap; word-break: break-word; max-height: 380px; overflow: auto; margin: 12px 0 0; max-width: 900px; }
.lyrics-grid { columns: 2; column-gap: 36px; margin-top: 12px; max-width: 900px; }
.lyrics-grid section { break-inside: avoid; margin: 0 0 18px; }
.lyrics-grid h3 { font-size: 13px; font-weight: 700; color: var(--text-2); letter-spacing: .06em; margin: 0 0 4px; }
.lyrics-grid p { margin: 0; font-size: 17px; line-height: 1.75; }
.lyrics-grid .tr { display: block; font-size: 14px; color: var(--text-2); line-height: 1.5; margin-bottom: 4px; }
.proc { list-style: none; padding: 0; margin: 12px 0 0; max-width: 900px; display: flex; flex-direction: column; gap: 10px; }
.proc li { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: start; background: var(--bg-2); border-radius: 14px; padding: 12px 16px; }
.proc .n { width: 32px; height: 32px; border-radius: 50%; background: var(--text); color: #fff; font-weight: 900; display: grid; place-items: center; }
.proc .c { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.note-ai { margin-top: 18px; font-size: 15px; color: var(--text-2); max-width: 900px; }
/* ── 背景音樂（2026-10-03：96 首曲庫；一列一首＝播放鍵｜曲名與標籤｜用這份點歌單做一首，點歌單收在下面） ── */
.bgm-chips { margin-top: 18px; }
.bgm-auto { margin-top: 16px; font-size: 16px; }
.bgm-list { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-direction: column; gap: 10px; max-width: 980px; }
.bgm-row { position: relative; display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 8px 16px; align-items: center; background: var(--bg-2); border-radius: 16px; padding: 12px 16px; overflow: hidden;
  content-visibility: auto; contain-intrinsic-size: auto 150px; } /* 96 列：畫面外的先不排版 */
.bgm-row.playing { background: var(--red-soft); }
.bgm-play { width: 52px; height: 52px; border-radius: 50%; border: 0; background: var(--red); color: #fff; font-size: 18px; cursor: pointer; display: grid; place-items: center; padding: 0 0 0 3px; transition: transform .15s var(--ease), background .15s; }
.bgm-play:hover { background: var(--red-2); }
.bgm-play:active { transform: scale(.94); }
.bgm-row.playing .bgm-play { padding-left: 0; }
.bgm-play .eq { color: #fff; height: 18px; }
.bgm-name { min-width: 0; }
.bgm-name b { font-size: 18px; font-weight: 900; }
.bgm-name .alt { color: var(--text-2); font-size: 14px; }
.bgm-tags { color: var(--text-2); font-size: 14px; margin-top: 2px; }
.bgm-acts { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.bgm-req { grid-column: 1 / -1; margin-top: 0; background: #fff; }
.bgm-dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 14px; margin: 0; font-size: 15px; }
.bgm-dl dt { color: var(--text-2); white-space: nowrap; }
.bgm-dl dd { margin: 0; font-weight: 500; min-width: 0; }
.bgm-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; pointer-events: none; }
.bgm-bar i { display: block; height: 100%; background: var(--red); transform-origin: left; transform: scaleX(0); transition: transform .25s linear; }
.dlg ol.legal { padding-left: 1.4em; margin: 6px 0 0; }
.dlg ol.legal li { margin: 6px 0; }

@media (max-width: 1080px) {
  .feature { grid-template-columns: minmax(0, 1fr); }
  .detail-grid { grid-template-columns: minmax(0, 1fr); }
  .facts { position: static; }
}
@media (max-width: 640px) {
  .tl-row, .tl-head { grid-template-columns: 70px minmax(0, 1fr) auto; }
  .tl-row .tl-desc { grid-column: 1 / -1; }
  .tl-row .tl-btns { grid-row: 1; grid-column: 3; }
  .tl-row { padding-bottom: 10px; border-bottom: 1px solid var(--fill-2); }
  .tl-head span:nth-child(3) { display: none; }
  .feature .info { padding: 20px; }
  .feature p { display: -webkit-box; -webkit-line-clamp: 4; line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
  .works-grid { grid-template-columns: minmax(0, 1fr); }
  /* 17 顆用途在手機上排成一列左右滑（原本折成 9 行，把曲目擠到很下面）；貼齊螢幕兩邊 */
  .bgm-chips { flex-wrap: nowrap; overflow-x: auto; margin: 18px -16px 0; padding: 2px 16px 6px; scrollbar-width: none; overscroll-behavior-x: contain; }
  .bgm-chips::-webkit-scrollbar { display: none; }
  .bgm-chips .chip { flex: none; }
  .bgm-row { grid-template-columns: 48px minmax(0, 1fr); padding: 12px; }
  .bgm-play { width: 48px; height: 48px; }
  .bgm-acts { grid-column: 1 / -1; justify-content: flex-start; }
  .bgm-dl { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .bgm-dl dd { margin-bottom: 8px; }
  .lyrics-grid { columns: 1; }
  .proc li { grid-template-columns: 34px minmax(0, 1fr); }
  .proc .c { grid-column: 2; }
  .cta-band { padding: 20px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
