:root {
  --warn:#c81e1e;
  --plan:#174a7c;
  --green:#2f6b3f;
  --four:#f4a17f;
  --ink:#111827;
  --page:#f6f7fb;
  --panel:#fff;
  --line:#d9dee8;
  --gov-font:"FZXiaoBiaoSong-B05S","方正小标宋简体","方正小标宋_GBK","STZhongsong","华文中宋","Songti SC","SimSun","Noto Serif CJK SC",serif;
}

* { box-sizing:border-box; }

body {
  margin:0;
  min-height:100vh;
  color:#151722;
  background:var(--page);
  font-family:-apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei",Arial,sans-serif;
}

button,
input,
textarea {
  font:inherit;
}

button {
  height:38px;
  padding:0 14px;
  border:1px solid #cfd6e4;
  border-radius:8px;
  background:#fff;
  color:#202638;
  font-weight:700;
  cursor:pointer;
}

button.primary {
  border-color:#174cf2;
  background:#174cf2;
  color:#fff;
}

.app {
  min-height:100vh;
  display:grid;
  grid-template-columns:minmax(0, 1fr) 360px;
}

.preview-panel {
  padding:24px;
  display:flex;
  flex-direction:column;
  gap:18px;
}

.topbar {
  display:flex;
  justify-content:space-between;
  gap:16px;
  align-items:center;
}

.back-link {
  color:#26314a;
  text-decoration:none;
  font-size:14px;
  font-weight:800;
}

.actions {
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  justify-content:flex-end;
}

.sheet-wrap {
  flex:1;
  min-height:520px;
  display:grid;
  place-items:center;
  overflow:auto;
  border:1px solid var(--line);
  border-radius:8px;
  background:
    linear-gradient(45deg, #eef1f6 25%, transparent 25%),
    linear-gradient(-45deg, #eef1f6 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #eef1f6 75%),
    linear-gradient(-45deg, transparent 75%, #eef1f6 75%);
  background-size:22px 22px;
  background-position:0 0, 0 11px, 11px -11px, -11px 0;
}

.sticker {
  position:relative;
  width:49.53mm;
  height:59.52mm;
  overflow:hidden;
  background:#fff;
  box-shadow:0 10px 28px rgba(21,31,52,.12);
  font-family:var(--gov-font);
}

@media screen {
  .sticker {
    transform:scale(2.25);
  }
}

.sticker-content {
  position:relative;
  z-index:2;
  height:100%;
  padding:2.05mm 2.05mm 1.25mm;
  display:flex;
  flex-direction:column;
  align-items:center;
  text-align:center;
}

.big-four {
  position:absolute;
  z-index:1;
  left:var(--serial-x, 50%);
  top:var(--serial-y, 54%);
  width:45mm;
  height:42mm;
  display:grid;
  place-items:center;
  color:var(--four);
  font-family:var(--gov-font);
  font-size:var(--serial-size, 48mm);
  line-height:1;
  font-weight:900;
  opacity:var(--serial-opacity, .38);
  transform:translate(-50%, -50%) scaleX(1.04);
  text-align:center;
  pointer-events:none;
}

[contenteditable="true"] {
  outline:none;
  border-radius:3px;
}

[contenteditable="true"]:focus {
  box-shadow:0 0 0 1px rgba(23,76,242,.45);
  background:rgba(255,255,255,.6);
}

.line {
  width:100%;
  white-space:nowrap;
  line-height:1.08;
  font-weight:900;
}

.warn {
  color:var(--warn);
  font-size:2.72mm;
}

.top { margin-bottom:1.58mm; }

h1 {
  margin:0;
  color:var(--ink);
  font-size:var(--title-size, 5.92mm);
  line-height:1;
  font-weight:900;
  font-family:var(--gov-font);
  white-space:nowrap;
}

.speed {
  margin-top:.98mm;
  color:var(--green);
  font-size:2.08mm;
}

.plans {
  width:100%;
  color:var(--plan);
  font-weight:900;
  transform:translateX(var(--plans-x, 0mm));
}

.plans h2 {
  margin:0;
  font-size:3.38mm;
  line-height:1.1;
}

.plans p {
  margin:1.18mm 0 0;
  font-size:var(--plan-size, 3.32mm);
  line-height:1.05;
  white-space:nowrap;
}

.monthly { margin-top:var(--monthly-y, 2.44mm); }
.yearly { margin-top:var(--yearly-y, 3.15mm); }

.promise {
  margin-top:auto;
  color:var(--green);
  font-size:3.16mm;
}

.contact {
  margin-top:.72mm;
  color:var(--ink);
  font-size:3.08mm;
}

.bottom {
  margin-top:1.05mm;
}

.hint {
  margin:0;
  color:#5c667a;
  font-size:13px;
  text-align:center;
}

.editor {
  min-height:100vh;
  padding:24px;
  overflow:auto;
  border-left:1px solid var(--line);
  background:var(--panel);
}

.editor-head p {
  margin:0 0 8px;
  color:#174cf2;
  font-size:12px;
  font-weight:900;
  letter-spacing:.12em;
}

.editor-head h2 {
  margin:0 0 20px;
  font-size:25px;
}

.control-grid,
.control-section {
  display:grid;
  gap:14px;
}

.plan-editor {
  display:grid;
  gap:10px;
}

.plan-editor-row {
  display:grid;
  grid-template-columns:minmax(0, 1fr) 38px;
  gap:8px;
  align-items:start;
}

.plan-editor-row button {
  width:38px;
  padding:0;
  color:#c21d15;
}

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

.control-section h3 {
  margin:0;
  font-size:16px;
}

label {
  display:grid;
  gap:7px;
  color:#4b5568;
  font-size:13px;
  font-weight:800;
}

textarea,
input[type="text"] {
  width:100%;
  min-height:42px;
  padding:10px 11px;
  border:1px solid #cfd6e4;
  border-radius:8px;
  color:#151722;
  background:#fff;
  resize:vertical;
}

input[type="color"] {
  width:100%;
  height:42px;
  padding:4px;
  border:1px solid #cfd6e4;
  border-radius:8px;
  background:#fff;
}

.deploy-note {
  margin:0;
  color:#5c667a;
  font-size:13px;
  line-height:1.75;
}

@media (max-width: 900px) {
  .app {
    grid-template-columns:1fr;
  }

  .editor {
    min-height:auto;
    border-left:0;
    border-top:1px solid var(--line);
  }

  .topbar {
    align-items:flex-start;
    flex-direction:column;
  }
}

@media print {
  @page {
    size:49.53mm 59.52mm;
    margin:0;
  }

  html,
  body {
    width:49.53mm;
    height:59.52mm;
    margin:0;
    background:#fff;
  }

  body * {
    visibility:hidden;
  }

  .sticker,
  .sticker * {
    visibility:visible;
  }

  .sticker {
    position:fixed;
    left:0;
    top:0;
    width:49.53mm;
    height:59.52mm;
    box-shadow:none;
    transform:none;
  }
}
