/* ============================================================
   CSS閸欐﹢鍣?& 閸忋劌鐪柌宥囩枂
   ============================================================ */
:root {
  --bg-gradient-top: #00B9C1;
  --bg-gradient-bottom: #E8F4F6;
  --bottom-banner-bg: #86D8E8;
  --popup-panel-bg: #F2F4F5;
  --left-nav-bg: #1A1A1A;
  --right-paint-bg: #2C2C30;
  --normal-btn-bg: #222222;
  --delete-btn-bg: #C82828;
  --primary-btn-from: #80D8F0;
  --primary-btn-to: #B0E8F8;
  --warning-color: #FFD020;
  --text-black: #000000;
  --text-white: #FFFFFF;
  --text-gray: #666666;
  --canvas-bg: #FFFFFF;
  --grid-line: #E0E0E0;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* iOS Safari 兼容：所有可交互元素加 cursor:pointer */
button, [onclick], input[type="range"], select {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Microsoft YaHei', 'PingFang SC', 'Hiragino Sans GB', sans-serif;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* ============================================================
   Z-INDEX 1: 閸忋劌鐪懗灞炬珯鐏?+ 濠曞倹璇炵憗鍛淬偘
   ============================================================ */
.bg-layer {
  position: fixed;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, #00B9C1 0%, #C8E8EC 35%, #E8F4F6 70%, #E8F4F6 100%);
}

/* ============================================================
   Z-INDEX 2: 鎼存洟鍎撮柅姘埉濡亜绠?
   ============================================================ */
.bottom-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 2;
  height: 52px;
  background: linear-gradient(180deg, rgba(134,216,232,0.7) 0%, rgba(134,216,232,0.95) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
.banner-text {
  font-size: 16px;
  color: #fff;
  letter-spacing: 2px;
  font-weight: 500;
}
.banner-bunny {
  font-size: 20px;
  animation: bunnyHop 1.2s ease-in-out infinite alternate;
}
.banner-bunny:nth-child(1) { animation-delay: 0s; }
.banner-bunny:nth-child(3) { animation-delay: 0.6s; }

@keyframes bunnyHop {
  0% { transform: translateY(0); }
  100% { transform: translateY(-6px); }
}

/* 閸欏厖绗呯憴鎺戭槵濞?*/
.footnote {
  position: fixed;
  bottom: 58px;
  right: 24px;
  z-index: 2;
  font-size: 11px;
  color: #666;
  pointer-events: none;
}

/* ============================================================
   Z-INDEX 3: 缂傛牞绶崳銊ゅ瘜瀵湱鐛?
   ============================================================ */
.editor-modal {
  position: fixed;
  inset: 12px;
  z-index: 3;
  width: auto;
  height: auto;
  margin: 0;
  background: #F2F4F5;
  border-radius: 8px;
  border: 2px solid #D0D4D8;
  box-shadow: 0 6px 28px rgba(0,0,0,0.2), 0 2px 8px rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ============================================================
   Z-INDEX 4: 瀵湱鐛ユい鍫曞劥鐎佃壈鍩呴幙宥勭稊閺?   ============================================================ */
.top-bar {
  z-index: 4;
  display: flex;
  align-items: center;
  min-height: 58px;
  padding: 10px 16px;
  background: #F2F4F5;
  border-bottom: 1px solid #D8DCE0;
  gap: 12px;
  flex-shrink: 0;
}

.top-leading-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

/* 閸﹀棗鑸伴崶鐐垼閹稿鎸抽柅姘辨暏 */
.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  transition: all 0.18s;
  flex-shrink: 0;
  color: #fff;
}
.icon-btn:hover {
  filter: brightness(1.2);
  transform: scale(1.06);
}
.icon-btn:active {
  transform: scale(0.94);
}

/* 鏉╂柨娲栭幐澶愭尦 */
.btn-github {
  background: #222;
}
.btn-github svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.btn-github:hover {
  color: #72F5F2;
}

/* 鐠€锕€鎲￠幐澶愭尦 */
.btn-announcement {
  background: #222;
  color: #FFD020;
}
.btn-announcement svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.btn-announcement:hover {
  color: #72F5F2;
}

.warn-text {
  font-size: 13px;
  color: #666;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 1;
}

/* 顶部作品身份 */
.work-identity {
  flex: 1;
  min-width: 0;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  line-height: 1.2;
}
.work-identity-title {
  max-width: 100%;
  overflow: hidden;
  color: #595d62;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.work-identity-meta {
  max-width: 100%;
  overflow: hidden;
  color: #8a8e93;
  font-size: 10px;
  letter-spacing: 0.25px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 閸欏厖鏅堕崝鐔诲厴閹稿鎸崇紒?*/
.btn-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  position: relative;
}

.btn-delete { background: #C82828; }
.btn-undo,
.btn-save { background: #222; }

.top-action-icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn-import {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 7px 18px;
  border-radius: 20px;
  border: none;
  background: linear-gradient(135deg, #D8832F 0%, #F0B65A 100%);
  color: #24170A;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(216, 131, 47, 0.34);
  transition: all 0.18s;
}
.btn-import:hover {
  filter: brightness(1.05);
  box-shadow: 0 4px 16px rgba(216, 131, 47, 0.48);
  transform: translateY(-1px);
}
.btn-import:active {
  transform: scale(0.96);
}
.btn-import .import-icon {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* 鐎瑰本鍨氶獮璺哄絺鐢啩瀵岄幐澶愭尦 */
.btn-primary {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 18px;
  border-radius: 20px;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, #80D8F0 0%, #B0E8F8 100%);
  color: #222;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  transition: all 0.18s;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(128,216,240,0.35);
}
.btn-primary:hover {
  box-shadow: 0 4px 16px rgba(128,216,240,0.55);
  transform: translateY(-1px);
}
.btn-primary:active {
  transform: scale(0.96);
}
.btn-primary .check-icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.btn-primary .dropdown-chevron {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ============================================================
   Z-INDEX 5: 娑撳鐖瓼lex鐢啫鐪?
   ============================================================ */
.editor-body {
  z-index: 5;
  display: flex;
  flex: 1;
  min-width: 0;
  min-height: 0;
  max-height: none;
  overflow: hidden;
}

/* --- 瀹革附鐖敍姘嚤閼割亜娅掓０鍕潔闂堛垺婢?20% --- */
.left-panel {
  flex: 0 0 clamp(190px, 17vw, 300px);
  width: clamp(190px, 17vw, 300px);
  min-width: 0;
  min-height: 0;
  background: #1A1A1A;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 12px;
  gap: 10px;
  border-right: 1px solid #333;
  overflow: hidden;
}

.left-controls {
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #66666b transparent;
}

.nav-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 1px;
}
.nav-icon {
  width: 24px;
  height: 24px;
  overflow: visible;
  fill: none;
  stroke: #b8bdc0;
  stroke-width: 1.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.nav-compass-cardinal {
  fill: #b8bdc0;
  stroke: none;
}
.nav-compass-diagonal {
  fill: #73797d;
  stroke: none;
}
.nav-compass-center {
  fill: #1a1a1a;
  stroke: #c9ced1;
  stroke-width: 1.15;
}

/* 导航预览 - 宽度对齐下方控件 */
.nav-preview-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border: 2px solid #555;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
}
.nav-preview-wrap:active {
  cursor: grabbing;
}
.nav-preview-wrap canvas {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}

.nav-viewport-indicator {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  border: 2px solid #72F5F2;
  background: rgba(114, 245, 242, 0.08);
  box-shadow: 0 0 0 1px rgba(14, 35, 38, 0.7), inset 0 0 0 1px rgba(255,255,255,0.45);
  pointer-events: none;
  z-index: 2;
  transition: left 0.05s linear, top 0.05s linear, width 0.05s linear, height 0.05s linear;
}

.left-control-section {
  width: 100%;
  flex: 0 0 auto;
  padding-top: 9px;
  border-top: 1px solid #39393d;
}
.left-control-section[hidden] {
  display: none;
}
.left-control-heading {
  color: #b8b8bc;
  font-size: 12px;
  letter-spacing: 0.8px;
}

.reference-section {
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.reference-heading-row,
.zoom-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}
.reference-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: none;
  background: transparent;
  color: #77777c;
  font-size: 12px;
}
.reference-switch-track {
  position: relative;
  width: 30px;
  height: 16px;
  border-radius: 9px;
  background: #48484d;
  transition: background 0.15s;
}
.reference-switch-thumb {
  position: absolute;
  width: 12px;
  height: 12px;
  left: 2px;
  top: 2px;
  border-radius: 50%;
  background: #bcbcc0;
  transition: transform 0.15s, background 0.15s;
}
.reference-switch.active {
  color: #72F5F2;
}
.reference-switch.active .reference-switch-track {
  background: #238d91;
}
.reference-switch.active .reference-switch-thumb {
  background: #fff;
  transform: translateX(14px);
}
.opacity-control {
  display: grid;
  grid-template-columns: auto 1fr 30px;
  align-items: center;
  gap: 7px;
  color: #929297;
  font-size: 11px;
  transition: opacity 0.15s;
}
.opacity-control[hidden] {
  display: none;
}
.opacity-control.disabled {
  opacity: 0.38;
}
.opacity-control input {
  min-width: 0;
  width: 100%;
  accent-color: #72F5F2;
}

.zoom-section {
  display: flex;
  flex: 1 1 auto;
  min-height: 130px;
  flex-direction: column;
  gap: 8px;
}
.zoom-control-body {
  flex: 1;
  min-height: 0;
  display: flex;
  justify-content: center;
  align-items: center;
}
.zoom-heading-icon {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #b8b8bc;
}
.zoom-heading-icon svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}
.zoom-slider {
  --zoom-progress: 28.5714%;
  -webkit-appearance: none;
  appearance: none;
  width: 30px;
  height: 100%;
  min-height: 92px;
  writing-mode: vertical-lr;
  direction: rtl;
  background: transparent;
  outline: none;
  cursor: pointer;
}
.zoom-slider::-webkit-slider-runnable-track {
  width: 10px;
  border-radius: 999px;
  border: 1px solid #77777d;
  background: linear-gradient(
    to top,
    #72F5F2 0,
    #72F5F2 var(--zoom-progress),
    #4b4b50 var(--zoom-progress),
    #4b4b50 100%
  );
  box-shadow: inset 0 0 3px rgba(0,0,0,0.55);
}
.zoom-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 28px;
  height: 28px;
  margin-left: -10px;
  border-radius: 50%;
  border: 3px solid #d8ffff;
  background: #72F5F2;
  box-shadow: 0 2px 8px rgba(0,0,0,0.45), 0 0 8px rgba(114,245,242,0.45);
}
.zoom-slider::-moz-range-track {
  width: 10px;
  border-radius: 999px;
  border: 1px solid #77777d;
  background: #4b4b50;
}
.zoom-slider::-moz-range-progress {
  width: 10px;
  border-radius: 999px;
  background: #72F5F2;
}
.zoom-slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 3px solid #d8ffff;
  background: #72F5F2;
  box-shadow: 0 2px 8px rgba(0,0,0,0.45);
}
.zoom-reset-btn {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid #55555a;
  border-radius: 7px;
  background: #2C2C30;
  color: #d8d8dc;
  transition: transform 0.15s, background 0.15s;
}
.zoom-reset-icon {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.35;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.zoom-reset-btn:hover {
  background: #38383d;
  color: #72F5F2;
  transform: rotate(-12deg);
}
.zoom-reset-btn:active {
  transform: rotate(-30deg) scale(0.92);
}

/* --- 娑擃厽鐖敍姘辨暰鐢啰绱潏鎴濆隘 60% --- */
/* 宽屏使用纵向缩放；窄屏或矮屏自动切换为横向缩放 */
@media (max-width: 900px), (max-height: 700px) {
  .zoom-section {
    flex: 0 0 auto;
    min-height: 0;
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) 32px;
    align-items: center;
    gap: 8px;
  }
  .zoom-heading-row {
    display: contents;
  }
  .zoom-heading-icon {
    grid-column: 1;
    grid-row: 1;
  }
  .zoom-control-body {
    grid-column: 2;
    grid-row: 1;
    width: 100%;
    height: 30px;
  }
  .zoom-reset-btn {
    grid-column: 3;
    grid-row: 1;
  }
  .zoom-slider {
    width: 100%;
    height: 30px;
    min-width: 0;
    min-height: 0;
    writing-mode: horizontal-tb;
    direction: ltr;
  }
  .zoom-slider::-webkit-slider-runnable-track {
    width: 100%;
    height: 10px;
    background: linear-gradient(
      to right,
      #72F5F2 0,
      #72F5F2 var(--zoom-progress),
      #4b4b50 var(--zoom-progress),
      #4b4b50 100%
    );
  }
  .zoom-slider::-webkit-slider-thumb {
    margin-top: -10px;
    margin-left: 0;
  }
  .zoom-slider::-moz-range-track,
  .zoom-slider::-moz-range-progress {
    width: auto;
    height: 10px;
  }
}

.center-panel {
  flex: 1;
  width: auto;
  min-width: 0;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #E8ECEF;
  position: relative;
  overflow: hidden;
  padding: 18px;
}

.canvas-container {
  position: relative;
  display: grid;
  place-items: center;
  width: min(100%, calc(100dvh - 116px));
  height: auto;
  aspect-ratio: 1;
  flex: 0 0 auto;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  -ms-overflow-style: none;
  background: transparent;
  border: none;
}

.canvas-container::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

/* 缂冩垶鐗搁悽璇茬 */
#pixelCanvas {
  display: block;
  position: relative;
  z-index: 2;
  image-rendering: pixelated;
  cursor: crosshair;
  flex-shrink: 0;
  touch-action: none;
}

/* 閸椾礁鐡х€规矮缍呯痪?*/
/* 缂冩垶鐗哥亸鍝勵嚟閹稿洨銇?*/
/* --- 閸欒櫕鐖敍姘额杹閺傛瑥浼愰崗閿嬬埉 20% --- */
.right-panel {
  flex: 0 0 clamp(280px, 24vw, 420px);
  width: clamp(280px, 24vw, 420px);
  min-width: 0;
  min-height: 0;
  background: #2C2C30;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 0 12px 14px;
  gap: 12px;
  border-left: 1px solid #3A3A3E;
  overflow: hidden;
}

.editorial-area-label {
  margin: 0 -12px;
  padding: 7px 12px 5px;
  background: #202023;
  color: #68686d;
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 9px;
  letter-spacing: 3px;
  text-transform: uppercase;
}

/* 工具栏按钮组 */
.tool-icons {
  display: flex;
  gap: 0;
  width: 100%;
  justify-content: center;
  padding: 4px 0 10px;
  border-bottom: 1px solid #171719;
}
.tool-icon-btn {
  width: 58px;
  height: 48px;
  border-radius: 0;
  border: none;
  border-right: 1px solid #4a4a4e;
  background: transparent;
  color: #ddd;
  cursor: pointer;
  font-size: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.tool-icon-btn:last-child {
  border-right: none;
}
.tool-icon-btn:hover {
  background: #3a3a3e;
  color: #fff;
}
.tool-icon-btn:disabled {
  color: #5b5b60;
  cursor: not-allowed;
  background: transparent;
}
.tool-icon-btn.active {
  background: rgba(114,245,242,0.13);
  color: #72F5F2;
  box-shadow: inset 0 -2px 0 #72F5F2;
}
.eyedropper-icon,
.canvas-guides-icon,
.move-canvas-icon,
.history-icon {
  width: 27px;
  height: 27px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.canvas-guides-icon {
  width: 30px;
  height: 30px;
  stroke-width: 1.7;
}
.move-canvas-icon {
  width: 29px;
  height: 29px;
  stroke-width: 1.65;
}
.history-icon {
  width: 29px;
  height: 29px;
  stroke-width: 1.9;
}

.palette-tabs {
  display: flex;
  margin: 0 -12px;
  background: #202023;
  border-top: 1px solid #424247;
  border-bottom: 1px solid #171719;
}
.palette-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 8px;
  border: none;
  border-right: 1px solid #3d3d42;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #b9b9bd;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.palette-tab:last-child {
  border-right: none;
}
.palette-tab:hover {
  color: #fff;
  background: #2c2c30;
}
.palette-tab.active {
  color: #fff;
  background: #303034;
  border-bottom-color: #72F5F2;
}
.palette-tab-icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.55;
  stroke-linecap: round;
  stroke-linejoin: round;
  color: #8b8b90;
}
.palette-tab.active .palette-tab-icon {
  color: #72F5F2;
}

.palette-panel-view,
.statistics-panel-view {
  flex: 1;
  min-height: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
}
.palette-view-caption {
  margin-bottom: 8px;
  color: #77777c;
  font-size: 9px;
  letter-spacing: 1px;
  text-align: right;
}
.palette-panel-view[hidden],
.statistics-panel-view[hidden] {
  display: none;
}
.palette-color-scroll,
.statistics-color-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
  scrollbar-color: #666 #242427;
  scrollbar-width: thin;
}
.palette-color-scroll:focus-visible,
.statistics-color-scroll:focus-visible {
  outline: 1px solid rgba(114,245,242,0.65);
  outline-offset: 2px;
}
.statistics-summary {
  color: #d2d2d5;
  font-size: 12px;
  text-align: center;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #45454a;
  padding-bottom: 4px;
}
.statistics-hint {
  color: #9a9aa0;
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
  margin-bottom: 10px;
}
.replication-complete-control {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  padding: 8px 9px;
  border: 1px solid #4c4c51;
  border-radius: 4px;
  background: #242427;
  color: #d6d6d9;
  font-size: 12px;
  cursor: pointer;
}
.replication-complete-control[hidden] {
  display: none;
}
.replication-complete-control.disabled {
  color: #77777c;
  cursor: default;
}
.replication-complete-control input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.replication-checkbox-mark {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border: 1px solid #6a6a70;
  border-radius: 3px;
  background: #171719;
  color: #171719;
}
.replication-complete-control input:focus-visible + .replication-checkbox-mark {
  outline: 2px solid #72F5F2;
  outline-offset: 2px;
}
.replication-complete-control input:checked + .replication-checkbox-mark {
  border-color: #72F5F2;
  background: #238d91;
  color: #fff;
}
.replication-complete-control input:checked + .replication-checkbox-mark::after {
  content: '✓';
  font-size: 12px;
  font-weight: 700;
}
.replication-preview-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32px;
  gap: 6px;
  margin: 0 0 10px;
}
.replication-preview-segments {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  padding: 3px;
  border: 1px solid #4c4c51;
  border-radius: 4px;
  background: #242427;
}
.replication-preview-control[hidden] {
  display: none;
}
.replication-preview-segments button {
  min-width: 0;
  padding: 6px 8px;
  border: none;
  border-radius: 3px;
  background: transparent;
  color: #8c8c91;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.replication-preview-segments button:hover {
  color: #e7e7e9;
}
.replication-preview-segments button.active {
  background: #238d91;
  color: #fff;
}
.replication-preview-segments button:focus-visible {
  outline: 2px solid #72F5F2;
  outline-offset: 1px;
}
.replication-reset-btn {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid #4c4c51;
  border-radius: 4px;
  background: #242427;
  color: #8c8c91;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.replication-reset-btn:hover:not(:disabled) {
  border-color: #c85a5a;
  background: #352528;
  color: #f08a8a;
}
.replication-reset-btn:disabled {
  opacity: 0.35;
  cursor: default;
}
.replication-reset-btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.statistics-sort-control {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  color: #8c8c91;
  font-size: 12px;
}
.statistics-sort-control select {
  flex: 1;
  min-width: 0;
  padding: 6px 24px 6px 8px;
  border: 1px solid #4c4c51;
  border-radius: 3px;
  background: #242427;
  color: #d6d6d9;
  font-size: 12px;
  cursor: pointer;
}
.statistics-sort-control select:focus {
  outline: 1px solid #72F5F2;
  outline-offset: 1px;
}
.statistics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
  width: 100%;
  box-sizing: border-box;
}

/* 颜色网格 */
.color-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}

.color-swatch {
  aspect-ratio: 1;
  border: 1px solid rgba(255,255,255,0.35);
  cursor: pointer;
  transition: all 0.12s;
  border-radius: 3px;
  position: relative;
  overflow: hidden;
}

.color-swatch:hover {
  border-color: #fff;
  transform: scale(1.12);
  z-index: 2;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
.color-swatch.active {
  border-color: #72F5F2;
  border-width: 3px;
  box-shadow: 0 0 8px rgba(114,245,242,0.75);
}

.statistics-color {
  aspect-ratio: 1;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 3px;
  cursor: pointer;
  transition: transform 0.12s, border-color 0.12s, box-shadow 0.12s;
}
.statistics-color:hover {
  transform: scale(1.08);
  z-index: 2;
  border-color: #fff;
}
.statistics-color.active {
  border: 3px solid #72F5F2;
  box-shadow: 0 0 8px rgba(114,245,242,0.75);
}
.statistics-color.completed::before {
  content: '✓';
  position: absolute;
  top: 3px;
  right: 3px;
  z-index: 1;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(20,20,23,0.86);
  color: #72F5F2;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  pointer-events: none;
}
.statistics-count {
  position: absolute;
  right: 3px;
  bottom: 3px;
  min-width: 20px;
  padding: 2px 4px;
  border-radius: 9px;
  background: rgba(20,20,23,0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.8);
  pointer-events: none;
  line-height: 1;
}

.canvas-container.statistics-readonly #pixelCanvas {
  cursor: default;
}
.canvas-container.eyedropper-active #pixelCanvas,
.canvas-container.statistics-readonly.eyedropper-active #pixelCanvas {
  cursor: crosshair;
}
.canvas-container.move-canvas-active #pixelCanvas,
.canvas-container.statistics-readonly.move-canvas-active #pixelCanvas {
  cursor: grab;
}
.canvas-container.move-canvas-active.panning #pixelCanvas,
.canvas-container.statistics-readonly.move-canvas-active.panning #pixelCanvas {
  cursor: grabbing;
}

/* ============================================================
   鐟佷礁澹€瀵湱鐛?
   ============================================================ */
.author-overlay {
  position: fixed;
  inset: 0;
  z-index: 750;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(12, 14, 18, 0.72);
  backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s, visibility 0.18s;
}
.author-overlay[hidden] {
  display: none;
}
.author-overlay.show {
  opacity: 1;
  visibility: visible;
}
.author-modal {
  position: relative;
  width: min(410px, calc(100vw - 32px));
  padding: 34px 30px 26px;
  border: 1px solid #4d5158;
  border-radius: 16px;
  background:
    linear-gradient(145deg, rgba(114,245,242,0.08), transparent 38%),
    #242428;
  color: #fff;
  box-shadow: 0 22px 70px rgba(0,0,0,0.52);
  text-align: center;
  transform: translateY(10px) scale(0.98);
  transition: transform 0.18s;
}
.author-overlay.show .author-modal {
  transform: translateY(0) scale(1);
}
.author-close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: 1px solid #4b4b51;
  border-radius: 50%;
  background: #303035;
  color: #a9a9ae;
  font-size: 22px;
  line-height: 1;
}
.author-close-btn:hover {
  border-color: #72F5F2;
  color: #72F5F2;
}
.author-avatar-frame {
  width: 104px;
  height: 104px;
  margin: 0 auto 14px;
  padding: 4px;
  border: 2px solid #72F5F2;
  border-radius: 50%;
  background: #19191c;
  box-shadow: 0 0 24px rgba(114,245,242,0.25);
}
.author-avatar-frame img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}
.author-kicker {
  color: #72F5F2;
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 9px;
  letter-spacing: 2.4px;
}
.author-modal h2 {
  margin-top: 7px;
  font-size: 24px;
  letter-spacing: 0.5px;
}
.author-modal > p {
  margin-top: 4px;
  color: #a5a5aa;
  font-size: 12px;
}
.author-links {
  display: grid;
  gap: 9px;
  margin-top: 22px;
}
.author-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid #45454b;
  border-radius: 8px;
  background: #2c2c30;
  color: #e7e7ea;
  text-align: left;
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}
.author-link:hover {
  border-color: #72F5F2;
  background: #343439;
  transform: translateY(-1px);
}
.author-link span:first-child {
  min-width: 0;
}
.author-link small,
.author-link strong {
  display: block;
}
.author-link small {
  margin-bottom: 3px;
  color: #88888e;
  font-size: 9px;
}
.author-link strong {
  overflow: hidden;
  font-size: 11px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.external-link-icon {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  color: #72F5F2;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.author-project-note {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid #3d3d42;
  color: #77777d;
  font-size: 10px;
}
.announcement-modal {
  width: min(570px, calc(100vw - 32px));
  max-height: min(760px, calc(100vh - 40px));
  overflow-y: auto;
  text-align: left;
  scrollbar-width: thin;
  scrollbar-color: #55565c transparent;
}

.work-share-modal {
  width: min(470px, calc(100vw - 32px));
  text-align: left;
}
.work-share-modal > .author-kicker,
.work-share-modal > h2,
.work-share-modal > p {
  text-align: center;
}
.work-share-icon {
  display: grid;
  width: 64px;
  height: 64px;
  margin: 0 auto 14px;
  place-items: center;
  border: 2px solid #72F5F2;
  border-radius: 50%;
  background: #19191c;
  color: #72F5F2;
  box-shadow: 0 0 24px rgba(114,245,242,0.22);
}
.work-share-icon svg {
  width: 30px;
  height: 30px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.work-share-section {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid #45454b;
  border-radius: 10px;
  background: #2c2c30;
}
.work-share-section h3 {
  color: #f2f2f4;
  font-size: 14px;
}
.work-share-section p {
  margin: 6px 0 13px;
  color: #97979d;
  font-size: 11px;
  line-height: 1.6;
}
.work-share-action {
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid #5c5c63;
  border-radius: 7px;
  background: #37373c;
  color: #f0f0f2;
  font-weight: 700;
}
.work-share-action.primary {
  width: 100%;
  border-color: #72F5F2;
  background: #3a7778;
}
.work-share-action:disabled {
  cursor: wait;
  opacity: 0.55;
}
.work-metadata-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 13px;
}
.work-metadata-grid label {
  display: grid;
  gap: 6px;
  color: #c7c7cb;
  font-size: 11px;
}
.work-metadata-grid input {
  min-width: 0;
  height: 38px;
  padding: 0 11px;
  border: 1px solid #55555d;
  border-radius: 7px;
  outline: none;
  background: #1e1e22;
  color: #ededf0;
}
.work-metadata-grid input:focus {
  border-color: #72F5F2;
  box-shadow: 0 0 0 2px rgba(114,245,242,0.12);
}
.published-work-result {
  display: grid;
  justify-items: center;
  margin-top: 13px;
}
.published-work-result[hidden] {
  display: none;
}
.published-work-result button {
  padding: 5px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #72F5F2;
  font: bold 25px/1.2 'Consolas', monospace;
  letter-spacing: 2px;
  text-align: center;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
}
.published-work-result button:hover,
.published-work-result button:focus-visible {
  outline: none;
  background: rgba(114,245,242,0.1);
  color: #a5fffd;
}
.published-work-result button:active {
  transform: translateY(1px);
}
.published-work-hint {
  margin-top: 2px;
  color: #818188;
  font-size: 10px;
}
.work-code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}
.work-code-row input {
  min-width: 0;
  height: 38px;
  padding: 0 11px;
  border: 1px solid #55555d;
  border-radius: 7px;
  outline: none;
  background: #1e1e22;
  color: #ededf0;
  font-family: 'Consolas', monospace;
}
.work-code-row input {
  font-size: 16px;
  letter-spacing: 1.5px;
}
.work-code-row input:focus {
  border-color: #72F5F2;
}
@media (max-width: 560px) {
  .work-metadata-grid {
    grid-template-columns: 1fr;
  }
}
.work-share-status {
  min-height: 18px;
  margin-top: 14px;
  font-size: 11px;
  line-height: 1.5;
  text-align: center;
}
.work-share-status[data-state="success"] {
  color: #72F5A7;
}
.work-share-status[data-state="error"] {
  color: #FF8C8C;
}
.work-share-status[data-state="loading"] {
  color: #72F5F2;
}
.announcement-modal > .author-kicker,
.announcement-modal > h2,
.announcement-modal > p {
  text-align: center;
}
.announcement-icon-frame {
  display: grid;
  width: 72px;
  height: 72px;
  margin: 0 auto 14px;
  place-items: center;
  border: 2px solid #72F5F2;
  border-radius: 50%;
  background: #19191c;
  color: #72F5F2;
  box-shadow: 0 0 24px rgba(114,245,242,0.22);
}
.announcement-icon-frame svg {
  width: 34px;
  height: 34px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.announcement-content {
  display: grid;
  gap: 12px;
  margin-top: 22px;
}
.announcement-section {
  padding: 16px 17px;
  border: 1px solid #45454b;
  border-radius: 10px;
  background: #2c2c30;
}
.announcement-section-heading {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 10px;
}
.announcement-section-number {
  color: #72F5F2;
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 10px;
  letter-spacing: 1px;
}
.announcement-section h3 {
  margin: 0;
  color: #f1f1f3;
  font-size: 14px;
}
.announcement-section p {
  color: #b2b2b7;
  font-size: 11px;
  line-height: 1.8;
}
.announcement-section .announcement-note {
  margin-top: 9px;
  padding: 8px 10px;
  border-left: 2px solid #FFD020;
  background: rgba(255,208,32,0.06);
  color: #929298;
  font-size: 10px;
}
.announcement-steps {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: #a9a9ae;
  font-size: 11px;
  line-height: 1.55;
}
.announcement-steps li {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 9px;
  align-items: start;
}
.announcement-steps li > span {
  padding: 2px 5px;
  border-radius: 4px;
  background: rgba(114,245,242,0.1);
  color: #72F5F2;
  text-align: center;
  font-size: 10px;
}

.crop-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,0.75);
  display: none;
  align-items: center;
  justify-content: center;
}
.crop-overlay.show {
  display: flex;
}
.crop-modal {
  background: #F2F4F5;
  border-radius: 14px;
  padding: 20px;
  width: 520px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.4);
}
.crop-title {
  font-size: 15px;
  font-weight: 700;
  color: #222;
  text-align: center;
  letter-spacing: 1px;
}
.crop-viewport {
  width: 400px;
  height: 400px;
  margin: 0 auto;
  border: 2px dashed #888;
  overflow: hidden;
  position: relative;
  background: repeating-conic-gradient(#E8E8E8 0% 25%, #fff 0% 50%) 50% / 16px 16px;
  cursor: grab;
  touch-action: none;
}
.crop-viewport:active {
  cursor: grabbing;
}
.crop-viewport img {
  position: absolute;
  pointer-events: none;
  image-rendering: auto;
}
.crop-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.crop-zoom-label {
  font-size: 11px;
  color: #666;
}
.crop-zoom-slider {
  width: 140px;
}
.crop-size-value {
  padding: 3px 8px;
  border: 1px solid #999;
  border-radius: 10px;
  background: #3A6BC5;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  border-color: #3A6BC5;
}
.crop-btns {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.crop-btn {
  padding: 8px 24px;
  border-radius: 18px;
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  transition: all 0.15s;
}
.crop-btn-cancel {
  background: #ddd;
  color: #555;
}
.crop-btn-confirm {
  background: linear-gradient(135deg, #80D8F0, #B0E8F8);
  color: #222;
}
.crop-btn:hover {
  transform: scale(1.04);
}
.crop-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}
.conversion-note {
  min-height: 16px;
  color: #666;
  font-size: 10px;
  line-height: 1.5;
  text-align: center;
}
.conversion-status {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 34px;
  padding: 7px 10px;
  border-radius: 7px;
  background: #E8F3F5;
  color: #35545A;
  font-size: 11px;
  flex-wrap: wrap;
}
.conversion-status.show {
  display: flex;
}
.conversion-status.error {
  background: #FBE7E7;
  color: #A52C2C;
}
.conversion-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(53,84,90,0.25);
  border-top-color: #3A6BC5;
  border-radius: 50%;
  animation: conversionSpin 0.75s linear infinite;
}
.conversion-status.error .conversion-spinner {
  display: none;
}
@keyframes conversionSpin {
  to { transform: rotate(360deg); }
}
.color-usage-summary {
  margin-top: 7px;
  color: #aaa;
  font-size: 10px;
  line-height: 1.45;
  text-align: center;
}
.conversion-result-summary {
  margin-top: 12px;
  padding: 10px 4px 4px;
  border-top: 1px solid #3f3f44;
  color: #777;
  font-size: 10px;
  line-height: 1.4;
  text-align: center;
}
.conversion-retry-btn {
  display: none;
  padding: 3px 9px;
  border: 1px solid #B55A5A;
  border-radius: 10px;
  background: #fff;
  color: #9B3030;
  font-size: 10px;
  cursor: pointer;
}

/* ============================================================
   閹绘劗銇氬☉鍫熶紖
   ============================================================ */
.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  background: #222;
  color: #fff;
  padding: 10px 24px;
  border-radius: 20px;
  font-size: 13px;
  letter-spacing: 0.5px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
}
.toast.show {
  opacity: 1;
}

/* 导出下拉列表 */
.export-dropdown {
  position: fixed;
  z-index: 600;
  width: min(220px, calc(100vw - 16px));
  max-height: calc(100vh - 16px);
  max-height: calc(100dvh - 16px);
  background: linear-gradient(135deg, #80D8F0 0%, #B0E8F8 100%);
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(128,216,240,0.35);
  display: none;
  overflow-x: hidden;
  overflow-y: auto;
}
.export-dropdown.show {
  display: block;
}
.export-item {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  column-gap: 10px;
  width: 100%;
  padding: 12px 16px;
  background: transparent;
  border: none;
  color: #222;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  letter-spacing: 0.5px;
  transition: background 0.12s;
}
.export-item:hover {
  background: rgba(255,255,255,0.35);
}
.export-item-icon {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
}
.export-item-icon svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.export-item-label {
  display: block;
  min-width: 0;
  line-height: 24px;
}
.export-divider {
  height: 2px;
  background: rgba(0,0,0,0.15);
  margin: 0;
}
.export-warning {
  padding: 12px 16px;
  color: #C82828;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.6;
  text-align: center;
}

/* ============================================================
   閸濆秴绨插?   ============================================================ */
/* ============================================================
   移动端 / 平板响应式布局
   ============================================================ */
@media (max-width: 1180px) {
  .top-bar {
    gap: 8px;
  }
  .top-leading-actions {
    gap: 8px;
  }
  .top-bar .warn-text {
    display: none;
  }
  .top-bar .btn-import,
  .top-bar .btn-primary {
    padding-left: 13px;
    padding-right: 13px;
  }
}

@media (max-width: 900px) {
  /* 锁定页面：禁止滚动、禁止缩放 */
  html, body {
    overflow: hidden;
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
  }

  /* 隐藏装饰元素 */
  .bottom-banner, .footnote { display: none !important; }

  /* 横屏移动端同样使用完整可视区域 */
  .editor-modal {
    position: fixed;
    inset: 0;
    width: auto;
    height: auto;
    top: 0;
    left: 0;
    transform: none;
    margin: 0;
    border-radius: 0;
    border: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  /* 移除高度限制，保留flex三栏 */
  .editor-body {
    min-height: 0; max-height: none;
  }

  /* 横屏三栏保持紧凑比例 */
  .left-panel {
    flex: 0 0 19%;
    width: 19%;
    min-width: 0;
    padding: 8px 6px;
    gap: 8px;
    overflow: hidden;
  }
  .left-control-heading {
    font-size: 10px;
    white-space: nowrap;
  }
  .reference-switch {
    gap: 4px;
    font-size: 10px;
  }
  .opacity-control {
    font-size: 10px;
  }
  .right-panel {
    flex: 0 0 27%;
    width: 27%;
    min-width: 0;
    padding-left: 6px;
    padding-right: 6px;
    gap: 6px;
  }
  .center-panel {
    min-width: 0;
    padding: 8px;
  }
  .canvas-container {
    width: min(100%, calc(100dvh - 118px));
  }

  /* 顶栏拆为身份行与操作行，避免按钮无序挤压 */
  .top-bar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
      "leading identity"
      "actions actions";
    min-height: 0;
    padding: 6px 8px;
    gap: 5px 8px;
  }
  .top-leading-actions {
    grid-area: leading;
    gap: 6px;
  }
  .top-bar .work-identity {
    grid-area: identity;
    align-items: flex-start;
    text-align: left;
  }
  .top-bar .btn-group {
    grid-area: actions;
    width: 100%;
    justify-content: flex-end;
    margin-left: 0;
  }
  .top-bar .warn-text {
    display: none;
  }
  .top-bar .btn-import,
  .top-bar .btn-primary {
    padding-left: 12px;
    padding-right: 12px;
  }

  /* 导入弹窗适配 */
  .crop-modal {
    width: 96vw;
    max-height: 96vh;
    max-height: 96dvh;
    padding: 12px;
    gap: 8px;
    overflow-y: auto;
  }
  .crop-title { font-size: 13px; }
  .crop-viewport {
    width: min(320px, 42dvh);
    height: min(320px, 42dvh);
    flex: 0 0 auto;
    aspect-ratio: 1;
    margin: 0 auto;
  }
  .crop-controls {
    flex-wrap: wrap;
    gap: 6px;
  }
  .crop-zoom-slider { width: 100px; }
  .crop-btn { padding: 6px 16px; font-size: 12px; }
}

@media (max-width: 680px) {
  .top-bar .icon-btn {
    width: 34px;
    height: 34px;
  }
  .top-bar .btn-group {
    gap: 5px;
  }
  .top-bar .btn-import {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 50%;
  }
  .top-bar .btn-import span {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
  .top-bar .btn-primary {
    padding-left: 10px;
    padding-right: 10px;
  }
  .work-identity-title {
    font-size: 12px;
  }
  .work-identity-meta {
    font-size: 9px;
  }
}

/* 移动端竖屏提示（JS动态控制显示） */
.rotate-hint {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(0,0,0,0.92);
  color: #fff;
  gap: 16px;
  text-align: center;
  font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.rotate-hint.show {
  display: flex;
}
.rotate-icon {
  width: 64px;
  height: 64px;
  animation: rotateHintBounce 1.5s ease-in-out infinite;
}
.rotate-icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.rotate-text {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 2px;
}
.rotate-sub {
  font-size: 14px;
  color: #aaa;
  letter-spacing: 1px;
}
@keyframes rotateHintBounce {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-15deg); }
  75% { transform: rotate(15deg); }
}
