.bgremove-page {
  margin: 0;
  min-height: 100vh;
  color: #122033;
  background:
    radial-gradient(circle at 12% 0%, rgba(20, 184, 166, 0.09), transparent 30%),
    linear-gradient(180deg, #f8fbff 0%, #eef6f3 100%);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.bgremove-header {
  border-bottom: 1px solid #dbe7ee;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(8px);
}

.bgremove-header-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px 20px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.bgremove-title {
  margin: 0;
  font-size: 30px;
  line-height: 1.2;
}

.bgremove-subtitle {
  margin: 10px 0 0;
  max-width: 860px;
  color: #425466;
  line-height: 1.6;
}

.bgremove-back-link {
  flex-shrink: 0;
  color: #0f766e;
  font-weight: 700;
  text-decoration: none;
}

.bgremove-main {
  max-width: 1240px;
  margin: 0 auto;
  padding: 22px 20px 44px;
}

.bgremove-workbench-head {
  margin-bottom: 16px;
  border: 1px solid #d6e7e2;
  border-radius: 16px;
  padding: 16px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 10px 30px rgba(18, 32, 51, 0.05);
}

.bgremove-workbench-head h2 {
  margin: 4px 0 0;
  font-size: 22px;
  line-height: 1.25;
}

.bgremove-kicker {
  margin: 0;
  color: #0f766e;
  font-size: 13px;
  font-weight: 800;
}

.bgremove-notice {
  margin: 0;
  max-width: 470px;
  padding: 10px 12px;
  border: 1px solid #bfe7dd;
  border-radius: 10px;
  color: #115e59;
  background: #ecfdf5;
  font-size: 14px;
}

.bgremove-notice--secondary {
  margin-top: 8px;
  max-width: min(720px, 100%);
  font-size: 13px;
  line-height: 1.55;
  border-color: #94a3b8;
  color: #334155;
  background: #f8fafc;
}

.bgremove-notice--secondary code {
  font-size: 0.9em;
  word-break: break-all;
}

.bgremove-layout {
  display: grid;
  grid-template-columns: minmax(360px, 430px) minmax(0, 1fr);
  align-items: start;
  gap: 16px;
}

.bgremove-card {
  border: 1px solid #dde7ee;
  border-radius: 16px;
  padding: 18px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(18, 32, 51, 0.055);
}

.bgremove-card h2 {
  margin: 0;
  font-size: 18px;
}

.bgremove-card-head {
  margin-bottom: 14px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.bgremove-card-eyebrow {
  margin: 0 0 4px;
  color: #0f766e;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.bgremove-card-badge {
  flex-shrink: 0;
  border: 1px solid #cde7df;
  border-radius: 999px;
  padding: 4px 8px;
  color: #0f766e;
  background: #ecfdf5;
  font-size: 12px;
  font-weight: 800;
}

.bgremove-control-panel,
.bgremove-info-panel,
.bgremove-text-panel {
  grid-column: 1;
}

.bgremove-original-panel,
.bgremove-text-result-panel,
.bgremove-result-panel {
  grid-column: 2;
}

.bgremove-original-panel {
  grid-row: 1 / span 2;
}

.bgremove-dropzone {
  min-height: 150px;
  border: 1.5px dashed #b8cad8;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  background: linear-gradient(180deg, #fbfdff, #f5faf8);
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.bgremove-dropzone:hover,
.bgremove-dropzone.is-dragover {
  border-color: #0f766e;
  background: #f0fdfa;
}

.bgremove-dropzone strong {
  font-size: 16px;
}

.bgremove-dropzone span {
  color: #5f7082;
  font-size: 13px;
}

.bgremove-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.bgremove-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.bgremove-mode-group {
  border: 0;
  margin: 14px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.bgremove-mode-group legend {
  margin-bottom: 8px;
  color: #425466;
  font-size: 14px;
  font-weight: 700;
}

.bgremove-mode-option {
  border: 1px solid #d7e2ea;
  border-radius: 10px;
  min-height: 58px;
  padding: 11px 12px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  cursor: pointer;
  background: #fbfdff;
}

.bgremove-mode-option:has(input:checked) {
  border-color: #0f766e;
  background: #ecfdf5;
}

.bgremove-mode-option-recommended {
  position: relative;
}

.bgremove-mode-option-recommended::after {
  content: "推荐";
  position: absolute;
  top: 8px;
  right: 8px;
  border-radius: 999px;
  padding: 2px 6px;
  background: #0f766e;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

.bgremove-mode-option input {
  margin-top: 3px;
  accent-color: #0f766e;
}

.bgremove-mode-option span {
  display: grid;
  gap: 3px;
}

.bgremove-mode-option strong {
  font-size: 14px;
}

.bgremove-mode-option em {
  color: #64748b;
  font-size: 12px;
  font-style: normal;
  line-height: 1.35;
}

.bgremove-mode-tip {
  margin: 10px 0 0;
  color: #64748b;
  font-size: 13px;
  line-height: 1.5;
}

.bgremove-convert-box {
  margin-top: 14px;
  border: 1px solid #d7e2ea;
  border-radius: 12px;
  padding: 14px;
  background: #f8fbfc;
}

.bgremove-convert-head h3 {
  margin: 0;
  font-size: 15px;
}

.bgremove-convert-head p {
  margin: 5px 0 12px;
  color: #64748b;
  font-size: 13px;
  line-height: 1.45;
}

.bgremove-tool-desc {
  margin: 0 0 12px;
  color: #64748b;
  font-size: 13px;
  line-height: 1.5;
}

.bgremove-text-grid {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.bgremove-text-controls {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.bgremove-control label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #425466;
  font-size: 13px;
  font-weight: 700;
}

.bgremove-control span {
  color: #0f766e;
  font-variant-numeric: tabular-nums;
}

.bgremove-control input {
  width: 100%;
  margin-top: 7px;
  accent-color: #0f766e;
}

.bgremove-select-label {
  display: block;
  margin-bottom: 6px;
  color: #425466;
  font-size: 13px;
  font-weight: 700;
}

.bgremove-convert-row {
  display: flex;
  gap: 10px;
}

.bgremove-select {
  min-width: 0;
  flex: 1;
  border: 1px solid #cbd8e2;
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
  color: #122033;
  font-size: 14px;
}

.bgremove-format-group {
  border: 0;
  margin: 14px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.bgremove-format-group legend {
  width: 100%;
  color: #425466;
  font-size: 14px;
  font-weight: 700;
}

.bgremove-format-option {
  border: 1px solid #d7e2ea;
  border-radius: 999px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  background: #fbfdff;
  color: #425466;
  font-size: 13px;
  font-weight: 700;
}

.bgremove-format-option:has(input:checked) {
  border-color: #0f766e;
  background: #ecfdf5;
  color: #0f766e;
}

.bgremove-format-option input {
  accent-color: #0f766e;
}

.bgremove-btn {
  border: 1px solid #cbd8e2;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.bgremove-btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.bgremove-btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.bgremove-btn-primary {
  border-color: #0f766e;
  background: #0f766e;
  color: #fff;
}

.bgremove-btn-light {
  background: #fff;
  color: #0f766e;
  font-weight: 700;
}

.bgremove-btn-ghost {
  background: #f8fafc;
  color: #425466;
}

.bgremove-meta-list {
  margin: 0;
  padding: 0;
}

.bgremove-meta-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #edf2f7;
  padding: 10px 0;
}

.bgremove-meta-item:last-child {
  border-bottom: 0;
}

.bgremove-meta-item dt {
  color: #64748b;
}

.bgremove-meta-item dd {
  margin: 0;
  max-width: 68%;
  overflow-wrap: anywhere;
  text-align: right;
  font-weight: 700;
}

.bgremove-preview-box {
  position: relative;
  min-height: 360px;
  border: 1px solid #dde7ee;
  border-radius: 14px;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.bgremove-original-panel .bgremove-preview-box {
  min-height: 580px;
}

.bgremove-result-panel .bgremove-preview-box {
  min-height: 420px;
}

.bgremove-selection-rect {
  position: absolute;
  border: 2px solid #0f766e;
  background: rgba(15, 118, 110, 0.12);
  box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.18);
  pointer-events: none;
  z-index: 2;
}

.bgremove-preview-box.is-selecting {
  cursor: crosshair;
}

.bgremove-editor {
  margin-bottom: 12px;
  display: grid;
  gap: 10px;
}

.bgremove-editor-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.bgremove-editor-row-range {
  flex-wrap: nowrap;
}

.bgremove-editor-label {
  color: #425466;
  font-size: 13px;
  font-weight: 700;
}

.bgremove-chip-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.bgremove-chip {
  border: 1px solid #d7e2ea;
  border-radius: 999px;
  padding: 7px 10px;
  background: #fff;
  color: #425466;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.bgremove-chip.is-active {
  border-color: #0f766e;
  background: #ecfdf5;
  color: #0f766e;
}

.bgremove-chip:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.bgremove-range {
  min-width: 90px;
  flex: 1;
  accent-color: #0f766e;
}

.bgremove-result-bg {
  background-image:
    linear-gradient(45deg, #e2e8f0 25%, transparent 25%),
    linear-gradient(-45deg, #e2e8f0 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e2e8f0 75%),
    linear-gradient(-45deg, transparent 75%, #e2e8f0 75%);
  background-size: 18px 18px;
  background-position: 0 0, 0 9px, 9px -9px, -9px 0;
}

.bgremove-result-white {
  background: #fff;
}

.bgremove-result-black {
  background: #111827;
}

.bgremove-result-gray {
  background: #94a3b8;
}

.bgremove-preview-box img,
.bgremove-preview-box canvas {
  max-width: 100%;
  max-height: 72vh;
  object-fit: contain;
  display: block;
}

.bgremove-original-panel .bgremove-preview-box img {
  width: 100%;
  height: 100%;
}

.bgremove-preview-box img[hidden],
.bgremove-preview-box canvas[hidden],
.bgremove-preview-box .bgremove-placeholder[hidden] {
  display: none;
}

.bgremove-result-canvas {
  cursor: crosshair;
  touch-action: none;
}

.bgremove-placeholder {
  margin: 0;
  padding: 0 16px;
  color: #6b7b8c;
  text-align: center;
}

@media (max-width: 760px) {
  .bgremove-workbench-head {
    flex-direction: column;
  }

  .bgremove-header-inner {
    flex-direction: column;
  }

  .bgremove-layout {
    grid-template-columns: 1fr;
  }

  .bgremove-control-panel,
  .bgremove-info-panel,
  .bgremove-text-panel,
  .bgremove-original-panel,
  .bgremove-text-result-panel,
  .bgremove-result-panel {
    grid-column: 1;
  }

  .bgremove-original-panel {
    grid-row: auto;
  }

  .bgremove-original-panel .bgremove-preview-box,
  .bgremove-result-panel .bgremove-preview-box,
  .bgremove-preview-box {
    min-height: 300px;
  }

  .bgremove-actions {
    flex-direction: column;
  }

  .bgremove-convert-row {
    flex-direction: column;
  }

  .bgremove-text-grid {
    grid-template-columns: 1fr;
  }

  .bgremove-mode-group {
    grid-template-columns: 1fr;
  }

  .bgremove-editor-row-range {
    flex-wrap: wrap;
  }

  .bgremove-btn {
    width: 100%;
  }
}
