/* 捏一只今天的情绪 · claymorphism */
:root {
  color-scheme: light dark;

  --bg-1: #f4eeff;
  --bg-2: #ffedf3;
  --ink: #3a2560;
  --ink-2: #6b5590;
  --ink-3: #9084ab;

  --slab-1: #eee5ff;
  --slab-2: #ddcff8;
  --slab-shadow: #bda9e6;

  --card-1: #fdf8ff;
  --card-2: #f4e9fb;
  --card-edge: #ffffff;

  --peach-1: #ffd4e0;
  --peach-2: #f0a9c0;
  --peach-deep: #cf7c99;
  --lilac-1: #ded0ff;
  --lilac-2: #b39ce8;

  --g-body-1: #fff6d9;
  --g-body-2: #ffdca1;
  --g-body-3: #efb087;
  --g-ink-1: #4c3268;
  --g-ink-2: #2c1c44;
  --g-pink-1: #ffc2d4;
  --g-pink-2: #e8849f;
  --g-lilac-1: #e3d5ff;
  --g-lilac-2: #ac91e4;
  --g-gold-1: #ffe8a3;
  --g-gold-2: #f0b64e;
  --g-green-1: #c3e8b0;
  --g-green-2: #86c37a;
  --g-cheek-1: #ffb3c6;
  --g-cheek-2: #f4839f;

  --shadow-soft: 0 18px 40px rgba(92, 63, 143, 0.16);
  --shadow-slab: 0 22px 34px rgba(120, 92, 180, 0.22);
  --ring: #8d6ff0;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-1: #1e1830;
    --bg-2: #241a2b;
    --ink: #f6efff;
    --ink-2: #c2b1e2;
    --ink-3: #9c8cbb;

    --slab-1: #332a4c;
    --slab-2: #26203a;
    --slab-shadow: #120d1f;

    --card-1: #2c2342;
    --card-2: #251d38;
    --card-edge: #453662;

    --peach-1: #f3adc4;
    --peach-2: #cf7f9b;
    --peach-deep: #8f4f66;
    --lilac-1: #4a3b6e;
    --lilac-2: #332a4d;

    --g-body-1: #ffeec4;
    --g-body-2: #f6cd95;
    --g-body-3: #d99c76;
    --g-ink-1: #402a5c;
    --g-ink-2: #241535;
    --g-pink-1: #ffb6cc;
    --g-pink-2: #cc708c;
    --g-lilac-1: #d5c3ff;
    --g-lilac-2: #8e75c8;
    --g-gold-1: #ffe49a;
    --g-gold-2: #d69b3c;
    --g-green-1: #addb9c;
    --g-green-2: #6fae66;
    --g-cheek-1: #f79eb5;
    --g-cheek-2: #d4728c;

    --shadow-soft: 0 20px 42px rgba(0, 0, 0, 0.45);
    --shadow-slab: 0 24px 36px rgba(0, 0, 0, 0.5);
    --ring: #b9a3ff;
  }
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  padding: 0;
  font-family: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(120% 80% at 12% 4%, var(--bg-2) 0%, transparent 58%),
    radial-gradient(120% 90% at 92% 96%, var(--bg-1) 0%, transparent 60%),
    linear-gradient(168deg, var(--bg-1), var(--bg-2));
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

.haze {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(34px);
  opacity: 0.55;
}
.blob--a { width: 240px; height: 240px; left: -80px; top: -60px; background: #e2c9ff; }
.blob--b { width: 280px; height: 280px; right: -110px; top: 22%; background: #ffd4de; opacity: 0.45; }
.blob--c { width: 220px; height: 220px; left: 18%; bottom: -90px; background: #ffe9c2; opacity: 0.4; }
@media (prefers-color-scheme: dark) {
  .blob { opacity: 0.22; }
  .blob--a { background: #6a4fa8; }
  .blob--b { background: #a0577c; }
  .blob--c { background: #a8814a; }
}

.wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
  padding: clamp(26px, 6vw, 44px) 20px 40px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ---------- 标题 ---------- */
.eyebrow {
  margin: 0 0 8px;
  font-size: 11px;
  letter-spacing: 0.32em;
  font-weight: 700;
  color: var(--ink-3);
}

.title {
  margin: 0;
  font-size: clamp(30px, 9vw, 38px);
  line-height: 1.16;
  letter-spacing: 0.02em;
  font-weight: 800;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.55);
}
@media (prefers-color-scheme: dark) {
  .title { text-shadow: 0 2px 10px rgba(0, 0, 0, 0.4); }
}

.lede {
  margin: 10px 0 0;
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--ink-2);
}


/* ---------- SVG 渐变色 ---------- */
.g-body-1 { stop-color: var(--g-body-1); }
.g-body-2 { stop-color: var(--g-body-2); }
.g-body-3 { stop-color: var(--g-body-3); }
.g-ink-1 { stop-color: var(--g-ink-1); }
.g-ink-2 { stop-color: var(--g-ink-2); }
.g-pink-1 { stop-color: var(--g-pink-1); }
.g-pink-2 { stop-color: var(--g-pink-2); }
.g-lilac-1 { stop-color: var(--g-lilac-1); }
.g-lilac-2 { stop-color: var(--g-lilac-2); }
.g-gold-1 { stop-color: var(--g-gold-1); }
.g-gold-2 { stop-color: var(--g-gold-2); }
.g-green-1 { stop-color: var(--g-green-1); }
.g-green-2 { stop-color: var(--g-green-2); }
.g-cheek-1 { stop-color: var(--g-cheek-1); }
.g-cheek-2 { stop-color: var(--g-cheek-2); }

/* ---------- 舞台 ---------- */
.stage {
  position: relative;
  margin: 2px 0 0;
  padding: 4px 0 0;
}

.slab {
  position: absolute;
  left: 7%;
  right: 7%;
  bottom: 34px;
  height: 80px;
  border-radius: 42px;
  background: linear-gradient(170deg, var(--slab-1), var(--slab-2));
  box-shadow:
    var(--shadow-slab),
    inset 0 4px 0 rgba(255, 255, 255, 0.55),
    inset 0 -10px 16px rgba(120, 92, 180, 0.18);
  z-index: 0;
}
@media (prefers-color-scheme: dark) {
  .slab {
    box-shadow:
      var(--shadow-slab),
      inset 0 3px 0 rgba(255, 255, 255, 0.09),
      inset 0 -10px 16px rgba(0, 0, 0, 0.35);
  }
}

.figure {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  max-width: 340px;
  height: auto;
  margin: 0 auto;
  overflow: visible;
}

.ground { fill: #6a4b9c; opacity: 0.14; filter: url(#blurMid); }
.crumbs ellipse { fill: var(--peach-2); opacity: 0.55; }
.crumbs ellipse:nth-child(2) { fill: var(--lilac-2); opacity: 0.5; }
.crumbs ellipse:nth-child(3) { fill: #efc46b; opacity: 0.55; }
.crumbs ellipse:nth-child(4) { fill: var(--peach-2); opacity: 0.4; }
.foot { fill: url(#armFill); filter: url(#partShadow); }
.foot-hi { fill: #fff; opacity: 0.4; }

.body { fill: url(#bodyFill); }
.body-edge { fill: none; stroke: rgba(120, 70, 110, 0.16); stroke-width: 2; }
.body-shade { fill: #c07b6a; opacity: 0.22; filter: url(#blurBig); }
.body-rim {
  fill: none;
  stroke: #fff;
  stroke-width: 16;
  opacity: 0.5;
  filter: url(#blurBig);
  transform: translate(-5px, -7px);
}
.body-gloss { fill: #fff; opacity: 0.3; filter: url(#blurBig); }
.arm { fill: url(#armFill); filter: url(#partShadow); }
.cheek { fill: url(#cheekFill); opacity: 0.82; filter: url(#blurMid); }

#character, .part { transform-box: fill-box; }
#character { transform-origin: 50% 100%; }
.part { transform-origin: 50% 50%; }
.part--hat { transform-origin: 50% 100%; }

.part { cursor: pointer; }
.part:focus { outline: none; }
.part:focus-visible .hit { stroke: var(--ring); stroke-width: 3; stroke-dasharray: 7 7; opacity: 1; }
.part .hit {
  fill: transparent;
  stroke: transparent;
  stroke-width: 2;
  opacity: 0;
  transition: opacity 0.2s ease;
}

/* 悬停提示只在支持悬停的设备上出现 */
@media (hover: hover) {
  .part:hover .hit { stroke: var(--ring); stroke-width: 2; stroke-dasharray: 6 6; opacity: 0.5; }
}

/* 造型元素 */
.eye-ink { fill: url(#inkFill); }
.eye-lid { fill: url(#bodyFill); }
.eye-line { fill: none; stroke: url(#inkFill); stroke-width: 9; stroke-linecap: round; }
.eye-glint { fill: #fff; opacity: 0.92; }
.spiral { fill: none; stroke: url(#inkFill); stroke-width: 4.6; stroke-linecap: round; }
.mouth-ink { fill: url(#inkFill); }
.mouth-line { fill: none; stroke: url(#inkFill); stroke-width: 8.5; stroke-linecap: round; }
.tongue { fill: #f4879f; }
.hat-pink { fill: url(#hatPink); }
.hat-lilac { fill: url(#hatLilac); }
.hat-gold { fill: url(#hatGold); }
.hat-rib { fill: none; stroke: rgba(255, 255, 255, 0.45); stroke-width: 3; stroke-linecap: round; }
.hat-hi { fill: #fff; opacity: 0.35; }
.sprout { fill: url(#sproutFill); }
.sprout-stem { fill: none; stroke: url(#sproutFill); stroke-width: 7; stroke-linecap: round; }

/* ---------- 提示 ---------- */
.hint {
  margin: 6px 0 0;
  text-align: center;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  transition: opacity 0.4s ease;
}
.hint.is-gone { opacity: 0; }

/* ---------- 按钮 ---------- */
.controls {
  display: flex;
  align-items: stretch;
  gap: 12px;
  margin-top: 2px;
}

.btn-squish {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  border-radius: 26px;
  padding: 15px 22px 14px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  cursor: pointer;
  color: #4a2340;
  font-family: inherit;
  background: linear-gradient(180deg, var(--peach-1), var(--peach-2));
  box-shadow:
    0 14px 22px rgba(180, 96, 127, 0.32),
    0 4px 0 var(--peach-deep),
    inset 0 4px 0 rgba(255, 255, 255, 0.65),
    inset 0 -10px 16px rgba(180, 96, 127, 0.28);
  transition: transform 0.16s cubic-bezier(.3, 1.4, .5, 1), box-shadow 0.16s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.btn-squish__label { font-size: 18px; font-weight: 800; letter-spacing: 0.06em; }
.btn-squish__sub { font-size: 11.5px; letter-spacing: 0.08em; opacity: 0.72; }
.btn-squish:active {
  transform: translateY(5px) scale(0.985);
  box-shadow:
    0 6px 10px rgba(180, 96, 127, 0.3),
    0 1px 0 var(--peach-deep),
    inset 0 3px 0 rgba(255, 255, 255, 0.4),
    inset 0 -4px 10px rgba(180, 96, 127, 0.35);
}
.btn-squish:focus-visible { outline: 3px solid var(--ring); outline-offset: 3px; }

@media (prefers-color-scheme: dark) {
  .btn-squish { color: #37182b; }
}

.btn-dice {
  flex: 0 0 auto;
  width: 62px;
  border: 0;
  border-radius: 24px;
  cursor: pointer;
  color: var(--ink);
  background: linear-gradient(180deg, var(--card-1), var(--card-2));
  box-shadow:
    0 14px 22px rgba(120, 92, 180, 0.2),
    0 4px 0 var(--slab-2),
    inset 0 3px 0 rgba(255, 255, 255, 0.7),
    inset 0 -8px 14px rgba(120, 92, 180, 0.14);
  display: grid;
  place-items: center;
  padding: 12px;
  transition: transform 0.16s cubic-bezier(.3, 1.4, .5, 1), box-shadow 0.16s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.btn-dice svg { width: 24px; height: 24px; }
.btn-dice:active {
  transform: translateY(5px) scale(0.96);
  box-shadow:
    0 5px 9px rgba(120, 92, 180, 0.2),
    0 1px 0 var(--slab-2),
    inset 0 2px 0 rgba(255, 255, 255, 0.5),
    inset 0 -3px 8px rgba(120, 92, 180, 0.2);
}
.btn-dice:focus-visible { outline: 3px solid var(--ring); outline-offset: 3px; }
@media (prefers-color-scheme: dark) {
  .btn-dice {
    box-shadow:
      0 14px 22px rgba(0, 0, 0, 0.4),
      0 4px 0 #171126,
      inset 0 3px 0 rgba(255, 255, 255, 0.1),
      inset 0 -8px 14px rgba(0, 0, 0, 0.3);
  }
}

/* ---------- 情绪纸条 ---------- */
.slip {
  position: relative;
  border-radius: 26px;
  padding: 20px 22px 18px;
  background: linear-gradient(168deg, var(--card-1), var(--card-2));
  box-shadow:
    var(--shadow-soft),
    inset 0 3px 0 var(--card-edge),
    inset 0 -12px 20px rgba(120, 92, 180, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.4);
  overflow: hidden;
}
@media (prefers-color-scheme: dark) {
  .slip { border-color: rgba(255, 255, 255, 0.06); }
}
.slip::after {
  content: "";
  position: absolute;
  right: -26px;
  top: -30px;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0) 70%);
  opacity: 0.5;
  pointer-events: none;
}

.slip__kicker {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.22em;
  font-weight: 700;
  color: var(--ink-3);
}
.slip__name {
  margin: 6px 0 10px;
  font-size: 24px;
  line-height: 1.3;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.slip__line {
  margin: 0 0 6px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--ink-2);
}
.slip__meta {
  margin: 10px 0 0;
  font-size: 11.5px;
  letter-spacing: 0.08em;
  color: var(--ink-3);
}
.slip__meta:empty { display: none; }

.slip.is-stamped { animation: stamp 0.62s cubic-bezier(.34, 1.5, .64, 1); }
@keyframes stamp {
  0% { transform: scale(1); }
  32% { transform: scale(0.965, 0.94); }
  100% { transform: scale(1); }
}

/* ---------- 捏过的小罐子 ---------- */
.jam {
  border-radius: 24px;
  padding: 16px 18px 16px;
  background: linear-gradient(170deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.34));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 10px 22px rgba(120, 92, 180, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.45);
}
@media (prefers-color-scheme: dark) {
  .jam {
    background: linear-gradient(170deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02));
    border-color: rgba(255, 255, 255, 0.07);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 10px 22px rgba(0, 0, 0, 0.3);
  }
}
.jam__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  font-size: 11.5px;
  letter-spacing: 0.12em;
  font-weight: 700;
  color: var(--ink-2);
}
.jam__note { font-weight: 500; color: var(--ink-3); letter-spacing: 0.06em; }
.jam__row {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 8px 14px 8px 10px;
  border: 0;
  border-radius: 16px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  background: linear-gradient(180deg, var(--peach-1), var(--peach-2));
  box-shadow:
    0 6px 10px rgba(180, 96, 127, 0.22),
    inset 0 2px 0 rgba(255, 255, 255, 0.6),
    inset 0 -5px 8px rgba(180, 96, 127, 0.22);
  transition: transform 0.15s cubic-bezier(.3, 1.4, .5, 1);
  animation: chipIn 0.4s cubic-bezier(.34, 1.5, .64, 1);
  -webkit-tap-highlight-color: transparent;
}
.chip:nth-child(3n + 2) {
  background: linear-gradient(180deg, var(--lilac-1), var(--lilac-2));
  box-shadow:
    0 6px 10px rgba(120, 92, 180, 0.22),
    inset 0 2px 0 rgba(255, 255, 255, 0.6),
    inset 0 -5px 8px rgba(120, 92, 180, 0.22);
}
.chip:nth-child(3n + 3) {
  background: linear-gradient(180deg, #ffe6a8, #f3c46b);
  box-shadow:
    0 6px 10px rgba(190, 140, 60, 0.22),
    inset 0 2px 0 rgba(255, 255, 255, 0.6),
    inset 0 -5px 8px rgba(190, 140, 60, 0.2);
}
.chip:active { transform: translateY(3px) scale(0.97); }
.chip:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; }
.chip__dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #fff, rgba(255, 255, 255, 0) 62%);
  box-shadow: inset 0 -2px 3px rgba(120, 60, 90, 0.35);
  flex: 0 0 auto;
}
@keyframes chipIn {
  0% { transform: scale(0.4); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.foot {
  margin: 4px 0 0;
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--ink-3);
  opacity: 0.85;
}

/* ---------- 动效开关 ---------- */
@media (prefers-reduced-motion: reduce) {
  .slip.is-stamped { animation: none; }
  .chip { animation: none; }
  .btn-squish, .btn-dice, .chip { transition: none; }
}
