@font-face {
  font-family: "Huawei Sans";
  src: url("assets/HuaweiSans-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Huawei Sans";
  src: url("assets/HuaweiSans-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --forest-ink: #214a2b;
  --leaf: #69bd88;
  --leaf-deep: #4da96c;
  --paper: rgba(250, 255, 247, 0.84);
  --white: #ffffff;
  --shadow: rgba(31, 72, 48, 0.24);
  --stage-width: 1920;
  --stage-height: 1080;
}

* {
  box-sizing: border-box;
}

.admin-link {
  position: fixed;
  z-index: 8;
  top: 18px;
  right: 22px;
  padding: 9px 13px;
  color: #2f5bc4;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(78, 116, 220, 0.22);
  border-radius: 999px;
  box-shadow: 0 8px 20px rgba(53, 83, 129, 0.12);
  backdrop-filter: blur(8px);
}

.admin-link:hover { color: #fff; background: #4e74dc; }

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

body {
  overflow: hidden;
  color: var(--forest-ink);
  background: #163c2c url("assets/forest-background.png") center / cover fixed no-repeat;
  font-family: "Huawei Sans", "Avenir Next", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button {
  font: inherit;
}

.app-shell {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 0;
}

.stage {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: #e8f7e7;
  box-shadow: 0 2rem 6rem rgba(10, 42, 26, 0.32);
}

.design-reference {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
  user-select: none;
  pointer-events: none;
}

.interaction-layer,
.selection-layer,
.hotspot-layer {
  position: absolute;
  inset: 0;
}

.interaction-layer {
  isolation: isolate;
}

.selection-layer {
  z-index: 2;
  pointer-events: none;
}

.hotspot-layer {
  z-index: 3;
}

.card-selection {
  position: absolute;
  display: grid;
  place-items: center;
  border-radius: 0.18rem;
  background: rgba(5, 18, 16, 0.78);
  box-shadow: inset 0 0 0 0.1rem rgba(255, 255, 255, 0.12), 0 0.3rem 1rem rgba(0, 0, 0, 0.25);
  animation: selection-in 180ms ease-out both;
}

.check-badge {
  display: grid;
  place-items: center;
  width: clamp(2.1rem, 4vw, 4.2rem);
  aspect-ratio: 1;
  color: #0b0d0d;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.25);
  font-size: clamp(1.6rem, 3.2vw, 3.2rem);
  font-weight: 700;
  line-height: 1;
}

.card-hotspot {
  position: absolute;
  padding: 0;
  border: 0;
  border-radius: 0.25rem;
  background: transparent;
  cursor: pointer;
  transition: box-shadow 180ms ease, transform 180ms ease;
}

.card-hotspot:hover {
  box-shadow: inset 0 0 0 0.13rem rgba(255, 255, 255, 0.82), 0 0 1.2rem rgba(255, 255, 255, 0.55);
  transform: translateY(-0.15rem);
}

.card-hotspot:focus-visible,
.print-trigger:focus-visible,
.home-trigger:focus-visible {
  outline: 0.2rem solid #113f2a;
  outline-offset: 0.2rem;
}

.print-trigger {
  position: absolute;
  z-index: 5;
  left: 38.35%;
  top: 76.55%;
  width: 23.3%;
  height: 11.2%;
  border: 0.18rem solid rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.96);
  background: linear-gradient(180deg, #c4ebbc 0%, #acd8b0 100%);
  box-shadow: 0 0 1.2rem rgba(255, 255, 255, 0.7), inset 0 0 0.7rem rgba(255, 255, 255, 0.52);
  cursor: not-allowed;
  font-size: clamp(1.4rem, 3.1vw, 3.65rem);
  font-weight: 700;
  letter-spacing: 0.18em;
  opacity: 0.92;
  transition: transform 180ms ease, filter 180ms ease, background 180ms ease, opacity 180ms ease;
}

.print-trigger.is-ready {
  color: #fff;
  background: linear-gradient(180deg, #8edc4d 0%, #49a936 100%);
  box-shadow: 0 0 1.6rem rgba(113, 226, 68, 0.92), inset 0 0.2rem 0.35rem rgba(255, 255, 255, 0.35);
  cursor: pointer;
  opacity: 1;
}

.print-trigger.is-ready:hover {
  filter: saturate(1.15) brightness(1.05);
  transform: translateY(-0.2rem) scale(1.01);
}

.print-trigger:disabled {
  pointer-events: none;
}

.print-hint {
  position: absolute;
  z-index: 5;
  left: 3.5%;
  bottom: 4.7%;
  margin: 0;
  padding: 0.42em 0.9em;
  color: rgba(24, 74, 45, 0.78);
  background: rgba(255, 255, 255, 0.32);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 999px;
  box-shadow: 0 0.3rem 1rem rgba(46, 103, 66, 0.08);
  font-size: clamp(0.58rem, 0.85vw, 0.95rem);
  letter-spacing: 0.02em;
  backdrop-filter: blur(0.5rem);
}

.modal {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 2rem;
  background: rgba(4, 14, 11, 0.78);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  width: min(90vw, 37.5rem);
  min-height: 15rem;
  padding: 3.25rem 3rem 2.8rem;
  color: #102d1a;
  text-align: center;
  background: rgba(255, 255, 255, 0.95);
  border: 0.12rem solid rgba(255, 255, 255, 0.85);
  border-radius: 2rem;
  box-shadow: 0 1.2rem 3rem rgba(0, 0, 0, 0.28);
  transform: translateY(0.6rem) scale(0.98);
  transition: transform 220ms ease;
}

.modal.is-open .modal-card {
  transform: translateY(0) scale(1);
}

.modal-card h1 {
  margin: 0.55rem 0 0.75rem;
  font-size: clamp(1.8rem, 4vw, 3rem);
  letter-spacing: 0.04em;
}

.modal-card p {
  margin: 0;
  font-size: clamp(0.95rem, 1.6vw, 1.25rem);
  line-height: 1.55;
}

.modal-kicker {
  color: var(--leaf-deep);
  font-size: 0.75rem !important;
  font-weight: 700;
  letter-spacing: 0.22em;
}

.spinner {
  width: 3.5rem;
  aspect-ratio: 1;
  margin: 0 auto 1.3rem;
  border: 0.35rem solid rgba(105, 189, 136, 0.25);
  border-top-color: var(--leaf-deep);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

.printer-mark {
  position: relative;
  width: 4.8rem;
  height: 4.2rem;
  margin: 0 auto 1rem;
  color: var(--leaf-deep);
}

.printer-body {
  position: absolute;
  left: 0.2rem;
  top: 1.15rem;
  width: 3.95rem;
  height: 2.25rem;
  border: 0.3rem solid currentColor;
  border-radius: 0.6rem;
}

.printer-body::before {
  position: absolute;
  left: 0.55rem;
  top: -1.55rem;
  width: 2.3rem;
  height: 1.35rem;
  border: 0.3rem solid currentColor;
  border-bottom: 0;
  border-radius: 0.4rem 0.4rem 0 0;
  content: "";
}

.printer-body::after {
  position: absolute;
  left: 0.65rem;
  right: 0.65rem;
  bottom: 0.45rem;
  height: 0.28rem;
  border-radius: 999px;
  background: currentColor;
  content: "";
}

.printer-check {
  position: absolute;
  right: -0.2rem;
  bottom: -0.45rem;
  display: grid;
  place-items: center;
  width: 2.25rem;
  aspect-ratio: 1;
  color: #fff;
  background: var(--leaf-deep);
  border: 0.22rem solid #fff;
  border-radius: 50%;
  font-size: 1.4rem;
  font-weight: 700;
}

.home-trigger {
  min-width: 12rem;
  margin-top: 2rem;
  padding: 0.65rem 2.3rem;
  color: #fff;
  background: linear-gradient(180deg, #8edc4d, #49a936);
  border: 0.14rem solid rgba(255, 255, 255, 0.95);
  border-radius: 999px;
  box-shadow: 0 0 1.2rem rgba(113, 226, 68, 0.65);
  cursor: pointer;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  transition: transform 180ms ease, filter 180ms ease;
}

.home-trigger:hover {
  filter: brightness(1.05);
  transform: translateY(-0.12rem);
}

.toast {
  position: fixed;
  z-index: 30;
  left: 50%;
  bottom: 2rem;
  padding: 0.8rem 1.15rem;
  color: #fff;
  background: rgba(22, 58, 43, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  box-shadow: 0 0.8rem 2rem rgba(0, 0, 0, 0.2);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 0.8rem);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.print-sheet {
  display: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.no-script {
  position: fixed;
  inset: 2rem;
  z-index: 40;
  padding: 2rem;
  color: #173b25;
  background: #fff;
  border-radius: 1rem;
  font-size: 1.25rem;
}

@keyframes selection-in {
  from {
    opacity: 0;
    transform: scale(0.98);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 900px) {
  .print-hint {
    display: none;
  }

  .modal-card {
    padding: 2.6rem 1.6rem 2.2rem;
    border-radius: 1.4rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}

@media print {
  .admin-link { display: none; }
  @page {
    /* 作品可见卡片是 214 × 340 的比例；100mm 宽对应约 158.88mm 高。 */
    size: 100mm 158.88mm;
    margin: 0;
  }

  html,
  body {
    width: 100%;
    min-height: 100%;
    overflow: visible;
    background: #fff;
  }

  .app-shell,
  .modal,
  .toast,
  .no-script {
    display: none !important;
  }

  .print-sheet {
    display: block;
    width: 100mm;
    height: 158.88mm;
    margin: 0;
    padding: 0;
    overflow: hidden;
    text-align: center;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .print-sheet img {
    display: block;
    width: 100%;
    height: 100%;
    margin: 0;
    object-fit: fill;
  }
}
