/* =========================================================
   牙齿小宇宙 · 二维码海报（A4 打印页）
   ========================================================= */
:root {
  --ink: #2E2523;
  --ink-soft: #6B5C57;
  --ink-faint: #998A84;
  --cream: #FBF8F3;
  --coral: #9D1F2D;
  --coral-deep: #7C1420;
  --teal: #2F7D63;
  --sun: #C8A24A;
  --line: rgba(93, 42, 40, .12);
  --font: "PingFang SC", "HarmonyOS Sans SC", "Hiragino Sans GB", "Source Han Sans SC", "Noto Sans SC", "Microsoft YaHei", "Yuanti SC", system-ui, sans-serif;
  --font-round: "Yuanti SC", "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", var(--font);
  --brand-red: #8C000D;
  --brand-red-2: #9D1F2D;
  --brand-gold: #C8A24A;
  --brand-green: #2F7D63;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body.poster-page {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(900px 500px at 80% -5%, rgba(200, 162, 74, .14), transparent 60%),
    #E7E0D5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
button, input { font: inherit; }
a { color: inherit; text-decoration: none; }
svg { display: block; max-width: 100%; }

/* ---------------- 顶部工具栏 ---------------- */
.ptoolbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 22px;
  padding: 14px clamp(16px, 3vw, 36px);
  background: rgba(255, 251, 244, .94);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(61, 48, 33, .1);
  box-shadow: 0 6px 24px rgba(87, 62, 38, .07);
}
.ptoolbar__head { min-width: 240px; flex: 1 1 260px; }
.ptoolbar__title { font-family: var(--font-round); font-weight: 800; font-size: 17px; }
.ptoolbar__hint { margin-top: 2px; font-size: 12px; color: var(--ink-soft); line-height: 1.5; }
.ptoolbar__form { display: flex; flex-wrap: wrap; gap: 10px 16px; flex: 2 1 460px; }
.ptoolbar__field { display: flex; flex-direction: column; gap: 3px; flex: 1 1 210px; min-width: 0; }
.ptoolbar__field span { font-size: 11px; font-weight: 700; color: var(--ink-soft); }
.ptoolbar__field input {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(61, 48, 33, .16);
  border-radius: 11px;
  background: #fff;
  font-size: 13px;
  color: var(--ink);
  outline: none;
  transition: border-color .16s, box-shadow .16s;
}
.ptoolbar__field input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(31, 182, 166, .14); }
.ptoolbar__actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .16s, box-shadow .16s, background .16s;
}
.pbtn:active { transform: scale(.97); }
.pbtn--primary { background: var(--coral); color: #fff; box-shadow: 0 8px 20px rgba(232, 92, 77, .28); }
.pbtn--primary:hover { background: var(--coral-deep); }
.pbtn--ghost { background: #fff; color: var(--ink); border-color: rgba(61, 48, 33, .14); }
.pbtn--ghost:hover { box-shadow: 0 6px 16px rgba(87, 62, 38, .1); }
.ptoolbar__status { font-size: 11.5px; color: var(--ink-faint); }
.ptoolbar__status.is-bad { color: var(--coral-deep); font-weight: 700; }

/* ---------------- 画布 ---------------- */
.poster-viewport {
  padding: 30px 16px 60px;
  display: flex;
  justify-content: center;
}
.poster-scale {
  width: 210mm;
  height: 297mm;
  transform-origin: top center;
  flex: none;
}
.poster {
  position: relative;
  width: 210mm;
  height: 297mm;
  background: var(--cream);
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(60, 40, 20, .28), 0 2px 0 rgba(255, 255, 255, .6) inset;
  display: flex;
  flex-direction: column;
  padding: 14mm 15mm 12mm;
}
.poster__blob {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}
.poster__blob--1 {
  width: 120mm; height: 120mm;
  right: -46mm; top: -50mm;
  background: radial-gradient(circle at 40% 40%, rgba(255, 201, 77, .55), rgba(255, 201, 77, 0) 68%);
}
.poster__blob--2 {
  width: 150mm; height: 150mm;
  left: -70mm; bottom: -60mm;
  background: radial-gradient(circle at 55% 45%, rgba(31, 182, 166, .18), rgba(31, 182, 166, 0) 70%);
}
.poster__dots {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(173, 142, 102, .22) 1.1px, transparent 1.1px);
  background-size: 6mm 6mm;
  -webkit-mask-image: radial-gradient(ellipse at 78% 18%, #000 0%, transparent 46%);
  mask-image: radial-gradient(ellipse at 78% 18%, #000 0%, transparent 46%);
  opacity: .55;
}
.poster__spark { position: absolute; z-index: 1; color: var(--sun); }
.poster__spark--1 { top: 24mm; right: 26mm; font-size: 8mm; transform: rotate(12deg); }
.poster__spark--2 { top: 82mm; left: 12mm; font-size: 5mm; color: var(--coral); }
.poster__spark--3 { top: 128mm; right: 16mm; font-size: 5.5mm; color: var(--teal); }

.poster__head { position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 6mm; }
.poster__brand { display: flex; align-items: center; gap: 4mm; }
.poster__logo-box {
  display: inline-flex;
  align-items: center;
  padding: 2.2mm 3.4mm;
  background: #fff;
  border: .3mm solid rgba(140, 0, 13, .12);
  border-radius: 3mm;
  box-shadow: 0 1.2mm 3mm rgba(87, 38, 32, .09);
}
.poster__logo { height: 9.2mm; width: auto; display: block; }
.poster__brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.poster__brand-text strong { font-family: var(--font-round); font-size: 5.2mm; font-weight: 900; letter-spacing: .02em; }
.poster__brand-text small { font-size: 2.4mm; color: var(--brand-red-2, #9D1F2D); letter-spacing: .16em; margin-top: .6mm; }
.poster__tag {
  padding: 2mm 4mm;
  border-radius: 999px;
  background: rgba(255, 255, 255, .78);
  border: .35mm solid var(--line);
  font-size: 2.6mm;
  font-weight: 700;
  color: var(--ink-soft);
  white-space: nowrap;
}

.poster__hero { position: relative; z-index: 2; display: flex; align-items: flex-end; justify-content: space-between; gap: 4mm; margin-top: 9mm; }
.poster__hero-copy { max-width: 118mm; }
.poster__eyebrow {
  display: inline-block;
  padding: 1.6mm 3.6mm;
  border-radius: 999px;
  background: rgba(255, 255, 255, .82);
  border: .35mm solid rgba(140, 0, 13, .16);
  font-size: 2.5mm;
  font-weight: 800;
  letter-spacing: .08em;
  color: var(--brand-red-2, #9D1F2D);
}
.poster__title {
  margin-top: 4mm;
  font-family: var(--font-round);
  font-size: 12.4mm;
  line-height: 1.28;
  font-weight: 900;
  letter-spacing: .01em;
}
.poster__title em {
  font-style: normal;
  color: var(--coral-deep);
  position: relative;
  display: inline-block;
}
.poster__title em::after {
  content: "";
  position: absolute;
  left: -1mm; right: -1mm; bottom: -.6mm;
  height: 3mm;
  border-radius: 2mm;
  background: rgba(255, 201, 77, .5);
  z-index: -1;
}
.poster__lede {
  margin-top: 3.4mm;
  font-size: 3.5mm;
  line-height: 1.75;
  color: var(--ink-soft);
}
.poster__mascot { width: 52mm; flex: none; margin-bottom: -2mm; }
.poster__mascot svg { width: 100%; height: auto; filter: drop-shadow(0 3mm 3mm rgba(120, 80, 40, .15)); }

/* ---------------- 扫码主卡 ---------------- */
.poster__scan { position: relative; z-index: 2; margin-top: 9mm; }
.poster__scan-card {
  display: flex;
  align-items: center;
  gap: 10mm;
  padding: 8mm 10mm;
  border-radius: 8mm;
  background:
    radial-gradient(60mm 40mm at 92% 0%, rgba(200, 162, 74, .3), transparent 65%),
    linear-gradient(140deg, #5C0910, #7C1420 62%, #8C000D);
  color: #FFF9F2;
  box-shadow: 0 5mm 12mm rgba(80, 55, 30, .22);
}
.poster__qr { flex: none; text-align: center; }
.poster__qr-code {
  width: 52mm; height: 52mm;
  padding: 2.4mm;
  background: #fff;
  border-radius: 4mm;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.poster__qr-code svg { width: 100% !important; height: 100% !important; }
.poster__qr-code img { width: 100%; height: 100%; object-fit: contain; }
.poster__qr-hint { margin-top: 2mm; font-size: 2.4mm; color: rgba(255, 249, 242, .64); letter-spacing: .06em; }
.poster__scan-kicker { font-size: 2.4mm; letter-spacing: .28em; color: #FFD98A; font-weight: 700; }
.poster__scan-copy h2 { margin-top: 1.6mm; font-family: var(--font-round); font-size: 7.6mm; line-height: 1.28; font-weight: 900; }
.poster__features { margin-top: 4mm; display: grid; gap: 2.6mm; }
.poster__features li { display: flex; align-items: center; gap: 3mm; }
.poster__features li > span {
  flex: none;
  width: 7mm; height: 7mm;
  display: grid; place-items: center;
  border-radius: 2.6mm;
  background: rgba(255, 249, 242, .1);
  font-size: 3.6mm;
}
.poster__features strong { display: block; font-size: 3.2mm; font-weight: 800; }
.poster__features small { display: block; margin-top: .4mm; font-size: 2.5mm; color: rgba(255, 249, 242, .64); }

/* ---------------- 三个小任务 ---------------- */
.poster__tasks {
  position: relative;
  z-index: 2;
  margin-top: 8mm;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4mm;
}
.poster__task {
  position: relative;
  padding: 5mm;
  border-radius: 5mm;
  background: rgba(255, 255, 255, .72);
  border: .35mm solid var(--line);
}
.poster__task-num {
  position: absolute;
  top: 4.4mm; right: 4.6mm;
  font-family: ui-monospace, monospace;
  font-size: 2.4mm;
  font-weight: 800;
  color: var(--ink-faint);
  letter-spacing: .08em;
}
.poster__task h3 { font-family: var(--font-round); font-size: 4.6mm; font-weight: 900; }
.poster__task h3::before { content: ""; display: block; width: 6mm; height: 1.2mm; border-radius: 1mm; background: var(--coral); margin-bottom: 2.4mm; }
.poster__task:nth-child(2) h3::before { background: var(--teal); }
.poster__task:nth-child(3) h3::before { background: var(--sun); }
.poster__task p { margin-top: 1.8mm; font-size: 2.7mm; line-height: 1.65; color: var(--ink-soft); }

/* ---------------- 刷牙口诀 ---------------- */
.poster__tip {
  position: relative;
  z-index: 2;
  margin-top: 8mm;
  padding: 4.6mm 6mm;
  display: flex;
  align-items: center;
  gap: 5mm;
  border-radius: 5mm;
  background: rgba(255, 255, 255, .66);
  border: .4mm dashed rgba(61, 48, 33, .2);
}
.poster__tip-badge {
  flex: none;
  padding: 1.8mm 3.4mm;
  border-radius: 999px;
  background: var(--sun);
  color: #3D2C07;
  font-size: 2.5mm;
  font-weight: 900;
  letter-spacing: .04em;
}
.poster__tip-copy p { font-size: 3.2mm; font-weight: 800; color: var(--ink); }
.poster__tip-copy p strong { color: var(--coral-deep); font-size: 3.8mm; padding: 0 .4mm; }
.poster__tip-copy small { display: block; margin-top: 1.2mm; font-size: 2.5mm; color: var(--ink-soft); line-height: 1.6; }

/* ---------------- 页脚 ---------------- */
.poster__foot { position: relative; z-index: 2; margin-top: auto; padding-top: 6mm; border-top: .35mm dashed rgba(61, 48, 33, .22); }
.poster__foot-main { display: flex; align-items: baseline; justify-content: space-between; gap: 4mm; flex-wrap: wrap; }
.poster__foot-main strong { font-family: var(--font-round); font-size: 3.6mm; font-weight: 900; }
.poster__foot-main small { font-size: 2.4mm; color: var(--ink-faint); letter-spacing: .02em; word-break: break-all; }
.poster__foot-meta { margin-top: 2mm; font-size: 2.35mm; line-height: 1.7; color: var(--ink-soft); }
.poster__disclaimer { margin-top: 1.6mm; font-size: 2.3mm; line-height: 1.7; color: var(--ink-faint); max-width: 168mm; }

/* ---------------- 打印 ---------------- */
@page {
  size: A4 portrait;
  margin: 0;
}
@media print {
  html, body { width: 210mm; height: 296.8mm; background: #fff !important; overflow: hidden; }
  body.poster-page { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .ptoolbar { display: none !important; }
  .poster-viewport { padding: 0 !important; display: block; }
  .poster-scale { width: 210mm !important; height: 296.8mm !important; transform: none !important; margin: 0 !important; zoom: 1 !important; }
  .poster { box-shadow: none !important; width: 210mm; height: 296.8mm; }
  .poster__blob, .poster__dots, .poster__scan-card, .poster__task, .poster__tip, .poster__logo-box { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------------- 小屏 ---------------- */
@media (max-width: 640px) {
  .ptoolbar { position: static; padding: 12px 14px; }
  .ptoolbar__head { flex-basis: 100%; }
  .ptoolbar__form { flex-basis: 100%; }
  .ptoolbar__actions { flex-basis: 100%; }
  .ptoolbar__actions .pbtn { flex: 1; }
  .poster-viewport { padding: 18px 8px 40px; }
}
@media print and (max-width: 640px) {
  .poster-viewport { padding: 0; }
}
