
/* ========== 消除移动端双击缩放 ========== */
html, body, button, .edit-btn, .reset-layout-btn, .edit-tool-btn, .popup-card {
  touch-action: manipulation;
}
  
/* ========== 编辑按钮（统一样式） ========== */
.edit-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.85);
  color: white;
  border: none;
  border-radius: 14px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.15s ease;
  z-index: 5;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  font-family: inherit;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}
.app-shell.edit-mode .edit-btn,
.edit-mode .edit-btn,
.app-shell.edit-mode ~ .tabbar-edit-btn,
body.edit-mode .tabbar-edit-btn {
  opacity: 1 !important;
  pointer-events: auto !important;
}
.edit-btn:active {
  transform: scale(0.95);
  opacity: 0.8;
}

/* 2. 底部栏编辑按钮：基于屏幕安全区定位，绝对不被网址栏挡，PWA也绝无白条 */
.tabbar-edit-btn {
  position: fixed;
  top: auto;
  bottom: calc(85px + env(safe-area-inset-bottom, 0px));
  right: 24px;
  z-index: 5;
}

/* ========== 拖拽状态 ========== */
.draggable {
  position: relative;
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.edit-mode .draggable {
  cursor: move;
  -webkit-touch-callout: none !important;
  -webkit-user-select: none !important;
  user-select: none !important;
}

.edit-mode .draggable * {
  -webkit-touch-callout: none !important;
  -webkit-user-select: none !important;
  user-select: none !important;
}

.draggable.dragging {
  opacity: 0.92;
  z-index: 5 !important;
  transition: none !important;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.18);
}

/* ========== 编辑模式左上角工具按钮组 ========== */
.edit-toolbar-group {
  position: fixed;
  top: calc(8px + env(safe-area-inset-top, 0px));
  left: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 5;
  pointer-events: none;
}

.reset-layout-btn,
.edit-tool-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.85);
  color: white;
  border: none;
  border-radius: 20px;
  padding: 7px 13px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.15s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  font-family: inherit;
  width: auto;
  max-width: fit-content;
  user-select: none;
  -webkit-user-select: none;
}

.reset-layout-btn svg,
.edit-tool-btn svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.app-shell.edit-mode .reset-layout-btn,
.app-shell.edit-mode .edit-tool-btn {
  opacity: 1 !important;
  pointer-events: auto !important;
}

.reset-layout-btn:active,
.edit-tool-btn:active {
  opacity: 0.7;
  transform: scale(0.95);
}

