/* ============================================
   components.css
   果赖蛋糕坊 - 组件样式
   按钮 · 卡片 · 色块 · 滑块 · 装饰 · 模态框 · 提示
   ============================================ */

/* ============================================
   按钮 .btn 系列
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  min-height: var(--btn-h);
  padding: 0 var(--space-lg);
  font-family: var(--font-rounded);
  font-size: var(--fs);
  font-weight: var(--fw-bold);
  line-height: 1;
  color: var(--white);
  background: linear-gradient(135deg, var(--pink) 0%, var(--pink-dark) 100%);
  border: none;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow);
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  transition: transform var(--t-fast) var(--ease-bounce),
    box-shadow var(--t), opacity var(--t);
  -webkit-tap-highlight-color: transparent;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.3) 0%,
    rgba(255, 255, 255, 0) 60%
  );
  pointer-events: none;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn:active {
  transform: scale(0.94);
  box-shadow: var(--shadow-press);
}

.btn:disabled {
  opacity: 0.5;
  cursor: default;
  transform: none;
}

.btn-sm {
  min-height: var(--btn-h-sm);
  min-width: var(--btn-h-sm);
  padding: 0 var(--space);
  font-size: var(--fs-sm);
  border-radius: var(--radius);
}

.btn-lg {
  min-height: var(--btn-h-lg);
  padding: 0 var(--space-xl);
  font-size: var(--fs-md);
}

.btn-primary {
  background: linear-gradient(135deg, var(--pink) 0%, var(--pink-dark) 100%);
  color: var(--white);
  box-shadow: 0 4px 14px rgba(255, 143, 168, 0.4);
}

.btn-primary:hover {
  box-shadow: 0 6px 20px rgba(255, 143, 168, 0.5);
}

.btn-secondary {
  background: linear-gradient(135deg, var(--purple-light) 0%, var(--purple) 100%);
  color: var(--purple-dark);
  box-shadow: 0 4px 14px rgba(183, 148, 212, 0.3);
}

.btn-secondary:hover {
  box-shadow: 0 6px 20px rgba(183, 148, 212, 0.4);
}

.btn-yellow {
  background: linear-gradient(135deg, var(--yellow) 0%, var(--yellow-dark) 100%);
  color: var(--text);
  box-shadow: 0 4px 14px rgba(255, 217, 102, 0.4);
}

.btn-yellow:hover {
  box-shadow: 0 6px 20px rgba(255, 217, 102, 0.5);
}

.btn-voice {
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-dark) 100%);
  color: var(--white);
  box-shadow: 0 4px 14px rgba(123, 167, 217, 0.4);
  position: relative;
}

.btn-voice.recording {
  animation: pulse 1.2s var(--ease-smooth) infinite;
  background: linear-gradient(135deg, var(--strawberry) 0%, var(--pink-dark) 100%);
}

.btn-round {
  min-width: var(--btn-h);
  min-height: var(--btn-h);
  width: var(--btn-h);
  height: var(--btn-h);
  padding: 0;
  border-radius: 50%;
  font-size: var(--fs-lg);
  background: rgba(255, 255, 255, 0.8);
  color: var(--purple-dark);
  box-shadow: var(--shadow);
  border: 2px solid var(--purple-light);
}

.btn-round:hover {
  background: var(--white);
  border-color: var(--purple);
}

.btn-round:active {
  transform: scale(0.88);
}

.btn-block {
  display: flex;
  width: 100%;
}

/* ============================================
   卡片面板 .panel
   ============================================ */
.panel {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--t);
}

.panel:hover {
  box-shadow: var(--shadow);
}

.panel-title {
  font-family: var(--font-display);
  font-size: var(--fs);
  font-weight: var(--fw-bold);
  color: var(--purple-dark);
  margin-bottom: var(--space);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  line-height: 1.4;
}

/* ============================================
   色块选择器 .color-grid + .color-swatch
   ============================================ */
.color-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(36px, 1fr));
  gap: var(--space-sm);
  margin-bottom: var(--space);
}

.color-swatch {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 3px solid var(--white);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform var(--t-fast) var(--ease-bounce),
    box-shadow var(--t);
  position: relative;
  -webkit-tap-highlight-color: transparent;
}

.color-swatch:hover {
  transform: scale(1.15) translateY(-2px);
  box-shadow: var(--shadow-md);
}

.color-swatch:active {
  transform: scale(0.9);
}

.color-swatch.active {
  transform: scale(1.2);
  box-shadow: 0 0 0 3px var(--purple-dark), var(--shadow-md);
}

.color-swatch.active::after {
  content: "✓";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: var(--fs-sm);
  font-weight: var(--fw-black);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* color input 样式 */
.color-grid input[type="color"],
input[type="color"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 36px;
  border: 2px solid var(--purple-light);
  border-radius: var(--radius);
  background: transparent;
  cursor: pointer;
  padding: 0;
  overflow: hidden;
}

input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
  border-radius: var(--radius-sm);
}

input[type="color"]::-webkit-color-swatch {
  border: none;
  border-radius: var(--radius-sm);
}

input[type="color"]::-moz-color-swatch {
  border: none;
  border-radius: var(--radius-sm);
}

.color-grid input[type="color"] {
  grid-column: 1 / -1;
  border-radius: var(--radius);
}

/* ============================================
   滑块行 .slider-row
   ============================================ */
.slider-row {
  display: flex;
  align-items: center;
  gap: var(--space);
  padding: var(--space-sm) 0;
  flex-wrap: wrap;
}

.slider-row label {
  flex-shrink: 0;
  min-width: 48px;
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--text);
}

.slider-row input[type="range"] {
  flex: 1 1 auto;
  min-width: 100px;
  -webkit-appearance: none;
  appearance: none;
  height: 8px;
  border-radius: var(--radius-full);
  background: linear-gradient(
    90deg,
    var(--pink-light) 0%,
    var(--purple-light) 100%
  );
  outline: none;
  cursor: pointer;
}

.slider-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--pink) 0%, var(--pink-dark) 100%);
  border: 3px solid var(--white);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform var(--t-fast) var(--ease-bounce);
}

.slider-row input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.slider-row input[type="range"]::-webkit-slider-thumb:active {
  transform: scale(1.3);
}

.slider-row input[type="range"]::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--pink) 0%, var(--pink-dark) 100%);
  border: 3px solid var(--white);
  box-shadow: var(--shadow);
  cursor: pointer;
}

.slider-row input[type="range"]::-moz-range-track {
  height: 8px;
  border-radius: var(--radius-full);
  background: linear-gradient(
    90deg,
    var(--pink-light) 0%,
    var(--purple-light) 100%
  );
}

.slider-row .val {
  flex-shrink: 0;
  min-width: 32px;
  text-align: center;
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
  color: var(--pink-dark);
  background: var(--pink-light);
  padding: 2px var(--space-sm);
  border-radius: var(--radius-full);
}

.slider-row input[type="checkbox"] {
  width: 22px;
  height: 22px;
  accent-color: var(--pink-dark);
  cursor: pointer;
}

/* input-group */
.input-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  margin-bottom: var(--space);
}

.input-group label {
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--text);
}

.input-group input[type="text"],
.input-group select,
select {
  width: 100%;
  padding: 10px var(--space-md);
  border-radius: var(--radius);
  border: 2px solid var(--purple-light);
  background: var(--white);
  font-size: var(--fs);
  color: var(--text);
  transition: border-color var(--t), box-shadow var(--t);
}

.input-group input[type="text"]:focus,
select:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px var(--purple-light);
}

/* ============================================
   装饰按钮网格 .deco-grid + .deco-btn
   ============================================ */
.deco-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: var(--space-sm);
  margin-bottom: var(--space);
}

.deco-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 64px;
  padding: var(--space-sm);
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform var(--t-fast) var(--ease-bounce),
    border-color var(--t), box-shadow var(--t);
  -webkit-tap-highlight-color: transparent;
}

.deco-btn:hover {
  transform: translateY(-2px);
  border-color: var(--purple);
  box-shadow: var(--shadow);
}

.deco-btn:active {
  transform: scale(0.94);
}

.deco-btn .emoji,
.deco-btn .icon {
  font-size: var(--fs-xl);
  line-height: 1;
}

.deco-btn .name,
.deco-btn .label {
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  color: var(--text);
  line-height: 1.2;
  text-align: center;
}

.deco-btn.active {
  border-color: var(--pink-dark);
  background: var(--pink-light);
  box-shadow: 0 0 0 2px var(--pink-dark), var(--shadow);
}

/* ============================================
   模式切换 .mode-toggle
   ============================================ */
.mode-toggle {
  display: inline-flex;
  background: var(--purple-light);
  border-radius: var(--radius-full);
  padding: 3px;
  gap: 2px;
  margin-bottom: var(--space);
  box-shadow: var(--shadow-inner);
}

.mode-toggle button {
  flex: 1;
  min-height: 34px;
  padding: 0 var(--space);
  border: none;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--text-light);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  cursor: pointer;
  transition: all var(--t) var(--ease-bounce);
  white-space: nowrap;
}

.mode-toggle button:hover {
  color: var(--purple-dark);
}

.mode-toggle button.active {
  background: linear-gradient(135deg, var(--pink) 0%, var(--pink-dark) 100%);
  color: var(--white);
  box-shadow: var(--shadow);
  font-weight: var(--fw-bold);
}

/* ============================================
   模态框 .modal
   ============================================ */
.modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
  background: rgba(90, 74, 106, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: fadeIn var(--t) var(--ease-out);
}

.modal-content {
  width: 100%;
  max-width: 420px;
  max-height: 80vh;
  overflow-y: auto;
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: var(--space-lg);
  box-shadow: var(--shadow-lg);
  animation: popIn var(--t-bounce) var(--ease-bounce);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.modal-content h3,
.modal-content h2 {
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: var(--fw-black);
  color: var(--purple-dark);
  text-align: center;
}

.modal-content .btn {
  width: 100%;
}

/* 包装网格 */
.package-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space);
}

.package-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-sm);
  background: var(--cream);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--t) var(--ease-bounce);
  min-height: 90px;
}

.package-option .emoji {
  font-size: var(--fs-2xl);
  line-height: 1;
}

.package-option span:last-child {
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  color: var(--text);
  text-align: center;
}

.package-option:hover {
  transform: translateY(-2px);
  border-color: var(--purple);
  box-shadow: var(--shadow);
}

.package-option.active {
  border-color: var(--pink-dark);
  background: var(--pink-light);
  box-shadow: 0 0 0 2px var(--pink-dark), var(--shadow);
}

/* ============================================
   提示 .toast
   ============================================ */
.toast {
  position: fixed;
  top: calc(var(--header-h) + var(--safe-top) + var(--space));
  left: 50%;
  transform: translateX(-50%) translateY(-120%);
  z-index: var(--z-toast);
  max-width: 90%;
  padding: var(--space) var(--space-lg);
  background: rgba(90, 74, 106, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--white);
  font-size: var(--fs);
  font-weight: var(--fw-medium);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-lg);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: transform var(--t-bounce) var(--ease-bounce),
    opacity var(--t);
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ============================================
   烘焙流程面板 .bake-flow-panel
   ============================================ */
.bake-flow-panel {
  background: linear-gradient(
    135deg,
    var(--yellow-light) 0%,
    var(--pink-light) 100%
  );
  border-radius: var(--radius-md);
  padding: var(--space-md);
  box-shadow: var(--shadow-sm);
  border: 2px solid var(--yellow);
}

.bake-flow-panel .panel-title {
  color: var(--orange-dark);
}

/* ============================================
   步骤指示器 .bake-steps
   ============================================ */
.bake-steps {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin: var(--space-md) 0;
  position: relative;
}

.bake-steps::before {
  content: "";
  position: absolute;
  top: 18px;
  left: 10%;
  right: 10%;
  height: 3px;
  background: var(--border-strong);
  border-radius: var(--radius-full);
  z-index: 0;
}

.bake-step {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  flex: 1;
}

.bake-step .step-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--white);
  border: 3px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs);
  font-weight: var(--fw-bold);
  color: var(--text-light);
  transition: all var(--t) var(--ease-bounce);
  box-shadow: var(--shadow-sm);
}

.bake-step .step-label {
  font-size: var(--fs-xs);
  color: var(--text-light);
  font-weight: var(--fw-medium);
  text-align: center;
  line-height: 1.2;
  transition: color var(--t);
}

.bake-step.active .step-circle {
  background: linear-gradient(135deg, var(--pink) 0%, var(--pink-dark) 100%);
  border-color: var(--pink-dark);
  color: var(--white);
  transform: scale(1.15);
  box-shadow: var(--shadow-glow-pink);
  animation: pulse 1.5s var(--ease-smooth) infinite;
}

.bake-step.active .step-label {
  color: var(--pink-dark);
  font-weight: var(--fw-bold);
}

.bake-step.done .step-circle {
  background: linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%);
  border-color: var(--green-dark);
  color: var(--white);
}

.bake-step.done .step-circle::after {
  content: "✓";
  font-size: var(--fs-md);
}

.bake-step.done .step-label {
  color: var(--green-dark);
}

/* ============================================
   进度条 .bake-progress-bar
   ============================================ */
.bake-progress-bar {
  width: 100%;
  height: 12px;
  background: var(--border);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin: var(--space) 0;
  box-shadow: var(--shadow-inner);
}

.bake-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(
    90deg,
    var(--yellow) 0%,
    var(--pink) 50%,
    var(--purple) 100%
  );
  border-radius: var(--radius-full);
  transition: width var(--t-slow) var(--ease-smooth);
  position: relative;
  overflow: hidden;
}

.bake-progress-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.5) 50%,
    transparent 100%
  );
  animation: sparkle 1.5s linear infinite;
}

/* ============================================
   蛋糕类型选择全屏 .cake-type-overlay
   ============================================ */
.cake-type-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-overlay);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
  padding-top: calc(var(--space-lg) + var(--safe-top));
  background: linear-gradient(
    135deg,
    var(--bg-gradient-start) 0%,
    var(--bg-gradient-mid) 50%,
    var(--bg-gradient-end) 100%
  );
  animation: fadeIn var(--t) var(--ease-out);
}

.cake-type-overlay.show {
  display: flex;
}

.cake-type-modal {
  width: 100%;
  max-width: 480px;
  text-align: center;
  animation: slideUp var(--t-slow) var(--ease-bounce);
}

.cake-type-modal h2 {
  font-family: var(--font-display);
  font-size: var(--fs-2xl);
  font-weight: var(--fw-black);
  color: var(--pink-dark);
  margin-bottom: var(--space-sm);
  text-shadow: 0 2px 4px rgba(255, 143, 168, 0.2);
}

.cake-type-modal p {
  font-size: var(--fs-md);
  color: var(--text-light);
  margin-bottom: var(--space-lg);
}

.cake-type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: var(--space-md);
}

.cake-type-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-lg) var(--space-md);
  background: rgba(255, 255, 255, 0.85);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: all var(--t) var(--ease-bounce);
  min-height: 130px;
  -webkit-tap-highlight-color: transparent;
}

.cake-type-card:hover {
  transform: translateY(-4px) scale(1.03);
  border-color: var(--pink-dark);
  box-shadow: var(--shadow-md);
}

.cake-type-card:active {
  transform: scale(0.96);
}

.cake-type-card .emoji {
  font-size: var(--fs-2xl);
  line-height: 1;
}

.cake-type-card .name {
  font-size: var(--fs);
  font-weight: var(--fw-bold);
  color: var(--purple-dark);
}

.cake-type-card.active {
  border-color: var(--pink-dark);
  background: var(--pink-light);
  box-shadow: 0 0 0 3px var(--pink-dark), var(--shadow-md);
  transform: scale(1.05);
}

/* ============================================
   包装选择 .package-modal
   ============================================ */
.package-modal .modal-content {
  max-width: 380px;
}

/* ============================================
   工具栏 .toolbar
   ============================================ */
.toolbar {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
  padding: var(--space-sm);
  background: rgba(255, 255, 255, 0.6);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.toolbar .btn {
  flex: 0 0 auto;
}

/* ============================================
   canvas容器 .canvas-wrapper (补充)
   ============================================ */
.canvas-wrapper {
  position: relative;
  border-radius: var(--radius-md);
}

.canvas-wrapper::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: var(--radius-lg);
  background: linear-gradient(
    135deg,
    var(--pink-light) 0%,
    var(--purple-light) 50%,
    var(--blue-light) 100%
  );
  opacity: 0.4;
  z-index: -1;
  filter: blur(8px);
}

/* ============================================
   画布缩放 .canvas-scale-row
   ============================================ */
.canvas-scale-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space);
  background: rgba(255, 255, 255, 0.7);
  border-radius: var(--radius);
  margin: var(--space-sm) 0;
}

.canvas-scale-row label {
  font-size: var(--fs-sm);
  color: var(--text);
  font-weight: var(--fw-medium);
  white-space: nowrap;
}

.canvas-scale-row input[type="range"] {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--blue-light) 0%, var(--blue) 100%);
}

.canvas-scale-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-dark) 100%);
  border: 2px solid var(--white);
  box-shadow: var(--shadow);
  cursor: pointer;
}

.canvas-scale-row .scale-val {
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
  color: var(--blue-dark);
  min-width: 40px;
  text-align: right;
}

/* ============================================
   语音指示器 .voice-indicator
   ============================================ */
.voice-indicator {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: linear-gradient(135deg, var(--blue-light) 0%, var(--purple-light) 100%);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow);
  animation: float 2s var(--ease-smooth) infinite;
}

.voice-indicator .wave {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 20px;
}

.voice-indicator .wave span {
  display: block;
  width: 3px;
  height: 8px;
  background: var(--blue-dark);
  border-radius: var(--radius-full);
  animation: pulse 0.8s var(--ease-smooth) infinite;
}

.voice-indicator .wave span:nth-child(2) {
  animation-delay: 0.15s;
  height: 14px;
}

.voice-indicator .wave span:nth-child(3) {
  animation-delay: 0.3s;
  height: 18px;
}

.voice-indicator .wave span:nth-child(4) {
  animation-delay: 0.45s;
  height: 12px;
}

.voice-indicator .wave span:nth-child(5) {
  animation-delay: 0.6s;
  height: 16px;
}

.voice-indicator .text {
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--purple-dark);
}

/* ============================================
   食材网格 .ingredient-grid
   ============================================ */
.ingredient-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: var(--space);
  padding: var(--space);
}

.ingredient-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-sm);
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all var(--t) var(--ease-bounce);
  text-align: center;
}

.ingredient-item:hover {
  transform: translateY(-3px);
  border-color: var(--green);
  box-shadow: var(--shadow);
}

.ingredient-item:active {
  transform: scale(0.94);
}

.ingredient-item .emoji {
  font-size: var(--fs-xl);
  line-height: 1;
}

.ingredient-item .name {
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  color: var(--text);
}

.ingredient-item.selected {
  border-color: var(--green-dark);
  background: var(--green-light);
  box-shadow: 0 0 0 2px var(--green-dark), var(--shadow);
}

/* ============================================
   创作记录 .replay-log
   ============================================ */
#replayLog,
#replayLogSide {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  max-height: 60vh;
  overflow-y: auto;
  padding-right: var(--space-xs);
}

.replay-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform var(--t-fast) var(--ease-bounce);
}

.replay-item:hover {
  transform: translateX(4px);
  border-color: var(--purple);
}

.replay-item .icon {
  font-size: var(--fs-lg);
  flex-shrink: 0;
}

.replay-item .info {
  flex: 1;
  min-width: 0;
}

.replay-item .info .title {
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
  color: var(--purple-dark);
}

.replay-item .info .time {
  font-size: var(--fs-xs);
  color: var(--text-light);
}

.replay-item .thumb {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background: var(--cream);
  object-fit: cover;
  flex-shrink: 0;
}

.empty-state {
  text-align: center;
  padding: var(--space-xl) var(--space-md);
  color: var(--text-light);
}

.empty-state .emoji {
  font-size: var(--fs-2xl);
  display: block;
  margin-bottom: var(--space);
  opacity: 0.6;
}

/* ============================================
   select 美化
   ============================================ */
select {
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23B794D4' d='M6 8L2 4h8z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-md) center;
  background-size: 12px;
  padding-right: var(--space-xl);
  cursor: pointer;
  width: 100%;
  padding: 10px var(--space-md);
  border-radius: var(--radius);
  border: 2px solid var(--purple-light);
  background-color: var(--white);
  font-size: var(--fs);
  color: var(--text);
  transition: border-color var(--t), box-shadow var(--t);
}

select:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px var(--purple-light);
}

/* ============================================
   层数设置 .layer-settings
   ============================================ */
#layerSettings {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-top: var(--space);
}

.layer-setting {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm);
  background: var(--cream);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.layer-setting .layer-label {
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
  color: var(--purple-dark);
  min-width: 56px;
}

.layer-setting input[type="color"] {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  padding: 0;
  border: 2px solid var(--white);
  box-shadow: var(--shadow-sm);
}

/* ============================================
   烘焙步骤内容
   ============================================ */
#bakeStepContent {
  min-height: 60px;
  padding: var(--space);
  background: rgba(255, 255, 255, 0.6);
  border-radius: var(--radius);
  margin: var(--space) 0;
  font-size: var(--fs-sm);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

#bakeStartBtn,
#bakeResetBtn {
  width: 100%;
  margin-top: var(--space-sm);
}
