/* ============================================
   Pixel Converter Pro – Stripped-down enhanced version
   Two-column layout: workbench | panel (no toolbar, no editor)
   ============================================ */

body.pixel-converter-page {
  height: 100vh;
  overflow: hidden;
  display: block;
  background:
    radial-gradient(circle at 50% 42%, rgba(76, 175, 80, 0.04), transparent 30%),
    linear-gradient(180deg, #151515 0 64px, #0d0d0d 64px 100%);
}
body.pixel-converter-page::before {
  display: none;
}

.pixel-back {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 40;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 7px 14px;
  background: rgba(26, 26, 26, 0.92);
  color: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-left: 3px solid #4caf50;
  border-radius: 0 6px 6px 0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.28);
  font-family: "MinecraftAE", "Consolas", monospace;
  font-size: 13px;
  text-decoration: none;
}
.pixel-back:hover {
  background: rgba(40, 40, 40, 0.96);
  color: #7ddf82;
  text-decoration: none;
}

.pixel-main {
  width: 100vw;
  height: 100vh;
  min-height: 100vh;
  display: block;
  padding: 0;
}

.pixel-gui,
.pixel-content,
body.pixel-converter-page .pc-canvas-wrapper {
  width: 100%;
  height: 100%;
  min-height: 0;
}
.pixel-gui {
  display: block;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}
.pixel-content {
  display: block;
}
body.pixel-converter-page .pc-canvas-wrapper {
  position: relative;
  display: block;
}

body.pixel-converter-page .pc-canvas {
  position: absolute;
  inset: 66px 14px 12px;
  width: auto;
  height: auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background-color: #202020;
  background-image:
    linear-gradient(45deg, #1c1c1c 25%, transparent 25%),
    linear-gradient(-45deg, #1c1c1c 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #1c1c1c 75%),
    linear-gradient(-45deg, transparent 75%, #1c1c1c 75%);
  background-size: 24px 24px;
  background-position: 0 0, 0 12px, 12px -12px, -12px 0;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 8px;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.72),
    0 18px 60px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    inset 0 -1px 0 rgba(0, 0, 0, 0.7);
}
body.pixel-converter-page .pc-canvas::before {
  content: "";
  position: absolute;
  inset: 1px;
  pointer-events: none;
  border-radius: 7px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 22%),
    radial-gradient(circle at 50% 45%, rgba(76, 175, 80, 0.08), transparent 34%);
}
body.pixel-converter-page .pc-canvas::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: 8px;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.04),
    inset 0 0 80px rgba(0, 0, 0, 0.2);
}

/* ---- Shell: workbench + panel ---- */
.pc-shell {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: auto;
  height: auto;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 0;
  gap: 0;
  align-items: stretch;
}

body.pixel-converter-page .pc-canvas.pc-has-upload .pc-shell {
  grid-template-columns: minmax(0, 1fr) 244px;
}

/* ---- Workbench ---- */
.pc-workbench {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
}

/* ---- Panel ---- */
.pc-panel {
  min-width: 0;
  display: none;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px;
  background: rgba(18, 18, 18, 0.9);
  border-left: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 0 7px 7px 0;
  box-shadow: -10px 0 34px rgba(0, 0, 0, 0.22);
}
body.pixel-converter-page .pc-canvas.pc-has-upload .pc-panel {
  display: flex;
}

.pc-panel-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pc-panel-label {
  color: rgba(255, 255, 255, 0.66);
  font-family: "MinecraftAE", "Consolas", monospace;
  font-size: 12px;
}

/* ---- Size switch ---- */
.pc-size-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.pc-size-btn {
  min-height: 32px;
  padding: 7px 9px;
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  font-family: "MinecraftAE", "Consolas", monospace;
  font-size: 12px;
  cursor: pointer;
}
.pc-size-btn:hover {
  background: rgba(76, 175, 80, 0.22);
  border-color: rgba(125, 223, 130, 0.5);
  color: #9cff9c;
}
.pc-size-btn.is-active {
  background: rgba(76, 175, 80, 0.32);
  color: #9cff9c;
  border-color: rgba(125, 223, 130, 0.6);
}

.pc-dim-num {
  font-family: "MinecraftAE", "Consolas", monospace;
}
.pc-dim-times {
  display: inline-block;
  padding: 0 1px;
  font-family: Arial, "Microsoft YaHei", sans-serif;
  font-size: 0.95em;
  line-height: 1;
  transform: translateY(-1px);
}

/* ---- Toolbar (info + actions inside panel) ---- */
body.pixel-converter-page .pc-toolbar {
  position: static;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 86px;
  margin-bottom: 20px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  box-shadow: none;
}

body.pixel-converter-page .pc-info {
  width: 100%;
  color: rgba(255, 255, 255, 0.72);
  text-align: left;
}
body.pixel-converter-page .pc-info-label,
body.pixel-converter-page .pc-info-value,
body.pixel-converter-page .pc-page-info {
  font-family: "MinecraftAE", "Consolas", monospace;
  font-size: 13px;
}
body.pixel-converter-page .pc-info-value {
  color: #7ddf82;
}

body.pixel-converter-page .pc-name-field {
  width: 100%;
  display: grid;
  gap: 6px;
  color: rgba(255, 255, 255, 0.72);
}
body.pixel-converter-page .pc-name-field input {
  width: 100%;
  min-width: 0;
  height: 34px;
  padding: 6px 8px;
  color: rgba(255, 255, 255, 0.86);
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  font-family: "MinecraftAE", "Consolas", monospace;
  font-size: 12px;
}
body.pixel-converter-page .pc-name-field input:focus {
  outline: none;
  border-color: rgba(125, 223, 130, 0.62);
  box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.16);
}

body.pixel-converter-page .pc-actions {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 7px 14px;
  border: 0;
  border-radius: 6px;
  font-family: "MinecraftAE", "Consolas", monospace;
  font-size: 13px;
  cursor: pointer;
}
body.pixel-converter-page .pc-convert-btn {
  background: #4caf50;
  color: #fff;
}
body.pixel-converter-page .pc-convert-btn:hover {
  background: #56c55a;
}
body.pixel-converter-page .pc-convert-only-btn {
  background: rgba(76, 175, 80, 0.18);
  color: #9cff9c;
  border: 1px solid rgba(125, 223, 130, 0.34);
}
body.pixel-converter-page .pc-convert-only-btn:hover {
  background: rgba(76, 175, 80, 0.32);
  border-color: rgba(125, 223, 130, 0.5);
}
body.pixel-converter-page .pc-reset-btn {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.82);
}
body.pixel-converter-page .pc-reset-btn:hover {
  background: rgba(255, 255, 255, 0.14);
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---- Thumbnails ---- */
.pc-panel-actions {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}
.pc-thumb-strip {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
}
.pc-thumb-item {
  position: relative;
  width: 68px;
  height: 68px;
  padding: 3px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 5px;
  background: #1a1a1a;
  cursor: pointer;
  transition: border-color 0.15s;
}
.pc-thumb-item:hover {
  border-color: rgba(125, 223, 130, 0.5);
}
.pc-thumb-item.is-active {
  border-color: #7ddf82;
  box-shadow: 0 0 8px rgba(125, 223, 130, 0.3);
}
.pc-thumb-canvas {
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  border-radius: 3px;
}
.pc-thumb-arrow {
  color: rgba(255, 255, 255, 0.5);
  font-size: 22px;
  line-height: 1;
}
.pc-thumb-label {
  display: block;
  margin-top: 4px;
  font-family: "MinecraftAE", "Consolas", monospace;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
  text-align: center;
  white-space: nowrap;
}
.pc-thumb-item.is-active .pc-thumb-label {
  color: #7ddf82;
}

/* ---- Drop zone ---- */
body.pixel-converter-page .pc-drop-zone {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 5;
  width: min(720px, calc(100% - 60px));
  min-width: 320px;
  min-height: 280px;
  height: auto;
  padding: 50px 42px;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  border: 2px dashed rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.12);
  border-radius: 6px;
  cursor: pointer;
}
body.pixel-converter-page .pc-drop-zone:hover,
body.pixel-converter-page .pc-drag-over {
  border-color: #7ddf82 !important;
  background: rgba(76, 175, 80, 0.08);
}
body.pixel-converter-page .pc-drop-plus {
  font-size: 96px;
  line-height: 1;
  color: rgba(255, 255, 255, 0.38);
  font-family: "MinecraftAE", "Consolas", monospace;
}
body.pixel-converter-page .pc-drop-zone:hover .pc-drop-plus,
body.pixel-converter-page .pc-drag-over .pc-drop-plus {
  color: #7ddf82;
}
body.pixel-converter-page .pc-drop-text {
  color: rgba(255, 255, 255, 0.86);
  font-family: "MinecraftAE", "Microsoft YaHei", sans-serif;
  font-size: 28px;
  text-align: center;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.55);
}
body.pixel-converter-page .pc-drop-hint {
  display: initial;
  color: rgba(255, 255, 255, 0.36);
  font-family: "Microsoft YaHei", sans-serif;
  font-size: 16px;
}

body.pixel-converter-page .pc-canvas.pc-has-upload .pc-drop-zone {
  display: none !important;
}

body.pixel-converter-page .pc-feature-badges {
  display: flex;
  margin-top: 12px;
  gap: 12px;
}
body.pixel-converter-page .pc-feature-badge {
  background: rgba(76, 175, 80, 0.14);
  border: 1px solid rgba(125, 223, 130, 0.22);
  color: #7ddf82;
  font-family: "MinecraftAE", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  padding: 6px 14px;
  border-radius: 14px;
}

/* ---- Preview area ---- */
body.pixel-converter-page .pc-preview {
  position: absolute;
  inset: 0;
  z-index: 3;
  width: auto;
  height: auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px 18px;
  pointer-events: none;
}
body.pixel-converter-page .pc-preview canvas {
  max-width: none;
  max-height: none;
  object-fit: contain;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 4px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.36);
}

/* ---- Navigation ---- */
body.pixel-converter-page .pc-nav-btn {
  position: absolute;
  z-index: 6;
  top: 50%;
  transform: translateY(-50%);
  min-width: 46px;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  pointer-events: all;
  background: rgba(26, 26, 26, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  color: #fff;
  font-family: "MinecraftAE", "Consolas", monospace;
  font-size: 14px;
  cursor: pointer;
}
body.pixel-converter-page .pc-nav-btn:hover {
  background: rgba(76, 175, 80, 0.88);
  border-color: rgba(125, 223, 130, 0.82);
}
.pc-nav-left {
  left: 18px;
}
.pc-nav-right {
  right: 18px;
}

/* ---- Toast ---- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 90;
  transform: translate(-50%, 16px);
  padding: 12px 16px;
  color: #fff;
  background: rgba(18, 18, 18, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 6px;
  font-family: "MinecraftAE", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}
.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---- Mobile ---- */
@media (max-width: 700px) {
  body.pixel-converter-page .pc-canvas {
    inset: 60px 8px 8px;
  }
  .pixel-back {
    top: 12px;
    left: 12px;
    min-height: 32px;
    padding: 5px 10px;
    font-size: 12px;
  }
  body.pixel-converter-page .pc-canvas.pc-has-upload .pc-shell {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto;
  }
  .pc-panel {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px;
    border-left: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 0 0 7px 7px;
  }
  body.pixel-converter-page .pc-toolbar {
    min-height: auto;
    margin-bottom: 0;
  }
  body.pixel-converter-page .pc-drop-zone {
    min-width: 240px;
    min-height: 200px;
    padding: 30px 20px;
  }
  body.pixel-converter-page .pc-drop-plus {
    font-size: 60px;
  }
  body.pixel-converter-page .pc-drop-text {
    font-size: 20px;
  }
  body.pixel-converter-page .pc-feature-badges {
    flex-wrap: wrap;
    justify-content: center;
  }
  body.pixel-converter-page .pc-feature-badge {
    font-size: 13px;
    padding: 4px 10px;
  }
}
