@font-face {
  font-family: "MaShanZheng";
  src: url("./fonts/MaShanZheng-Regular.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: "LongCang";
  src: url("./fonts/LongCang-Regular.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: "ZCOOLXiaoWei";
  src: url("./fonts/ZCOOLXiaoWei-Regular.ttf") format("truetype");
  font-display: swap;
}

:root {
  --ink: #1d1b17;
  --muted: #777167;
  --paper: #f1ede4;
  --paper-deep: #e8e1d4;
  --line: rgba(42, 35, 26, 0.14);
  --red: #a93626;
  --red-dark: #782418;
  --gold: #c99748;
  --white: #fffdf8;
  --shadow: 0 18px 70px rgba(52, 39, 24, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
  background: #d9d2c5;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: "PingFang SC", "Hiragino Sans GB", sans-serif;
  background:
    radial-gradient(circle at 8% 12%, rgba(255, 253, 245, 0.8), transparent 28rem),
    radial-gradient(circle at 92% 82%, rgba(159, 49, 31, 0.12), transparent 32rem),
    #dfd8ca;
}

button,
input,
textarea {
  font: inherit;
}

button,
label,
input[type="range"] {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

.paper-noise {
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.2;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.92' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.13'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 78px;
  padding: 12px clamp(18px, 3vw, 48px);
  border-bottom: 1px solid rgba(33, 28, 22, 0.12);
  background: rgba(239, 235, 226, 0.92);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  width: max-content;
}

.brand-seal {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: #f6e9d2;
  font: 24px/1 "MaShanZheng", serif;
  background:
    linear-gradient(145deg, transparent 0 10%, rgba(255, 255, 255, 0.12) 10% 12%, transparent 12%),
    var(--red);
  border: 1px solid rgba(93, 22, 13, 0.35);
  box-shadow: inset 0 0 0 3px rgba(255, 238, 214, 0.1);
  transform: rotate(-3deg);
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--red);
  font-family: Georgia, serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.brand h1 {
  margin: 0;
  font: 28px/0.9 "ZCOOLXiaoWei", serif;
  letter-spacing: 0.15em;
}

.privacy-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: #746d63;
  font-size: 12px;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #57936b;
  box-shadow: 0 0 0 4px rgba(87, 147, 107, 0.12);
}

.top-export {
  justify-self: end;
}

.button {
  min-height: 40px;
  padding: 0 18px;
  border: 0;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

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

.button-primary {
  color: #fff8ed;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.1), transparent 45%),
    var(--red);
  box-shadow: 0 8px 24px rgba(126, 36, 24, 0.22);
}

.button-primary:hover {
  background-color: var(--red-dark);
  box-shadow: 0 10px 28px rgba(126, 36, 24, 0.28);
}

.button-light {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.52);
}

.button-accent {
  color: #fff9ef;
  background: #27231e;
}

.full-width {
  width: 100%;
}

.studio {
  display: grid;
  grid-template-columns: minmax(270px, 330px) minmax(380px, 1fr) minmax(270px, 330px);
  align-items: start;
  min-height: calc(100vh - 78px);
}

.panel {
  min-height: calc(100vh - 78px);
  background: rgba(244, 241, 234, 0.72);
}

.panel-left {
  border-right: 1px solid var(--line);
}

.panel-right {
  border-left: 1px solid var(--line);
}

.mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 18px 22px 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: rgba(214, 206, 192, 0.42);
}

.mode-button {
  display: grid;
  min-height: 38px;
  place-items: center;
  border: 0;
  border-radius: 3px;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.mode-button.active {
  color: var(--ink);
  background: var(--white);
  box-shadow: 0 3px 12px rgba(47, 39, 29, 0.08);
}

.layer-stack {
  display: grid;
  gap: 6px;
  margin: 8px 22px 0;
}

.layer-card {
  display: grid;
  grid-template-columns: 1fr 38px;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.32);
  transition: border 160ms ease, background 160ms ease, transform 160ms ease;
}

.layer-card.active {
  border-color: rgba(169, 54, 38, 0.44);
  background: rgba(255, 252, 245, 0.88);
  box-shadow: 0 5px 16px rgba(70, 48, 31, 0.06);
  transform: translateX(2px);
}

.layer-select {
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  gap: 9px;
  min-height: 50px;
  padding: 6px 8px;
  border: 0;
  text-align: left;
  background: transparent;
  cursor: pointer;
}

.layer-symbol {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  color: #f1dfc0;
  background: #2d201a;
  font: 20px "MaShanZheng", serif;
}

.layer-symbol.hand-symbol {
  color: #fff2dd;
  background:
    linear-gradient(135deg, rgba(169, 54, 38, 0.8), transparent),
    #2b211c;
  font-family: Georgia, serif;
  font-size: 15px;
}

.layer-select strong,
.layer-select small {
  display: block;
}

.layer-select strong {
  margin-bottom: 2px;
  font-size: 10px;
}

.layer-select small {
  color: var(--muted);
  font-size: 8px;
}

.layer-visibility {
  display: grid;
  height: 100%;
  place-items: center;
  border-left: 1px solid var(--line);
  cursor: pointer;
}

.layer-visibility input {
  position: absolute;
  opacity: 0;
}

.layer-visibility span {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 1px solid rgba(169, 54, 38, 0.28);
  border-radius: 50%;
  color: var(--red);
  background: rgba(169, 54, 38, 0.06);
  font-size: 8px;
}

.layer-visibility input:not(:checked) + span {
  border-color: var(--line);
  color: #aaa296;
  background: transparent;
  text-decoration: line-through;
}

.control-section {
  padding: 22px;
  border-bottom: 1px solid var(--line);
}

.first-section {
  padding-top: 24px;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

.section-heading.compact {
  margin-bottom: 12px;
}

.step-number {
  padding-top: 2px;
  color: var(--red);
  font: italic 11px/1 Georgia, serif;
}

.section-heading h2,
.subheading h3 {
  margin: 0;
  font-family: "ZCOOLXiaoWei", serif;
  font-weight: 400;
  letter-spacing: 0.06em;
}

.section-heading h2 {
  font-size: 17px;
}

.section-heading p,
.subheading span {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.upload-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 68px;
  padding: 12px;
  border: 1px dashed rgba(112, 96, 74, 0.42);
  border-radius: 5px;
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0.6), rgba(235, 226, 211, 0.36));
  cursor: pointer;
  transition: border 160ms ease, background 160ms ease;
}

.upload-card:hover {
  border-color: var(--red);
  background: rgba(255, 250, 241, 0.78);
}

.upload-card input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.upload-icon {
  display: grid;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--red);
  background: rgba(255, 255, 255, 0.72);
  font-family: Georgia, serif;
  font-size: 22px;
}

.upload-card strong,
.upload-card small {
  display: block;
}

.upload-card strong {
  margin-bottom: 3px;
  font-size: 13px;
}

.upload-card small {
  color: var(--muted);
  font-size: 10px;
}

.ratio-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 10px;
}

.ratio-button {
  min-height: 30px;
  padding: 0 4px;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.36);
  font-size: 10px;
  cursor: pointer;
}

.ratio-button.active {
  border-color: rgba(153, 47, 32, 0.45);
  color: var(--red);
  background: rgba(169, 54, 38, 0.07);
}

textarea {
  width: 100%;
  min-height: 82px;
  padding: 13px 14px;
  resize: vertical;
  border: 1px solid rgba(66, 55, 40, 0.18);
  border-radius: 4px;
  outline: none;
  color: var(--ink);
  background: rgba(255, 254, 250, 0.76);
  font: 25px/1.2 "MaShanZheng", serif;
  transition: border 160ms ease, box-shadow 160ms ease;
}

textarea:focus {
  border-color: rgba(169, 54, 38, 0.5);
  box-shadow: 0 0 0 3px rgba(169, 54, 38, 0.07);
}

.text-action {
  margin-top: 9px;
  padding: 0;
  border: 0;
  color: var(--red);
  background: transparent;
  font-size: 11px;
  cursor: pointer;
}

.text-action span {
  margin-right: 3px;
}

.font-list {
  display: grid;
  gap: 7px;
}

.font-card {
  position: relative;
  display: grid;
  grid-template-columns: 58px 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 66px;
  padding: 8px 10px 8px 7px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 4px;
  text-align: left;
  background: rgba(255, 255, 255, 0.38);
  cursor: pointer;
  transition: border 160ms ease, transform 160ms ease, background 160ms ease;
}

.font-card:hover {
  transform: translateX(2px);
}

.font-card.active {
  border-color: rgba(160, 51, 35, 0.45);
  background: rgba(255, 252, 245, 0.92);
}

.font-card.active::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 3px;
  content: "";
  background: var(--red);
}

.font-sample {
  display: grid;
  width: 52px;
  height: 48px;
  place-items: center;
  color: #f3dfb9;
  background:
    linear-gradient(135deg, rgba(160, 45, 28, 0.72), rgba(23, 20, 17, 0.9)),
    #211d19;
  font-size: 22px;
}

.font-mashan {
  font-family: "MaShanZheng", serif;
}

.font-longcang {
  font-family: "LongCang", serif;
}

.font-zcool {
  font-family: "ZCOOLXiaoWei", serif;
}

.font-card strong,
.font-card small {
  display: block;
}

.font-card strong {
  margin-bottom: 3px;
  font-size: 12px;
}

.font-card small {
  color: var(--muted);
  font-size: 10px;
}

.font-card em {
  align-self: start;
  padding: 2px 4px;
  border: 1px solid rgba(61, 112, 76, 0.2);
  border-radius: 2px;
  color: #467454;
  background: rgba(76, 126, 90, 0.08);
  font-family: Georgia, serif;
  font-size: 8px;
  font-style: normal;
}

.hand-tip {
  margin-bottom: 17px;
  padding: 11px 12px;
  border-left: 2px solid var(--gold);
  color: #655d52;
  background: rgba(198, 153, 72, 0.08);
  font-size: 11px;
  line-height: 1.65;
}

.hand-tip span {
  color: var(--gold);
}

.brush-picker {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 16px;
}

.brush-picker button {
  display: grid;
  min-height: 50px;
  padding: 6px 3px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.35);
  font-size: 8px;
  cursor: pointer;
}

.brush-picker button.active {
  border-color: rgba(169, 54, 38, 0.48);
  color: var(--red);
  background: rgba(255, 252, 246, 0.92);
}

.brush-mark {
  position: relative;
  display: block;
  width: 30px;
  height: 14px;
}

.brush-mark::before {
  position: absolute;
  top: 5px;
  left: 2px;
  width: 26px;
  height: 4px;
  border-radius: 90% 5% 90% 5%;
  content: "";
  background: currentColor;
  transform: rotate(-10deg);
}

.brush-dry::before {
  height: 5px;
  background: repeating-linear-gradient(0deg, currentColor 0 1px, transparent 1px 2px);
}

.brush-marker::before {
  height: 3px;
  border-radius: 0;
}

.brush-eraser::before {
  top: 1px;
  left: 8px;
  width: 14px;
  height: 10px;
  border: 1px solid currentColor;
  border-radius: 2px;
  background: transparent;
}

.hand-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 14px 0 8px;
}

.hidden {
  display: none !important;
}

.canvas-column {
  position: sticky;
  top: 78px;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 78px);
  min-height: 640px;
  padding: 20px clamp(18px, 3vw, 46px) 16px;
  overflow: hidden;
  background:
    linear-gradient(rgba(76, 65, 51, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(76, 65, 51, 0.045) 1px, transparent 1px),
    rgba(218, 211, 198, 0.56);
  background-size: 26px 26px;
}

.canvas-meta,
.stage-footnote {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 10px;
}

.canvas-meta {
  margin-bottom: 12px;
}

.canvas-meta > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.live-badge {
  padding: 4px 7px;
  color: #486c52;
  background: rgba(75, 119, 86, 0.1);
}

.dual-layer-badge {
  padding: 4px 7px;
  color: #8f5f28;
  background: rgba(198, 153, 72, 0.1);
}

.guide-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: 10px;
  cursor: pointer;
}

.guide-toggle span {
  display: inline-block;
  width: 22px;
  height: 12px;
  padding: 2px;
  border-radius: 999px;
  background: #aaa297;
}

.guide-toggle span::after {
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  content: "";
  background: #fff;
  transition: transform 160ms ease;
}

.guide-toggle.active span {
  background: var(--red);
}

.guide-toggle.active span::after {
  transform: translateX(10px);
}

.canvas-stage {
  position: relative;
  display: grid;
  flex: 1;
  min-height: 0;
  place-items: center;
}

.canvas-wrap {
  position: relative;
  display: grid;
  max-width: 100%;
  max-height: 100%;
  place-items: center;
  filter: drop-shadow(0 28px 34px rgba(50, 37, 25, 0.23));
  animation: canvas-arrive 700ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes canvas-arrive {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

canvas {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 180px);
  border: 7px solid rgba(247, 242, 232, 0.8);
  outline: 1px solid rgba(42, 33, 24, 0.22);
  background: #1f1b18;
  touch-action: none;
  cursor: grab;
}

body.hand-mode canvas {
  cursor: crosshair;
}

canvas:active {
  cursor: grabbing;
}

.drag-hint {
  position: absolute;
  bottom: 20px;
  left: 50%;
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.72);
  background: rgba(20, 18, 15, 0.58);
  font-size: 9px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 6px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.canvas-wrap:hover .drag-hint {
  opacity: 1;
  transform: translate(-50%, 0);
}

body.hand-mode .drag-hint {
  display: none;
}

.drop-message {
  position: absolute;
  inset: 12px;
  display: grid;
  place-items: center;
  border: 2px dashed rgba(169, 54, 38, 0.55);
  color: var(--red);
  background: rgba(243, 235, 221, 0.9);
  font-family: "ZCOOLXiaoWei", serif;
  font-size: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
}

.canvas-stage.dragging .drop-message {
  opacity: 1;
}

.stage-footnote {
  margin-top: 10px;
}

.warm-mark {
  color: #9b553e;
  font-family: "MaShanZheng", serif;
  font-size: 13px;
}

.subheading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
}

.subheading h3 {
  font-size: 15px;
}

.preset-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.preset {
  padding: 0 0 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: border 160ms ease, transform 160ms ease;
}

.preset:hover {
  transform: translateY(-2px);
}

.preset.active {
  border-color: rgba(169, 54, 38, 0.52);
  box-shadow: 0 5px 15px rgba(65, 45, 29, 0.08);
}

.preset-preview {
  display: grid;
  height: 55px;
  margin-bottom: 7px;
  place-items: center;
  font: 31px/1 "MaShanZheng", serif;
}

.preset-ember {
  color: #d8a951;
  text-shadow: 2px 2px 0 #3f120d;
  background:
    linear-gradient(100deg, transparent 25%, rgba(142, 22, 15, 0.7) 25% 55%, transparent 55%),
    #1e1714;
}

.preset-paper {
  color: #1e1b17;
  background:
    linear-gradient(15deg, rgba(128, 36, 26, 0.12), transparent 60%),
    #d8c7a5;
}

.preset-night {
  color: #eadfcb;
  text-shadow: 2px 2px 0 #8e1d17;
  background:
    radial-gradient(circle at 65% 30%, #6e1713, transparent 32%),
    #11151a;
}

.preset-harbor {
  color: #f4e7c9;
  text-shadow: 3px 2px 0 #b22c22, -2px -1px 0 #23695e;
  background:
    linear-gradient(110deg, transparent 0 40%, rgba(196, 35, 27, 0.64) 40% 62%, transparent 62%),
    #172226;
}

.preset-news {
  color: #191713;
  text-shadow: 2px 2px 0 rgba(142, 40, 28, 0.45);
  background:
    repeating-linear-gradient(0deg, rgba(41, 35, 28, 0.08) 0 1px, transparent 1px 4px),
    #d5c49f;
}

.preset-zen {
  color: #29251f;
  text-shadow: none;
  background:
    radial-gradient(circle at 72% 28%, rgba(82, 92, 73, 0.22), transparent 25%),
    #ede5d4;
}

.preset strong {
  font-size: 10px;
  font-weight: 600;
}

.color-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 18px;
}

.color-pair label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 38px;
  padding: 0 8px 0 10px;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.42);
  font-size: 10px;
}

input[type="color"] {
  width: 24px;
  height: 24px;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

input[type="color"]::-webkit-color-swatch {
  border: 2px solid rgba(255, 255, 255, 0.8);
  border-radius: 50%;
}

.range-control {
  display: block;
  margin-top: 14px;
}

.range-control > span {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  color: #5e584f;
  font-size: 10px;
}

.range-control output {
  color: var(--red);
  font-family: Georgia, serif;
  font-size: 10px;
}

input[type="range"] {
  width: 100%;
  height: 3px;
  margin: 0;
  appearance: none;
  border-radius: 999px;
  outline: none;
  background: linear-gradient(90deg, var(--red) 0 50%, #cfc6b8 50%);
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  width: 13px;
  height: 13px;
  appearance: none;
  border: 2px solid #f7f2e8;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 1px 5px rgba(78, 40, 27, 0.28);
}

.license-box {
  display: flex;
  gap: 11px;
  margin: 18px 22px;
  padding: 13px;
  border: 1px solid rgba(73, 113, 82, 0.2);
  color: #475b4c;
  background: rgba(75, 119, 86, 0.07);
}

.license-icon {
  display: grid;
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: #5c8766;
  font-size: 11px;
}

.license-box strong {
  font-size: 11px;
}

.license-box p {
  margin: 4px 0 6px;
  font-size: 9px;
  line-height: 1.55;
}

.license-box button {
  padding: 0;
  border: 0;
  color: #416149;
  background: transparent;
  font-size: 9px;
  font-weight: 650;
  cursor: pointer;
}

.bottom-export {
  width: calc(100% - 44px);
  margin: 0 22px 22px;
}

dialog {
  width: min(520px, calc(100% - 32px));
  padding: 34px;
  border: 1px solid rgba(74, 57, 39, 0.22);
  color: var(--ink);
  background:
    linear-gradient(140deg, rgba(255, 255, 255, 0.7), transparent 45%),
    #efe8da;
  box-shadow: 0 30px 100px rgba(33, 24, 16, 0.3);
}

dialog::backdrop {
  background: rgba(23, 20, 16, 0.62);
  backdrop-filter: blur(5px);
}

dialog h2 {
  margin: 4px 0 14px;
  font: 28px/1 "ZCOOLXiaoWei", serif;
}

dialog p,
dialog li {
  color: #5f574d;
  font-size: 12px;
  line-height: 1.75;
}

dialog ul {
  padding-left: 20px;
}

dialog small {
  display: block;
  margin-top: 17px;
  color: #81796f;
  font-size: 9px;
}

.dialog-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  font: 26px/1 Georgia, serif;
  cursor: pointer;
}

.dialog-links {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.dialog-links a {
  padding: 7px 9px;
  border: 1px solid var(--line);
  color: var(--red);
  background: rgba(255, 255, 255, 0.5);
  font-size: 10px;
  text-decoration: none;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  z-index: 50;
  padding: 10px 16px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 3px;
  color: #fff8ec;
  background: rgba(29, 26, 22, 0.94);
  box-shadow: 0 12px 40px rgba(20, 15, 11, 0.3);
  font-size: 11px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 180ms ease, transform 180ms ease;
}

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

@media (max-width: 1100px) {
  .studio {
    grid-template-columns: 285px 1fr;
  }

  .panel-right {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    min-height: auto;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .panel-right .control-section {
    border-right: 1px solid var(--line);
  }

  .license-box,
  .bottom-export {
    align-self: center;
  }

  .canvas-column {
    top: 78px;
  }
}

@media (max-width: 760px) {
  .topbar {
    grid-template-columns: 1fr auto;
  }

  .privacy-note {
    display: none;
  }

  .studio {
    display: flex;
    flex-direction: column;
  }

  .panel {
    width: 100%;
    min-height: auto;
    border: 0;
  }

  .canvas-column {
    position: relative;
    top: auto;
    order: -1;
    width: 100%;
    height: 72vh;
    min-height: 520px;
  }

  .panel-right {
    display: block;
  }

  .top-export {
    min-height: 36px;
    padding: 0 12px;
    font-size: 11px;
  }
}

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