.watermark-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 86% 6%, rgba(96, 165, 250, 0.1), transparent 28%),
    radial-gradient(circle at 6% 76%, rgba(56, 249, 215, 0.045), transparent 24%),
    #050510;
}

.watermark-page [hidden] {
  display: none !important;
}

.watermark-page::after {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  opacity: 0.2;
  background-image:
    linear-gradient(rgba(96, 165, 250, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(96, 165, 250, 0.08) 1px, transparent 1px);
  background-size: 88px 88px;
  mask-image: radial-gradient(circle at 55% 45%, #000, transparent 72%);
}

.tool-header {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 78px;
  padding: 0 48px;
  border-bottom: 1px solid rgba(230, 237, 243, 0.1);
  background: rgba(5, 5, 16, 0.76);
  backdrop-filter: blur(18px);
}

.tool-header-meta {
  display: flex;
  align-items: center;
  gap: 34px;
  color: rgba(139, 148, 158, 0.62);
  font: 600 9px/1 var(--font-display);
  letter-spacing: 0.18em;
}

.tool-header-meta a {
  padding-bottom: 7px;
  color: rgba(230, 237, 243, 0.76);
  border-bottom: 1px solid rgba(56, 249, 215, 0.24);
}

.tool-header-meta b {
  margin-left: 7px;
  color: var(--cyan);
}

.tool-main {
  width: min(1520px, calc(100vw - 80px));
  margin: 0 auto;
  padding: 90px 0 100px;
}

.tool-intro {
  position: relative;
  max-width: 900px;
  margin-bottom: 58px;
}

.tool-kicker {
  margin: 0 0 20px;
  color: rgba(56, 249, 215, 0.65);
  font: 600 9px/1 var(--font-display);
  letter-spacing: 0.22em;
}

.tool-intro h1 {
  width: max-content;
  max-width: 100%;
  margin: 0;
  color: transparent;
  background: linear-gradient(105deg, #e6edf3 0%, #7cebdc 48%, #60a5fa 100%);
  background-clip: text;
  font-size: clamp(48px, 6vw, 86px);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.055em;
}

.tool-intro > p:not(.tool-kicker) {
  max-width: 650px;
  margin: 24px 0 0;
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.9;
}

.local-badge {
  position: absolute;
  right: -420px;
  bottom: 10px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: rgba(56, 249, 215, 0.48);
  font: 600 8px/1 var(--font-display);
  letter-spacing: 0.18em;
}

.local-badge i,
.preview-header p i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 10px rgba(56, 249, 215, 0.76);
}

.watermark-workspace {
  display: grid;
  grid-template-columns: 390px minmax(0, 1fr);
  min-height: 760px;
  border: 1px solid rgba(96, 165, 250, 0.22);
  background: rgba(5, 12, 22, 0.82);
  box-shadow: 0 42px 120px rgba(0, 0, 0, 0.28);
}

.control-panel {
  display: flex;
  flex-direction: column;
  padding: 30px;
  border-right: 1px solid rgba(96, 165, 250, 0.18);
  background: rgba(6, 15, 27, 0.92);
}

.panel-heading,
.preview-header,
.preview-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.panel-heading {
  margin-bottom: 24px;
  color: rgba(139, 148, 158, 0.58);
  font: 600 9px/1 var(--font-display);
  letter-spacing: 0.17em;
}

.text-button,
.replace-button {
  padding: 0;
  color: rgba(56, 249, 215, 0.7);
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 11px;
}

.text-button:disabled {
  opacity: 0.28;
  cursor: default;
}

.drop-zone {
  display: grid;
  place-items: center;
  min-height: 170px;
  padding: 22px;
  border: 1px dashed rgba(56, 249, 215, 0.32);
  background:
    linear-gradient(rgba(56, 249, 215, 0.028), rgba(56, 249, 215, 0.01)),
    repeating-linear-gradient(45deg, transparent 0 12px, rgba(96, 165, 250, 0.016) 12px 13px);
  cursor: pointer;
  text-align: center;
  transition: border-color 0.25s ease, background 0.25s ease, transform 0.25s ease;
}

.drop-zone:hover,
.drop-zone.is-dragging {
  border-color: var(--cyan);
  background-color: rgba(56, 249, 215, 0.045);
  transform: translateY(-2px);
}

.drop-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.upload-symbol {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-bottom: 10px;
  color: var(--cyan);
  border: 1px solid rgba(56, 249, 215, 0.36);
  border-radius: 50%;
  font: 300 24px/1 var(--font-display);
}

.drop-zone strong {
  font-size: 14px;
  font-weight: 500;
}

.drop-zone small {
  margin-top: 7px;
  color: rgba(139, 148, 158, 0.55);
  font-size: 10px;
}

.file-summary {
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  padding: 16px 18px;
  border: 1px solid rgba(56, 249, 215, 0.2);
  background: rgba(56, 249, 215, 0.025);
}

.file-summary:not([hidden]) {
  display: flex;
}

.file-summary div {
  min-width: 0;
}

.file-summary strong,
.file-summary small {
  display: block;
}

.file-summary strong {
  max-width: 245px;
  overflow: hidden;
  font-size: 12px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-summary small {
  margin-top: 5px;
  color: var(--text-muted);
  font-size: 9px;
}

.settings {
  display: grid;
  gap: 20px;
  min-width: 0;
  margin: 26px 0 0;
  padding: 0;
  border: 0;
}

.settings:disabled {
  opacity: 0.42;
}

.field {
  display: grid;
  gap: 9px;
}

.field > span:first-child,
.compact-field > span:first-child {
  display: flex;
  justify-content: space-between;
  color: rgba(230, 237, 243, 0.62);
  font-size: 11px;
}

.field output {
  color: var(--cyan);
  font: 500 9px/1 var(--font-display);
}

.text-field input,
.compact-field select {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  color: var(--text);
  border: 1px solid rgba(96, 165, 250, 0.2);
  outline: none;
  background: rgba(3, 8, 16, 0.66);
  font: 400 12px/1 var(--font-cn);
  transition: border-color 0.25s ease;
}

.text-field input:focus,
.compact-field select:focus {
  border-color: rgba(56, 249, 215, 0.56);
}

.mode-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid rgba(96, 165, 250, 0.18);
}

.mode-grid label {
  cursor: pointer;
}

.mode-grid input {
  position: absolute;
  opacity: 0;
}

.mode-grid span {
  display: grid;
  place-items: center;
  min-height: 38px;
  color: var(--text-muted);
  border-right: 1px solid rgba(96, 165, 250, 0.14);
  font-size: 10px;
}

.mode-grid label:last-child span {
  border-right: 0;
}

.mode-grid input:checked + span {
  color: #031018;
  background: linear-gradient(100deg, var(--cyan), var(--blue));
  font-weight: 600;
}

.range-field input,
.compact-field input {
  width: 100%;
  height: 2px;
  margin: 6px 0;
  appearance: none;
  background: rgba(139, 148, 158, 0.24);
}

.range-field input::-webkit-slider-thumb,
.compact-field input::-webkit-slider-thumb {
  width: 13px;
  height: 13px;
  appearance: none;
  border: 2px solid #081320;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 10px rgba(56, 249, 215, 0.55);
  cursor: pointer;
}

.color-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.color-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.color-control input {
  width: 30px;
  height: 24px;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(230, 237, 243, 0.2);
  background: transparent;
}

.color-control code {
  color: rgba(230, 237, 243, 0.52);
  font: 500 9px/1 var(--font-display);
}

.export-row {
  display: grid;
  grid-template-columns: 1fr 1.45fr;
  gap: 14px;
}

.export-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 54px;
  margin-top: auto;
  padding: 0 20px;
  color: #031018;
  border: 0;
  background: linear-gradient(100deg, var(--cyan), var(--blue));
  cursor: pointer;
  font-weight: 600;
  letter-spacing: 0.08em;
  transition: opacity 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.export-button:not(:disabled):hover {
  box-shadow: 0 15px 36px rgba(56, 249, 215, 0.16);
  transform: translateY(-2px);
}

.export-button:disabled {
  opacity: 0.28;
  cursor: default;
  filter: grayscale(1);
}

.export-button b {
  font: 400 21px/1 var(--font-display);
}

.preview-panel {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-width: 0;
  padding: 30px;
}

.preview-header {
  min-height: 42px;
  padding-bottom: 18px;
}

.preview-header > div span,
.preview-footer {
  color: rgba(139, 148, 158, 0.58);
  font: 600 8px/1 var(--font-display);
  letter-spacing: 0.16em;
}

.preview-header > div small {
  display: block;
  margin-top: 7px;
  color: rgba(230, 237, 243, 0.46);
  font-size: 10px;
}

.preview-header p {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  color: rgba(56, 249, 215, 0.58);
  font-size: 9px;
}

.canvas-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 620px;
  padding: 30px;
  overflow: hidden;
  border: 1px solid rgba(96, 165, 250, 0.16);
  background:
    linear-gradient(45deg, rgba(96, 165, 250, 0.035) 25%, transparent 25%, transparent 75%, rgba(96, 165, 250, 0.035) 75%),
    linear-gradient(45deg, rgba(96, 165, 250, 0.035) 25%, transparent 25%, transparent 75%, rgba(96, 165, 250, 0.035) 75%),
    rgba(2, 7, 14, 0.7);
  background-position: 0 0, 12px 12px;
  background-size: 24px 24px;
}

.canvas-stage canvas {
  display: none;
  max-width: 100%;
  max-height: 68vh;
  border: 1px solid rgba(230, 237, 243, 0.12);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.42);
}

.canvas-stage.has-image canvas {
  display: block;
}

.empty-preview {
  display: grid;
  place-items: center;
  text-align: center;
}

.canvas-stage.has-image .empty-preview {
  display: none;
}

.empty-preview strong {
  margin-top: 28px;
  font-size: 17px;
  font-weight: 500;
}

.empty-preview p {
  margin: 8px 0 0;
  color: var(--text-muted);
  font-size: 11px;
}

.empty-orbit {
  position: relative;
  width: 120px;
  height: 120px;
  border: 1px solid rgba(96, 165, 250, 0.16);
  border-radius: 50%;
  box-shadow: inset -18px -18px 42px rgba(0, 0, 0, 0.45), inset 10px 10px 34px rgba(96, 165, 250, 0.08);
}

.empty-orbit::before,
.empty-orbit::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 168px;
  height: 46px;
  content: "";
  border: 1px solid rgba(56, 249, 215, 0.22);
  border-radius: 50%;
  transform: translate(-50%, -50%) rotate(-18deg);
}

.empty-orbit::after {
  width: 150px;
  height: 38px;
  border-color: rgba(96, 165, 250, 0.16);
  transform: translate(-50%, -50%) rotate(14deg);
}

.empty-orbit span {
  position: absolute;
  top: 50%;
  left: -24px;
  z-index: 2;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 10px var(--cyan);
}

.preview-footer {
  min-height: 46px;
  padding-top: 18px;
}

.tool-notes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 28px;
  border-top: 1px solid rgba(96, 165, 250, 0.16);
  border-bottom: 1px solid rgba(96, 165, 250, 0.16);
}

.tool-notes article {
  min-height: 170px;
  padding: 30px;
  border-right: 1px solid rgba(96, 165, 250, 0.16);
}

.tool-notes article:last-child {
  border-right: 0;
}

.tool-notes span {
  color: rgba(56, 249, 215, 0.44);
  font: 500 9px/1 var(--font-display);
}

.tool-notes h2 {
  margin: 24px 0 10px;
  font-size: 17px;
  font-weight: 500;
}

.tool-notes p {
  margin: 0;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.8;
}

.tool-toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 20;
  max-width: min(360px, calc(100vw - 48px));
  padding: 14px 18px;
  color: #031018;
  background: linear-gradient(100deg, var(--cyan), var(--blue));
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.34);
  opacity: 0;
  pointer-events: none;
  font-size: 12px;
  font-weight: 600;
  transform: translateY(12px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.tool-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1080px) {
  .tool-main { width: min(100% - 40px, 920px); }
  .local-badge { position: static; margin-top: 22px; }
  .watermark-workspace { grid-template-columns: 340px minmax(0, 1fr); }
  .control-panel, .preview-panel { padding: 24px; }
}

@media (max-width: 820px) {
  .tool-header { min-height: 66px; padding: 0 20px; }
  .tool-header-meta > span { display: none; }
  .tool-header-meta { gap: 0; }
  .tool-main { padding: 70px 0; }
  .tool-intro { margin-bottom: 38px; }
  .tool-intro h1 { font-size: 48px; }
  .watermark-workspace { grid-template-columns: 1fr; }
  .control-panel { border-right: 0; border-bottom: 1px solid rgba(96, 165, 250, 0.18); }
  .canvas-stage { min-height: 500px; }
  .tool-notes { grid-template-columns: 1fr; }
  .tool-notes article { min-height: 140px; border-right: 0; border-bottom: 1px solid rgba(96, 165, 250, 0.16); }
  .tool-notes article:last-child { border-bottom: 0; }
}

@media (max-width: 520px) {
  .tool-header-meta a { font-size: 0; }
  .tool-header-meta a b { margin: 0; font-size: 17px; }
  .tool-main { width: calc(100vw - 28px); padding-top: 54px; }
  .tool-intro h1 { font-size: 42px; }
  .tool-intro > p:not(.tool-kicker) { font-size: 13px; }
  .control-panel, .preview-panel { padding: 18px; }
  .mode-grid { grid-template-columns: repeat(2, 1fr); }
  .mode-grid label:nth-child(2) span { border-right: 0; }
  .mode-grid label:nth-child(-n + 2) span { border-bottom: 1px solid rgba(96, 165, 250, 0.14); }
  .export-row { grid-template-columns: 1fr; }
  .canvas-stage { min-height: 380px; padding: 14px; }
  .preview-header p { display: none; }
  .preview-footer { display: grid; gap: 8px; }
}
