/* 咖啡拉花 · 样式（.g-latteart 前缀） */

.g-latteart {
  gap: 8px;
  padding-bottom: calc(12px + var(--safe-b));
}

/* ---------------- 顶部 ---------------- */

.g-latteart .la-head { min-height: 40px; align-items: center; gap: 8px; }
.g-latteart .la-head-left { display: flex; align-items: center; min-width: 0; }

.g-latteart .la-gallery-btn {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(220, 190, 150, 0.28);
  background: rgba(255, 236, 210, 0.06);
  color: #e7d6c0;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  touch-action: manipulation;
}

.g-latteart .la-hbtn {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 11px;
  font-size: 12px;
}

/* ---------------- 杯面 ---------------- */

.g-latteart .la-stage {
  position: relative;
  flex: 1;
  min-height: 360px;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(220, 190, 150, 0.22);
  background:
    radial-gradient(70% 55% at 30% 18%, rgba(255, 226, 190, 0.1), transparent 60%),
    linear-gradient(100deg, #5a3d28 0%, #6b4a30 30%, #5e4129 55%, #4a3020 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 24px 60px -30px rgba(0, 0, 0, 0.95);
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

.g-latteart .la-canvas-host { position: absolute; inset: 0; }

.g-latteart .la-canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100% !important;
  height: 100% !important;
  z-index: 1;
}

.g-latteart .la-rim-gloss {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: radial-gradient(46% 34% at 50% 122%, rgba(0, 0, 0, 0.32), transparent 70%);
}

.g-latteart .la-hint {
  min-height: 17px;
  text-align: center;
  font-size: 11.5px;
  letter-spacing: 0.02em;
  color: var(--dim);
}

/* ---------------- 模板 chips ---------------- */

.g-latteart .la-chips {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 2px 1px;
  scrollbar-width: none;
}

.g-latteart .la-chips::-webkit-scrollbar { display: none; }

.g-latteart .la-chip {
  flex: none;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--dim);
  font-size: 12px;
  font-weight: 600;
  touch-action: manipulation;
  transition: color 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.g-latteart .la-chip.active {
  color: #2a5da8;
  border-color: rgba(121, 184, 255, 0.6);
  background: #dcecff;
}

.g-latteart .la-chip.done { color: #8fe2a1; }
.g-latteart .la-chip.done.active { color: #1f6b4a; }
.g-latteart .la-chip.done::after { content: ' ✓'; font-weight: 800; }

/* ---------------- 工具 ---------------- */

.g-latteart .la-tools {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 7px;
}

.g-latteart .la-tool {
  min-height: 44px;
  padding: 0 4px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 236, 210, 0.05);
  color: var(--dim);
  font-size: 12px;
  font-weight: 600;
  touch-action: manipulation;
  transition: color 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.g-latteart .la-tool.on {
  color: #ffe9c9;
  border-color: rgba(255, 214, 160, 0.55);
  background: linear-gradient(180deg, rgba(160, 110, 70, 0.55), rgba(120, 78, 46, 0.55));
  box-shadow: 0 0 16px rgba(255, 200, 140, 0.15);
}

.g-latteart .la-tool:active { transform: scale(0.97); }

/* ---------------- 画廊 ---------------- */

.g-latteart .la-mask {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  align-items: flex-end;
  justify-content: center;
  background: rgba(6, 4, 2, 0.55);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

.g-latteart .la-mask.show { display: flex; animation: fadeIn 0.18s ease both; }

.g-latteart .la-sheet {
  width: 100%;
  max-width: 430px;
  padding: 16px 16px calc(16px + var(--safe-b));
  border-radius: 20px 20px 0 0;
  border: 1px solid var(--line-2);
  border-bottom: 0;
  background: linear-gradient(180deg, #241a12, #191108);
  box-shadow: 0 -22px 60px -18px rgba(0, 0, 0, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  animation: laSheetIn 0.22s cubic-bezier(0.2, 0.9, 0.3, 1) both;
}

@keyframes laSheetIn {
  from { transform: translateY(26px); opacity: 0.6; }
  to { transform: none; opacity: 1; }
}

.g-latteart .la-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 12px;
  color: #f3e4d1;
}

.g-latteart .la-x {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  color: #d8c4a8;
  font-size: 19px;
  line-height: 1;
  touch-action: manipulation;
}

.g-latteart .la-gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.g-latteart .la-gallery-item {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 240, 220, 0.12);
  background: rgba(255, 255, 255, 0.04);
  touch-action: manipulation;
}

.g-latteart .la-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.g-latteart .la-gallery-label {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 3px 5px;
  font-size: 9.5px;
  line-height: 1.3;
  color: #fff;
  text-align: left;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.66));
}

.g-latteart .la-gallery-empty {
  padding: 26px 8px;
  text-align: center;
  color: rgba(216, 196, 168, 0.6);
  font-size: 12px;
  line-height: 1.6;
}

.g-latteart .la-gallery-empty.hidden { display: none; }
.g-latteart .la-sheet-tip { margin-top: 12px; text-align: center; color: rgba(216, 196, 168, 0.55); }

.g-latteart .la-img-wrap {
  max-height: 52vh;
  overflow: auto;
  border-radius: 12px;
  background: #0b0f18;
}

.g-latteart .la-img {
  display: block;
  width: 100%;
  border-radius: 12px;
}

/* ---------------- 窄屏 ---------------- */

@media (max-height: 700px) {
  .g-latteart .la-stage { min-height: 340px; }
  .g-latteart .la-chip { min-height: 34px; font-size: 11.5px; }
  .g-latteart .la-tool { min-height: 40px; font-size: 11.5px; }
}

@media (max-width: 359px) {
  .g-latteart .la-hbtn,
  .g-latteart .la-gallery-btn { padding: 0 11px; font-size: 11.5px; }
  .g-latteart .la-tool { font-size: 11px; }
}
