/* 基础重置与平板触控体验防抖 */
* {
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  touch-action: manipulation;
}
input, textarea {
  user-select: auto;
}
body {
  background-color: #F8F5EE;
  background-image: radial-gradient(#E8E2D2 1px, transparent 1px);
  background-size: 24px 24px;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  overscroll-behavior: none;
}

/* Q萌 3D 糖果立体拟态按钮 */
.bubbly-btn {
  transition: all 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}
.bubbly-btn:active {
  transform: translateY(4px);
}
.bubbly-yellow {
  background: linear-gradient(180deg, #FFE082 0%, #FFCA28 100%);
  box-shadow: 0 5px 0 #DDA600, 0 8px 12px rgba(221, 166, 0, 0.25);
}
.bubbly-yellow:active {
  box-shadow: 0 1px 0 #DDA600, 0 3px 6px rgba(221, 166, 0, 0.2);
}

.bubbly-purple {
  background: linear-gradient(180deg, #A064FF 0%, #8338EC 100%);
  box-shadow: 0 5px 0 #5E17B5, 0 8px 12px rgba(131, 56, 236, 0.3);
}
.bubbly-purple:active {
  box-shadow: 0 1px 0 #5E17B5, 0 3px 6px rgba(131, 56, 236, 0.2);
}

.bubbly-coral {
  background: linear-gradient(180deg, #FF8A8A 0%, #FF6B6B 100%);
  box-shadow: 0 5px 0 #D84242, 0 8px 12px rgba(255, 107, 107, 0.3);
}
.bubbly-coral:active {
  box-shadow: 0 1px 0 #D84242, 0 3px 6px rgba(255, 107, 107, 0.2);
}

.bubbly-mint {
  background: linear-gradient(180deg, #4EE5BA 0%, #06D6A0 100%);
  box-shadow: 0 5px 0 #039E76, 0 8px 12px rgba(6, 214, 160, 0.3);
}
.bubbly-mint:active {
  box-shadow: 0 1px 0 #039E76, 0 3px 6px rgba(6, 214, 160, 0.2);
}

.bubbly-card {
  background: #FFFFFF;
  box-shadow: 0 6px 0 #E2DDD0, 0 10px 20px rgba(0, 0, 0, 0.04);
  border: 3px solid #EFEAE0;
}

/* 输入框流动舱：纯净米白纸张底色 */
.prompt-flow-card {
  background-color: #FFFDF7;
}

/* 富文本提示词输入框与行内标签混排 */
.rich-prompt-editor {
  min-height: 38px;
  outline: none;
  word-break: break-word;
  white-space: pre-wrap;
  user-select: text;
  -webkit-user-select: text;
  cursor: text;
}

.rich-prompt-editor:empty::before,
.rich-prompt-editor[data-empty="true"]::before {
  content: attr(data-placeholder);
  color: #9CA3AF;
  font-weight: 500;
  pointer-events: none;
  display: inline-block;
}

.magic-tag-chip {
  display: inline-flex;
  align-items: center;
  vertical-align: baseline;
  user-select: none;
  -webkit-user-select: none;
  line-height: 1.3;
}


/* 工具栏 4 大独立 3D 拟态卡片按钮 (未按下：凸起立体白底 / 按下：下沉实色激活) */
.tool-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-weight: 900;
  font-size: 12px;
  border-radius: 14px;
  border: 2px solid #EFEAE0;
  background: #FFFFFF;
  color: #5C5346;
  box-shadow: 0 3px 0 #E2DDD0, 0 4px 6px rgba(0, 0, 0, 0.03);
  transition: all 0.12s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
  user-select: none;
  padding: 6px 10px;
}
.tool-btn:hover:not(.active) {
  border-color: #FFD166;
  transform: translateY(-1px);
  box-shadow: 0 4px 0 #E2DDD0, 0 6px 8px rgba(0, 0, 0, 0.05);
}
.tool-btn:active {
  transform: translateY(3px) !important;
  box-shadow: 0 0 0 transparent !important;
}

/* 按下激活态 (下沉并注入统一的活力暖橙黄) */
.tool-btn.active,
.tool-btn-pan.active,
.tool-btn-lasso.active,
.tool-btn-rect.active,
.tool-btn-eraser.active {
  transform: translateY(2px);
  background: #FFD166 !important;
  color: #3A3335 !important;
  border-color: #DEAC33 !important;
  box-shadow: 0 1px 0 #B08216, inset 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}

/* 水平滚动条美化 */
.scroll-smooth-x {
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.scroll-smooth-x::-webkit-scrollbar {
  display: none;
}

/* 抽屉滚动条精致化 */
.drawer-scroll {
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.18) transparent;
}
.drawer-scroll::-webkit-scrollbar {
  width: 5px;
}
.drawer-scroll::-webkit-scrollbar-track {
  background: transparent;
}
.drawer-scroll::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.18);
  border-radius: 9999px;
}
.drawer-scroll::-webkit-scrollbar-thumb:hover {
  background-color: rgba(0, 0, 0, 0.32);
}

/* 魔法旋转发光 */
/* 温暖星光呼吸发光 */
@keyframes magic-warm-pulse {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 16px rgba(255, 209, 102, 0.55)); }
  50% { transform: scale(1.04); filter: drop-shadow(0 0 28px rgba(255, 183, 3, 0.75)); }
}
.magic-warm-glow {
  animation: magic-warm-pulse 2.2s infinite ease-in-out;
}

/* 魔法棒施法手势：左右自然、柔和轻盈地挥动 */
@keyframes wand-wave-smooth {
  0%, 100% {
    transform: rotate(0deg) scale(1);
  }
  25% {
    transform: rotate(-22deg) translateY(-3px) scale(1.06);
  }
  50% {
    transform: rotate(12deg) translateY(2px) scale(0.98);
  }
  75% {
    transform: rotate(-15deg) translateY(-2px) scale(1.04);
  }
}
.animate-wand-wave {
  display: inline-block;
  transform-origin: 75% 85%; /* 魔法棒手柄握持点 */
  animation: wand-wave-smooth 1.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

/* 暖金流光光环：自然匀速旋转 */
@keyframes golden-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.golden-aura-ring {
  border: 3px solid transparent;
  border-top-color: #FFD166;
  border-right-color: #FFE5A3;
  border-bottom-color: rgba(255, 209, 102, 0.25);
  border-left-color: rgba(255, 229, 163, 0.7);
  box-shadow: 0 0 20px rgba(255, 209, 102, 0.35);
  animation: golden-spin 2.4s linear infinite;
}

/* 暖心外层星光微光慢速扩散环 */
@keyframes aura-breathe {
  0%, 100% { transform: scale(1); opacity: 0.45; }
  50% { transform: scale(1.08); opacity: 0.8; }
}
.golden-aura-outer {
  animation: aura-breathe 2.6s ease-in-out infinite;
}

/* 伴生金星闪烁 */
@keyframes star-twinkle {
  0%, 100% { transform: scale(0.85); opacity: 0.4; }
  50% { transform: scale(1.2); opacity: 1; }
}
.star-twinkle {
  animation: star-twinkle 1.6s ease-in-out infinite;
}

@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.spin-slow {
  animation: spin-slow 12s linear infinite;
}

/* 打印专用样式 */
@media print {
  @page {
    margin: 0;
    size: auto;
  }

  html, body {
    background: #FFFFFF !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    height: 100% !important;
    overflow: visible !important;
  }

  #app {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    height: 100% !important;
  }

  /* 彻底隐藏除打印页面外的所有主界面、导航与弹窗，杜绝多余顶部内容泄漏 */
  #app > *:not(.print-page) {
    display: none !important;
  }

  body > *:not(#app) {
    display: none !important;
  }

  .no-print {
    display: none !important;
  }

  .print-page {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 100vw;
    height: 100vh;
    max-width: 100%;
    max-height: 100%;
    margin: 0 !important;
    padding: 10mm;
    box-sizing: border-box;
    page-break-inside: avoid;
    break-inside: avoid;
    overflow: hidden;
  }

  .print-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    box-shadow: none !important;
  }

  .print-bw {
    filter: grayscale(100%) contrast(160%) !important;
  }
}

/* 移动端专属优化与安全区域适配 */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .mobile-safe-bottom {
    padding-bottom: calc(0.5rem + env(safe-area-inset-bottom));
  }
}
/* 移动端滚动条隐藏优化 */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}
