.rs-widget, .rs-dialog {
  color: #262823;
  font: 14px/1.5 "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", sans-serif;
}
.rs-widget *, .rs-dialog * { box-sizing: border-box; }
.rs-widget [hidden], .rs-dialog [hidden] { display: none !important; }
.rs-widget button, .rs-dialog button, .rs-dialog input { font: inherit; }
.rs-widget button, .rs-dialog button { cursor: pointer; }
.rs-widget :focus-visible, .rs-dialog :focus-visible { outline: 2px solid #61884a; outline-offset: 3px; }
.rs-widget {
  position: absolute;
  z-index: 5;
  right: max(30px, env(safe-area-inset-right));
  bottom: calc(var(--reader-bar-height, 45px) + env(safe-area-inset-bottom) + 25px);
}
.rs-trigger {
  display: grid; place-items: center;
  width: 50px; height: 50px; padding: 0; border: 0; border-radius: 4px;
  color: #cdcdcd; background: #191919; box-shadow: 0 3px 14px rgb(0 0 0 / 16%);
}
.rs-trigger:hover, .rs-trigger[aria-expanded=true] { color: white; background: #111; }
.rs-glyph { display: grid; grid-template-columns: repeat(2, 10px); gap: 2px; }
.rs-glyph i { width: 10px; height: 10px; border: 1px solid currentColor; }
.rs-glyph i::before { content: ""; display: block; width: 4px; height: 4px; margin: 2px; background: currentColor; }
.rs-glyph i:last-child { border: 0; }
.rs-glyph i:last-child::before {
  width: 2px; height: 2px; margin: 0;
  box-shadow: 4px 0, 8px 0, 0 2px, 6px 2px, 2px 4px, 4px 4px, 8px 4px, 0 6px, 4px 6px, 6px 8px, 8px 8px;
}
.rs-popover {
  position: absolute; right: calc(100% + 10px); bottom: 0;
  width: 170px; padding: 8px 8px 12px; border-radius: 5px;
  background: #fff; box-shadow: 0 4px 20px rgb(0 0 0 / 26%); text-align: center;
}
.rs-popover::after {
  content: ""; position: absolute; right: -5px; bottom: 20px;
  width: 10px; height: 10px; background: #fff; transform: rotate(45deg);
}
.rs-popover p, .rs-caption { margin: 5px 0 0; font-size: 13px; line-height: 1.5; text-align: center; }
.rs-widget canvas, .rs-dialog canvas { display: block; max-width: 100%; height: auto; margin-inline: auto; image-rendering: pixelated; }
.rs-dialog {
  box-sizing: border-box;
  width: min(540px, calc(100vw - 32px)); max-height: calc(100dvh - 28px);
  padding: 0; border: 0; border-radius: 17px; background: #fff; overflow: auto;
  box-shadow: 0 16px 60px rgb(0 0 0 / 35%); text-align: left;
}
.rs-dialog::backdrop { background: rgb(9 10 9 / 72%); }
.rs-dialog header { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px 14px 22px; border-bottom: 1px solid #e1e3dc; }
.rs-dialog h2 { margin: 0; color: #242820; font-size: 20px; font-weight: 650; }
.rs-dialog .rs-close {
  width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%;
  color: #50554c; background: #f1f2ee; font: 25px/1 sans-serif;
}
.rs-content { display: grid; grid-template-columns: 205px minmax(0, 1fr); align-items: stretch; }
.rs-code { display: grid; justify-items: center; align-content: center; padding: 18px 15px; background: #f5f6f2; }
.rs-code canvas { width: 174px; border-radius: 5px; }
.rs-caption { color: #4a5146; }
.rs-actions { min-width: 0; align-self: center; padding: 22px; }
.rs-actions label { display: block; margin-bottom: 8px; font-weight: 650; }
.rs-actions input {
  width: 100%; height: 39px; min-width: 0; border: 1px solid #ced2c8; border-radius: 5px;
  padding: 7px 10px; color: #30342c; background: #fafbf8; font-size: 13px;
}
.rs-buttons { margin-top: 11px; display: flex; flex-wrap: wrap; gap: 8px; }
.rs-buttons button {
  min-height: 36px; padding: 6px 14px; border: 1px solid #465e3c; border-radius: 5px;
  background: #405e35; color: #fff; font-size: 14px;
}
.rs-buttons .rs-native { color: #2f4628; border-color: #bfc7b9; background: #fff; }
.rs-buttons button:disabled { opacity: .5; cursor: default; }
.rs-result { margin: 8px 0 0; color: #42533b; font-size: 13px; }
.rs-result:empty { margin: 0; }
@media (max-width: 640px) {
  .rs-widget { right: max(12px, env(safe-area-inset-right)); bottom: calc(var(--reader-bar-height, 48px) + env(safe-area-inset-bottom) + 12px); }
  .rs-trigger { width: 44px; height: 44px; }
  .rs-dialog { width: min(370px, calc(100vw - 28px)); }
  .rs-content { grid-template-columns: 1fr; }
  .rs-code { padding-block: 12px; }
  .rs-code canvas { width: 156px; }
  .rs-actions { padding: 18px; }
}
@media (max-height: 420px) and (min-width: 460px) {
  .rs-content { grid-template-columns: 160px minmax(0, 1fr); }
  .rs-code canvas { width: 122px; }
}
