.flex {
  display: flex;
  justify-content: space-between;
}
.flex > :is(span, div) {
  flex: 1;
}
.flex > :is(span, div) + :is(span, .preview) {
  border-left: 1px solid #ddd;
  box-shadow: inset 1px 0 #fff;
  padding-left: 10px;
}
.main-part {
  min-height: 520px;
  padding-left: 10px;
}

.container.empty:has(canvas):after {
  content: '尚未上传视频';
  color: var(--ui-gray);
  width: fit-content;
  height: 30px;
  display: grid;
  place-items: center;
  position: absolute;
  inset: 0;
  margin: auto;
  z-index: 1;
}
.container {
  margin-top: 10px;
  margin-right: 10px;
  position: relative;
}
.container canvas {
  width: 100%;
  height: auto;
  display: block;
  margin-inline: auto;
  background-color: #000;
}
dd, p {
  margin: 0;
}

.operate {
  max-width: 600px;
}

.bg-grid {
  background: conic-gradient(#eee 25%, white 0deg 50%, #eee 0deg 75%, white 0deg) 0 / 20px 20px;
}
.origin {
  margin-left: -10px;
  padding-left: 10px;
}

.upload-x {
  border: 2px dashed darkgray;
  border-radius: 8px;
  margin: 10px 10px 0 0;
  padding: 2rem 1rem;
  text-align: center;
}
.upload-tips {
  margin: 1rem 0 0;
  color: gray;
  font-size: 14px;
}

.form-set {
  margin-right: 10px;
  padding-bottom: 1rem;
}
.form-flex {
  display: flex;
  gap: 1rem;
}
.form-set dd {
  padding-right: 1.5rem;
}
h5, h6 {
  font-size: 100%;
}
.form-set h5 {
  font-weight: 400;
  margin: 0;
}

[id="radioPercent"]:checked ~ .size-px,
[id="radioPixel"]:checked ~ .size-percent {
  display: none;
}

.flow-root {
  display: flow-root;
}
.left {
  float: left;
}


.water-preview {
  width: 128px; height: 128px;
  color: var(--ui-gray);
  border: 1px dashed;
  float: left;
  margin-right: 1rem;
  cursor: pointer;
  transition: .2s;
  position: relative;
  --gradient: linear-gradient(currentColor, currentColor) no-repeat center;
}
.water-preview:hover {
  color: var(--ui-dark);
}
.water-preview img {
  display: block;
  width: 100%; height: 100%;
  object-fit: contain;
}
.water-preview:not(:has(img)) {
  background: var(--gradient), var(--gradient);
  background-size: 2px 24px, 24px 2px;
}
.water-preview:has(img):hover::before {
  content: '更换水印';
  position: absolute;
  inset: 0;
  background-color: #000a;
  z-index: 1;
  display: flex;
  color: #fff;
  place-items: center;
}

.water-p,
.water-flex {
  margin-top: 8px;
}
.water-flex {
  display: flex;
  text-align: center;
  gap: 1rem;
}
.water-li {
  margin-top: 12px;
}

.rotate-output {
  margin-left: .75rem;
  color: var(--ui-gray);
}
.rate-x {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
  gap: .5rem;
}

.size-px {
  display: inline-flex;
  margin-left: 1rem;
}
.size-percent {
  margin-top: .5rem;
}

.size-percent input {
  width: calc(100% - 6ch);
}

.download-x {
  margin-block: 1rem;
  text-align: center;
  padding-top: 1rem;
}
.download-x p {
  color: var(--ui-gray);
}

.label-title {
  display: block;
  font-weight: bold;
  margin-bottom: .25rem;
  font-family: KaiTi, STKaiTi;
}

.form-li:not(:first-child) {
  margin-top: 1rem;
}

.ml30 {
  margin-left: 30px;
}

:is(.origin, .preview) section {
  margin-top: 1rem;
}
:is(.origin, .preview) img {
  display: block;
  max-width: 100%;
}
.section-h {
  margin-bottom: .5rem;
  line-height: 1.75;
}
.section-h > span {
  font-size: 12px;
}
.section-h output {
  font-size: 12px;
  margin-left: 16px;
  color: var(--ui-gray);
}
.section-h strong {
  font-family: Arial;
}
.section-img {
  padding: 10px;
  margin-left: -10px;
  display: grid;
  place-items: center;
}

.green {
  color: var(--ui-green);
}
.red {
  color: var(--ui-red);
}

.clip {
  position: absolute;
  clip: rect(0 0 0 0);
}

.clear-a {
  display: inline-flex;
  align-items: center;
  font-size: 14px;
  gap: 3px;
  color: var(--ui-dark);
  position: absolute;
  margin-left: 1.25rem;
  margin-top: 10px;
}
.clear-a:hover {
  color: var(--ui-blue);
  text-decoration: none;
}
.clear-a svg {
  width: 1rem;
  height: 1rem;
  fill: currentColor
}

.main-part:not(:has(.section-img)) .clear-a {
  display: none;
}

.audio-upload {
  display: flex;
  margin-top: 12px;
  align-items: center;
}
.audio-cover {
  width: 64px; height: 64px;
  border-radius: 8px;
  overflow: hidden;
  flex: none;
  margin-right: 12px;
}
.audio-cover img {
  display: block;
  width: 100%; height: 100%;
  object-fit: cover;
}
.audio-cover:has(span) {
  display: grid;
  place-items: center;
}
.audio-cover:not(:has(img)) {
  background-color: #333;
  color: #fff;
  position: relative;
}
.audio-cover:not(:has(*))::before,
.audio-cover:not(:has(*))::after {
  content: '';
  width: 32px;
  inset: 0;
  margin: auto;
  position: absolute;
}
.audio-cover::before {
  height: 32px;
  border: 2px solid;
  border-radius: 50%;
}
.audio-cover::after {
  width: 32px;
  height: 2px;
  background-color: currentColor;
  transform: rotate(45deg);
}
.audio-info {
  flex: 1;
}
.audio-info h6 {
  margin: 0;
}
.audio-info time {
  color: var(--ui-gray);
}


/* 移动端布局兼容 */
@media (max-width: 640px) {
  h3.flex span:is(:first-child, :last-child) {
      display: none;
  }
  h3.flex span {
      padding: 0;
      border: 0;
  }

  .main-part {
      flex-direction: column;
      padding-left: 0;
  }

  .main-part > :is(.operate, .preview) {
      border-left: 0;
  }

  .operate {
      order: -1;
      border-bottom: 1px solid var(--ui-border);
  }

  :is(.preview, .origin):empty::after {
      height: 100px;
  }

  .preview::before,
  .origin::before {
      display: block;
      line-height: 30px;
      font-size: 15px;
      background: #f0f3f9;
      padding-left: 10px;
      border-bottom: 1px solid #ededed;
      color: #4e4e4e;
      text-shadow: 0px 1px 0px white;   
  }
  .origin::before {
      content: '原图';
  }
  .preview::before {
      content: '预览';
  }
  #preview {
      padding-left: 0;
  }
  .section-img {
      margin-left: 0;
  }
  .section-h {
      padding-inline: 10px;
  }
}

#videoX video {
  width: 100%;
}

/* 自定义播放器样式 */
.render-loading {
  position: absolute;
  width: 80px;
  height: 80px;
  border-radius: 8px;
  background-color: #000a;
  color: #fff;
  inset: 0;
  margin: auto;
  display: grid;
  place-items: center;
  font-size: 12px;
  white-space: nowrap;
  line-height: 20px;
}
.render-progress {
  --render-percent :0;
  transition: --render-percent 0.5s;
  counter-reset: progress var(--render-percent);
}
.render-progress::before {
  content: "";
  width: 24px;
  height: 24px;
  display: block;
  margin: 0 auto 4px;
  border-radius: 16px;
  border: 2px solid;
  border-top-color: transparent;
  animation: renderSpin 1s linear infinite;
}
@keyframes renderSpin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}
@property --render-percent {
  syntax: "<integer>";
  inherits: false;
  initial-value: 0;
}
.render-progress::after {
  content: counter(progress) "%";
}
dialog .render-progress::before {
  display: none;
}
.render-dialog {
  padding: 1rem;
  width: 360px;
  max-width: calc(100vw - 2rem);
  overflow: auto;
  font-size: 14px;
  border-radius: 8px;
  --ui-progress-background-color: var(--ui-border, #d0d0d5);
  box-shadow: 2px 2px 6px #0003;
}
.render-dialog::backdrop {
  background-color: #000a;
}
.render-dialog p:not(:last-child) {
  color: gray;
  margin-bottom: 12px;
}
.render-hidden {
  position: absolute;
  left: -999px;
  font-size: 0;
  top: -999px;
}

.render-dialog progress {
  display: block;
  width: 100%;
  height: 8px;
  border: 0;
  margin-block: 8px;
  background-color: var(--ui-progress-background-color);
  border-radius: 1em;
  overflow: hidden;
}
.render-dialog progress::-moz-progress-bar {
  background-color: var(--ui-blue, #f23f93);
}
.render-dialog progress::-webkit-progress-bar {
  background-color: var(--ui-progress-background-color);
}
.render-dialog progress::-webkit-progress-value {
  background-color: var(--ui-blue, #f23f93);
  transition: var(--duration, 0.5s);
}
.render-export-footer {
  text-align: right;
  margin-top: 16px;
}
.render-export-progress {
  font-feature-settings: "tnum";
}
.render-export p a {
  color: var(--ui-blue, #f23f93);
}
.render-btn {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 8px;
  min-width: 80px;
  color: #333;
  transition: 0.2s;
  text-align: center;
  font-size: 14px;
  background-color: #e3e3e3;
  border: none;
}
.render-btn-primary {
  background-color: var(--ui-blue, #f23f93);
  color: #fff;
  margin-left: 8px;
}
.render-btn:enabled:hover,
.render-btn:any-link:hover {
  filter: brightness(0.95);
}
.render-btn:disabled,
.render-btn:not(:any-link) {
  opacity: 0.75;
}

/* 播放器样式 */
.render-player-x {
  position: absolute;
  z-index: 2;
  left: 0;
  right: 0;
  bottom: 0;
  margin-inline: auto;
  background: linear-gradient(rgba(0, 0, 0, 0), #000);
  color: #fff;
  font-size: 12px;
  opacity: 1;
  transition: opacity 0.2s;
  transition-delay: 0;
}
.render-active:not(:hover) .render-player-x {
  opacity: 0;
  transition-delay: 0.3s;
}
.render-player-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-inline: 4px;
}
[class*="render-player-btn"] {
  border: 0;
  background: none no-repeat center;
  background-size: 18px 18px;
  margin: 0;
  padding: 0;
  height: 24px;
  width: 24px;
  font-size: 0;
  color: transparent;
  opacity: 0.9;
  cursor: pointer;
  transition: opacity 0.2s;
}
[class*="render-player-btn"]:hover {
  opacity: 1;
}
.render-player-btn-play {
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 1024 1024' xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cdefs%3E%3Cstyle/%3E%3C/defs%3E%3Cpath d='M511.5 4C231.216 4 4 231.216 4 511.5S231.216 1019 511.5 1019 1019 791.784 1019 511.5 791.784 4 511.5 4zm0 919.844c-227.73 0-412.344-184.614-412.344-412.344S283.77 99.156 511.5 99.156 923.844 283.77 923.844 511.5 739.23 923.844 511.5 923.844zM384.624 289.468L765.25 511.5 384.624 733.532V289.468z' fill='%23fff'/%3E%3C/svg%3E");
}
.render-player-btn-pause {
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 1024 1024' xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cdefs%3E%3Cstyle/%3E%3C/defs%3E%3Cpath d='M512 16C238 16 16 238 16 512s222 496 496 496 496-222 496-496S786 16 512 16zm0 896c-221 0-400-179-400-400s179-400 400-400 400 179 400 400-179 400-400 400zm192-560v320c0 17.6-14.4 32-32 32h-96c-17.6 0-32-14.4-32-32V352c0-17.6 14.4-32 32-32h96c17.6 0 32 14.4 32 32zm-224 0v320c0 17.6-14.4 32-32 32h-96c-17.6 0-32-14.4-32-32V352c0-17.6 14.4-32 32-32h96c17.6 0 32 14.4 32 32z' fill='%23fff'/%3E%3C/svg%3E");
}
.render-player-btn-voice[open] {
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 1024 1024' xmlns='http://www.w3.org/2000/svg' width='128' height='128'%3E%3Cpath d='M734.118 271.776l-46.483 46.522c43.48 50.07 69.959 115.234 69.959 186.753 0 78.772-31.9 150.056-83.53 201.648l46.483 46.484c63.564-63.447 102.833-151.208 102.833-248.131.001-89.654-33.886-171.234-89.262-233.276z' fill='%23fff'/%3E%3Cpath d='M830.05 175.884l-49.33 49.29c67.229 74.054 108.565 172.012 108.565 279.875 0 115.115-46.678 219.333-122.096 294.79l49.252 49.281c88.13-88.043 142.57-209.692 142.57-344.071-.002-127.127-49.177-242.477-128.962-329.165zm-183.321 183.36l-44.534 44.475c21.877 27.98 35.018 63.076 35.018 101.33 0 45.51-18.444 86.707-48.237 116.52l44.182 44.241c41.102-41.18 66.566-97.977 66.566-160.761 0-55.51-19.966-106.341-52.995-145.805zM224.83 633.093l273.188 204.905V177.815L224.83 382.68zM87.253 381.432c-12.83 0-23.203 10.373-23.203 23.183v199.446c0 12.81 10.374 23.183 23.203 23.183h84.933V381.432H87.253z' fill='%23fff'/%3E%3C/svg%3E");
  background-position: center;
}
.render-player-btn-voice {
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 1024 1024' xmlns='http://www.w3.org/2000/svg' width='128' height='128'%3E%3Cpath d='M518.568 166.067L231.874 381.1v262.805l286.694 215.04zm136.324 538.434L770.425 588.96 885.93 704.5l74.623-74.684-115.494-115.494 115.535-115.544-74.623-74.562L770.44 439.701 654.87 324.135l-74.563 74.644L695.8 514.31 580.206 629.858zM87.466 637.78h89.14V379.75h-89.14c-13.455 0-24.338 10.902-24.338 24.337v209.355c0 13.435 10.882 24.338 24.338 24.338z' fill='%23fff'/%3E%3C/svg%3E");
}
.render-player-slider-x {
  display: flex;
  height: 13px;
  position: relative;
  margin-left: 8px;
  margin-right: 8px;
}
.render-player-slider-track {
  flex: 1;
  height: 4px;
  background-color: hsla(0, 0%, 100%, 0.5);
  border-radius: 2px;
  overflow: hidden;
}
.render-player-slider-track::before {
  content: "";
  display: block;
  height: 100%;
  background-color: #fff;
  width: calc(1% * var(--progress));
}
.render-player-slider-thumb {
  position: absolute;
  width: 12px;
  height: 12px;
  border: 0;
  padding: 0;
  background: #fff;
  border-radius: 50%;
  margin: 0;
  top: 0;
  bottom: 0;
  margin: -4px -8px 0;
  left: calc(1% * var(--progress));
}
.render-player-slider-thumb:hover,
.render-player-slider-thumb:active {
  box-shadow: 0 0 0 1px var(--color-info-text);
}
.render-player-time {
  line-height: 32px;
  padding-right: 8px;
  padding-left: 4px;
  margin-right: auto;
}
ui-dot,
[is-dot] {
  display: inline-block;
  height: 1em;
  line-height: 1;
  text-align: left;
  vertical-align: -0.25em;
  overflow: hidden;
}
ui-dot::before,
[is-dot]::before {
  display: block;
  content: "...\A..\A.";
  white-space: pre-wrap;
  animation: dot 3s infinite step-start both;
}
@keyframes dot {
  33% {
    transform: translateY(-2em);
  }
  66% {
    transform: translateY(-1em);
  }
}