/* [enhance] 质感增强层样式。只追加，不改原站 style.css。 */

/* ---------- 载入：墨线进度 + 展卷式退场 ---------- */
#loading { transition: opacity 500ms ease-out, clip-path 900ms cubic-bezier(0.7, 0, 0.2, 1); }
#loading.done { clip-path: inset(0 0 0 100%); transition: clip-path 900ms cubic-bezier(0.7, 0, 0.2, 1), opacity 300ms ease-out 650ms; }
.enh-ink { position: absolute; left: 50%; top: calc(50% + 30px); width: 220px; height: 1px; transform: translateX(-50%);
  background: rgba(242, 234, 219, 0.16); overflow: hidden; }
.enh-ink i { display: block; width: 100%; height: 100%; background: var(--paper); transform: scaleX(0); transform-origin: 50% 50%;
  transition: transform 240ms ease-out; }
.enh-pct { position: absolute; left: 50%; top: calc(50% + 42px); transform: translateX(-50%); font-family: var(--mono); font-size: 10.5px;
  letter-spacing: 1px; color: rgba(242, 234, 219, 0.5); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- 拖拽光标 ---------- */
/* 画布的 DOM 子节点是真实 DOM，拖拽会把卡片文字选中，所以整个舞台禁用文本选择 */
#stage { cursor: grab; -webkit-user-select: none; user-select: none; }
#stage.enh-grab { cursor: grabbing; }

/* ---------- 控制条：声音 / 回到卷首 ---------- */
#controls { display: flex; align-items: center; gap: 10px; }
.enh-pill { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; font-size: 13px; letter-spacing: 1px;
  color: var(--paper); padding: 9px 14px; border: 1px solid rgba(242, 234, 219, 0.28); border-radius: 999px; background: rgba(5, 5, 5, 0.55);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: border-color 160ms ease-out, transform 120ms ease-out, opacity 300ms ease-out; }
.enh-pill:hover { border-color: rgba(242, 234, 219, 0.6); }
.enh-pill:active { transform: scale(0.98); }
.enh-pill:focus-visible { outline: 1px solid var(--paper); outline-offset: 3px; }
.enh-pill svg { width: 13px; height: 13px; fill: none; stroke: var(--paper); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
#enh-sound[aria-pressed="true"] { border-color: rgba(242, 234, 219, 0.72); }
#enh-sound .i-on { display: none; }
#enh-sound[aria-pressed="true"] .i-on { display: block; }
#enh-sound[aria-pressed="true"] .i-off { display: none; }
#enh-back { opacity: 0; pointer-events: none; transform: translateY(4px); }
#enh-back.on { opacity: 1; pointer-events: auto; transform: none; }

@media (max-width: 767px) {
  .enh-pill { font-size: 12px; padding: 8px 11px; }
  /* 窄屏：右下角有平台角标，控制条改竖排避开；「回到卷首」绝对定位，出现时不顶动其他按钮 */
  #controls { flex-direction: column; align-items: flex-start; gap: 8px; }
  #enh-back { position: absolute; left: 0; bottom: calc(100% + 8px); }
}
@media (prefers-reduced-motion: reduce) {
  #loading, #loading.done { transition: none; clip-path: none; }
  .enh-ink i { transition: none; }
  #enh-back { transition: none; }
}
