:root {
  --bg-red-1: #5f0207;
  --bg-red-2: #92050f;
  --bg-red-3: #3f0004;
  --gold-1: #f6d78f;
  --gold-2: #b97b19;
  --gold-3: #fff4c5;
  --cream: #f8e8d3;
  --text-light: #fff3df;
  --shadow-dark: rgba(34, 3, 5, 0.45);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "STSong", "Songti SC", "KaiTi", serif;
  background:
    radial-gradient(circle at 50% 12%, rgba(255, 225, 159, 0.32), transparent 18%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 12%),
    linear-gradient(140deg, var(--bg-red-1), var(--bg-red-2) 45%, var(--bg-red-3));
  color: var(--text-light);
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  background:
    repeating-linear-gradient(
      82deg,
      transparent 0 22px,
      rgba(255, 214, 140, 0.07) 22px 24px,
      transparent 24px 52px
    ),
    radial-gradient(circle at 50% 0%, rgba(255, 208, 131, 0.26), transparent 40%);
  mix-blend-mode: screen;
}

body::after {
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 255, 255, 0.32), transparent 5%),
    radial-gradient(circle at 15% 70%, rgba(255, 219, 146, 0.08), transparent 18%),
    radial-gradient(circle at 85% 78%, rgba(255, 219, 146, 0.08), transparent 16%);
}

.poster-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px 16px;
}

.capture-stage {
  position: relative;
  width: min(100%, 600px);
  padding: 18px 0 26px;
  background:
    radial-gradient(circle at 50% 12%, rgba(255, 225, 159, 0.32), transparent 18%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 12%),
    linear-gradient(140deg, var(--bg-red-1), var(--bg-red-2) 45%, var(--bg-red-3));
  border-radius: 18px;
  overflow: hidden;
}

.capture-stage::before,
.capture-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.capture-stage::before {
  background:
    repeating-linear-gradient(
      82deg,
      transparent 0 22px,
      rgba(255, 214, 140, 0.07) 22px 24px,
      transparent 24px 52px
    ),
    radial-gradient(circle at 50% 0%, rgba(255, 208, 131, 0.26), transparent 40%);
  mix-blend-mode: screen;
}

.capture-stage::after {
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 255, 255, 0.32), transparent 5%),
    radial-gradient(circle at 15% 70%, rgba(255, 219, 146, 0.08), transparent 18%),
    radial-gradient(circle at 85% 78%, rgba(255, 219, 146, 0.08), transparent 16%);
}

.poster-shell {
  width: min(100%, 560px);
  position: relative;
  z-index: 1;
  margin: 0 auto;
}

.capture-button {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 233, 190, 0.5);
  border-radius: 999px;
  background: rgba(90, 8, 12, 0.78);
  color: #fff1d8;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow:
    0 10px 18px rgba(0, 0, 0, 0.22),
    inset 0 0 0 1px rgba(255, 245, 220, 0.08);
  backdrop-filter: blur(6px);
  transition: transform 0.2s ease, background 0.2s ease;
}

.capture-button:hover {
  transform: translateY(-1px);
  background: rgba(112, 10, 15, 0.88);
}

.capture-button svg {
  width: 21px;
  height: 21px;
  fill: currentColor;
}

.capture-button.is-busy {
  width: auto;
  min-width: 78px;
  padding: 0 14px;
  font-size: 0.88rem;
}

.capture-button.is-busy svg {
  display: none;
}

.capture-stage.is-capturing .capture-button {
  opacity: 0;
}

.capture-clone {
  position: fixed;
  left: -99999px;
  top: 0;
  z-index: -1;
}

.capture-clone .top-badge,
.capture-clone .notice-bar,
.capture-clone .content-card,
.capture-clone .portrait-frame,
.capture-clone .profile-card,
.capture-clone .profile-meta p {
  backdrop-filter: none !important;
  filter: none !important;
}

.capture-clone .profile-card {
  background:
    linear-gradient(180deg, rgba(117, 24, 19, 0.96), rgba(89, 12, 14, 0.94)),
    radial-gradient(circle at 50% 0%, rgba(255, 214, 135, 0.08), transparent 42%);
  border: 1px solid rgba(255, 228, 184, 0.55);
  box-shadow:
    inset 0 0 0 1px rgba(255, 245, 220, 0.08),
    0 10px 20px rgba(0, 0, 0, 0.18);
}

.capture-clone .profile-card::before {
  display: none;
}

.capture-clone .profile-meta p {
  background: rgba(255, 245, 228, 0.12);
  border: 1px solid rgba(255, 232, 188, 0.18);
  box-shadow: none;
}

.capture-clone .top-badge::before,
.capture-clone .profile-card::after,
.capture-clone .content-card::before,
.capture-clone .content-card::after {
  filter: none !important;
}

.top-badge {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 16px;
  padding: 18px 28px;
  border-radius: 20px;
  border: 2px solid rgba(255, 226, 153, 0.8);
  background:
    linear-gradient(180deg, rgba(149, 7, 18, 0.96), rgba(104, 0, 8, 0.92)),
    linear-gradient(90deg, rgba(255, 237, 170, 0.25), transparent 40%, rgba(255, 237, 170, 0.2));
  box-shadow:
    inset 0 0 0 3px rgba(255, 219, 122, 0.12),
    0 10px 30px rgba(0, 0, 0, 0.28);
  overflow: hidden;
}

.top-badge::before {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 16px;
  border: 1px solid rgba(255, 241, 200, 0.3);
}

.badge-code-block,
.badge-text {
  position: relative;
  z-index: 1;
  text-align: center;
}

.badge-text {
  font-size: clamp(1.9rem, 5vw, 2.6rem);
  line-height: 1.1;
  letter-spacing: 0.12em;
  color: var(--gold-3);
  text-shadow:
    0 0 10px rgba(255, 217, 120, 0.25),
    0 3px 6px rgba(57, 10, 5, 0.7);
}

.badge-label {
  font-size: clamp(1.35rem, 3.2vw, 1.8rem);
  line-height: 1.15;
  letter-spacing: 0.12em;
  color: var(--gold-3);
  text-shadow:
    0 0 10px rgba(255, 217, 120, 0.2),
    0 3px 6px rgba(57, 10, 5, 0.7);
}

.badge-code {
  margin-top: 8px;
  font-family: "Times New Roman", Georgia, serif;
  font-size: clamp(0.92rem, 2vw, 1.08rem);
  letter-spacing: 0.16em;
  color: #ffe1a0;
}

.badge-code-input {
  display: block;
  width: min(100%, 220px);
  margin-top: 8px;
  padding: 6px 10px;
  border: 1px solid rgba(255, 230, 172, 0.25);
  border-radius: 999px;
  background: rgba(65, 4, 8, 0.34);
  color: #ffe1a0;
  font-family: "Times New Roman", Georgia, serif;
  font-size: clamp(0.92rem, 2vw, 1.08rem);
  line-height: 1.2;
  letter-spacing: 0.12em;
  text-align: center;
  outline: none;
  box-shadow: inset 0 0 0 1px rgba(255, 241, 200, 0.08);
}

.badge-code-input:focus {
  border-color: rgba(255, 236, 194, 0.5);
  box-shadow:
    inset 0 0 0 1px rgba(255, 241, 200, 0.14),
    0 0 0 3px rgba(255, 220, 148, 0.12);
}

.badge-text-compact {
  font-size: clamp(1.6rem, 4.2vw, 2.2rem);
  letter-spacing: 0.1em;
}

.badge-flare {
  position: absolute;
  left: 43%;
  top: 56%;
  width: 70px;
  height: 70px;
  transform: translate(-50%, -50%);
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.95), rgba(255, 221, 126, 0.65) 25%, transparent 62%);
  filter: blur(1px);
}

.notice-bar {
  margin-top: 12px;
  padding: 12px 18px 14px;
  border-radius: 6px;
  background:
    linear-gradient(180deg, rgba(62, 28, 8, 0.92), rgba(29, 20, 9, 0.88)),
    linear-gradient(90deg, rgba(255, 214, 131, 0.1), transparent 35%);
  box-shadow: 0 5px 18px rgba(0, 0, 0, 0.2);
}

.notice-bar p {
  margin: 0;
  font-size: clamp(0.88rem, 2.2vw, 1rem);
  line-height: 1.45;
  font-weight: 600;
  color: #fff5e7;
}

.content-card {
  margin-top: 18px;
  padding: 20px;
  border-radius: 42px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02));
}

.portrait-frame {
  min-height: 600px;
  border-radius: 42px;
  background: var(--cream);
  box-shadow:
    inset 0 0 0 1px rgba(151, 79, 34, 0.15),
    0 10px 22px var(--shadow-dark);
  padding: 18px;
}

.portrait-uploader {
  position: relative;
  display: block;
  height: 100%;
  min-height: 564px;
  cursor: pointer;
}

.portrait-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 3;
}

.portrait-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 32px;
  object-fit: cover;
  object-position: center;
  display: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.portrait-preview.is-visible {
  display: block;
}

.portrait-placeholder {
  height: 100%;
  min-height: 564px;
  border-radius: 32px;
  background:
    linear-gradient(180deg, rgba(255, 245, 232, 0.9), rgba(246, 228, 204, 0.95)),
    repeating-linear-gradient(
      135deg,
      rgba(207, 157, 105, 0.08) 0 18px,
      rgba(255, 255, 255, 0.12) 18px 36px
    );
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  padding: 32px 24px;
  text-align: center;
  color: #b67a45;
  font-size: clamp(1.15rem, 3vw, 1.5rem);
  letter-spacing: 0.18em;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.portrait-placeholder.is-hidden {
  opacity: 0;
  transform: scale(0.98);
  pointer-events: none;
}

.portrait-placeholder span {
  font-weight: 700;
}

.portrait-placeholder small {
  display: block;
  max-width: 280px;
  font-size: 0.9rem;
  line-height: 1.6;
  letter-spacing: 0.08em;
  color: rgba(128, 73, 29, 0.9);
}

.upload-badge {
  padding: 10px 24px;
  border-radius: 999px;
  border: 1px solid rgba(173, 104, 45, 0.25);
  background: rgba(255, 250, 243, 0.72);
  box-shadow: 0 10px 20px rgba(129, 72, 33, 0.08);
  font-size: 1rem;
  letter-spacing: 0.14em;
}

.profile-card {
  position: relative;
  margin-top: 14px;
  padding: 26px 28px 24px;
  border-radius: 28px;
  border: 1px solid rgba(255, 232, 188, 0.45);
  background:
    linear-gradient(180deg, rgba(107, 18, 16, 0.9), rgba(76, 8, 11, 0.86)),
    radial-gradient(circle at 50% 0%, rgba(255, 214, 135, 0.12), transparent 40%);
  box-shadow:
    inset 0 0 0 2px rgba(255, 249, 226, 0.08),
    0 12px 24px rgba(0, 0, 0, 0.24);
  display: grid;
  grid-template-columns: 1.05fr 1.1fr 0.9fr;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}

.profile-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(95deg, transparent 0 18%, rgba(255, 216, 143, 0.12) 36%, transparent 55%),
    linear-gradient(82deg, transparent 0 46%, rgba(255, 216, 143, 0.1) 46.4%, transparent 47.4%);
  pointer-events: none;
}

.profile-meta {
  position: relative;
  z-index: 1;
}

.profile-meta p {
  margin: 0 0 10px;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  color: #fffaf0;
}

.profile-meta p:last-child {
  margin-bottom: 0;
}

.profile-meta span {
  min-width: 0;
  font-size: clamp(1.15rem, 3vw, 1.6rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.08em;
  white-space: nowrap;
  writing-mode: horizontal-tb;
}

.profile-meta span::after {
  content: "：";
}

.profile-meta strong {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  font-weight: 600;
  color: #ffe5bf;
}

.meta-input {
  display: block;
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  color: #ffe5bf;
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  font-weight: 600;
  line-height: 1.1;
  text-align: right;
  outline: none;
}

.meta-input::placeholder {
  color: rgba(255, 229, 191, 0.6);
}

.profile-center {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 12px 0;
}

.highlight-title-input {
  display: block;
  width: 100%;
  max-width: 180px;
  margin: 0 auto 8px;
  border: 0;
  background: transparent;
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 500;
  color: #fff1d8;
  text-align: center;
  text-shadow: 0 2px 12px rgba(255, 235, 192, 0.18);
  outline: none;
}

.highlight-textarea {
  display: block;
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
  border: 0;
  background: transparent;
  color: #f6d7b8;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  line-height: 1.6;
  text-align: center;
  resize: none;
  overflow: hidden;
  outline: none;
}

.highlight-title-input::placeholder,
.highlight-textarea::placeholder {
  color: rgba(246, 215, 184, 0.62);
}

.export-value {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.export-badge-code {
  min-height: 32px;
  line-height: 1.2;
}

.export-meta-value {
  white-space: nowrap;
}

.export-highlight-title {
  line-height: 1.15;
}

.export-highlight-text {
  min-height: 30px;
  line-height: 1.6;
}

.spark-ring {
  width: 148px;
  height: 72px;
  margin: 0 auto -12px;
  border-radius: 50%;
  border: 6px dotted rgba(255, 245, 224, 0.9);
  filter: drop-shadow(0 0 8px rgba(255, 231, 176, 0.55));
  transform: rotate(-8deg);
}

.flower-cluster {
  position: relative;
  z-index: 1;
  min-height: 140px;
}

.flower {
  position: absolute;
  right: 22px;
  top: 12px;
  width: 74px;
  height: 74px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 35%, #ffeef4 0 16%, #f5b4c6 16% 38%, transparent 39%),
    radial-gradient(circle at 60% 30%, #fff5f8 0 16%, #ef9db8 16% 38%, transparent 39%),
    radial-gradient(circle at 54% 58%, #fff8fa 0 16%, #f2b2c3 16% 38%, transparent 39%),
    radial-gradient(circle at 34% 62%, #fff2f6 0 16%, #ec92af 16% 38%, transparent 39%),
    radial-gradient(circle at 50% 48%, #fff8d5 0 11%, #f0be6e 11% 20%, transparent 21%);
  filter: drop-shadow(0 10px 12px rgba(51, 8, 10, 0.35));
}

.petal {
  position: absolute;
  background: linear-gradient(180deg, #ffe9f1, #f3b4c7);
  border-radius: 50% 50% 50% 10%;
  box-shadow: 0 8px 12px rgba(52, 7, 10, 0.22);
}

.petal-a {
  right: 106px;
  top: 58px;
  width: 28px;
  height: 14px;
  transform: rotate(-10deg);
}

.petal-b {
  right: 30px;
  top: 86px;
  width: 32px;
  height: 15px;
  transform: rotate(16deg);
}

.petal-c {
  right: 124px;
  top: 98px;
  width: 26px;
  height: 13px;
  transform: rotate(-26deg);
}

@media (max-width: 600px) {
  .poster-page {
    padding: 14px 0;
  }

  .poster-shell {
    width: 100%;
  }

  .capture-stage {
    width: 100%;
    padding-top: 20px;
    padding-bottom: 20px;
    border-radius: 0;
  }

  .capture-button {
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
  }

  .top-badge {
    margin: 0 10px;
    padding: 16px 14px;
    gap: 10px;
  }

  .badge-label {
    font-size: 1.1rem;
    letter-spacing: 0.08em;
  }

  .badge-code {
    margin-top: 6px;
    font-size: 0.76rem;
    letter-spacing: 0.1em;
  }

  .badge-code-input {
    width: 100%;
    max-width: 156px;
    margin-top: 6px;
    padding: 5px 8px;
    font-size: 0.76rem;
    letter-spacing: 0.08em;
  }

  .badge-text-compact {
    font-size: 1.45rem;
    letter-spacing: 0.06em;
  }

  .notice-bar,
  .content-card,
  .profile-card {
    margin-left: 10px;
    margin-right: 10px;
  }

  .portrait-frame {
    min-height: 500px;
  }

  .portrait-uploader,
  .portrait-placeholder {
    min-height: 464px;
  }

  .profile-card {
    grid-template-columns: 1fr;
    grid-template-areas:
      "center"
      "meta"
      "flower";
    text-align: center;
    gap: 20px;
    padding: 24px 18px 20px;
  }

  .profile-center {
    grid-area: center;
    padding: 4px 0 0;
  }

  .highlight-title-input {
    margin-bottom: 6px;
    font-size: clamp(2.1rem, 8vw, 2.6rem);
  }

  .highlight-textarea {
    max-width: 100%;
    font-size: 0.88rem;
    letter-spacing: 0.06em;
    line-height: 1.5;
  }

  .spark-ring {
    width: 124px;
    height: 60px;
    margin-bottom: -6px;
  }

  .profile-meta {
    grid-area: meta;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 12px;
  }

  .profile-meta p {
    grid-template-columns: 64px minmax(0, 1fr);
    margin: 0;
    padding: 12px 14px;
    min-height: 92px;
    border-radius: 14px;
    background: rgba(255, 245, 228, 0.08);
    box-shadow: inset 0 0 0 1px rgba(255, 232, 188, 0.12);
  }

  .profile-meta span {
    font-size: 1.22rem;
    letter-spacing: 0.02em;
  }

  .profile-meta strong {
    font-size: 0.98rem;
    text-align: right;
  }

  .meta-input {
    font-size: 1.06rem;
    text-align: right;
  }

  .profile-meta p:last-child {
    grid-column: 1 / -1;
  }

  .flower-cluster {
    grid-area: flower;
    min-height: 72px;
  }

  .flower {
    right: 50%;
    top: 0;
    width: 62px;
    height: 62px;
    transform: translateX(52px);
  }

  .petal-a {
    right: 50%;
    top: 42px;
    transform: translateX(2px) rotate(-10deg);
  }

  .petal-b {
    right: 50%;
    top: 64px;
    transform: translateX(72px) rotate(16deg);
  }

  .petal-c {
    right: 50%;
    top: 72px;
    transform: translateX(-12px) rotate(-26deg);
  }
}
