/** Shopify CDN: Minification failed

Line 7:0 Unexpected "<"
Line 452:0 Unexpected "<"

**/
<style>
  .custom-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 10px;
    box-sizing: border-box;
  }
  .custom-modal-overlay.active {
    opacity: 1;
  }

  .custom-modal-box {
    background: #eeeeee;
    width: 100%;
    max-width: 1300px;
    height: 95vh;
    max-height: 95vh;
    display: flex;
    flex-direction: column;
    padding: 0;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    border-radius: 12px;
    overflow: hidden;
    /* 字体抗锯齿 */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
  .custom-modal-overlay.active .custom-modal-box {
    transform: translateY(0);
  }

  .modal-header {
    padding: 15px 30px;
    background: #ffffff;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    height: 60px;
    box-sizing: border-box;
  }

  /* 主内容区：隐藏滚动条 */
  .modal-content-area {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
    background: #e5e5e5;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .modal-content-area::-webkit-scrollbar {
    display: none;
  }

  .acrylic-block {
    position: relative;
    width: 100%;
    height: auto;
    aspect-ratio: 3 / 2 !important;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.6),
      inset 0 -1px 0 rgba(0, 0, 0, 0.1),
      0 2px 5px rgba(0, 0, 0, 0.1),
      0 20px 40px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    flex-shrink: 0;
    max-width: 700px;
  }
  .acrylic-block::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
      125deg,
      rgba(255, 255, 255, 0.15) 0%,
      rgba(255, 255, 255, 0) 40%
    );
    pointer-events: none;
    border-radius: 6px;
    z-index: 10;
  }

  #play-progress-line {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 2px;
    background-color: rgba(255, 59, 48, 0.9);
    box-shadow: 0 0 8px rgba(255, 59, 48, 0.6);
    z-index: 30;
    display: none;
    pointer-events: none;
    transition: left 0.1s linear;
  }

  canvas {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* 让波形图浮在反光层上 */
    position: relative;
    z-index: 20;
  }

  .controls-wrapper {
    background: #ffffff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
    width: 100%;
    max-width: 900px;
    box-sizing: border-box;
    flex-shrink: 0;
  }

  .row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    width: 100%;
  }

  .controls-wrapper input[type="text"],
  .controls-wrapper select {
    padding: 0 14px;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    font-size: 14px;
    outline: none;
    background: #f9fafb;
    height: 40px;
    box-sizing: border-box;
    flex: 1;
    min-width: 120px;
    color: #333333;
  }

  .upload-hint {
    width: 100%;
    text-align: center;
    font-size: 11px;
    color: #666666;
    margin: 0 0 5px;
  }

  /* 上传按钮基础样式 */
  .file-btn {
    padding: 0 20px;
    height: 40px;
    line-height: 40px;
    border-radius: 6px;
    background: #333333;
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: inline-block;
    white-space: nowrap;
    text-align: center;
    flex: 0 0 auto;
    border: none;
    transition: all 0.2s;
  }
  .file-btn:hover {
    background: #000000;
  }

  /* 上传按钮状态色 */
  .file-btn.uploaded {
    background: #059669;
  }
  .file-btn.loading {
    background: #d97706;
    pointer-events: none;
  }
  .file-btn.error {
    background: #dc2626;
    animation: shake 0.5s;
  }

  /* 加购按钮的错误抖动 */
  .btn-error-shake {
    background: #dc2626 !important;
    animation: shake 0.5s;
  }

  /* 抖动动画 */
  @keyframes shake {
    0% {
      transform: translateX(0);
    }
    25% {
      transform: translateX(-5px);
    }
    50% {
      transform: translateX(5px);
    }
    75% {
      transform: translateX(-5px);
    }
    100% {
      transform: translateX(0);
    }
  }

  #playBtn {
    padding: 0 20px;
    height: 40px;
    border-radius: 6px;
    border: none;
    background: #3b82f6;
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    opacity: 0.5;
    pointer-events: none;
    flex: 0 0 auto;
  }
  #playBtn.active {
    opacity: 1;
    pointer-events: auto;
  }
  #playBtn:hover {
    background: #2563eb;
  }

  .slider-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    height: 40px;
    padding: 0 12px;
    border-radius: 6px;
    flex: 1;
    min-width: 180px;
  }

  .slider-side-text {
    font-size: 11px;
    color: #888888;
    font-weight: 600;
    text-transform: uppercase;
    white-space: nowrap;
    user-select: none;
  }

  input[type="range"] {
    -webkit-appearance: none;
    background: transparent;
    flex: 1;
    margin: 0 5px;
  }
  input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 14px;
    width: 14px;
    border-radius: 50%;
    background: #333333;
    cursor: pointer;
    margin-top: -5px;
  }
  input[type="range"]::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
  }

  /* 底部区域 & 进度按钮 */
  .modal-footer {
    padding: 20px 30px;
    background: #ffffff;
    border-top: 1px solid #e0e0e0;
    flex-shrink: 0;
    z-index: 100;
    position: relative;
    box-sizing: border-box;
  }

  .btn-group {
    display: flex;
    gap: 15px;
    width: 100%;
  }

  .custom-btn {
    flex: 1;
    padding: 15px;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 6px;
    font-weight: 600;
  }

  .btn-cancel {
    background: transparent;
    border: 1px solid #cccccc;
  }

  .btn-save {
    position: relative;
    background: #111111;
    color: #ffffff;
    border: 1px solid #111111;
    overflow: hidden;
    z-index: 1;
    transition: border-color 0.3s;
    /* 进度条背景 */
    background-image: linear-gradient(
      to right,
      #059669 var(--progress, 0%),
      #111111 var(--progress, 0%)
    );
    background-size: 100% 100%;
    background-repeat: no-repeat;
  }
  .btn-save:disabled {
    opacity: 0.8;
    cursor: wait;
  }

  /* 📱 移动端优化 */
  @media screen and (max-width: 768px) {
    /* 底部适配 iOS 安全区 */
    .modal-footer {
      padding: 14px 20px calc(env(safe-area-inset-bottom, 16px) + 6px) !important;
    }

    .custom-modal-overlay {
      align-items: flex-end !important;
      padding: 0 !important;
    }

    .custom-modal-box {
      width: 100% !important;
      height: 92vh !important;
      margin: 0 !important;
      border-radius: 20px 20px 0 0 !important;
      border: none !important;
      transform: translateY(100%) !important;
    }
    .custom-modal-overlay.active .custom-modal-box {
      transform: translateY(0) !important;
    }

    .modal-header {
      padding: 10px 20px !important;
      height: 50px !important;
    }
    .modal-header h2 {
      font-size: 1.1rem !important;
    }

    .modal-content-area {
      padding: 15px;
    }

    .acrylic-block {
      width: 100%;
      margin-bottom: 10px;
      max-width: none;
    }
  }

  /* 💻 大屏布局优化 */
  @media screen and (min-width: 1100px) {
    .custom-modal-box {
      height: 95vh;
    }
    .modal-content-area {
      flex-direction: row !important;
      align-items: center !important;
      justify-content: center !important;
      gap: 50px !important;
      padding: 40px !important;
      overflow: hidden !important;
    }
    .acrylic-block {
      flex: 0 0 auto !important;
      height: 100% !important;
      max-height: 60vh !important;
      width: auto !important;
      margin: 0 !important;
      max-width: none !important;
      box-shadow: 0 30px 60px rgba(0, 0, 0, 0.2);
    }
    .controls-wrapper {
      flex: 1;
      max-width: 380px !important;
      background: #ffffff;
      padding: 30px !important;
      max-height: 65vh;
      overflow-y: auto;
    }
  }

  /* 隐藏原生 file input，只保留自定义按钮 */
  input[type="file"] {
    display: none;
  }
</style>
