:root {
  color-scheme: light;
  --ink: #17221d;
  --muted: #7a837d;
  --soft: #eef2ee;
  --line: #e3e8e3;
  --accent: #c8f15d;
  --accent-strong: #a9d63f;
  --paper: #fbfcfa;
  --shadow: 0 24px 70px rgba(21, 35, 28, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: #e9eeea;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 20% 12%, rgba(200, 241, 93, 0.14), transparent 28rem),
    linear-gradient(138deg, #e8ede9 0%, #f7f8f5 48%, #e5ede7 100%);
  color: var(--ink);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

.page-glow {
  position: fixed;
  z-index: 0;
  width: 24rem;
  height: 24rem;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.28;
  pointer-events: none;
}

.page-glow--top {
  top: -13rem;
  right: -5rem;
  background: #bee85f;
}

.page-glow--bottom {
  bottom: -14rem;
  left: -6rem;
  background: #b9d7c0;
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding: 28px 0 26px;
}

.topbar,
.footer-note,
.panel-heading,
.preview-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar {
  margin-bottom: 82px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: inline-grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 11px;
  background: var(--ink);
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: -1px;
  transform: rotate(-5deg);
}

.brand-name {
  font-size: 15px;
  font-weight: 750;
  letter-spacing: -0.3px;
}

.topbar-note {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #647168;
  font-size: 12px;
}

.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #91c33f;
  box-shadow: 0 0 0 4px rgba(145, 195, 63, 0.13);
}

.hero-copy {
  max-width: 720px;
  margin-bottom: 42px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 14px;
  color: #849083;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.hero-copy h1 {
  margin: 0;
  font-size: clamp(36px, 5.1vw, 68px);
  font-weight: 680;
  letter-spacing: -0.07em;
  line-height: 1.05;
}

.hero-copy h1 em {
  display: block;
  color: #75846e;
  font-style: normal;
}

.hero-description {
  max-width: 440px;
  margin: 22px 0 0;
  color: #6f7b72;
  font-size: 15px;
  line-height: 1.8;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid rgba(223, 229, 223, 0.88);
  border-radius: 26px;
  background: rgba(251, 252, 250, 0.88);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.input-panel,
.preview-panel {
  min-width: 0;
  padding: 37px 42px 35px;
}

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

.panel-heading,
.preview-topline {
  align-items: flex-start;
  min-height: 47px;
}

.section-kicker {
  margin-bottom: 8px;
  color: #9ba59b;
  font-size: 9px;
}

.panel-heading h2,
.preview-topline h2 {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.keyboard-tip {
  margin-top: 5px;
  color: #a4ada6;
  font-size: 10px;
}

.mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  margin: 30px 0 26px;
  padding: 4px;
  border-radius: 13px;
  background: #eef2ee;
}

.mode-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #8a948c;
  font-size: 12px;
  transition: background 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.mode-button:hover {
  color: var(--ink);
}

.mode-button.is-active {
  background: white;
  color: var(--ink);
  box-shadow: 0 3px 12px rgba(20, 37, 26, 0.07);
}

.mode-icon {
  font-size: 12px;
  font-weight: 800;
}

.input-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  color: #4f5d53;
  font-size: 12px;
  font-weight: 700;
}

.char-count {
  color: #a4ada6;
  font-size: 10px;
  font-weight: 500;
}

textarea {
  display: block;
  width: 100%;
  min-height: 172px;
  padding: 17px 18px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 15px;
  outline: 0;
  background: rgba(255, 255, 255, 0.76);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.75;
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

textarea::placeholder {
  color: #b7beb8;
}

textarea:focus {
  border-color: #afcf74;
  background: white;
  box-shadow: 0 0 0 4px rgba(200, 241, 93, 0.18);
}

.input-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  color: #9aa49c;
  font-size: 10px;
}

.hint-icon {
  display: inline-grid;
  width: 15px;
  height: 15px;
  place-items: center;
  border: 1px solid #bdc8bf;
  border-radius: 50%;
  font-family: Georgia, serif;
  font-size: 10px;
  font-weight: 700;
}

.action-row {
  display: flex;
  gap: 10px;
  margin-top: 24px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 43px;
  padding: 0 17px;
  border: 0;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease, opacity 160ms ease;
}

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

.button:not(:disabled):active {
  transform: translateY(1px);
}

.button--primary {
  flex: 1;
  background: var(--ink);
  color: var(--accent);
}

.button--primary:hover {
  background: #29372d;
}

.button-arrow {
  font-size: 18px;
  font-weight: 400;
  line-height: 0;
}

.button--ghost {
  padding: 0 20px;
  border: 1px solid var(--line);
  background: transparent;
  color: #778279;
}

.button--ghost:hover {
  border-color: #c4cec5;
  background: #f5f7f4;
  color: var(--ink);
}

.preview-panel {
  background: rgba(246, 249, 245, 0.52);
}

.preview-badge {
  padding: 6px 9px;
  border-radius: 99px;
  background: #edf1ec;
  color: #9aa59b;
  font-size: 10px;
  transition: background 180ms ease, color 180ms ease;
}

.preview-badge.is-ready {
  background: #e7f4be;
  color: #6f8938;
}

.barcode-stage {
  position: relative;
  display: grid;
  width: 100%;
  min-height: 290px;
  margin: 30px auto 23px;
  place-items: center;
  border: 1px solid #e4eae4;
  border-radius: 20px;
  background: white;
  box-shadow: 0 12px 30px rgba(26, 43, 30, 0.06);
}

#barcode {
  display: none;
  width: 90%;
  max-height: 250px;
}

#barcode.is-visible {
  display: block;
}

.barcode-empty {
  position: relative;
  display: grid;
  place-items: center;
  width: 79%;
  min-height: 205px;
  align-content: center;
  border: 1px dashed #dce4dc;
  border-radius: 13px;
  color: #a9b3aa;
  text-align: center;
}

.barcode-empty p {
  margin: 11px 0 3px;
  color: #7f8b81;
  font-size: 12px;
  font-weight: 700;
}

.barcode-empty > span:not(.empty-line) {
  color: #b1bab2;
  font-size: 10px;
}

.empty-symbol {
  color: #9cac85;
  font-family: Georgia, serif;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -7px;
  transform: rotate(-8deg);
}

.empty-line {
  position: absolute;
  left: 13%;
  width: 74%;
  height: 1px;
  background: #edf2ed;
}

.empty-line--top {
  top: 28%;
}

.empty-line--bottom {
  bottom: 28%;
}

.result-meta {
  padding: 12px 14px;
  border: 1px solid #e4eae4;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.58);
}

.result-label {
  margin: 0 0 5px;
  color: #a0aaa1;
  font-size: 10px;
}

.result-value {
  overflow: hidden;
  margin: 0;
  color: #5d6a61;
  font-size: 11px;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 18px;
}

.button--download {
  grid-column: 1 / -1;
  background: var(--accent);
  color: #2d3d20;
}

.button--download:hover:not(:disabled) {
  background: var(--accent-strong);
}

.download-icon {
  font-size: 19px;
  font-weight: 400;
  line-height: 0;
}

.button--secondary {
  border: 1px solid var(--line);
  background: white;
  color: #667269;
}

.button--secondary:hover:not(:disabled) {
  border-color: #c4d2c2;
  color: var(--ink);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.46;
}

.preview-status {
  min-height: 16px;
  margin: 14px 0 0;
  color: #98a39a;
  font-size: 10px;
  text-align: center;
}

.preview-status.is-error {
  color: #b76b63;
}

.footer-note {
  justify-content: flex-start;
  gap: 14px;
  padding: 25px 4px 0;
  color: #99a49b;
  font-size: 10px;
  letter-spacing: 0.02em;
}

.footer-line {
  width: 30px;
  height: 1px;
  background: #c8d1c8;
}

[hidden] {
  display: none !important;
}

@media (max-width: 820px) {
  .topbar {
    margin-bottom: 56px;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

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

  .preview-panel {
    padding-top: 34px;
  }
}

@media (max-width: 520px) {
  .app-shell {
    width: min(100% - 28px, 1180px);
    padding-top: 18px;
  }

  .topbar {
    margin-bottom: 48px;
  }

  .topbar-note {
    font-size: 10px;
  }

  .hero-copy {
    margin-bottom: 30px;
  }

  .hero-copy h1 {
    font-size: 40px;
  }

  .hero-description {
    margin-top: 16px;
    font-size: 13px;
  }

  .input-panel,
  .preview-panel {
    padding: 27px 21px 25px;
  }

  .keyboard-tip {
    display: none;
  }

  .mode-switch {
    margin-top: 24px;
  }

  .barcode-stage {
    min-height: 250px;
    margin-top: 25px;
  }

  .footer-note {
    flex-wrap: wrap;
    gap: 8px 12px;
    line-height: 1.5;
  }
}
