body {
  margin: 0;
  padding: 0;
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
  background: linear-gradient(to right, #e0f7fa, #e1f5fe);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 100vh;
  padding-top: 30px;
}

h1 {
  color: #007acc;
  font-size: 2.2rem;
  margin-bottom: 10px;
  text-align: center;
}

#prompt {
  font-size: 1.2rem;
  color: #333;
  margin-bottom: 20px;
}

#canvas-container {
  width: 90vw;
  max-width: 480px;
}

canvas {
  width: 100%;
  height: auto;
  border: 2px solid #007acc;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  background-color: #fff;
  touch-action: none;
}

button {
  margin: 5px;
  padding: 10px 20px;
  background: linear-gradient(to right, #2196f3, #21cbf3);
  border: none;
  border-radius: 6px;
  color: white;
  font-size: 1rem;
  cursor: pointer;
  transition: 0.3s ease;
}

button:hover {
  background: linear-gradient(to right, #1976d2, #00acc1);
  transform: scale(1.05);
}

#result {
  margin-top: 20px;
  font-size: 1.3rem;
  font-weight: bold;
  color: #006064;
  text-align: center;
}

.popup-overlay {
  display: none;    /* 默认一律隐藏 */
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.popup-content {
  background: #ffffff;
  border-radius: 16px;
  padding: 30px 40px;
  text-align: center;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  animation: scaleIn 0.3s ease;
}

.popup-content h2 {
  font-size: 1.8rem;
  color: #2e7d32;
  margin-bottom: 10px;
}

.popup-content p {
  font-size: 1.2rem;
  color: #333;
  margin-bottom: 20px;
}

.popup-content button {
  padding: 10px 20px;
  font-size: 1rem;
  background-color: #4caf50;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

.popup-content button:hover {
  background-color: #388e3c;
}

@keyframes scaleIn {
  from {
    transform: scale(0.9);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

#back-button {
  position: fixed;
  top: 16px;
  right: 16px;
  background: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  padding: 8px 14px;
  font-size: 0.9rem;
  border-radius: 6px;
  cursor: pointer;
  z-index: 1000;
  transition: 0.2s ease;
}

#back-button:hover {
  background: rgba(0, 0, 0, 0.75);
}

/* CNN 动画部分样式 */
#cnn-animation {
  margin-top: 20px;
  max-width: 90vw;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.cnn-step {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 1rem;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.6s ease;
}

.cnn-step.visible {
  opacity: 1;
  transform: translateY(0);
}

.cnn-box {
  width: 90px;
  height: 90px;
  background-color: #e3f2fd;
  border: 2px solid #64b5f6;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: bold;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.cnn-arrow {
  font-size: 2rem;
  color: #1976d2;
}
.loading-dots span {
  font-size: 2rem;
  animation: blink 1.2s infinite;
  margin: 0 3px;
}

.loading-dots span:nth-child(2) {
  animation-delay: 0.2s;
}
.loading-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes blink {
  0%, 100% { opacity: 0.2; }
  50% { opacity: 1; }
}

.vector-bar {
  background-color: #64b5f6;
  height: 20px;
  margin: 4px 0;
  border-radius: 4px;
  color: white;
  padding-left: 6px;
  font-size: 0.85rem;
  transition: width 0.5s ease;
}

/* 弹窗遮罩 */
.popup-overlay {
  position: fixed; top:0; left:0;
  width:100vw; height:100vh;
  background:rgba(0,0,0,0.4);
  display:flex; justify-content:center; align-items:center;
  z-index:1000;
}

/* 弹窗内容 */
.popup-content {
  background:#fff; padding:20px; border-radius:8px;
  text-align:center; max-width:320px;
}

.stage {
  margin-bottom:15px;
}

.stage p {
  margin:8px 0 4px;
  font-size:0.9rem; color:#333;
}

.popup-content button {
  padding:6px 12px; border:none;
  background:#2196f3; color:#fff; border-radius:4px;
  cursor:pointer;
}
/* —— 动画弹窗 —— */
.popup-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: rgba(0,0,0,0.4);
  display: flex; justify-content: center; align-items: center;
  z-index: 1000;
}
.popup-content {
  background: #fff;
  padding: 20px;
  border-radius: 8px;
  text-align: center;
  max-width: 340px;
}
.stage {
  margin-bottom: 16px;
}
.stage p {
  margin: 8px 0 4px;
  font-size: 0.9rem;
  color: #333;
}
.stage img {
  max-width: 224px;
  border: 1px solid #ccc;
}
.popup-content button {
  margin-top: 8px;
  padding: 6px 12px;
  border: none;
  background: #2196f3;
  color: #fff;
  border-radius: 4px;
  cursor: pointer;
}
.slides {
  display: flex;
  width: 300%;
  transition: transform 0.3s ease;
}
.process-slide {
  flex: 0 0 33.3333%;
  box-sizing: border-box;
  padding: 10px;
}

/* 弹窗遮罩层保持原来，只是居中对齐 */
.popup-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

/* 弹窗内容区：更宽、更大的 padding，渐变背景，圆角和阴影 */
.popup-content {
  width: 90%;
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
  background: linear-gradient(135deg, #ffffff, #f3f7fa);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 10px 40px rgba(0,0,0,0.15);
}

/* 标题样式 */
.popup-content h2 {
  font-size: 1.75rem;
  margin-bottom: 1rem;
  color: #2E7D32;
}

/* 每一步的容器 */
.process-step {
  margin-top: 1.5rem;
}

/* 步骤标题 */
.process-step .step-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #155724;
  margin-bottom: 0.5rem;
}

/* 步骤说明 */
.process-step .step-desc {
  font-size: 1rem;
  line-height: 1.6;
  color: #34495e;
  margin-bottom: 0.5rem;
}

/* 关闭按钮 */
.close-btn {
  display: block;
  margin: 2rem auto 0;
  padding: 0.6rem 1.2rem;
  font-size: 1rem;
  border: none;
  border-radius: 6px;
  background: #2E7D32;
  color: white;
  cursor: pointer;
}
.close-btn:hover {
  background: #27692c;
}

/* 宽度改为 5 步：总宽度 500%，每步占 20% */
.slides {
  display: flex;
  width: 500%;
  transition: transform 0.3s ease;
}
.process-slide {
  flex: 0 0 20%;
  box-sizing: border-box;
  padding: 12px;
}
.process-slide h3 {
  font-size: 1.4rem;
  color: #2E7D32;
}
.process-step img {
  max-width: 100%;
  border-radius: 4px;
  margin-bottom: 8px;
}
.slide-caption {
  font-size: 1rem;
  color: #444;
}

.process-slide img,
.process-slide canvas {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;       /* 强制宽高比为 1:1 */
  object-fit: contain;       /* 保持完整显示，可改为 cover 填满容器 */
  margin: 0 auto 8px;
  border-radius: 4px;
}

.arrow-btn:hover {
  background: rgba(0,0,0,0.5);
  transform: translateY(-50%);
}

/* ==============================
   移动端更强制水平居中
   ============================== */

/* 中小屏：宽度 ≤ 768px */
@media screen and (max-width: 768px) {
  #canvas-container {
    /* 保证容器相对于自身宽度居中 */
    position: relative !important;
    left: 50%            !important;
    transform: translateX(-50%) !important;
  }
}

/* 超小屏：宽度 ≤ 480px */
@media screen and (max-width: 480px) {
  #canvas-container {
    position: relative !important;
    left: 50%            !important;
    transform: translateX(-50%) !important;
  }
}

    /* —— 移动端适配 —— */
    @media (max-width: 768px) {
      /* 允许页面滚动，去掉固定全屏 */
      html, body {
        overflow: auto;
        height: auto;
      }
      /* 滑动容器自适应高度 */
      .v-slides-wrapper {
        height: auto !important;
      }
      .v-slides, .v-slide {
        transform: none !important;
        height: auto !important;
        min-height: auto;
        padding: 20px 10px;
      }
      /* 欢迎页内边距和居中 */
      #welcome {
        padding: 40px 20px;
      }
      /* 标题和简介缩小 */
      #welcome .title {
        font-size: 2.4rem !important;
        margin-bottom: 8px;
      }
      #welcome .intro {
        font-size: 1rem !important;
        line-height: 1.5;
        max-width: 100%;
        margin-bottom: 24px;
      }
      /* 按钮铺满并适当收窄 */
      #welcome .start-btn {
        width: 100% !important;
        max-width: 280px;
        font-size: 1rem !important;
        padding: 12px 0;
      }

    }
