:root {
  color-scheme: light;
  --bg: #17130e;
  --card: #fff8ea;
  --card-deep: #241a12;
  --text: #2a1a10;
  --text-on-dark: #fff1d2;
  --muted: #806b53;
  --muted-on-dark: #d4bc92;
  --primary: #a65a2a;
  --primary-dark: #7c3e1d;
  --border: #d7b985;
  --ok: #26735b;
  --warn: #b36a21;
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100dvh;
  background:
    radial-gradient(circle at 18% 0%, rgba(232, 198, 137, .45), transparent 30rem),
    radial-gradient(circle at 86% 12%, rgba(67, 121, 101, .24), transparent 26rem),
    radial-gradient(circle at 50% 48%, rgba(252, 244, 224, .82), transparent 32rem),
    linear-gradient(135deg, #25180f, #b8945c 48%, #17332c);
  color: var(--text);
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .18;
  background-image:
    linear-gradient(90deg, rgba(255,255,255,.08) 1px, transparent 1px),
    linear-gradient(rgba(255,255,255,.08) 1px, transparent 1px);
  background-size: 34px 34px;
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .2;
  background:
    radial-gradient(ellipse at 12% 72%, rgba(28, 42, 38, .28), transparent 28rem),
    radial-gradient(ellipse at 82% 76%, rgba(84, 58, 38, .22), transparent 24rem);
  filter: blur(18px);
}
.topbar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: .9rem 1.5rem;
  border-bottom: 1px solid rgba(215, 185, 133, .28);
  background: rgba(35, 26, 19, .78);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 10;
}
h1, h2, h3, p { margin-top: 0; }
.topbar h1 { color: var(--text-on-dark); font-size: 1.25rem; margin-bottom: .25rem; letter-spacing: .02em; }
.topbar p { color: var(--muted-on-dark); margin-bottom: 0;     max-width: 65rem;
    font-size: clamp(0.5rem, 1.3vw, 1.2rem); }
.card p { color: var(--muted); margin-bottom: 0; }
nav { display: flex; flex-wrap: wrap; gap: .5rem; }
button, .button {
  border: 0;
  border-radius: 999px;
  padding: .72rem 1.05rem;
  background: linear-gradient(135deg, #b96931, var(--primary-dark));
  color: white;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.7rem;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
button:hover, .button:hover { background: linear-gradient(135deg, #c57a3c, #8e4821); box-shadow: 0 8px 22px rgba(94, 45, 16, .22); }
button:active, .button:active { transform: translateY(1px) scale(.99); }
button.secondary, .button.secondary { background: #efe0c3; color: var(--text); }
button.active { box-shadow: 0 0 0 3px rgba(215, 185, 133, .32); }
button:disabled { opacity: .55; cursor: not-allowed; }
button:disabled:hover { background: linear-gradient(135deg, #b96931, var(--primary-dark)); box-shadow: none; }
button.secondary:disabled:hover { background: #efe0c3; color: var(--text); }
.button[aria-disabled="true"] {
  opacity: .5;
  pointer-events: none;
}
main {
  padding: 1.5rem;
}
.page { display: none; }
.page.active { display: block; }
.card {
  background:
    linear-gradient(180deg, rgba(255, 252, 244, .96), rgba(247, 229, 195, .96)),
    var(--card);
  border: 1px solid rgba(215, 185, 133, .72);
  border-radius: 1.35rem;
  padding: 1.25rem;
  box-shadow: 0 22px 70px rgba(10, 8, 6, .24);
}
.hidden { display: none !important; }
.category-grid, .history-grid, .stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem;
}

@media (min-width: 1200px) { /* 这里的具体数值可以根据你 5 个元素的临界点来算 */
  .category-grid, .history-grid, .stats-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

.category-panel {
  overflow: hidden;
  position: relative;
}
.category-panel::after {
  content: "";
  position: absolute;
  right: -6rem;
  bottom: -7rem;
  width: 18rem;
  height: 18rem;
  border: 1px solid rgba(166, 90, 42, .18);
  border-radius: 50%;
  pointer-events: none;
}
.category-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 10rem;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1.25rem;
}
.category-hero h2 {
  color: var(--text);
  font-size: clamp(1.8rem, 3vw, 3rem);
  line-height: 1.08;
  margin-bottom: .55rem;
}
.eyebrow {
  color: var(--primary);
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .08em;
  margin-bottom: .55rem;
}
.bronze-orbit {
  position: relative;
  width: 8.5rem;
  height: 8.5rem;
  justify-self: end;
  border: 1px solid rgba(166, 90, 42, .45);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(34, 88, 76, .3), transparent 58%),
    radial-gradient(circle at 46% 35%, #c68945, #432411 62%, #15100c);
  box-shadow: inset 0 0 0 10px rgba(255, 230, 185, .08), 0 20px 55px rgba(64, 32, 13, .32);
}
.bronze-orbit span,
.bronze-orbit::before,
.bronze-orbit::after {
  content: "";
  position: absolute;
  border: 2px solid rgba(255, 223, 160, .58);
  border-radius: 50%;
}
.bronze-orbit span { inset: 2.7rem; }
.bronze-orbit::before { left: 2rem; right: 2rem; top: 1.35rem; bottom: 1.35rem; }
.bronze-orbit::after { left: 1.1rem; right: 1.1rem; top: 3.1rem; bottom: 2.1rem; border-radius: 55% 55% 42% 42%; }
.category-card, .history-item, .stat-card {
  border: 1px solid rgba(166, 90, 42, .26);
  border-radius: 1.15rem;
  padding: 1.05rem;
  background:
    radial-gradient(circle at 92% 12%, rgba(38, 115, 91, .14), transparent 36%),
    linear-gradient(145deg, #fff6e3, #ead2a5);
}
.category-card {
  min-height: 11rem;
  color: var(--text);
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  text-align: left;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.55);
}
.category-card:hover {
  color: var(--text);
  background:
    radial-gradient(circle at 92% 12%, rgba(38, 115, 91, .2), transparent 36%),
    linear-gradient(145deg, #fff9e9, #e5c58e);
}
.category-card h3 { margin-bottom: .55rem; font-size: 1.25rem; }
.category-card p { line-height: 1.55; }
.category-mark {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  background: radial-gradient(circle, #f7d596 18%, #9b5428 19% 34%, #233f35 35% 52%, transparent 53%);
  box-shadow: 0 0 0 1px rgba(166, 90, 42, .3);
}
.category-action {
  margin-top: 1rem;
  color: var(--primary-dark);
  font-size: .92rem;
  font-weight: 900;
}
.workspace {
  display: grid;
  grid-template-columns: minmax(320px, 1.1fr) minmax(300px, .78fr);
  gap: 1rem;
}
.section-head, .toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}
.actions{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .75rem;
}

.history-item .actions{
  display: grid;
  grid-template-columns: 1fr;
  gap: .75rem;
}

.toolbar {
  justify-content: flex-start;
  margin: 1rem 0;
}
.draw-hint {
  border-left: 4px solid var(--primary);
  padding-left: .75rem;
  line-height: 1.6;
}
.draw-toolbar {
  border: 1px solid rgba(166, 90, 42, .18);
  border-radius: 1rem;
  padding: .7rem;
  background: rgba(255, 248, 234, .56);
}
.toolbar.compact {
  margin: 0;
}
.toolbar label {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  color: var(--muted);
  font-weight: 700;
}
.color-control {
  border: 1px solid rgba(166, 90, 42, .22);
  border-radius: 999px;
  padding: .35rem .45rem .35rem .7rem;
  background: #fff7e8;
}
.color-control input[type="color"] {
  width: 3.4rem;
  height: 2.25rem;
  border: 2px solid #111827;
  border-radius: .7rem;
  padding: .15rem;
  background: linear-gradient(135deg, #111827 0 50%, #ffffff 50% 100%);
  cursor: pointer;
}
.color-control input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.color-control input[type="color"]::-webkit-color-swatch {
  border: 0;
  border-radius: .45rem;
}
.color-control input[type="color"]::-moz-color-swatch {
  border: 0;
  border-radius: .45rem;
}
.submit-cooldown {
  border-radius: 999px;
  padding: .45rem .75rem;
  background: #fff7ed;
  color: var(--warn);
  font-size: .9rem;
  font-weight: 800;
}
input, select {
  border: 1px solid rgba(166, 90, 42, .26);
  border-radius: 999px;
  padding: .65rem .8rem;
  background: #fffaf0;
}
.icon-button {
  width: 2.7rem;
  min-width: 2.7rem;
  padding: 0;
  font-size: 0;
}
.icon-button::before {
  content: attr(data-icon);
  font-size: 1.25rem;
  line-height: 1;
}
.style-button::before {
  color: #8b4b24;
}
.style-button {
  background: #efe0c3;
  color: var(--text);
  min-width: 5.8rem;
}
.style-button:hover {
  background: #ead3a6;
  color: var(--text);
}
#draw-canvas {
  width: 100%;
  max-width: 768px;
  aspect-ratio: 1 / 1;
  border: 2px solid #9c7140;
  border-radius: 1.1rem;
  background: #050403;
  box-shadow: inset 0 0 0 6px rgba(255, 224, 168, .07), 0 18px 45px rgba(30, 17, 8, .22);
  touch-action: none;
}
.status {
  padding: .85rem 1rem;
  border-radius: .85rem;
  background: #f4e1bb;
  color: #5a341d;
  margin: .75rem 0;
}
.countdown {
  font-size: 2rem;
  font-weight: 900;
  color: var(--warn);
  margin: 1rem 0;
}
.result-image {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  max-height: none;
  object-fit: contain;
  border-radius: 1rem;
  border: 1px solid var(--border);
  background: #17130f;
  transform-origin: center;
  transition: opacity .45s ease, filter .45s ease, box-shadow .45s ease, transform .45s ease;
}
.result-image.preview-active {
  opacity: .72;
  filter: blur(1.25px) saturate(.78) contrast(.92) brightness(1.03);
  box-shadow: 0 0 0 1px rgba(212, 188, 146, .24), 0 1rem 3rem rgba(31, 24, 17, .16);
}
.result-preview-stage {
  position: relative;
  width: 99%;
  overflow: hidden;
  border-radius: 1rem;
  isolation: isolate;
}
.result-preview-stage.generating {
  min-height: min(78vh, 44rem);
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at center, rgba(192, 128, 57, .2), transparent 28%),
    radial-gradient(circle at center, rgba(32, 87, 72, .16), transparent 64%),
    #1f1811;
}
.result-preview-stage .result-image {
  display: block;
}
.preview-generation-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: .7rem;
  border-radius: inherit;
  background: radial-gradient(circle at center, rgba(20, 15, 10, .08), rgba(20, 15, 10, .34));
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.result-preview-stage.generating .preview-generation-overlay {
  opacity: 1;
  visibility: visible;
}
.preview-spinner {
  position: relative;
  width: 9rem;
  height: 9rem;
  border: 1px solid rgba(255, 232, 184, .3);
  border-radius: 50%;
  background: rgba(25, 18, 12, .42);
  box-shadow: 0 1rem 2.5rem rgba(0, 0, 0, .25), inset 0 0 1.4rem rgba(246, 216, 140, .1);
  will-change: transform, box-shadow;
}
.preview-ripple {
  position: absolute;
  inset: 50% auto auto 50%;
  width: 100%;
  height: 100%;
  z-index: 0;
  border: 3px solid rgba(246, 216, 140, .72);
  border-radius: 43% 57% 52% 48% / 48% 44% 56% 52%;
  background: radial-gradient(circle, rgba(246, 216, 140, .2), transparent 52%, rgba(246, 216, 140, .16) 66%, transparent 74%);
  box-shadow: 0 0 1.5rem rgba(246, 216, 140, .42);
  transform: translate(-50%, -50%) scale(.45);
  opacity: 0;
  pointer-events: none;
  will-change: transform, opacity;
}
.preview-ripple-two {
  border-radius: 58% 42% 46% 54% / 44% 58% 42% 56%;
  border-color: rgba(118, 181, 155, .65);
  background: radial-gradient(circle, rgba(118, 181, 155, .16), transparent 52%, rgba(118, 181, 155, .1) 66%, transparent 74%);
  box-shadow: 0 0 1.5rem rgba(118, 181, 155, .34);
}
.preview-ripple-three {
  border-radius: 48% 52% 61% 39% / 57% 43% 55% 45%;
  border-color: rgba(255, 240, 190, .54);
  background: radial-gradient(circle, rgba(255, 240, 190, .12), transparent 52%, rgba(255, 240, 190, .08) 66%, transparent 74%);
  box-shadow: 0 0 1.5rem rgba(255, 240, 190, .28);
}
.preview-halo {
  position: absolute;
  inset: -.7rem;
  z-index: 0;
  border: 1px solid rgba(246, 216, 140, .44);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(246, 216, 140, .18), transparent 58%);
  box-shadow: 0 0 2.8rem rgba(246, 216, 140, .42), inset 0 0 1.8rem rgba(246, 216, 140, .16);
  opacity: .2;
  pointer-events: none;
  will-change: transform, opacity;
}
.preview-orbit {
  position: absolute;
  inset: -.95rem;
  z-index: 1;
  border: 1px solid rgba(255, 232, 184, .28);
  border-radius: 50%;
  transform-origin: center;
  pointer-events: none;
  will-change: transform;
}
.preview-orbit::before {
  content: "";
  position: absolute;
  inset: .22rem;
  border: 1px dashed rgba(118, 181, 155, .3);
  border-radius: 50%;
}
.preview-orbit-two {
  inset: -1.35rem;
  border-color: rgba(118, 181, 155, .26);
  transform: rotate(32deg);
}
.preview-orbit-two::before {
  border-color: rgba(246, 216, 140, .26);
}
.preview-orbit-dot {
  position: absolute;
  top: 50%;
  left: -.3rem;
  width: .6rem;
  height: .6rem;
  border-radius: 50%;
  background: #f6d88c;
  box-shadow: 0 0 .9rem rgba(246, 216, 140, .95);
  transform: translateY(-50%);
}
.preview-orbit-two .preview-orbit-dot {
  width: .42rem;
  height: .42rem;
  background: #76b59b;
  box-shadow: 0 0 .75rem rgba(118, 181, 155, .9);
}
.preview-spinner-ring {
  position: absolute;
  z-index: 1;
  border-radius: 50%;
  pointer-events: none;
  will-change: transform;
}
.preview-spinner-ring-one {
  inset: .66rem;
  border: 4px solid transparent;
  border-top-color: #f6d88c;
  border-right-color: rgba(246, 216, 140, .55);
}
.preview-spinner-ring-two {
  inset: 1.78rem;
  border: 3px solid transparent;
  border-bottom-color: #76b59b;
  border-left-color: rgba(118, 181, 155, .55);
}
.preview-spinner-core {
  position: absolute;
  z-index: 2;
  inset: 50% auto auto 50%;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 43% 57% 52% 48%;
  background: #f6d88c;
  box-shadow: 0 0 1.1rem rgba(246, 216, 140, .9);
  transform: translate(-50%, -50%);
  will-change: transform;
}
.preview-spinner-spark {
  position: absolute;
  z-index: 2;
  width: .48rem;
  height: .48rem;
  border-radius: 50%;
  background: #f6d88c;
  box-shadow: 0 0 .65rem currentColor;
  will-change: transform, opacity;
}
.preview-spinner-spark-one {
  top: 1.16rem;
  right: .84rem;
}
.preview-spinner-spark-two {
  bottom: 1.08rem;
  left: .98rem;
  color: #76b59b;
  background: currentColor;
}
.preview-spinner-spark-three {
  right: 1.16rem;
  bottom: 1.28rem;
}
.preview-generation-label {
  padding: .55rem .9rem;
  border: 1px solid rgba(255, 232, 184, .24);
  border-radius: 999px;
  background: rgba(25, 18, 12, .62);
  color: #fff0be;
  box-shadow: 0 .55rem 1.5rem rgba(0, 0, 0, .18);
  font-size: .92rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: .12em;
  will-change: transform, opacity;
}
.generation-visual {
  display: grid;
  justify-items: center;
  gap: .7rem;
  min-height: 19rem;
  place-content: center;
  margin: 1rem 0;
  overflow: hidden;
  border: 1px solid rgba(166, 90, 42, .22);
  border-radius: 1rem;
  background:
    radial-gradient(circle at center, rgba(192, 128, 57, .23), transparent 23%),
    radial-gradient(circle at center, rgba(32, 87, 72, .16), transparent 60%),
    #1f1811;
  color: var(--text-on-dark);
}
.generation-visual p {
  margin: 0;
  color: var(--muted-on-dark);
  font-size: .92rem;
  font-weight: 800;
  letter-spacing: .04em;
}
.generation-copy span { display: inline-block; }
.generation-orbit {
  position: relative;
  width: 10rem;
  height: 10rem;
}
.generation-core,
.generation-ring,
.generation-spark {
  position: absolute;
  left: 50%;
  top: 50%;
}
.generation-core {
  width: 2rem;
  height: 2rem;
  margin: -1rem;
  border-radius: 43% 57% 52% 48%;
  background: radial-gradient(circle at 36% 30%, #fff0be, #c67b2e 38%, #255b4b 76%);
  box-shadow: 0 0 1.4rem rgba(239, 184, 89, .9);
}
.generation-ring {
  border: 1px solid rgba(255, 222, 156, .76);
  border-radius: 50%;
}
.generation-ring-one {
  width: 6.2rem;
  height: 6.2rem;
  margin: -3.1rem;
  border-radius: 57% 43% 48% 52%;
}
.generation-ring-two {
  width: 9rem;
  height: 9rem;
  margin: -4.5rem;
  border-color: rgba(83, 168, 137, .65);
  border-radius: 42% 58% 55% 45%;
}
.generation-spark {
  width: .55rem;
  height: .55rem;
  margin: -.275rem;
  border-radius: 50%;
  background: #f6d88c;
  box-shadow: 0 0 .8rem #f6d88c;
}
.generation-spark-one { transform: translate(3.6rem, -2.7rem); }
.generation-spark-two { transform: translate(-4rem, 2.2rem); background: #76b59b; box-shadow: 0 0 .8rem #76b59b; }
.generation-spark-three { transform: translate(1.3rem, 4.25rem); }
.edit-again-button {
  background: linear-gradient(135deg, #2a7a63, #14533f);
  box-shadow: 0 10px 24px rgba(20, 83, 63, .24);
}
.edit-again-button:hover {
  background: linear-gradient(135deg, #328a70, #14533f);
}
.result-download-button {
  min-width: 9rem;
  background: linear-gradient(135deg, #d08a32, #9b4c1f);
  box-shadow: 0 10px 24px rgba(155, 76, 31, .28);
  font-size: 1rem;
}
.result-download-button::before {
  content: "↓";
  margin-right: .45rem;
  font-size: 1.25rem;
  line-height: 1;
}
.result-download-button:hover {
  background: linear-gradient(135deg, #e0a044, #ad5a25);
}
.source-download-button {
  min-width: 9rem;
  border: 1px solid rgba(38, 115, 91, .45);
  background: #e1f0e8;
  color: #185843;
  box-shadow: 0 6px 16px rgba(38, 115, 91, .12);
  font-size: .96rem;
}
.source-download-button::before {
  content: "✎";
  margin-right: .45rem;
  font-size: 1.05rem;
  line-height: 1;
}
.source-download-button:hover {
  background: #cbe6d9;
  color: #104734;
}
.public-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(16rem, 20rem);
  gap: 1rem;
  align-items: stretch;
}
.public-preview-card,
.public-info-card {
  min-width: 0;
}
.public-preview-card {
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}
.public-preview-card::before {
  content: "";
  position: absolute;
  right: -7rem;
  top: -8rem;
  width: 20rem;
  height: 20rem;
  border: 1px solid rgba(166, 90, 42, .12);
  border-radius: 50%;
  pointer-events: none;
}
.public-compare-grid {
  display: grid;
  flex: 1;
  grid-template-columns: minmax(12rem, 34fr) minmax(0, 66fr);
  gap: 1.15rem;
}
.public-compare-grid.single-artwork {
  grid-template-columns: minmax(0, 1fr);
}
.public-compare-grid.single-artwork .public-result-panel {
  width: min(100%, 54rem);
  justify-self: center;
}
.public-art-panel {
  display: flex;
  min-width: 0;
  flex-direction: column;
  margin: 0;
}
.public-source-panel {
  align-self: stretch;
}
.public-result-panel {
  position: relative;
}
.public-result-panel::after {
  content: "NEW WORK";
  position: absolute;
  right: .8rem;
  top: 3.05rem;
  z-index: 2;
  border: 1px solid rgba(255, 235, 190, .34);
  border-radius: 999px;
  padding: .34rem .55rem;
  background: rgba(23, 51, 44, .82);
  color: #f8dfad;
  font-size: .62rem;
  font-weight: 900;
  letter-spacing: .12em;
  pointer-events: none;
}
.public-art-panel figcaption {
  display: flex;
  align-items: center;
  gap: .7rem;
  margin-bottom: .65rem;
}
.public-art-panel figcaption > span {
  display: grid;
  width: 2.35rem;
  height: 2.35rem;
  place-items: center;
  border: 1px solid rgba(166, 90, 42, .3);
  border-radius: 50%;
  background: #f1dfbd;
  color: var(--primary-dark);
  font-size: .78rem;
  font-weight: 900;
}
.public-art-panel figcaption strong,
.public-art-panel figcaption small {
  display: block;
}
.public-art-panel figcaption small {
  margin-top: .15rem;
  color: var(--muted);
}
.public-section-head {
  margin-bottom: 1rem;
}
.public-section-head .eyebrow,
.public-info-card .eyebrow {
  font-size: .76rem;
  letter-spacing: .12em;
}
.public-section-head h2 {
  margin-bottom: .45rem;
  font-size: clamp(1.45rem, 1.8vw, 1.85rem);
  line-height: 1.2;
}
.live-badge {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: .45rem;
  border: 1px solid rgba(38, 115, 91, .28);
  border-radius: 999px;
  padding: .48rem .72rem;
  background: #e1f0e8;
  color: #185843;
  font-size: .84rem;
  font-weight: 900;
  white-space: nowrap;
}
.live-badge span {
  width: .52rem;
  height: .52rem;
  border-radius: 50%;
  background: #2f9674;
  box-shadow: 0 0 0 .28rem rgba(47, 150, 116, .13);
}
.public-image-stage {
  position: relative;
  display: grid;
  flex: 1;
  min-height: 0;
  aspect-ratio: 1 / 1;
  place-items: center;
  overflow: hidden;
  border: 2px solid #9c7140;
  border-radius: 1.1rem;
  background:
    radial-gradient(circle at 50% 42%, rgba(65, 127, 105, .2), transparent 30%),
    radial-gradient(circle at center, rgba(198, 137, 70, .16), transparent 62%),
    #100d0a;
  box-shadow: inset 0 0 0 6px rgba(255, 224, 168, .07), 0 18px 45px rgba(30, 17, 8, .2);
}
.public-image-stage .result-image {
  width: 100%;
  height: 100%;
  max-height: none;
  border: 0;
  border-radius: 0;
  object-fit: contain;
}
.public-source-stage {
  flex: 1;
  width: 100%;
  background:
    linear-gradient(135deg, rgba(255, 227, 174, .05), transparent 42%),
    radial-gradient(circle at 50% 45%, rgba(255, 255, 255, .065), transparent 42%),
    #050403;
  box-shadow:
    inset 0 0 0 6px rgba(255, 224, 168, .05),
    0 1.15rem 2.8rem rgba(30, 17, 8, .24);
}
.public-source-stage .result-image {
  image-rendering: auto;
}
.public-result-panel .public-image-stage {
  border-color: #b7793a;
  box-shadow:
    inset 0 0 0 6px rgba(255, 224, 168, .08),
    0 1.4rem 3.8rem rgba(30, 17, 8, .3),
    0 0 0 1px rgba(38, 115, 91, .16);
}
.public-result-panel .result-image {
  width: 100%;
  height: 100%;
  object-fit: contain !important;
  object-position: center;
}
.public-empty {
  display: grid;
  justify-items: center;
  max-width: 26rem;
  padding: 2rem;
  color: var(--text-on-dark);
  text-align: center;
}
.public-empty-state {
  flex: 1;
  min-height: min(68vh, 48rem);
  align-content: center;
  justify-self: stretch;
  max-width: none;
  border: 2px solid #9c7140;
  border-radius: 1.1rem;
  background:
    radial-gradient(circle at 50% 42%, rgba(65, 127, 105, .2), transparent 30%),
    radial-gradient(circle at center, rgba(198, 137, 70, .16), transparent 62%),
    #100d0a;
}
.public-empty strong {
  margin-top: 1rem;
  font-size: 1.18rem;
}
.public-empty p {
  margin-top: .55rem;
  color: var(--muted-on-dark);
  line-height: 1.65;
}
.public-empty-mark {
  width: 7rem;
  height: 7rem;
  border: 1px solid rgba(255, 223, 160, .42);
  border-radius: 50%;
  background:
    radial-gradient(circle, #f7d596 0 9%, transparent 10% 20%, #9b5428 21% 30%, transparent 31% 42%, #285c4c 43% 52%, transparent 53%),
    rgba(255, 255, 255, .03);
  box-shadow: 0 0 3rem rgba(198, 137, 70, .2);
}
.public-info-card {
  display: flex;
  min-height: 0;
  flex-direction: column;
  gap: 1rem;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 100% 0%, rgba(39, 104, 83, .17), transparent 34%),
    linear-gradient(165deg, rgba(255, 252, 244, .98), rgba(238, 216, 176, .98));
}
.public-info-card::after {
  content: "";
  position: absolute;
  right: -4.5rem;
  bottom: -5rem;
  width: 13rem;
  height: 13rem;
  border: 1px solid rgba(38, 115, 91, .13);
  border-radius: 43% 57% 52% 48%;
  transform: rotate(24deg);
  pointer-events: none;
}
.public-info-card h2 {
  margin-bottom: 0;
  color: #402313;
  font-size: clamp(1.35rem, 1.5vw, 1.65rem);
  line-height: 1.2;
}
.direction-story,
.public-update-line,
.public-download-button,
.homepage-qr {
  position: relative;
  z-index: 1;
}
.direction-story {
  border: 1px solid rgba(166, 90, 42, .2);
  border-radius: 1rem;
  padding: .85rem .9rem;
}
.direction-story {
  border-left: 4px solid #a65a2a;
  background: rgba(255, 248, 234, .62);
}
.direction-index {
  display: inline-block;
  margin-bottom: .45rem;
  color: var(--primary-dark);
  font-size: .7rem;
  font-weight: 900;
  letter-spacing: .16em;
}
.direction-story p {
  color: #6d533d;
  font-size: .9rem;
  line-height: 1.65;
}
.public-update-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  border-bottom: 1px solid rgba(166, 90, 42, .2);
  padding: 0 .15rem .65rem;
  color: var(--muted);
  font-size: .78rem;
}
.public-update-line time {
  color: #4e3423;
  font-weight: 800;
  text-align: right;
}
.public-download-button {
  width: 100%;
}
.homepage-qr {
  display: grid;
  justify-items: center;
  gap: .85rem;
  margin-top: auto;
  border: 1px solid rgba(38, 115, 91, .24);
  border-radius: 1.1rem;
  padding: 1rem;
  background:
    radial-gradient(circle at 100% 0%, rgba(38, 115, 91, .13), transparent 42%),
    #f5ead1;
  text-align: center;
}
.homepage-qr strong {
  display: block;
  margin-bottom: .3rem;
  color: #174b3c;
  font-size: 1.08rem;
}
.homepage-qr p {
  line-height: 1.55;
}
.qr {
  display: block;
  width: 11rem;
  height: 11rem;
  padding: .65rem;
  background: white;
  border: 1px solid rgba(38, 115, 91, .2);
  border-radius: .85rem;
  box-shadow: 0 .7rem 1.8rem rgba(30, 75, 60, .12);
}

@media (min-width: 901px) {
  body.public-display-active {
    height: 100dvh;
    overflow: hidden;
  }
  body.public-display-active main {
    height: calc(100dvh - var(--public-topbar-height, 0px));
    padding: 1rem 1.5rem 1.5rem;
  }
  body.public-display-active #page-public,
  body.public-display-active .public-workspace,
  body.public-display-active .public-preview-card,
  body.public-display-active .public-info-card,
  body.public-display-active .public-compare-grid,
  body.public-display-active .public-art-panel {
    min-height: 0;
    height: 100%;
  }
  body.public-display-active .public-compare-grid {
    grid-template-rows: minmax(0, 1fr);
  }
  body.public-display-active .public-source-panel {
    width: 100%;
    height: 100%;
    justify-self: stretch;
  }
  body.public-display-active .public-result-panel {
    height: 100%;
  }
  body.public-display-active .public-image-stage {
    min-height: 0;
    aspect-ratio: auto;
  }
  body.public-display-active .public-empty-state {
    min-height: 0;
    height: 100%;
  }
}

@media (min-width: 901px) and (max-height: 820px) {
  body.public-display-active .topbar {
    padding: .65rem 1.25rem;
  }
  body.public-display-active .topbar p {
    display: none;
  }
  body.public-display-active main {
    padding: .65rem 1rem 1rem;
  }
  body.public-display-active .public-workspace {
    gap: .65rem;
  }
  body.public-display-active .public-preview-card,
  body.public-display-active .public-info-card {
    padding: .8rem;
  }
  body.public-display-active .public-section-head {
    margin-bottom: .55rem;
  }
  body.public-display-active .public-section-head h2 {
    margin-bottom: 0;
    font-size: 1.45rem;
  }
  body.public-display-active .public-section-head p:not(.eyebrow) {
    display: none;
  }
  body.public-display-active .public-art-panel figcaption {
    margin-bottom: .4rem;
  }
  body.public-display-active .public-info-card {
    gap: .55rem;
  }
  body.public-display-active .direction-story {
    padding: .55rem .7rem;
  }
  body.public-display-active .direction-story p {
    font-size: .8rem;
    line-height: 1.4;
  }
  body.public-display-active .direction-index {
    margin-bottom: .25rem;
  }
  body.public-display-active .homepage-qr {
    gap: .45rem;
    padding: .55rem;
  }
  body.public-display-active .homepage-qr p {
    font-size: .8rem;
    line-height: 1.35;
  }
  body.public-display-active .qr {
    width: clamp(6.5rem, 16vh, 8.5rem);
    height: clamp(6.5rem, 16vh, 8.5rem);
  }
}
.history-item img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: .75rem;
  background: #0f172a;
}
.history-item .meta { color: var(--muted); font-size: .9rem; margin: .5rem 0; }
.stat-card strong { display: block; font-size: 2rem; margin-top: .35rem; }
.chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 1rem;
  margin: 1rem 0 1.25rem;
}
.chart-card {
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1rem;
  background: #fbfdff;
}
.chart-card.wide {
  grid-column: 1 / -1;
}
.chart-box {
  width: 100%;
  height: 320px;
}
.stats-table-wrap {
  overflow-x: auto;
}
.stats-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: .75rem;
}
.stats-table th,
.stats-table td {
  padding: .7rem .8rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}
.stats-table th {
  color: var(--muted);
  font-size: .9rem;
}
.stats-table td:first-child {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}
.timeline-head {
  margin-bottom: .65rem;
}
.timeline-limit-note {
  color: var(--muted);
  font-size: .88rem;
}
.timeline {
  display: grid;
  gap: .6rem;
}
.timeline-item {
  border-left: 4px solid var(--primary);
  background: #fbfdff;
  padding: .65rem .85rem;
  border-radius: .5rem;
}
.toast {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 30;
  max-width: min(24rem, calc(100vw - 2rem));
  border: 1px solid #fed7aa;
  border-radius: 1rem;
  padding: .9rem 1rem;
  background: #fff7ed;
  color: #9a3412;
  box-shadow: 0 18px 50px rgba(22, 34, 51, .18);
  font-weight: 800;
}

@media (max-width: 900px) {
  body {
    background:
      radial-gradient(circle at 20% 0%, rgba(240, 211, 157, .55), transparent 24rem),
      radial-gradient(circle at 100% 18%, rgba(58, 124, 101, .2), transparent 20rem),
      linear-gradient(160deg, #3a281a, #d9bf89 48%, #f4ead4);
  }
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 0rem;
    padding: .75rem .85rem .85rem;
  }
  .topbar h1 {
    font-size: 1.02rem;
    line-height: 1.25;
  }
  .topbar p { display: none; }
  .main-nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }
  .main-nav button {
    min-height: 2.35rem;
    padding: .55rem .4rem;
    font-size: .9rem;
    white-space: nowrap;
  }
  .category-panel {
    border-radius: 1.15rem;
  }
  .category-hero {
    grid-template-columns: 1fr;
    margin-bottom: 1rem;
  }
  .category-hero h2 {
    font-size: 1.7rem;
    line-height: 1.15;
  }
  .category-hero p:not(.eyebrow) {
    line-height: 1.55;
  }
  .bronze-orbit { display: none; }
  .category-grid { grid-template-columns: 1fr; }
  .category-card {
    min-height: 8.2rem;
    padding: 1rem;
  }
  .category-card h3 {
    font-size: 1.18rem;
  }
  .workspace { grid-template-columns: 1fr; }
  .public-workspace { grid-template-columns: 1fr; }
  .public-compare-grid {
    grid-template-columns: minmax(10rem, 42fr) minmax(0, 58fr);
  }
  .chart-grid { grid-template-columns: 1fr; }
  main { padding: .75rem; }
  .card {
    border-radius: 1.15rem;
    padding: .95rem;
  }
  .section-head {
    align-items: flex-start;
    gap: .65rem;
  }
  .draw-card .section-head {
    align-items: center;
    flex-wrap: nowrap;
  }
  .draw-card .section-head > div {
    flex: 1;
    min-width: 0;
  }
  .section-head h2 {
    font-size: 1.35rem;
    margin-bottom: .25rem;
  }
  .draw-card .section-head h2 {
    margin-bottom: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .section-head p {
    font-size: .92rem;
    line-height: 1.45;
  }
  .draw-card .section-head p {
    display: none;
  }
  #back-category {
    flex: 0 0 auto;
    min-height: 2rem;
    padding: .36rem .62rem;
    font-size: .82rem;
  }
  .draw-hint {
    margin: .45rem 0 0;
    font-size: .86rem;
    line-height: 1.45;
  }
  .draw-toolbar {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    align-items: stretch;
    gap: .4rem;
    margin: .55rem 0 0;
    padding: .45rem;
    border-radius: .85rem;
  }
  .draw-card {
    display: flex;
    flex-direction: column;
    gap: .55rem;
  }
  .draw-card .section-head { order: 1; }
  #draw-canvas { order: 2; }
  .draw-toolbar { order: 3; }
  .draw-hint { order: 4; }
  .draw-toolbar .color-control,
  .draw-toolbar .mode-control {
    grid-column: span 3;
  }
  .draw-toolbar .range-control {
    grid-column: 1 / -1;
  }
  #undo-draw,
  #clear-canvas,
  #change-style {
    grid-column: span 2;
  }
  #submit-job { grid-column: 1 / -1; }
  .submit-cooldown { grid-column: 1 / -1; }
  .draw-toolbar label {
    justify-content: space-between;
    min-width: 0;
    min-height: 2.75rem;
    gap: .35rem;
    font-size: .84rem;
  }
  .draw-toolbar input,
  .draw-toolbar select {
    min-width: 0;
    padding: .46rem .55rem;
    font-size: .84rem;
  }
  .range-control {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
  }
  .color-control {
    padding: .25rem .35rem .25rem .55rem;
  }
  .color-control input[type="color"] {
    width: 2rem;
    height: 1.5rem;
    border-radius: .55rem;
  }
  #brush-size {
    width: 70%;
  }
  .icon-button {
    width: 100%;
    min-width: 0;
    min-height: 2.75rem;
  }
  #change-style {
    min-width: 0;
    min-height: 2.75rem;
    padding: 0 .5rem;
    font-size: .84rem;
    white-space: nowrap;
  }
  #submit-job {
    min-height: 2.75rem;
    font-size: .96rem;
  }
  #draw-canvas {
    border-radius: .95rem;
    max-height: min(54dvh, calc(100vw - 1.5rem));
  }
  .workspace[data-mobile-step="status"] #draw-canvas,
  .workspace[data-mobile-step="result"] #draw-canvas {
    max-height: min(42dvh, calc(100vw - 1.5rem));
  }
  .result-card {
    min-height: auto;
  }
  .public-section-head {
    align-items: flex-start;
  }
  .public-image-stage {
    min-height: 0;
  }
  .public-info-card {
    gap: .8rem;
  }
  .homepage-qr {
    grid-template-columns: minmax(0, 1fr) auto;
    justify-items: start;
    text-align: left;
  }
  .qr {
    width: 8.5rem;
    height: 8.5rem;
  }
  .result-card h2 {
    font-size: 1.45rem;
  }
  .status {
    line-height: 1.55;
    margin: .65rem 0;
  }
  .countdown {
    font-size: 1.7rem;
  }
  .result-preview-stage.generating {
    min-height: 20rem;
  }
  .preview-spinner {
    width: 6.8rem;
    height: 6.8rem;
  }
  .preview-halo {
    inset: -.55rem;
  }
  .preview-orbit {
    inset: -.68rem;
  }
  .preview-orbit-two {
    inset: -.96rem;
  }
  .preview-spinner-ring-one {
    inset: .5rem;
  }
  .preview-spinner-ring-two {
    inset: 1.34rem;
  }
  .preview-spinner-core {
    width: 1.1rem;
    height: 1.1rem;
  }
  .preview-spinner-spark {
    width: .4rem;
    height: .4rem;
  }
  .preview-spinner-spark-one {
    top: .88rem;
    right: .64rem;
  }
  .preview-spinner-spark-two {
    bottom: .82rem;
    left: .76rem;
  }
  .preview-spinner-spark-three {
    right: .88rem;
    bottom: 1rem;
  }
  .preview-generation-label {
    padding: .46rem .76rem;
    font-size: .84rem;
  }
  .generation-visual {
    min-height: 15rem;
  }
  #result-actions {
    align-items: stretch;
    flex-direction: column;
    grid-template-columns: repeat(2, 1fr);
  }
  #result-actions > * {
    width: 100%;
  }
  .edit-again-button {
    font-size: 1.08rem;
  }
  .toast {
    right: .85rem;
    bottom: .85rem;
  }
}

/* 移动端仅提供创作和公共浏览功能，统计功能仅限桌面端使用。 */
@media (hover: none) and (pointer: coarse) {
  .main-nav button[data-page="stats"] {
    display: none;
  }
}

@media (max-width: 420px) {
  .homepage-qr {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }
  .draw-toolbar {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
  .draw-toolbar .color-control,
  .draw-toolbar .mode-control {
    grid-column: span 3;
  }
  #undo-draw,
  #clear-canvas,
  #change-style {
    grid-column: span 2;
  }
  .draw-toolbar .range-control,
  #submit-job,
  .submit-cooldown {
    grid-column: 1 / -1;
  }
}

/* 最终视觉收敛层。 */
body {
  background:
    radial-gradient(circle at 16% 0%, rgba(214, 180, 119, .24), transparent 28rem),
    radial-gradient(circle at 88% 10%, rgba(42, 94, 79, .14), transparent 26rem),
    linear-gradient(145deg, #2b2118, #c5ab78 52%, #203f36);
}

body::before {
  opacity: .1;
  background: url("/assets/sanxingdui-page.svg") center 6rem / min(62rem, 86vw) min(62rem, 86vw) no-repeat;
}

body::after {
  opacity: .06;
}

.topbar {
  background: rgba(29, 49, 42, .94);
}

.category-panel,
.draw-card,
.result-card,
.public-preview-card,
.public-info-card,
#page-history > .card,
#page-stats > .card,
#page-admin > .card {
  background: linear-gradient(180deg, #fffaf0, #eee0c4);
}

.category-panel::before,
.category-panel::after,
.draw-card::before,
.result-card::before,
.public-preview-card::after,
.public-info-card::before,
.public-info-card::after,
#page-history > .card::before,
#page-stats > .card::before,
#page-admin > .card::before {
  content: none;
}

.category-grid,
.history-grid,
.stats-grid,
.chart-grid {
  padding-top: 0;
  background: none;
}

.category-card,
.history-item,
.stat-card,
.chart-card,
.timeline-item,
.draw-toolbar,
.toolbar.compact,
.stats-table-wrap,
.draw-hint,
.direction-story,
.status,
.homepage-qr,
.public-section-head p:not(.eyebrow),
input,
select {
  background-image: none;
}

.category-card,
.history-item,
.stat-card,
.chart-card,
.timeline-item {
  background-color: #f8ecd5;
}

.category-card::before,
.history-item::before,
.stat-card::before,
.chart-card::before,
.timeline-item::before {
  content: none;
}

.draw-toolbar,
.toolbar.compact,
.stats-table-wrap,
.draw-hint,
.direction-story,
.status,
.homepage-qr,
.public-section-head p:not(.eyebrow) {
  background-color: #f4e6ca;
  box-shadow: none;
}

button,
.button,
.edit-again-button,
.result-download-button,
#page-public .public-download-button {
  border: 1px solid transparent;
  border-radius: .65rem;
  background: #8f4b27;
  background-image: none;
  box-shadow: none;
}

button:hover,
.button:hover,
.edit-again-button:hover,
.result-download-button:hover,
#page-public .public-download-button:hover {
  background: #743b1f;
  background-image: none;
  box-shadow: none;
}

button.secondary,
.button.secondary,
.style-button,
.source-download-button,
button.secondary:disabled:hover {
  border-color: #c5a875;
  background: #efe0c3;
  background-image: none;
  color: #2a1a10;
  box-shadow: none;
}

button:disabled:hover {
  background: #8f4b27;
  background-image: none;
  box-shadow: none;
}

#page-draw .category-hero,
#page-public .public-section-head {
  border-bottom: 1px solid rgba(151, 87, 44, .22);
}

#page-draw .category-hero {
  padding: .7rem .85rem 1rem;
}

#page-draw .category-hero::before,
#page-draw .draw-card .section-head::after,
#page-draw .draw-hint::after,
#page-draw .status::after,
#page-draw .draw-toolbar::before,
#page-draw .draw-toolbar::after,
#page-draw .generation-orbit::before,
#page-public .public-section-head::after,
#page-public .direction-story::after,
#page-public .homepage-qr::before {
  content: none;
}

#page-draw .draw-card .section-head,
#page-draw .result-card > h2 {
  padding-bottom: .35rem;
}

#page-draw .draw-hint,
#page-draw .status,
#page-public .direction-story {
  padding-right: 1rem;
}

#page-draw .draw-toolbar {
  overflow: visible;
  padding-top: .7rem;
}

.draw-canvas-frame {
  max-width: 778px;
  padding: 4px;
  border: 1px solid #9c7140;
  border-radius: 1rem;
  background: #d7bd8c;
  box-shadow: 0 .7rem 1.8rem rgba(41, 24, 14, .14);
}

.draw-canvas-frame::before,
.draw-canvas-frame::after {
  width: 2rem;
  height: 2rem;
  opacity: .16;
}

#draw-canvas,
.public-image-stage,
.result-preview-stage {
  outline: 0;
}

#page-draw .result-preview-stage:not(.generating) {
  background: #17130f;
}

.generation-visual,
.public-empty-state,
.result-preview-stage.generating {
  background: radial-gradient(circle at center, rgba(57, 116, 96, .16), transparent 58%), #17130f;
}

#page-draw #result-actions {
  padding-top: 0;
  background: none;
}

#page-public .public-section-head {
  overflow: visible;
  padding: .55rem .65rem .75rem;
}

#page-public .live-badge {
  padding-left: .72rem;
  background: #e1f0e8;
  background-image: none;
}

#page-public .public-art-panel {
  padding: .55rem;
  border: 1px solid #b99763;
  border-radius: .85rem;
  background: #f7ecd8;
  box-shadow: none;
}

#page-public .public-art-panel figcaption {
  min-height: 2.8rem;
  margin-bottom: .5rem;
  border-bottom: 1px solid rgba(151, 87, 44, .22);
  padding: .3rem .35rem .5rem;
  background: none;
}

#page-public .public-source-panel,
#page-public .public-result-panel {
  background: #f7ecd8;
}

#page-public .public-image-stage {
  border: 2px solid #907044;
  border-radius: .75rem;
  box-shadow: inset 0 0 0 1px rgba(255, 232, 184, .08), 0 .65rem 1.5rem rgba(30, 17, 8, .14);
}

#page-public .public-source-panel .public-image-stage {
  border-color: #65766d;
}

#page-public .public-result-panel .public-image-stage {
  border-color: #9c7140;
}

#page-public .public-image-stage::before,
#page-public .public-image-stage::after {
  content: "";
  position: absolute;
  z-index: 2;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 0;
  background: url("/assets/sanxingdui-corner.svg") center / contain no-repeat;
  opacity: .14;
  pointer-events: none;
}

#page-public .public-image-stage::before {
  inset: auto auto .35rem .35rem;
}

#page-public .public-image-stage::after {
  top: .35rem;
  right: .35rem;
  transform: rotate(180deg);
}

#page-public .public-source-stage,
#page-public .public-result-panel .public-image-stage {
  background-image: none;
  background-color: #080706;
}

#page-public .public-image-stage .result-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

#page-public .public-update-line {
  border-bottom: 1px solid rgba(151, 87, 44, .2);
  padding-bottom: .65rem;
  background: none;
}

#page-public .homepage-qr {
  overflow: visible;
  padding: 1rem;
}

#page-public .qr {
  outline: 1px solid rgba(43, 105, 88, .2);
  outline-offset: 2px;
}

@media (max-width: 900px) {
  body::before {
    opacity: .07;
    background-position: center 9rem;
    background-size: 42rem 42rem;
  }
  #page-draw .category-hero,
  #page-public .public-section-head {
    background: rgba(255, 250, 238, .45);
  }
  .draw-canvas-frame {
    max-width: 100%;
    padding: 3px;
    border-radius: .85rem;
    background: #d7bd8c;
  }
  .draw-canvas-frame::before,
  .draw-canvas-frame::after,
  #page-public .public-image-stage::before,
  #page-public .public-image-stage::after {
    width: 1.4rem;
    height: 1.4rem;
    opacity: .09;
  }
  #page-public .public-art-panel {
    padding: .4rem;
    border-radius: .72rem;
  }
  #page-public .public-art-panel figcaption {
    min-height: 2.55rem;
    padding-right: .25rem;
    background: none;
  }
}

/* 克制版：纹样只作为识别符号和作品边框，不再铺满操作区与背景。 */
body {
  background:
    radial-gradient(circle at 16% 0%, rgba(214, 180, 119, .24), transparent 28rem),
    radial-gradient(circle at 88% 10%, rgba(42, 94, 79, .14), transparent 26rem),
    linear-gradient(145deg, #2b2118, #c5ab78 52%, #203f36);
}

body::before {
  opacity: .12;
  background-image: url("/assets/sanxingdui-page.svg");
  background-position: center 6rem;
  background-size: min(62rem, 86vw) min(62rem, 86vw);
  background-repeat: no-repeat;
}

body::after {
  opacity: .08;
}

.topbar {
  background: rgba(29, 49, 42, .94);
}

.category-panel,
.draw-card,
.result-card,
.public-preview-card,
#page-history > .card,
#page-stats > .card,
#page-admin > .card,
.public-info-card {
  background: linear-gradient(180deg, #fffaf0, #eee0c4);
}

.category-panel::before,
.category-panel::after,
.draw-card::before,
.result-card::before,
.public-preview-card::after,
.public-info-card::before,
.public-info-card::after,
#page-history > .card::before,
#page-stats > .card::before,
#page-admin > .card::before {
  content: none;
}

.category-grid,
.history-grid,
.stats-grid,
.chart-grid {
  padding-top: 0;
  background: none;
}

.category-card,
.history-item,
.stat-card,
.chart-card,
.timeline-item,
.draw-toolbar,
.toolbar.compact,
.stats-table-wrap,
.draw-hint,
.direction-story,
.status,
.homepage-qr,
.public-section-head p:not(.eyebrow),
input,
select {
  background-image: none;
}

.category-card,
.history-item,
.stat-card,
.chart-card,
.timeline-item {
  background-color: #f8ecd5;
}

.category-card::before,
.history-item::before,
.stat-card::before,
.chart-card::before,
.timeline-item::before {
  content: none;
}

.draw-toolbar,
.toolbar.compact,
.stats-table-wrap,
.draw-hint,
.direction-story,
.status,
.homepage-qr,
.public-section-head p:not(.eyebrow) {
  background-color: #f4e6ca;
  box-shadow: none;
}

button,
.button,
.edit-again-button,
.result-download-button,
#page-public .public-download-button {
  border: 1px solid transparent;
  border-radius: .65rem;
  background: #8f4b27;
  background-image: none;
  box-shadow: none;
  transition: background-color .15s ease, border-color .15s ease, transform .15s ease;
}

button:hover,
.button:hover,
.edit-again-button:hover,
.result-download-button:hover,
#page-public .public-download-button:hover {
  background: #743b1f;
  background-image: none;
  box-shadow: none;
}

button.secondary,
.button.secondary,
.style-button,
.source-download-button {
  border-color: #c5a875;
  background: #efe0c3;
  background-image: none;
  color: #2a1a10;
  box-shadow: none;
}

button.secondary:hover,
.button.secondary:hover,
.style-button:hover,
.source-download-button:hover {
  background: #e3cfaa;
  background-image: none;
  color: #2a1a10;
  box-shadow: none;
}

button:disabled:hover {
  background: #8f4b27;
  background-image: none;
  box-shadow: none;
}

button.secondary:disabled:hover {
  background: #efe0c3;
}

#page-draw .category-hero,
#page-public .public-section-head {
  border-bottom: 1px solid rgba(151, 87, 44, .22);
}

#page-draw .category-hero {
  padding: .7rem .85rem 1rem;
}

#page-draw .category-hero::before,
#page-draw .draw-card .section-head::after,
#page-draw .draw-hint::after,
#page-draw .status::after,
#page-draw .draw-toolbar::before,
#page-draw .draw-toolbar::after,
#page-draw .generation-orbit::before,
#page-public .public-section-head::after,
#page-public .direction-story::after,
#page-public .homepage-qr::before {
  content: none;
}

#page-draw .draw-card .section-head,
#page-draw .result-card > h2 {
  padding-bottom: .35rem;
}

#page-draw .draw-hint,
#page-draw .status,
#page-public .direction-story {
  padding-right: 1rem;
}

#page-draw .draw-toolbar {
  padding-top: .7rem;
  overflow: visible;
}

.draw-canvas-frame {
  max-width: 778px;
  padding: 4px;
  border: 1px solid #9c7140;
  border-radius: 1rem;
  background: #d7bd8c;
  box-shadow: 0 .7rem 1.8rem rgba(41, 24, 14, .14);
}

.draw-canvas-frame::before,
.draw-canvas-frame::after {
  width: 2rem;
  height: 2rem;
  opacity: .16;
}

.draw-canvas-frame::before {
  left: .3rem;
  bottom: .3rem;
}

.draw-canvas-frame::after {
  right: .3rem;
  top: .3rem;
}

#draw-canvas,
.public-image-stage,
.result-preview-stage {
  outline: 0;
}

#page-draw .result-preview-stage:not(.generating) {
  background: #17130f;
}

.generation-visual,
.public-empty-state,
.result-preview-stage.generating {
  background:
    radial-gradient(circle at center, rgba(57, 116, 96, .16), transparent 58%),
    #17130f;
}

#page-draw #result-actions {
  padding-top: 0;
  background: none;
}

#page-public .public-section-head {
  overflow: visible;
  padding: .55rem .65rem .75rem;
}

#page-public .live-badge {
  padding-left: .72rem;
  background: #e1f0e8;
  background-image: none;
}

#page-public .public-art-panel {
  padding: .55rem;
  border: 1px solid #b99763;
  border-radius: .85rem;
  background: #f7ecd8;
  box-shadow: none;
}

#page-public .public-art-panel figcaption {
  min-height: 2.8rem;
  margin-bottom: .5rem;
  border-bottom: 1px solid rgba(151, 87, 44, .22);
  padding: .3rem .35rem .5rem;
  background: none;
}

#page-public .public-source-panel,
#page-public .public-result-panel {
  background: #f7ecd8;
}

#page-public .public-image-stage {
  border: 2px solid #907044;
  border-radius: .75rem;
  box-shadow: inset 0 0 0 1px rgba(255, 232, 184, .08), 0 .65rem 1.5rem rgba(30, 17, 8, .14);
}

#page-public .public-source-panel .public-image-stage {
  border-color: #65766d;
}

#page-public .public-result-panel .public-image-stage {
  border-color: #9c7140;
}

#page-public .public-image-stage::before,
#page-public .public-image-stage::after {
  content: "";
  position: absolute;
  z-index: 2;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 0;
  background: url("/assets/sanxingdui-corner.svg") center / contain no-repeat;
  opacity: .14;
  pointer-events: none;
}

#page-public .public-image-stage::before {
  inset: auto auto .35rem .35rem;
}

#page-public .public-image-stage::after {
  top: .35rem;
  right: .35rem;
  transform: rotate(180deg);
}

#page-public .public-source-stage,
#page-public .public-result-panel .public-image-stage {
  background-image: none;
  background-color: #080706;
}

#page-public .public-image-stage .result-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

#page-public .direction-story {
  overflow: visible;
}

#page-public .public-update-line {
  border-bottom: 1px solid rgba(151, 87, 44, .2);
  padding-bottom: .65rem;
  background: none;
}

#page-public .homepage-qr {
  overflow: visible;
  padding: 1rem;
}

#page-public .qr {
  outline: 1px solid rgba(43, 105, 88, .2);
  outline-offset: 2px;
}

@media (max-width: 900px) {
  body::before {
    opacity: .08;
    background-position: center 9rem;
    background-size: 42rem 42rem;
  }
  #page-draw .category-hero {
    padding: .55rem .65rem .75rem;
    background: rgba(255, 250, 238, .45);
  }
  .draw-canvas-frame {
    max-width: 100%;
    padding: 3px;
    border-radius: .85rem;
    background: #d7bd8c;
  }
  .draw-canvas-frame::before,
  .draw-canvas-frame::after,
  #page-public .public-image-stage::before,
  #page-public .public-image-stage::after {
    width: 1.4rem;
    height: 1.4rem;
    opacity: .1;
  }
  #page-public .public-section-head {
    padding: .45rem .5rem .6rem;
    background: rgba(255, 250, 238, .45);
  }
  #page-public .public-art-panel {
    padding: .4rem;
    border-radius: .72rem;
  }
  #page-public .public-art-panel figcaption {
    min-height: 2.55rem;
    padding-right: .25rem;
  }
}

@media (max-width: 640px) {
  .public-compare-grid {
    grid-template-columns: 1fr;
  }
  .public-source-panel {
    width: 100%;
    justify-self: stretch;
  }
}

/* 三星堆青铜、金箔与朱砂色构成的原创纹样系统。 */
body::before {
  opacity: .42;
  background-image:
    url("/assets/sanxingdui-page.svg"),
    url("/assets/sanxingdui-border.svg"),
    linear-gradient(90deg, rgba(255,255,255,.055) 1px, transparent 1px),
    linear-gradient(rgba(255,255,255,.055) 1px, transparent 1px);
  background-position: center 4rem, center top, 0 0, 0 0;
  background-size: min(78rem, 94vw) min(78rem, 94vw), 50rem 4.5rem, 34px 34px, 34px 34px;
  background-repeat: no-repeat, repeat-x, repeat, repeat;
}

.topbar {
  background-image:
    linear-gradient(90deg, rgba(23, 19, 14, .92), rgba(29, 59, 50, .88)),
    url("/assets/sanxingdui-border.svg");
  background-position: center, center bottom;
  background-size: auto, 50rem 3.2rem;
  background-repeat: no-repeat, repeat-x;
}

.topbar > div,
.section-head > div,
.public-info-card > div:first-child {
  min-width: 0;
}

.topbar h1,
.card h2 {
  position: relative;
  z-index: 0;
  width: fit-content;
  max-width: 100%;
  min-height: 2.75rem;
  margin-left: 0;
  padding: .58rem 3.4rem .62rem 1.05rem;
  color: #fff0c3;
  font-family: "STKaiti", "KaiTi", "FangSong", "Microsoft YaHei", sans-serif;
  font-weight: 800;
  line-height: 1.25;
  text-shadow: 0 2px 10px rgba(6, 17, 14, .7);
  letter-spacing: .045em;
  overflow-wrap: anywhere;
  isolation: isolate;
}

.topbar h1::before,
.card h2::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  border: 1px solid rgba(226, 184, 105, .68);
  border-radius: .62rem 1.3rem .62rem .62rem;
  background:
    linear-gradient(100deg, rgba(20, 55, 47, .98), rgba(44, 90, 75, .92) 76%, rgba(146, 75, 36, .9));
  box-shadow: inset 0 0 0 3px rgba(248, 220, 158, .08), 0 .45rem 1rem rgba(40, 23, 13, .16);
}

.topbar h1::after,
.card h2::after {
  content: "";
  position: absolute;
  right: .45rem;
  top: 50%;
  z-index: -1;
  width: 2.25rem;
  height: 2.25rem;
  background: url("/assets/sanxingdui-sunwheel.svg") center / contain no-repeat;
  transform: translateY(-50%);
}

.topbar h1 {
  min-height: 2.5rem;
  margin-bottom: .5rem;
  padding-top: .48rem;
  padding-bottom: .2rem;
  font-size: clamp(2.5rem, 1.8vw, 1.42rem);
}

.category-panel,
.draw-card,
.result-card,
.public-preview-card,
#page-history > .card,
#page-stats > .card,
#page-admin > .card {
  position: relative;
  isolation: isolate;
  background-image:
    linear-gradient(180deg, rgba(255, 252, 244, .965), rgba(239, 219, 181, .965)),
    url("/assets/sanxingdui-page.svg");
  background-position: center, right -12rem bottom -14rem;
  background-size: auto, 38rem 38rem;
  background-repeat: no-repeat;
}

.category-panel::before,
.draw-card::before,
.result-card::before,
.public-preview-card::after,
#page-history > .card::before,
#page-stats > .card::before,
#page-admin > .card::before {
  content: "";
  position: absolute;
  right: .3rem;
  bottom: .3rem;
  z-index: -1;
  width: clamp(8rem, 16vw, 13rem);
  aspect-ratio: 1;
  background: url("/assets/sanxingdui-corner.svg") right bottom / contain no-repeat;
  opacity: .34;
  pointer-events: none;
}

.category-panel::before,
#page-history > .card::before,
#page-admin > .card::before {
  right: auto;
  left: .3rem;
  transform: scaleX(-1);
}

.category-panel::after {
  right: -1.5rem;
  bottom: -3.5rem;
  z-index: -1;
  width: 10rem;
  height: 22rem;
  background: url("/assets/sanxingdui-tree.svg") center / contain no-repeat;
  border: 0;
  border-radius: 0;
  opacity: .12;
}

.public-info-card {
  background-image:
    linear-gradient(165deg, rgba(255, 252, 244, .97), rgba(229, 207, 165, .96)),
    url("/assets/sanxingdui-tree.svg");
  background-position: center, right -1.8rem bottom -4rem;
  background-size: auto, 10rem auto;
  background-repeat: no-repeat;
}

.category-grid,
.history-grid,
.stats-grid,
.chart-grid {
  padding-top: 1.15rem;
  background: url("/assets/sanxingdui-border.svg") center top / 40rem 3.6rem repeat-x;
}

.category-card,
.history-item,
.stat-card,
.chart-card,
.timeline-item {
  position: relative;
  overflow: hidden;
  background-image:
    linear-gradient(rgba(255, 249, 235, .92), rgba(236, 213, 169, .94)),
    url("/assets/sanxingdui-texture.svg");
  background-position: center;
  background-size: cover;
}

.category-card::before,
.stat-card::before,
.history-item::before,
.chart-card::before,
.timeline-item::before {
  content: "";
  position: absolute;
  right: -.9rem;
  top: -.8rem;
  width: 5.6rem;
  height: 5.6rem;
  background: url("/assets/sanxingdui-sunwheel.svg") center / contain no-repeat;
  opacity: .16;
  pointer-events: none;
}

.category-card:nth-child(3n + 2)::before,
.history-item:nth-child(3n + 2)::before,
.stat-card:nth-child(3n + 2)::before {
  width: 6.6rem;
  height: 4.6rem;
  background-image: url("/assets/sanxingdui-bird.svg");
  opacity: .2;
}

.category-card:nth-child(3n)::before,
.history-item:nth-child(3n)::before,
.stat-card:nth-child(3n)::before {
  width: 6.1rem;
  height: 4.8rem;
  background-image: url("/assets/sanxingdui-mask.svg");
  opacity: .18;
}

.category-card > *,
.history-item > *,
.stat-card > *,
.chart-card > *,
.timeline-item > * {
  position: relative;
  z-index: 1;
}

.category-card:hover {
  background-image:
    linear-gradient(rgba(255, 252, 240, .9), rgba(228, 196, 139, .94)),
    url("/assets/sanxingdui-texture.svg");
  background-position: center;
  background-size: cover;
}

.draw-toolbar,
.toolbar.compact,
.stats-table-wrap {
  border: 1px solid rgba(151, 87, 44, .28);
  background-image:
    linear-gradient(rgba(255, 248, 231, .91), rgba(236, 214, 173, .92)),
    url("/assets/sanxingdui-texture.svg");
  background-position: center;
  background-size: cover;
}

.toolbar.compact {
  border-radius: .9rem;
  padding: .5rem .65rem;
}

button,
.button {
  background-image:
    linear-gradient(135deg, rgba(185, 105, 49, .96), rgba(124, 62, 29, .97)),
    url("/assets/sanxingdui-texture.svg");
  background-position: center;
  background-size: cover;
}

button:hover,
.button:hover {
  background-image:
    linear-gradient(135deg, rgba(202, 123, 59, .95), rgba(137, 69, 32, .97)),
    url("/assets/sanxingdui-texture.svg");
}

button.secondary,
.button.secondary,
.style-button {
  background-image:
    linear-gradient(rgba(245, 231, 201, .94), rgba(226, 201, 155, .95)),
    url("/assets/sanxingdui-texture.svg");
  background-position: center;
  background-size: cover;
}

input,
select {
  background-image:
    linear-gradient(rgba(255, 251, 240, .92), rgba(240, 222, 185, .94)),
    url("/assets/sanxingdui-texture.svg");
  background-position: center;
  background-size: cover;
}

.draw-hint,
.direction-story,
.status,
.homepage-qr,
.public-section-head p:not(.eyebrow) {
  position: relative;
  border-color: rgba(142, 78, 38, .36);
  background-image:
    linear-gradient(rgba(255, 250, 237, .9), rgba(238, 215, 174, .92)),
    url("/assets/sanxingdui-texture.svg");
  background-position: center;
  background-size: cover;
  box-shadow: inset 0 0 0 1px rgba(255, 248, 224, .5);
}

.draw-hint {
  border: 1px solid rgba(142, 78, 38, .32);
  border-left: 5px solid #9f542b;
  border-radius: .7rem;
  padding: .72rem 1rem;
}

.public-section-head p:not(.eyebrow) {
  max-width: 46rem;
  border: 1px solid rgba(142, 78, 38, .24);
  border-radius: .65rem;
  padding: .48rem .7rem;
}

.generation-visual,
.public-empty-state,
.result-preview-stage.generating {
  background-image:
    radial-gradient(circle at center, rgba(192, 128, 57, .22), transparent 28%),
    linear-gradient(rgba(16, 38, 32, .76), rgba(13, 26, 23, .88)),
    url("/assets/sanxingdui-page.svg");
  background-position: center;
  background-size: auto, auto, min(34rem, 90%) min(34rem, 90%);
  background-repeat: no-repeat;
}

.public-art-panel {
  border: 1px solid rgba(151, 87, 44, .24);
  border-radius: 1rem;
  padding: .72rem;
  background:
    linear-gradient(rgba(255, 249, 235, .92), rgba(232, 207, 161, .92)),
    url("/assets/sanxingdui-texture.svg") center / cover;
}

.public-image-stage,
.result-preview-stage,
#draw-canvas {
  outline: .35rem solid rgba(222, 179, 105, .12);
  outline-offset: -.55rem;
}

.public-image-stage::before,
.result-preview-stage::before {
  content: "";
  position: absolute;
  inset: .5rem;
  z-index: 2;
  border: 1px solid rgba(225, 184, 111, .24);
  border-radius: .72rem;
  background:
    url("/assets/sanxingdui-corner.svg") left top / 5rem 5rem no-repeat,
    url("/assets/sanxingdui-corner.svg") right bottom / 5rem 5rem no-repeat;
  opacity: .5;
  pointer-events: none;
}

.result-preview-stage::before {
  z-index: 3;
}

.stats-table {
  background: rgba(255, 249, 235, .72);
}

.stats-table th {
  background:
    linear-gradient(rgba(32, 81, 69, .94), rgba(20, 55, 47, .94)),
    url("/assets/sanxingdui-border.svg") center / 24rem 2.4rem;
  color: #f5d99a;
}

.live-badge,
.submit-cooldown,
.timeline-limit-note {
  background-image:
    linear-gradient(rgba(232, 242, 232, .9), rgba(201, 224, 210, .92)),
    url("/assets/sanxingdui-texture.svg");
  background-position: center;
  background-size: cover;
}

.timeline-limit-note {
  border: 1px solid rgba(38, 115, 91, .24);
  border-radius: 999px;
  padding: .38rem .65rem;
}

.toast {
  border-color: rgba(151, 87, 44, .34);
  background-image:
    linear-gradient(rgba(255, 248, 231, .94), rgba(238, 214, 172, .96)),
    url("/assets/sanxingdui-texture.svg");
  background-position: center;
  background-size: cover;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .48rem;
  color: #7c3e1d;
}

.eyebrow::before {
  content: "";
  width: 1.15rem;
  height: 1.15rem;
  flex: 0 0 auto;
  background: url("/assets/sanxingdui-sunwheel.svg") center / contain no-repeat;
}

.category-card h3,
.chart-card h3,
.public-art-panel figcaption strong,
.timeline-head h3 {
  color: #3f2416;
  font-family: "STKaiti", "KaiTi", "FangSong", "Microsoft YaHei", sans-serif;
  letter-spacing: .04em;
}

.chart-card h3,
.timeline-head h3 {
  width: fit-content;
  max-width: 100%;
  border-bottom: 3px double rgba(157, 83, 39, .58);
  padding: .3rem 3rem .4rem .2rem;
  background: url("/assets/sanxingdui-bird.svg") right center / 2.8rem 2rem no-repeat;
}

.category-mark {
  border-radius: .45rem;
  background: url("/assets/sanxingdui-mask.svg") center / contain no-repeat;
}

.public-empty-mark {
  background:
    url("/assets/sanxingdui-mask.svg") center / 78% auto no-repeat,
    radial-gradient(circle, rgba(216, 167, 90, .22), transparent 68%);
  box-shadow:
    0 0 0 1px rgba(166, 90, 42, .36),
    0 0 0 6px rgba(38, 115, 91, .08),
    0 12px 28px rgba(82, 46, 24, .18);
}

@media (max-width: 900px) {
  body::before {
    opacity: .32;
    background-position: center 8rem, center top, 0 0, 0 0;
    background-size: 46rem 46rem, 38rem 3.4rem, 34px 34px, 34px 34px;
  }
  .topbar h1,
  .card h2 {
    min-height: 2.4rem;
    margin-left: 0;
    padding: .48rem 2.8rem .52rem .8rem;
    font-size: 1.2rem;
    letter-spacing: .02em;
  }
  .topbar h1 {
    font-size: 1rem;
  }
  .topbar h1::after,
  .card h2::after {
    right: .35rem;
    width: 1.9rem;
    height: 1.9rem;
  }
  .category-panel,
  .draw-card,
  .result-card,
  .public-preview-card,
  #page-history > .card,
  #page-stats > .card,
  #page-admin > .card {
    background-position: center, right -11rem bottom -12rem;
    background-size: auto, 29rem 29rem;
  }
  .category-panel::before,
  .draw-card::before,
  .result-card::before,
  .public-preview-card::after,
  #page-history > .card::before,
  #page-stats > .card::before,
  #page-admin > .card::before {
    width: 7.5rem;
    opacity: .22;
  }
  .category-grid,
  .history-grid,
  .stats-grid,
  .chart-grid {
    padding-top: .85rem;
    background-size: 32rem 2.8rem;
  }
  .public-art-panel {
    padding: .55rem;
  }
}

@media (max-width: 420px) {
  .topbar h1,
  .card h2 {
    width: 100%;
    padding-right: 2.65rem;
  }
  .topbar h1::before,
  .card h2::before {
    border-radius: .58rem;
  }
  .chart-card h3,
  .timeline-head h3 {
    padding-right: 2.4rem;
    background-size: 2.2rem 1.6rem;
  }
}

/* 绘制页与公共展示页使用更密集、分区明确的纹样层。 */
#page-draw .category-hero,
#page-draw .draw-card .section-head,
#page-draw .result-card > h2,
#page-public .public-section-head,
#page-public .public-info-card > div:first-child {
  position: relative;
}

#page-draw .category-hero {
  border-bottom: 1px solid rgba(151, 87, 44, .22);
  padding: .8rem 1rem 2rem;
  background:
    url("/assets/sanxingdui-cloud.svg") center bottom / 100% 3rem no-repeat,
    linear-gradient(100deg, rgba(255, 249, 235, .76), rgba(225, 204, 163, .48));
}

#page-draw .category-hero::before {
  content: "";
  position: absolute;
  left: 52%;
  bottom: -.35rem;
  width: min(34rem, 65%);
  height: 2.2rem;
  background: url("/assets/sanxingdui-eyes.svg") center / contain no-repeat;
  opacity: .28;
  transform: translateX(-50%);
  pointer-events: none;
}

#page-draw .category-hero > div:first-child {
  position: relative;
  z-index: 1;
}

#page-draw .bronze-orbit {
  border-color: rgba(225, 185, 111, .62);
  background:
    url("/assets/sanxingdui-spiral.svg") center / 78% 78% no-repeat,
    radial-gradient(circle at 46% 35%, #c68945, #432411 62%, #15100c);
}

#page-draw .bronze-orbit span,
#page-draw .bronze-orbit::before,
#page-draw .bronze-orbit::after {
  opacity: .36;
}

#page-draw .category-card:nth-child(4n + 1) .category-mark {
  background-image: url("/assets/sanxingdui-mask.svg");
}

#page-draw .category-card:nth-child(4n + 2) .category-mark {
  background-image: url("/assets/sanxingdui-bird.svg");
}

#page-draw .category-card:nth-child(4n + 3) .category-mark {
  background-image: url("/assets/sanxingdui-crown.svg");
}

#page-draw .category-card:nth-child(4n) .category-mark {
  background-image: url("/assets/sanxingdui-spiral.svg");
}

#page-draw .category-card .category-mark {
  background-position: center;
  background-size: contain;
  background-repeat: no-repeat;
}

#page-draw .draw-card .section-head,
#page-draw .result-card > h2 {
  padding-bottom: 1rem;
}

#page-draw .draw-card .section-head::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: .95rem;
  border: 0;
  border-radius: 0;
  background: url("/assets/sanxingdui-fangs.svg") center / 32rem 4.6rem repeat-x;
  box-shadow: none;
  opacity: .46;
  pointer-events: none;
}

#page-draw .result-card > h2 {
  margin-bottom: .75rem;
}

#page-draw .draw-hint,
#page-draw .status {
  padding-right: 3.4rem;
}

#page-draw .draw-hint::after,
#page-draw .status::after {
  content: "";
  position: absolute;
  right: .55rem;
  top: 50%;
  width: 2.15rem;
  height: 2.15rem;
  background: url("/assets/sanxingdui-spiral.svg") center / contain no-repeat;
  opacity: .46;
  transform: translateY(-50%);
  pointer-events: none;
}

#page-draw .status::after {
  background-image: url("/assets/sanxingdui-eyes.svg");
  background-size: contain;
}

#page-draw .draw-toolbar {
  position: relative;
  overflow: hidden;
  padding-top: 1.3rem;
}

#page-draw .draw-toolbar::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: .72rem;
  background: url("/assets/sanxingdui-river.svg") center / 31rem 4.5rem repeat-x;
  opacity: .62;
  pointer-events: none;
}

#page-draw .draw-toolbar::after {
  content: "";
  position: absolute;
  right: -.45rem;
  bottom: -.8rem;
  width: 5.5rem;
  height: 4rem;
  background: url("/assets/sanxingdui-bird.svg") center / contain no-repeat;
  opacity: .13;
  pointer-events: none;
}

#page-draw .draw-toolbar > * {
  position: relative;
  z-index: 1;
}

.draw-canvas-frame {
  position: relative;
  width: 100%;
  max-width: 768px;
  padding: .6rem;
  border: 1px solid rgba(218, 174, 99, .56);
  border-radius: 1.35rem;
  background:
    url("/assets/sanxingdui-fangs.svg") center top / 34rem 3.4rem repeat-x,
    linear-gradient(145deg, #173d34, #8f4b28 55%, #d0a052);
  box-shadow: 0 18px 45px rgba(30, 17, 8, .26);
}

.draw-canvas-frame::before,
.draw-canvas-frame::after {
  content: "";
  position: absolute;
  z-index: 2;
  width: 4.6rem;
  height: 4.6rem;
  background: url("/assets/sanxingdui-corner.svg") center / contain no-repeat;
  opacity: .7;
  pointer-events: none;
}

.draw-canvas-frame::before {
  left: .35rem;
  bottom: .35rem;
}

.draw-canvas-frame::after {
  right: .35rem;
  top: .35rem;
  transform: rotate(180deg);
}

.draw-canvas-frame #draw-canvas {
  display: block;
}

#page-draw .result-preview-stage:not(.generating) {
  background-image:
    linear-gradient(rgba(13, 23, 20, .2), rgba(13, 23, 20, .4)),
    url("/assets/sanxingdui-eyes.svg"),
    radial-gradient(circle at center, rgba(46, 105, 88, .22), transparent 68%);
  background-position: center, center 1.2rem, center;
  background-size: auto, min(28rem, 82%) auto, auto;
  background-repeat: no-repeat;
}

#page-draw .generation-orbit::before {
  content: "";
  position: absolute;
  inset: 2.45rem;
  background: url("/assets/sanxingdui-mask.svg") center / contain no-repeat;
  opacity: .28;
}

#page-draw #result-actions {
  position: relative;
  padding-top: 1rem;
  background: url("/assets/sanxingdui-river.svg") center top / 30rem 3.5rem repeat-x;
}

#page-public .public-section-head {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid rgba(151, 87, 44, .24);
  padding: .65rem .75rem 1.45rem;
}

#page-public .public-section-head::after {
  content: "";
  position: absolute;
  right: 6.6rem;
  bottom: -.15rem;
  width: min(22rem, 38%);
  height: 2.5rem;
  background: url("/assets/sanxingdui-bird.svg") right center / contain no-repeat;
  opacity: .2;
  pointer-events: none;
}

#page-public .live-badge {
  padding-left: 2.35rem;
  background-image:
    url("/assets/sanxingdui-crown.svg"),
    linear-gradient(rgba(232, 242, 232, .92), rgba(201, 224, 210, .94)),
    url("/assets/sanxingdui-texture.svg");
  background-position: .45rem center, center, center;
  background-size: 1.55rem 1.2rem, auto, cover;
  background-repeat: no-repeat;
}

#page-public .public-art-panel figcaption {
  min-height: 3.15rem;
  border-bottom: 1px solid rgba(151, 87, 44, .25);
  padding: .35rem 3.2rem .55rem .35rem;
  background: url("/assets/sanxingdui-crown.svg") right center / 2.7rem 2rem no-repeat;
}

#page-public .public-source-panel {
  background-image:
    linear-gradient(rgba(255, 249, 235, .93), rgba(225, 205, 165, .94)),
    url("/assets/sanxingdui-eyes.svg"),
    url("/assets/sanxingdui-texture.svg");
  background-position: center, center bottom .8rem, center;
  background-size: auto, 88% auto, cover;
  background-repeat: no-repeat;
}

#page-public .public-result-panel {
  background-image:
    linear-gradient(rgba(255, 249, 235, .93), rgba(226, 205, 163, .94)),
    url("/assets/sanxingdui-sunwheel.svg"),
    url("/assets/sanxingdui-texture.svg");
  background-position: center, left .8rem bottom .7rem, center;
  background-size: auto, 4rem 4rem, cover;
  background-repeat: no-repeat;
}

#page-public .public-image-stage::before {
  background:
    url("/assets/sanxingdui-corner.svg") left top / 5rem 5rem no-repeat,
    url("/assets/sanxingdui-corner.svg") right bottom / 5rem 5rem no-repeat,
    url("/assets/sanxingdui-fangs.svg") center bottom / 26rem 3.7rem repeat-x;
}

#page-public .public-source-stage {
  background-image:
    linear-gradient(135deg, rgba(255, 227, 174, .05), transparent 42%),
    url("/assets/sanxingdui-eyes.svg"),
    radial-gradient(circle at 50% 45%, rgba(255, 255, 255, .065), transparent 42%);
  background-position: center, center 1rem, center;
  background-size: auto, 78% auto, auto;
  background-repeat: no-repeat;
  background-color: #050403;
}

#page-public .public-result-panel .public-image-stage {
  background-image:
    radial-gradient(circle at center, rgba(198, 137, 70, .12), transparent 62%),
    url("/assets/sanxingdui-spiral.svg");
  background-position: center;
  background-size: auto, min(19rem, 48%) min(19rem, 48%);
  background-repeat: no-repeat;
  background-color: #100d0a;
}

#page-public .public-info-card::before {
  content: "";
  position: absolute;
  top: 5.5rem;
  left: -.7rem;
  z-index: 0;
  width: 5.8rem;
  height: 4.2rem;
  background: url("/assets/sanxingdui-bird.svg") center / contain no-repeat;
  opacity: .13;
  pointer-events: none;
}

#page-public .direction-story {
  overflow: hidden;
  padding-right: 3.9rem;
}

#page-public .direction-story::after {
  content: "";
  position: absolute;
  right: -.35rem;
  bottom: -.6rem;
  width: 4rem;
  height: 4.6rem;
  background: url("/assets/sanxingdui-altar.svg") center / contain no-repeat;
  opacity: .26;
  pointer-events: none;
}

#page-public .public-update-line {
  border-bottom: 0;
  padding-bottom: .85rem;
  background: url("/assets/sanxingdui-river.svg") center bottom / 21rem 2.8rem repeat-x;
}

#page-public .public-download-button {
  border: 1px solid rgba(235, 202, 135, .34);
  background-image:
    url("/assets/sanxingdui-fangs.svg"),
    linear-gradient(135deg, #d08a32, #8c461d);
  background-position: center bottom, center;
  background-size: 22rem 3rem, auto;
  background-repeat: repeat-x, no-repeat;
}

#page-public .homepage-qr {
  overflow: hidden;
  padding-left: 3.3rem;
}

#page-public .homepage-qr::before {
  content: "";
  position: absolute;
  left: .35rem;
  bottom: .25rem;
  width: 3rem;
  height: 4rem;
  background: url("/assets/sanxingdui-altar.svg") center / contain no-repeat;
  opacity: .42;
  pointer-events: none;
}

#page-public .qr {
  outline: .35rem double rgba(43, 105, 88, .28);
  outline-offset: .18rem;
}

@media (max-width: 900px) {
  #page-draw .category-hero {
    padding: .55rem .65rem 1.55rem;
    background-size: 42rem 2.4rem, auto;
  }
  #page-draw .category-hero::before {
    width: 78%;
    height: 1.6rem;
  }
  #page-draw .draw-card .section-head,
  #page-draw .result-card > h2 {
    padding-bottom: .75rem;
  }
  #page-draw .draw-card .section-head::after {
    height: .68rem;
    background-size: 24rem 3.4rem;
  }
  #page-draw .draw-toolbar {
    padding-top: 1rem;
  }
  #page-draw .draw-toolbar::before {
    height: .5rem;
    background-size: 24rem 3.2rem;
  }
  .draw-canvas-frame {
    order: 2;
    padding: .42rem;
    border-radius: 1.08rem;
    background-size: 24rem 2.6rem, auto;
  }
  .draw-canvas-frame::before,
  .draw-canvas-frame::after {
    width: 3.4rem;
    height: 3.4rem;
  }
  #page-public .public-section-head {
    padding: .5rem .55rem 1rem;
    background-size: auto, 40rem 2.6rem;
  }
  #page-public .public-section-head::after {
    display: none;
  }
  #page-public .public-art-panel figcaption {
    min-height: 2.8rem;
    padding-right: 2.55rem;
    background-size: 2.15rem 1.6rem;
  }
  #page-public .direction-story {
    padding-right: 3.15rem;
  }
  #page-public .direction-story::after {
    width: 3.25rem;
    height: 3.8rem;
  }
}

@media (max-width: 420px) {
  #page-draw .category-hero::before {
    width: 92%;
  }
  #page-draw .draw-hint,
  #page-draw .status {
    padding-right: 2.8rem;
  }
  #page-draw .draw-hint::after,
  #page-draw .status::after {
    width: 1.75rem;
    height: 1.75rem;
  }
  #page-public .homepage-qr {
    padding-left: 1rem;
    padding-top: 3.2rem;
  }
  #page-public .homepage-qr::before {
    top: .25rem;
    bottom: auto;
    left: 50%;
    width: 2.4rem;
    height: 2.8rem;
    transform: translateX(-50%);
  }
}