:root {
  --ink: #5a2a3a;
  --ink-soft: #8a4d62;
  --petal: #ffd6e7;
  --blush: #ffc2d4;
  --rose: #e88ca6;
  --deep: #c45c7a;
  --paper: rgba(255, 248, 250, 0.78);
  --shadow: 0 24px 60px rgba(180, 80, 110, 0.22);
  font-family: "Noto Sans TC", "Zen Maru Gothic", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
}

body {
  background: linear-gradient(180deg, #fff0f5 0%, #ffd6e7 42%, #ffc4d6 100%);
  overflow-x: hidden;
}

.sakura-sky {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

#petals {
  width: 100%;
  height: 100%;
  display: block;
}

.mist {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.55;
}

.mist-a {
  width: 48vw;
  height: 48vw;
  background: #ffe4ec;
  top: -10vw;
  left: -8vw;
}

.mist-b {
  width: 40vw;
  height: 40vw;
  background: #ffb7c8;
  right: -10vw;
  bottom: 8vh;
}

.lab {
  position: relative;
  z-index: 1;
  max-width: 1120px;
  margin: 0 auto;
  padding: 40px 20px 80px;
}

.hero {
  text-align: center;
  margin-bottom: 20px;
}

.seal {
  display: inline-block;
  margin: 0 0 8px;
  padding: 4px 14px;
  border: 1px solid var(--deep);
  border-radius: 999px;
  letter-spacing: 0.35em;
  font-size: 12px;
  color: var(--deep);
  background: rgba(255, 255, 255, 0.45);
}

h1 {
  font-family: "Zen Maru Gothic", "Noto Sans TC", sans-serif;
  font-size: clamp(36px, 6vw, 64px);
  margin: 0 0 12px;
  letter-spacing: 0.08em;
}

.lede {
  max-width: 640px;
  margin: 0 auto;
  line-height: 1.8;
  color: var(--ink-soft);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(280px, 380px) 1fr;
  gap: 24px;
  align-items: start;
}

.console,
.readouts article,
.log {
  background: var(--paper);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: var(--shadow);
  border-radius: 28px;
}

.console {
  padding: 24px;
}

fieldset {
  border: 0;
  margin: 0 0 22px;
  padding: 0;
}

legend {
  font-weight: 700;
  margin-bottom: 14px;
  letter-spacing: 0.12em;
}

.control {
  display: block;
  margin-bottom: 14px;
}

.control-head {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  margin-bottom: 6px;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--deep);
}

.pigment.red input {
  accent-color: #e23b4a;
}
.pigment.green input {
  accent-color: #2ea44f;
}
.pigment.blue input {
  accent-color: #3b6fe2;
}

.swatch-row {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 12px;
  align-items: center;
  color: var(--ink-soft);
  font-size: 13px;
}

.swatch {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  border: 3px solid white;
  box-shadow: 0 8px 18px rgba(90, 42, 58, 0.18);
}

.ignite {
  width: 100%;
  border: 0;
  border-radius: 999px;
  padding: 14px 20px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: white;
  cursor: pointer;
  background: linear-gradient(135deg, #f08aaa, #c45c7a 60%, #9d3d5e);
  box-shadow: 0 12px 24px rgba(196, 92, 122, 0.35);
}

.ignite:hover {
  transform: translateY(-1px);
}

.stage {
  min-height: 520px;
}

.bench {
  height: 420px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 255, 255, 0.7), transparent 38%),
    linear-gradient(180deg, rgba(255, 240, 245, 0.3), rgba(255, 192, 210, 0.25));
  border-radius: 32px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  overflow: hidden;
  position: relative;
}

.column {
  position: relative;
  width: 180px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
}

.flask {
  width: 120px;
  z-index: 2;
}

.neck {
  width: 38px;
  height: 48px;
  margin: 0 auto;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.15));
  border: 2px solid rgba(140, 70, 90, 0.45);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
}

.body {
  height: 150px;
  border: 2px solid rgba(140, 70, 90, 0.5);
  border-radius: 18px 18px 42px 42px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.38), rgba(255, 255, 255, 0.08));
  overflow: hidden;
  position: relative;
  box-shadow: inset -18px 0 24px rgba(255, 255, 255, 0.35);
}

.liquid {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 42%;
  background: rgba(255, 120, 170, 0.75);
  transition: background 0.4s ease, height 0.6s ease;
}

.foam-stack {
  position: absolute;
  bottom: 198px;
  width: 96px;
  height: 0;
  border-radius: 48px 48px 14px 14px;
  transform-origin: bottom center;
  transition: height 1.1s cubic-bezier(0.16, 1, 0.3, 1), background 0.4s ease;
  box-shadow: 0 8px 28px rgba(196, 92, 122, 0.28);
  overflow: visible;
}

.foam-stack .blob {
  position: absolute;
  border-radius: 50%;
  background: inherit;
  filter: brightness(1.08);
}

.foam-stack .b1 {
  width: 54px;
  height: 54px;
  top: -18px;
  left: -10px;
}

.foam-stack .b2 {
  width: 64px;
  height: 64px;
  top: -22px;
  right: -12px;
}

.foam-stack .b3 {
  width: 42px;
  height: 42px;
  top: 18%;
  left: 28%;
}

.foam-stack.erupt {
  animation: wobble 1.4s ease-in-out;
}

@keyframes wobble {
  0%,
  100% {
    transform: scaleX(1);
  }
  40% {
    transform: scaleX(1.12);
  }
  70% {
    transform: scaleX(0.94);
  }
}

.readouts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}

.readouts article {
  padding: 16px 18px;
}

.readouts .span {
  grid-column: 1 / -1;
}

.readouts p,
.log p {
  margin: 0;
  font-size: 13px;
  color: var(--ink-soft);
}

.readouts h2,
.log h2 {
  margin: 6px 0 2px;
}

.log {
  margin-top: 28px;
  padding: 24px 28px;
}

.log ol {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.log li {
  display: grid;
  grid-template-columns: 18px 1fr auto;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px dashed rgba(196, 92, 122, 0.28);
  font-size: 14px;
}

@media (max-width: 860px) {
  .workspace {
    grid-template-columns: 1fr;
  }
}
