:root {
  --bg: #f3f0ff; --ink: #2a2440; --mute: #6f6890;
  --glass: rgba(255,255,255,.45); --edge: rgba(255,255,255,.8);
  --a1: #f472b6; --a2: #a78bfa; --bad: #dc2626;
  color-scheme: light;
}
[hidden] { display: none !important; }
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--ink);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }

.bg { position: fixed; inset: 0; overflow: hidden; z-index: 0; pointer-events: none; }
.bg i { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .85;
  animation: float 18s ease-in-out infinite alternate; }
.b1 { width: 420px; height: 420px; background: #fbcfe8; top: -120px; right: -100px; }
.b2 { width: 420px; height: 420px; background: #c4b5fd; bottom: -120px; left: -120px; animation-delay: -6s; }
.b3 { width: 300px; height: 300px; background: #bae6fd; top: 40%; left: 45%; animation-delay: -12s; }
@keyframes float { to { transform: translate(40px, -30px) scale(1.1); } }
@media (prefers-reduced-motion: reduce) { .bg i { animation: none; } }

.wrap { position: relative; z-index: 1; max-width: 640px; margin: 0 auto;
  padding: max(24px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
           max(32px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
.stack { display: flex; flex-direction: column; gap: 16px; }

.glass { border-radius: 24px; padding: 20px; background: var(--glass); border: 1px solid var(--edge);
  box-shadow: inset 0 1px 0 #fff, 0 20px 40px rgba(120,100,180,.18);
  -webkit-backdrop-filter: blur(22px) saturate(160%); backdrop-filter: blur(22px) saturate(160%); }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass { background: rgba(255,255,255,.85); }
}

.ttl { font-size: 24px; font-weight: 700; margin: 0; }
.sub { margin: 4px 0 14px; color: var(--mute); font-size: 14px; }
.h { font-size: 15px; margin: 0 0 10px; }
.head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.badges { display: flex; gap: 6px; }
.badge { font-size: 12px; padding: 4px 10px; border-radius: 999px; background: rgba(255,255,255,.6); border: 1px solid #fff; }
.badge.on { color: #047857; background: rgba(16,185,129,.15); }
.badge.off { color: #b91c1c; background: rgba(239,68,68,.15); }

.row { display: flex; gap: 8px; }
input { font: inherit; font-size: 16px; min-height: 46px; flex: 1; min-width: 0; border-radius: 14px;
  padding: 10px 14px; background: rgba(255,255,255,.7); border: 1px solid #fff; color: var(--ink); outline: none;
  -webkit-appearance: none; appearance: none; }
input:focus { border-color: var(--a2); box-shadow: 0 0 0 3px rgba(167,139,250,.25); }
.btn { min-height: 46px; padding: 0 18px; border: 0; border-radius: 14px; font: inherit; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--a1), var(--a2)); cursor: pointer; white-space: nowrap; touch-action: manipulation; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .6; }
.btn.ghost { background: rgba(255,255,255,.7); color: var(--ink); border: 1px solid #fff; }
.btn.small { min-height: 44px; padding: 0 12px; font-size: 13px; }
.msg { min-height: 1.2em; margin: 8px 0 0; font-size: 13px; color: var(--mute); overflow-wrap: anywhere; }
.msg.err { color: var(--bad); }

.jobs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.job { display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: 16px; background: rgba(255,255,255,.5); }
.cov { width: 48px; height: 48px; border-radius: 12px; flex: none; object-fit: cover;
  background: linear-gradient(135deg, #fda4af, #c4b5fd); }
.info { flex: 1; min-width: 0; }
.jt { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.js { font-size: 12px; color: var(--mute); overflow-wrap: anywhere; }
.js.err { color: var(--bad); }
.bar { height: 6px; border-radius: 6px; background: rgba(120,100,180,.12); overflow: hidden; margin-top: 6px; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--a1), var(--a2)); transition: width .4s; }
.empty { color: var(--mute); font-size: 13px; margin: 0; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 6px 12px; border-radius: 999px; font-size: 13px; border: 1px solid #fff; }
.chip.ok { background: rgba(16,185,129,.12); }
.chip.warn { background: rgba(245,158,11,.18); }
.chip small { color: var(--mute); margin-left: 4px; font-size: 11px; }
.more { display: flex; gap: 8px; align-items: center; margin-top: 12px; }
.more input { min-height: 44px; }
.link { background: none; border: 0; color: #7c5cd6; font: inherit; font-weight: 600; cursor: pointer;
  min-height: 44px; padding: 0 8px; white-space: nowrap; }
.exlist { list-style: none; padding: 0; margin: 10px 0 0; max-height: 320px; overflow: auto;
  display: flex; flex-wrap: wrap; gap: 6px; -webkit-overflow-scrolling: touch; }
.exlist li { font-size: 12px; padding: 3px 8px; border-radius: 8px; background: rgba(255,255,255,.55); }
.exlist li.broken { opacity: .45; text-decoration: line-through; }
.note { font-size: 12px; color: var(--mute); margin: 10px 0 0; }
.foot { text-align: center; font-size: 12px; color: var(--mute); }

@media (max-width: 560px) {
  .wrap { padding-top: max(16px, env(safe-area-inset-top)); }
  .stack { gap: 12px; }
  .glass { padding: 16px; border-radius: 20px;
    -webkit-backdrop-filter: blur(14px) saturate(150%); backdrop-filter: blur(14px) saturate(150%); }
  .ttl { font-size: 21px; }
  #urlForm { flex-wrap: wrap; }
  #urlForm input { flex-basis: 100%; }
  #urlForm .btn { flex: 1; }
  .bg i { filter: blur(40px); }
  .b1, .b2 { width: 280px; height: 280px; }
  .b3 { width: 200px; height: 200px; }
}

/* ---- 鈴聲剪輯 ---- */
.sheet-bg { position: fixed; inset: 0; z-index: 10; background: rgba(42,36,64,.28);
  display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 640px; max-height: 92vh; overflow: auto; border-radius: 24px 24px 0 0;
  background: rgba(255,255,255,.82); padding-bottom: max(20px, env(safe-area-inset-bottom)); }
@media (min-width: 561px) { .sheet-bg { align-items: center; } .sheet { border-radius: 24px; } }
body.locked { overflow: hidden; }
.wave { position: relative; height: 128px; margin-top: 8px; border-radius: 14px; background: rgba(255,255,255,.6);
  border: 1px solid #fff; overflow: hidden; }
.wave canvas { width: 100%; height: 100%; display: block; touch-action: none; cursor: ew-resize; }
.rt-times { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.rt-time { flex: 1 1 260px; display: flex; align-items: center; gap: 6px; }
.rt-time .label { font-size: 13px; color: var(--mute); width: 2.5em; }
.rt-time .rt-input { flex: 1; text-align: center; font-variant-numeric: tabular-nums; font-weight: 600; min-height: 44px; padding: 6px; }
.rt-len { margin: 10px 0 0; font-weight: 700; }
.rt-len.bad { color: var(--bad); }
.rt-fade { display: flex; gap: 8px; align-items: center; margin-top: 10px; font-size: 14px; min-height: 44px; }
.rt-fade input { width: 22px; height: 22px; min-height: 0; flex: none; -webkit-appearance: auto; appearance: auto; }
.rt-actions { margin-top: 6px; }
.rt-actions .btn { flex: 1; }
.rt-dl { display: flex; align-items: center; justify-content: center; text-decoration: none; margin-top: 10px; }
.rt-wavebar { display: flex; align-items: center; gap: 8px; }
.rt-wavebar .msg { flex: 1; margin: 0; }
.zoom { display: flex; align-items: center; gap: 6px; }
.zoom .btn.small { width: 44px; padding: 0; font-size: 18px; }
.zoom span { min-width: 3.2em; text-align: center; font-size: 13px; color: var(--mute); font-variant-numeric: tabular-nums; }
