:root {
  color-scheme: light;
  --ink: #27211c;
  --muted: #766d62;
  --paper: #f7f0df;
  --paper-deep: #e7dcc2;
  --red: #a42027;
  --red-dark: #7b171d;
  --green: #315d45;
  --shadow: rgba(83, 58, 28, 0.22);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: "Noto Serif SC", "Songti SC", serif;
  background:
    radial-gradient(circle at 20% 10%, rgba(164, 32, 39, 0.12), transparent 32rem),
    radial-gradient(circle at 80% 18%, rgba(49, 93, 69, 0.16), transparent 28rem),
    linear-gradient(135deg, #f2ead8 0%, #eee4ce 42%, #ddd0b2 100%);
}

button {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 18px;
}

.stage {
  width: min(100%, 920px);
  min-height: min(700px, calc(100vh - 64px));
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  gap: 12px;
  padding: clamp(14px, 3vw, 28px);
  position: relative;
  overflow: hidden;
}

.stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(124, 39, 27, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(124, 39, 27, 0.05) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(circle, black 0%, transparent 72%);
  pointer-events: none;
}

.masthead,
.deck-area,
.controls,
.meta-strip {
  position: relative;
  z-index: 1;
}

.masthead {
  text-align: center;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--red);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.18em;
}

h1 {
  margin: 0;
  font-size: clamp(32px, 5vw, 54px);
  line-height: 1.05;
  font-weight: 900;
}

.subtitle {
  max-width: 560px;
  margin: 8px auto 0;
  color: var(--muted);
  font-size: clamp(15px, 2.4vw, 18px);
  line-height: 1.7;
}

.deck-area {
  display: grid;
  place-items: center;
  min-height: 340px;
  perspective: 1400px;
}

.deck {
  position: absolute;
  width: min(70vw, 310px);
  aspect-ratio: 2.5 / 3.5;
  transform: translate(-110px, 12px) rotate(-13deg);
}

.deck-card {
  position: absolute;
  inset: 0;
  border-radius: 16px;
  border: 1px solid rgba(105, 69, 38, 0.18);
  background:
    linear-gradient(135deg, rgba(95, 53, 38, 0.12), transparent 36%),
    radial-gradient(circle at 70% 25%, rgba(49, 93, 69, 0.15), transparent 28%),
    var(--paper);
  box-shadow: 0 20px 46px var(--shadow);
}

.deck-card::before {
  content: "毛选";
  position: absolute;
  inset: 24px;
  display: grid;
  place-items: center;
  color: rgba(88, 38, 24, 0.3);
  font-size: 56px;
  font-weight: 900;
  writing-mode: vertical-rl;
  border: 1px solid rgba(137, 34, 35, 0.16);
}

.deck-card-2 {
  transform: translate(14px, 10px) rotate(5deg);
}

.deck-card-3 {
  transform: translate(28px, 20px) rotate(10deg);
}

.quote-card {
  width: min(84vw, 355px);
  min-height: 430px;
  position: relative;
  display: grid;
  align-content: start;
  gap: 13px;
  padding: 26px 24px 20px;
  overflow: hidden;
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.55), transparent 28%),
    linear-gradient(180deg, #fbf7ec 0%, var(--paper) 100%);
  box-shadow: 0 28px 70px rgba(88, 61, 32, 0.3);
  transform: rotate(2deg);
  transition:
    transform 420ms ease,
    box-shadow 420ms ease;
}

.quote-card.is-drawing {
  transform: rotate(0deg) translateY(-8px) rotateY(12deg);
  box-shadow: 0 38px 90px rgba(88, 61, 32, 0.38);
}

.paper-grain {
  position: absolute;
  inset: 0;
  opacity: 0.33;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(108, 87, 57, 0.16) 0 1px, transparent 1px),
    radial-gradient(circle at 80% 40%, rgba(108, 87, 57, 0.12) 0 1px, transparent 1px);
  background-size: 12px 16px, 18px 22px;
}

.card-border {
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(164, 32, 39, 0.22);
  border-radius: 12px;
  pointer-events: none;
}

.quote-card::after {
  content: "";
  position: absolute;
  right: -46px;
  bottom: -30px;
  width: 180px;
  height: 250px;
  background:
    linear-gradient(110deg, transparent 0 22%, rgba(164, 32, 39, 0.88) 23% 42%, transparent 43%),
    linear-gradient(132deg, transparent 0 35%, rgba(164, 32, 39, 0.78) 36% 55%, transparent 56%);
  transform: rotate(-9deg);
  opacity: 0.9;
}

.card-topline,
.quote-card section,
.stamp {
  position: relative;
  z-index: 1;
}

.card-topline {
  display: flex;
  justify-content: space-between;
  color: var(--green);
  font-size: 13px;
  font-weight: 900;
}

.label {
  margin: 0 0 6px;
  color: var(--red);
  font-size: 14px;
  font-weight: 900;
}

h2 {
  margin: 0;
  font-size: clamp(23px, 4vw, 30px);
  line-height: 1.42;
  font-weight: 900;
}

.quote-card section p:not(.label) {
  margin: 0;
  color: #554b41;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.68;
}

.stamp {
  width: 58px;
  height: 58px;
  margin-top: 4px;
  display: grid;
  place-items: center;
  justify-self: end;
  color: rgba(164, 32, 39, 0.86);
  border: 4px double rgba(164, 32, 39, 0.68);
  border-radius: 50%;
  font-size: 16px;
  font-weight: 900;
  transform: rotate(-14deg);
}

.controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.draw-button,
.ghost-button {
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 900;
}

.draw-button {
  min-width: 220px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #fff8ee;
  background: linear-gradient(180deg, #c32e35, var(--red-dark));
  box-shadow: 0 18px 34px rgba(164, 32, 39, 0.28);
}

.draw-button:active {
  transform: translateY(1px);
}

.button-icon {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 2px solid currentColor;
  border-radius: 5px;
  line-height: 1;
}

.ghost-button {
  padding: 0 18px;
  color: var(--red-dark);
  background: rgba(255, 248, 238, 0.62);
  border: 1px solid rgba(164, 32, 39, 0.22);
}

.meta-strip {
  display: flex;
  justify-content: center;
  gap: 18px;
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 680px) {
  .app-shell {
    padding: 12px;
  }

  .stage {
    min-height: calc(100vh - 24px);
    gap: 12px;
    padding: 22px 10px;
  }

  .deck-area {
    min-height: 430px;
  }

  .deck {
    width: 250px;
    transform: translate(-46px, 18px) rotate(-11deg);
  }

  .quote-card {
    width: min(92vw, 340px);
    min-height: 455px;
    padding: 26px 22px 20px;
  }

  .controls {
    gap: 10px;
  }

  .draw-button {
    min-width: 190px;
  }
}
