:root {
  color-scheme: dark;
  --bg: #040604;
  --panel: rgba(16, 18, 16, 0.78);
  --panel-strong: rgba(8, 10, 8, 0.84);
  --edge: rgba(255, 255, 255, 0.14);
  --edge-soft: rgba(255, 255, 255, 0.08);
  --text: #ffffff;
  --muted: rgba(255, 255, 255, 0.54);
  --accent: #7cff19;
  --accent-soft: #dfff63;
  --cyan: #20b9e9;
  --ink: #071107;
  --blue-ink: #12315c;
  --radius: 18px;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(133, 255, 31, 0.08), transparent 270px),
    radial-gradient(circle at 82% 130px, rgba(203, 255, 93, 0.12), transparent 180px),
    linear-gradient(135deg, #08160b, #020403 58%),
    var(--bg);
  color: var(--text);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(110deg, rgba(255, 255, 255, 0.08), transparent 24%, rgba(124, 255, 25, 0.06) 62%, transparent 78%),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.015) 0 1px, transparent 1px 18px);
  opacity: 0.7;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
.watermark:focus-visible {
  outline: 3px solid rgba(124, 255, 25, 0.32);
  outline-offset: 2px;
}

svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

h1,
h2,
p {
  margin: 0;
}

.page {
  width: min(720px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 26px 24px 44px;
  position: relative;
}

.hero-glass,
.preview-card,
.editor-card,
.status-bar {
  position: relative;
  overflow: hidden;
  margin-bottom: 22px;
  border: 1px solid var(--edge);
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.035) 38%, rgba(0, 0, 0, 0.18)),
    var(--panel);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    inset 0 -30px 44px rgba(0, 0, 0, 0.28),
    0 26px 70px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(30px) saturate(150%);
  -webkit-backdrop-filter: blur(30px) saturate(150%);
}

.hero-glass {
  padding: 30px;
  background:
    linear-gradient(135deg, rgba(217, 255, 101, 0.1), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.02)),
    rgba(9, 11, 9, 0.82);
}

.hero-decor-img {
  position: absolute;
  right: -54px;
  top: -34px;
  width: 146px;
  height: 125px;
  object-fit: contain;
  opacity: 0.78;
  pointer-events: none;
}

.brand-row,
.action-grid,
.card-head,
.stage-wrap,
.tool-panel,
.section-head,
.editor-form,
.brand-card > input,
.opacity-row,
.status-bar > * {
  position: relative;
  z-index: 1;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 20px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 104px;
  height: 104px;
  border-radius: 24px;
  background: transparent;
  filter:
    drop-shadow(0 18px 30px rgba(124, 255, 25, 0.18))
    drop-shadow(0 8px 18px rgba(0, 0, 0, 0.42));
}

.brand-icon {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-copy {
  min-width: 0;
}

.title {
  color: #ffffff;
  font-size: 36px;
  font-weight: 900;
  line-height: 1.06;
  letter-spacing: 0;
}

.subtitle {
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 15px;
  line-height: 1.35;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 30px;
}

.quota-card {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 12px;
  align-items: center;
  margin-top: 18px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.025) 44%, rgba(0, 0, 0, 0.18)),
    rgba(5, 12, 8, 0.54);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.quota-card > div {
  min-width: 0;
}

.quota-label {
  display: block;
  margin-bottom: 5px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 12px;
  font-weight: 700;
}

.quota-card strong {
  display: block;
  color: #fff;
  font-size: 16px;
  font-weight: 860;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.unlock-button {
  min-height: 40px;
  padding: 0 15px;
  border: 1px solid rgba(223, 255, 99, 0.22);
  border-radius: 999px;
  background: rgba(223, 255, 99, 0.08);
  color: var(--accent-soft);
  font-size: 14px;
  font-weight: 850;
  white-space: nowrap;
}

.glass-button,
.primary-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  border-radius: 999px;
  font-size: 17px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.glass-button {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.03)),
    rgba(28, 31, 28, 0.74);
  color: #f3fff0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.primary-button {
  background: linear-gradient(135deg, #ecff80, var(--accent) 58%, #38d500);
  color: var(--ink);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.44),
    0 18px 42px rgba(124, 255, 25, 0.24);
}

.glass-button:hover,
.primary-button:hover,
.mini-button:hover,
.ghost-action:hover {
  transform: translateY(-1px);
}

.compact {
  min-width: 180px;
  min-height: 46px;
  padding: 0 24px;
}

.preview-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.085), rgba(255, 255, 255, 0.018)),
    var(--panel-strong);
}

.preview-decor-img {
  position: absolute;
  right: -76px;
  top: 12px;
  width: 125px;
  height: 110px;
  object-fit: contain;
  opacity: 0.13;
  pointer-events: none;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 24px 26px 0;
}

.card-title {
  color: #fff;
  font-size: 20px;
  font-weight: 880;
  line-height: 1.2;
}

.card-subtitle {
  margin-top: 5px;
  color: rgba(255, 255, 255, 0.48);
  font-size: 14px;
}

.status-pill {
  flex: 0 0 auto;
  min-width: 86px;
  padding: 9px 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  color: var(--accent-soft);
  font-size: 14px;
  font-weight: 750;
  text-align: center;
  background: rgba(255, 255, 255, 0.06);
}

.stage-wrap {
  display: flex;
  justify-content: center;
  padding: 22px 22px 20px;
  overflow: visible;
}

.photo-stage,
.stage {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02)),
    #0a0d0a;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.12),
    0 20px 52px rgba(0, 0, 0, 0.32);
  touch-action: none;
}

.stage.is-empty {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 430px;
  border: 1px dashed rgba(255, 255, 255, 0.15);
  background:
    linear-gradient(135deg, rgba(223, 255, 99, 0.08), rgba(255, 255, 255, 0.025) 42%, rgba(0, 0, 0, 0.18)),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.035) 0 18px, transparent 18px 36px);
}

#photoCanvas {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 14px;
}

.stage.is-empty #photoCanvas,
.stage.is-empty .watermark {
  display: none;
}

.empty-state {
  display: grid;
  justify-items: center;
  gap: 16px;
  width: 88%;
  max-width: 530px;
  text-align: center;
}

.stage:not(.is-empty) .empty-state {
  display: none;
}

.empty-decor-img {
  width: 160px;
  height: 136px;
  object-fit: contain;
  opacity: 0.94;
}

.empty-title {
  color: #fff;
  font-size: 22px;
  font-weight: 880;
}

.empty-copy {
  color: rgba(255, 255, 255, 0.48);
  font-size: 15px;
  line-height: 1.55;
}

.watermark {
  --s: 0.25;
  position: absolute;
  left: 1.1%;
  top: 61%;
  width: 38%;
  max-width: calc(100% - 12px);
  color: #fff;
  opacity: 1;
  user-select: none;
  cursor: grab;
  touch-action: none;
}

.watermark:active {
  cursor: grabbing;
}

.stamp-card {
  width: calc(505px * var(--s));
  max-width: 100%;
  overflow: hidden;
  border-radius: calc(18px * var(--s));
  background: #fff;
  box-shadow: 0 10px 24px rgba(8, 25, 49, 0.16);
}

.stamp-card.is-hidden {
  display: none;
}

.stamp-title {
  display: flex;
  align-items: center;
  height: calc(165px * var(--s));
  padding-left: calc(50px * var(--s));
  background: var(--cyan);
  color: #fff;
  font-size: calc(88px * var(--s));
  font-weight: 300;
  line-height: 1;
  white-space: nowrap;
}

.stamp-time {
  display: flex;
  align-items: center;
  height: calc(208px * var(--s));
  padding-left: calc(39px * var(--s));
  color: var(--blue-ink);
  font-size: calc(148px * var(--s));
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.stamp-title.is-hidden,
.stamp-time.is-hidden,
.stamp-line.is-hidden,
.stamp-weather.is-hidden,
.stamp-note.is-hidden,
.stamp-footer.is-hidden {
  display: none;
}

.stamp-line,
.stamp-weather,
.stamp-note,
.stamp-footer {
  text-shadow: 0 3px 6px rgba(5, 15, 28, 0.5);
}

.stamp-line {
  margin-top: calc(35px * var(--s));
  font-size: calc(66px * var(--s));
  font-weight: 650;
  line-height: 1.08;
  white-space: nowrap;
}

.card-gap,
.stamp-card:not(.is-hidden) + .stamp-line:not(.is-hidden) {
  margin-top: calc(58px * var(--s));
}

.stamp-weather {
  display: flex;
  align-items: baseline;
  gap: calc(13px * var(--s));
  margin-top: calc(35px * var(--s));
  font-size: calc(66px * var(--s));
  font-weight: 650;
  line-height: 1.1;
}

.stamp-weather strong {
  font-size: calc(72px * var(--s));
  font-weight: 900;
}

.stamp-note {
  display: flex;
  align-items: center;
  gap: calc(20px * var(--s));
  margin-top: calc(35px * var(--s));
  font-size: calc(68px * var(--s));
  font-weight: 750;
  line-height: 1.1;
}

.quote-mark {
  color: #19c7ee;
  font-size: calc(70px * var(--s));
  font-weight: 900;
  text-shadow: none;
}

.stamp-footer {
  display: flex;
  align-items: flex-start;
  gap: calc(20px * var(--s));
  margin-top: calc(64px * var(--s));
  max-width: calc(821px * var(--s));
  font-size: calc(62px * var(--s));
  font-weight: 500;
  line-height: 1.18;
  white-space: normal;
}

.footer-text {
  flex: 1;
  min-width: 0;
  white-space: normal;
  word-break: break-all;
  overflow-wrap: break-word;
}

.cert {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: calc(66px * var(--s));
  height: calc(66px * var(--s));
  border: calc(3px * var(--s)) solid rgba(255, 255, 255, 0.88);
  border-radius: 50%;
  font-size: calc(42px * var(--s));
  line-height: 1;
}

.tool-panel {
  padding: 18px 24px 22px;
  border-top: 1px solid var(--edge-soft);
  background: rgba(255, 255, 255, 0.025);
}

.tool-heading {
  margin-bottom: 12px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 14px;
  font-weight: 760;
}

.tool-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 58px;
}

.tool-label {
  flex: 0 0 auto;
  color: #fff;
  font-size: 17px;
  font-weight: 820;
}

.position-grid {
  display: grid;
  grid-template-columns: repeat(3, 26px);
  gap: 10px;
  padding: 10px 13px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
}

.position-grid button {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(219, 230, 226, 0.8);
  border-radius: 7px;
  background: transparent;
}

.position-grid button.active {
  border-color: var(--accent);
  background: rgba(124, 255, 25, 0.1);
  box-shadow: 0 0 0 5px rgba(124, 255, 25, 0.12);
}

.range-row {
  margin-top: 8px;
}

.mini-button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 50%;
  color: #fff;
  font-size: 26px;
  font-weight: 900;
  line-height: 1;
  background: rgba(255, 255, 255, 0.07);
}

.size-slider {
  flex: 1;
  min-width: 0;
  accent-color: var(--accent);
}

.size-output {
  width: 64px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 16px;
  text-align: right;
}

.ghost-action {
  width: 100%;
  min-height: 46px;
  margin-top: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
  color: #f4fff4;
  font-size: 17px;
  font-weight: 820;
}

.editor-card {
  padding: 0 22px 14px;
}

.brand-card {
  padding-bottom: 20px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 70px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  color: #fff;
}

.section-head h2 {
  font-size: 20px;
  font-weight: 880;
  line-height: 1.2;
}

.text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 4px;
  background: transparent;
  color: var(--accent-soft);
  font-size: 14px;
  font-weight: 800;
}

.editor-form {
  display: grid;
}

.field-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 54px;
  grid-template-areas: "label field toggle";
  align-items: center;
  gap: 10px;
  min-height: 66px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.field-row.is-off {
  grid-template-columns: 72px minmax(0, 1fr) 54px;
}

.field-row.is-off > input,
.field-row.is-off > select,
.field-row.is-off > .split-inputs {
  display: none;
}

.field-label {
  grid-area: label;
  color: rgba(255, 255, 255, 0.82);
  font-size: 16px;
  font-weight: 780;
}

.field-row > input,
.field-row > select,
.field-row > .split-inputs {
  grid-area: field;
}

.switch {
  grid-area: toggle;
  justify-self: end;
  position: relative;
  width: 44px;
  height: 26px;
  transform: scale(0.88);
  transform-origin: center;
}

.brand-card .switch {
  grid-area: auto;
}

.switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch span {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  transition: background 0.18s ease;
}

.switch span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.32);
  transition: transform 0.18s ease;
}

.switch input:checked + span {
  background: var(--accent);
}

.switch input:checked + span::after {
  transform: translateX(18px);
}

.field-row input,
.field-row select,
.full-input {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.065), rgba(255, 255, 255, 0.018)),
    rgba(3, 7, 4, 0.62);
  color: #f4fff4;
  font-size: 16px;
  line-height: 46px;
}

input[type="range"] {
  background: transparent;
}

.split-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.weather-inputs {
  grid-template-columns: 1.05fr 0.65fr;
}

.brand-card.is-off > .full-input,
.brand-card.is-off > .opacity-row {
  display: none;
}

.full-input {
  margin-top: 18px;
}

.opacity-row {
  display: grid;
  gap: 10px;
  margin-top: 20px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 16px;
  font-weight: 760;
}

.opacity-row input {
  accent-color: var(--accent);
}

.status-bar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 14px;
  padding: 20px 24px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 15px;
  line-height: 1.45;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.02)),
    rgba(12, 15, 12, 0.72);
}

.status-bar #locationText {
  grid-column: 1;
}

.status-bar #relocateButton {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
}

.modal[hidden] {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.modal-panel {
  position: relative;
  z-index: 1;
  width: min(520px, 100%);
  overflow: hidden;
  padding: 26px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 22px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.035) 44%, rgba(0, 0, 0, 0.24)),
    rgba(9, 13, 9, 0.94);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 34px 90px rgba(0, 0, 0, 0.48);
}

.modal-panel h2 {
  color: #fff;
  font-size: 24px;
  font-weight: 900;
  line-height: 1.2;
}

.modal-copy {
  margin-top: 10px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 15px;
  line-height: 1.6;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.82);
  font-size: 24px;
  line-height: 1;
}

.redeem-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  margin-top: 18px;
}

.redeem-input-row input {
  width: 100%;
  min-height: 50px;
  padding: 0 15px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.065), rgba(255, 255, 255, 0.018)),
    rgba(3, 7, 4, 0.62);
  color: #f4fff4;
  font-size: 16px;
  text-transform: uppercase;
}

.redeem-message {
  min-height: 22px;
  margin-top: 12px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 14px;
}

.redeem-message.error {
  color: #ff9f9f;
}

.redeem-message.success {
  color: var(--accent-soft);
}

.redeem-plans {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.redeem-plans span {
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.045);
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  font-weight: 700;
}

@media (min-width: 960px) {
  .page {
    width: min(860px, calc(100% - 48px));
  }
}

@media (max-width: 560px) {
  .page {
    padding: 14px 12px 28px;
  }

  .hero-glass {
    padding: 24px;
  }

  .title {
    font-size: 30px;
  }

  .brand-mark {
    width: 86px;
    height: 86px;
  }

  .action-grid {
    gap: 12px;
  }

  .glass-button,
  .primary-button {
    min-height: 48px;
    font-size: 15px;
  }

  .quota-card {
    grid-template-columns: 1fr 1fr;
  }

  .unlock-button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .card-head {
    padding: 20px 20px 0;
  }

  .stage-wrap {
    padding: 18px;
  }

  .stage.is-empty {
    min-height: 360px;
  }

  .tool-panel,
  .editor-card {
    padding-left: 18px;
    padding-right: 18px;
  }

  .tool-row {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .range-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    width: 100%;
  }

  .range-row .tool-label {
    width: 100%;
  }

  .field-row,
  .field-row.is-off {
    grid-template-columns: 72px minmax(0, 1fr) 48px;
  }

  .split-inputs,
  .weather-inputs {
    grid-template-columns: 1fr;
  }

  .status-bar {
    grid-template-columns: 1fr;
  }

  .status-bar #relocateButton,
  .status-bar #locationText {
    grid-column: auto;
    grid-row: auto;
    justify-self: start;
  }

  .modal {
    padding: 16px;
  }

  .modal-panel {
    padding: 22px 18px;
  }

  .redeem-input-row {
    grid-template-columns: 1fr;
  }

  .redeem-plans {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
