:root {
  --ink: #6e2c08;
  --ink-title: #4f280d;
  --label: #7a4a2e;
  --hint: rgba(154, 112, 88, 0.82);
  --card: #fdf6ec;
  --card-border: rgba(190, 132, 82, 0.4);
  --panel: rgba(255, 251, 244, 0.96);
  --panel-border: rgba(190, 132, 82, 0.3);
  --input-border: rgba(187, 128, 112, 0.35);
  --input-focus: rgba(196, 90, 42, 0.65);
  --accent-top: #e88a3a;
  --accent-bottom: #b84a12;
  --cancel-top: #f5e8d8;
  --cancel-bottom: #e8d4bc;
  --error: #c53030;
  --success: #1e6a6a;
  --shadow: rgba(79, 40, 13, 0.12);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", sans-serif;
  color: var(--ink);
  background: #fff6e8;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

button,
input,
a {
  font: inherit;
  -webkit-appearance: none;
  appearance: none;
}

.page-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 120% 80% at 100% 0%, rgba(255, 220, 170, 0.35), transparent 55%),
    linear-gradient(180deg, #fff9ef 0%, #fff6e8 45%, #ffefe0 100%);
}

.shell {
  position: relative;
  max-width: 420px;
  margin: 0 auto;
  padding: calc(16px + env(safe-area-inset-top, 0px)) 16px calc(20px + var(--safe-bottom));
}

.head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 8px;
}

.title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--ink-title);
  letter-spacing: 0.02em;
}

.title-deco {
  width: 52px;
  height: 12px;
  background: linear-gradient(90deg, transparent, rgba(190, 132, 82, 0.45), transparent);
  border-radius: 2px;
  position: relative;
}

.title-deco::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 6px;
  height: 6px;
  margin-top: -3px;
  background: rgba(196, 90, 42, 0.55);
  transform: rotate(45deg);
  border-radius: 1px;
}

.title-deco-left::after {
  right: 0;
}

.title-deco-right::after {
  left: 0;
}

.case-title {
  margin: 0 0 14px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--hint);
  line-height: 1.5;
}

.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  box-shadow: 0 8px 24px var(--shadow);
  padding: 14px;
}

.gate {
  text-align: center;
  padding: 28px 18px;
}

.gate-text {
  margin: 0 0 18px;
  font-size: 15px;
  line-height: 1.55;
  color: var(--label);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 12px;
}

.pay-switch {
  display: flex;
  gap: 4px;
  margin-bottom: 10px;
  padding: 3px;
  border-radius: 8px;
  border: 1px solid rgba(190, 132, 82, 0.22);
  background: rgba(255, 248, 238, 0.65);
}

.pay-tab {
  flex: 1;
  border: none;
  background: transparent;
  color: rgba(138, 92, 68, 0.58);
  font-size: 15px;
  font-weight: 500;
  padding: 8px 6px;
  border-radius: 6px;
}

.pay-tab.is-active {
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink-title);
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(79, 40, 13, 0.08);
}

.balance {
  margin: 0 0 4px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--label);
  font-weight: 500;
}

.hint {
  margin: 0 0 10px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--hint);
}

.amount-input {
  display: block;
  width: 100%;
  border: 1px solid var(--input-border);
  border-radius: 10px;
  background: rgba(255, 251, 244, 0.98);
  padding: 12px;
  font-size: 15px;
  font-weight: 600;
  color: #5c3d2c;
  outline: none;
}

.amount-input::placeholder {
  color: rgba(154, 112, 88, 0.68);
  font-weight: 500;
}

.amount-input:focus {
  border-color: var(--input-focus);
  box-shadow: 0 0 0 2px rgba(196, 90, 42, 0.1);
}

.amount-input.has-error {
  border-color: var(--error);
}

.error {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--error);
  font-weight: 600;
}

.actions {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 10px;
  margin-top: 12px;
}

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  border: none;
  padding: 0 16px;
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  overflow: hidden;
}

.btn > span {
  position: relative;
  z-index: 1;
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  pointer-events: none;
}

.btn-cancel {
  flex: 0 0 154px;
  width: 154px;
  background: linear-gradient(180deg, var(--cancel-top), var(--cancel-bottom));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.btn-cancel > span {
  color: var(--ink-title);
}

.btn-submit {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 220px;
  background: linear-gradient(180deg, var(--accent-top), var(--accent-bottom));
  box-shadow: 0 2px 8px rgba(184, 74, 18, 0.28);
}

.btn-submit > span {
  color: #ffe2b2;
}

.btn-block {
  display: flex;
  width: 100%;
  max-width: none;
}

.btn:disabled {
  opacity: 0.55;
  pointer-events: none;
}

.success-card {
  text-align: center;
  padding: 28px 18px 18px;
}

.success-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: rgba(30, 106, 106, 0.12);
  color: var(--success);
  font-size: 28px;
  font-weight: 700;
  line-height: 52px;
}

.success-title {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 700;
  color: var(--ink-title);
}

.success-desc {
  margin: 0 0 18px;
  font-size: 14px;
  color: var(--hint);
}

@media (min-width: 480px) {
  .shell {
    padding-top: 32px;
  }
}
