:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --soft: #f8fafc;
  --text: #101828;
  --muted: #667085;
  --line: #e4e7ec;
  --brand: #1268f3;
  --brand-dark: #0b4eb9;
  --green: #138547;
  --green-soft: #e8f7ef;
  --red: #c23b30;
  --red-soft: #fff0ee;
  --amber: #946200;
  --amber-soft: #fff7dc;
  --shadow: 0 14px 34px rgba(16, 24, 40, .08);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(18, 104, 243, .08), transparent 260px),
    var(--bg);
  color: var(--text);
  line-height: 1.55;
}

button,
input,
textarea {
  font: inherit;
}

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

.page {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 18px 16px 112px;
}

.hero,
.section,
.panel,
.notice,
.flow {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(16, 24, 40, .03);
}

.hero {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 18px;
  align-items: start;
  padding: 22px;
  border-radius: 18px;
}

.brand-mark {
  position: relative;
  display: block;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: #0b1220;
  overflow: visible;
}

.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.brand-mark i {
  position: absolute;
  right: -8px;
  bottom: -8px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 4px solid #fff;
  border-radius: 50%;
  background: var(--brand);
  font-style: normal;
}

.brand-mark i svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: #fff;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: 42px;
  line-height: 1.1;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 20px;
  line-height: 1.2;
}

h3 {
  margin-bottom: 10px;
  font-size: 15px;
}

.online {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 11px;
  border: 1px solid rgba(19, 133, 71, .2);
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.hero-copy {
  max-width: 760px;
  margin-bottom: 16px;
  color: #344054;
  font-size: 16px;
}

.hero-copy a {
  color: var(--brand);
  font-weight: 850;
  text-decoration: none;
}

.hero-copy a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.hero-actions,
.mini-actions,
.sheet-actions,
.tools {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.action,
.bar-button,
.primary-btn,
.ghost,
.mini {
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 800;
}

.action {
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  background: var(--soft);
  color: var(--text);
}

.action.primary,
.bar-button,
.primary-btn {
  background: var(--brand);
  color: white;
}

.action.primary:hover,
.bar-button:hover,
.primary-btn:hover {
  background: var(--brand-dark);
}

.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.facts span,
.tag,
.status {
  display: inline-flex;
  align-items: center;
  width: max-content;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.facts span {
  min-height: 30px;
  padding: 5px 9px;
  background: #eef4ff;
  color: #194b8f;
}

.notice {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
  margin-top: 14px;
  padding: 13px 15px;
  border-radius: 14px;
  color: #344054;
}

.notice strong {
  color: var(--red);
}

.flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
  padding: 12px;
  border-radius: 14px;
}

.flow div {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 8px;
  align-items: center;
  min-height: 48px;
  padding: 8px;
  border-radius: 12px;
  background: var(--soft);
}

.flow strong {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #111827;
  color: white;
  font-size: 14px;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 16px;
  align-items: start;
  margin-top: 16px;
}

.main-col,
.side {
  display: grid;
  gap: 16px;
}

.side {
  position: sticky;
  top: 16px;
}

.section,
.panel {
  border-radius: 16px;
  padding: 18px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-end;
  margin-bottom: 16px;
}

.section-head p {
  max-width: 320px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
}

.plans {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.plan-card {
  display: grid;
  gap: 16px;
  min-height: 280px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--soft);
}

.plan-card.selected {
  border-color: var(--brand);
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(18, 104, 243, .18);
}

.tag {
  min-height: 24px;
  padding: 3px 8px;
  background: #eef4ff;
  color: var(--brand-dark);
}

.plan-name {
  margin-top: 10px;
  font-size: 21px;
  font-weight: 900;
}

.plan-desc {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.price-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.price-option {
  min-height: 86px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  padding: 10px;
  text-align: left;
  cursor: pointer;
}

.price-option:hover,
.price-option.active {
  border-color: var(--brand);
  box-shadow: inset 0 0 0 1px rgba(18, 104, 243, .15);
}

.price-label,
.price-token,
.hint,
.message,
.tools {
  color: var(--muted);
  font-size: 12px;
}

.price-value {
  display: block;
  margin: 4px 0;
  color: var(--red);
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
}

.checks {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: #344054;
  font-size: 13px;
}

.checks li::before {
  content: "✓";
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green);
  font-weight: 900;
}

.panel p {
  color: var(--muted);
  font-size: 13px;
}

.mini {
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  font-size: 12px;
}

.recent,
.empty {
  padding: 18px 10px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

.recent-item {
  display: grid;
  gap: 2px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--soft);
  text-align: left;
}

.recent-item strong,
.recent-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-item span {
  color: var(--muted);
  font-size: 12px;
}

.faq {
  display: grid;
  gap: 9px;
}

details {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--soft);
}

summary {
  min-height: 46px;
  padding: 12px 14px;
  cursor: pointer;
  font-weight: 850;
  list-style: none;
}

summary::-webkit-details-marker {
  display: none;
}

details p {
  margin: 0;
  padding: 0 14px 14px;
  color: var(--muted);
  font-size: 13px;
}

.bottom-bar {
  position: fixed;
  z-index: 30;
  left: 50%;
  bottom: 0;
  width: min(1120px, 100%);
  transform: translateX(-50%);
  padding: 10px 16px max(10px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(14px);
}

.bar-inner {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: center;
}

.selected {
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
}

.selected strong {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-button {
  min-height: 46px;
  padding: 10px 16px;
  white-space: nowrap;
}

.bar-button.secondary {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
}

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

.backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  background: rgba(15, 23, 42, .48);
}

.backdrop.open {
  display: block;
}

.sheet {
  position: fixed;
  z-index: 60;
  left: 50%;
  bottom: 0;
  display: flex;
  flex-direction: column;
  width: min(760px, 100%);
  max-height: min(92vh, 780px);
  transform: translate(-50%, 110%);
  border-radius: 18px 18px 0 0;
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: transform .22s ease;
}

.sheet.open {
  transform: translate(-50%, 0);
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--line);
}

.sheet-head h2 {
  font-size: 18px;
}

.close {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: var(--soft);
  color: var(--muted);
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.sheet-body {
  overflow: auto;
  padding: 16px 18px max(20px, env(safe-area-inset-bottom));
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.steps span {
  min-height: 34px;
  padding: 8px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--muted);
  text-align: center;
  font-size: 12px;
  font-weight: 850;
}

.steps span.active,
.steps span.done {
  background: #eef4ff;
  color: var(--brand-dark);
}

.order-selected,
.order-card,
.copy-row,
.result,
.stat {
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--soft);
}

.order-selected {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding: 12px;
  font-size: 13px;
}

.form-grid,
.payment-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
  color: #344054;
  font-size: 13px;
  font-weight: 750;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: 0;
  background: var(--soft);
  color: var(--text);
  padding: 12px;
}

input:focus,
textarea:focus {
  border-color: rgba(18, 104, 243, .6);
  box-shadow: 0 0 0 3px rgba(18, 104, 243, .12);
}

textarea {
  min-height: 86px;
  resize: vertical;
}

.input-prefix {
  display: grid;
  grid-template-columns: 42px 1fr;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--soft);
}

.input-prefix span {
  display: grid;
  place-items: center;
  border-right: 1px solid var(--line);
  color: var(--muted);
  font-weight: 900;
}

.input-prefix input {
  border: 0;
  border-radius: 0;
}

.trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.full {
  grid-column: 1 / -1;
}

.message {
  min-height: 20px;
  margin: 10px 0 0;
}

.message.error {
  color: var(--red);
}

.message.ok {
  color: var(--green);
}

.payment-option {
  min-height: 78px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--soft);
  padding: 12px;
  text-align: left;
  cursor: pointer;
}

.payment-option.active {
  border-color: var(--brand);
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(18, 104, 243, .15);
}

.payment-option strong {
  display: block;
}

.payment-option span {
  color: var(--muted);
  font-size: 12px;
}

.order-card {
  display: grid;
  gap: 9px;
  margin-bottom: 14px;
  padding: 14px;
  font-size: 13px;
}

.order-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.order-row strong {
  text-align: right;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  word-break: break-all;
}

.copy-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 10px;
  background: white;
}

.copy-row span {
  min-width: 0;
  color: #344054;
  font-size: 12px;
}

.payment-qr-row {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(18, 104, 243, .18);
  border-radius: 13px;
  background: #fff;
}

.payment-qr {
  width: 108px;
  height: 108px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  object-fit: contain;
}

.payment-qr-row strong {
  display: block;
  font-size: 14px;
}

.payment-qr-row span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.tips {
  display: grid;
  gap: 7px;
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 13px;
}

.tips li {
  display: grid;
  grid-template-columns: 8px 1fr;
  gap: 9px;
}

.tips li::before {
  content: "";
  width: 7px;
  height: 7px;
  margin-top: 8px;
  border-radius: 50%;
  background: var(--brand);
}

.ghost,
.primary-btn {
  flex: 1;
  min-height: 44px;
  padding: 10px 14px;
}

.ghost {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
}

.tools {
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.orders-list {
  display: grid;
  gap: 10px;
}

.order-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--soft);
}

.order-open {
  display: grid;
  gap: 4px;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 0;
  text-align: left;
  cursor: pointer;
}

.order-open span {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.delete {
  min-height: 34px;
  border: 1px solid #f0b6ae;
  border-radius: 10px;
  background: #fff;
  color: var(--red);
  padding: 6px 10px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.status {
  min-height: 24px;
  padding: 3px 8px;
  background: var(--amber-soft);
  color: var(--amber);
}

.status.paid,
.status.done {
  background: var(--green-soft);
  color: var(--green);
}

.result {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding: 13px;
}

.result-row {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  font-size: 13px;
}

.result-row strong {
  overflow-wrap: anywhere;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.stat {
  padding: 12px;
}

.stat span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.stat strong {
  display: block;
  margin-top: 4px;
  font-size: 20px;
}

.hidden {
  display: none !important;
}

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

  .side {
    position: static;
  }

  .flow,
  .plans {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .page {
    padding-inline: 10px;
  }

  .hero {
    grid-template-columns: 1fr;
    padding: 18px;
  }

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

  h1 {
    font-size: 30px;
  }

  .title-row,
  .section-head,
  .tools {
    align-items: flex-start;
    flex-direction: column;
  }

  .flow,
  .plans,
  .price-list,
  .form-grid,
  .payment-grid {
    grid-template-columns: 1fr;
  }

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

  .bar-inner #checkoutButton {
    grid-column: 1 / -1;
  }

  .sheet-actions {
    flex-direction: column-reverse;
  }

  .order-item,
  .result-row,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .payment-qr-row {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .payment-qr {
    width: min(100%, 220px);
    height: auto;
  }

  .delete,
  .mini {
    width: 100%;
  }
}
