:root {
  --bg: #070707;
  --bg-soft: #111111;
  --panel: linear-gradient(180deg, rgba(26, 26, 26, 0.96), rgba(14, 14, 14, 0.98));
  --panel-2: linear-gradient(180deg, rgba(22, 22, 22, 0.96), rgba(9, 9, 9, 0.98));
  --text: #f7edd6;
  --muted: #bba579;
  --line: rgba(212, 173, 92, 0.2);
  --gold: #d7ad5c;
  --gold-strong: #f0cb79;
  --gold-soft: rgba(215, 173, 92, 0.14);
  --danger: #d45c5c;
  --success: #78c08e;
  --radius: 24px;
  --shadow: 0 22px 50px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  color: var(--text);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at top right, rgba(215, 173, 92, 0.18), transparent 24%),
    radial-gradient(circle at 20% 0%, rgba(215, 173, 92, 0.12), transparent 30%),
    linear-gradient(180deg, #0d0d0d 0%, #080808 42%, #040404 100%);
}

body {
  padding: calc(env(safe-area-inset-top) + 12px) 12px calc(env(safe-area-inset-bottom) + 26px);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

input,
select,
textarea {
  width: 100%;
  color: #1f1a12;
  background: #a2998a;
  border: 1px solid rgba(215, 173, 92, 0.14);
  border-radius: 5px;
  padding: 10px 10px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

input::placeholder,
textarea::placeholder {
  color: #6e6a63;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(240, 203, 121, 0.68);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(215, 173, 92, 0.12);
}

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

label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

hr {
  border: 0;
  border-bottom: solid 0.05rem #555;
  margin: 20px 0;
}

.mobile-shell {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
}

.mobile-topbar {
  position: sticky;
  top: calc(env(safe-area-inset-top) + 6px);
  z-index: 12;
  margin-bottom: 10px;
  padding: 10px 10px 10px;
  border-radius: 5px;
  background:
    linear-gradient(135deg, rgba(215, 173, 92, 0.08), transparent 38%),
    linear-gradient(180deg, rgba(18, 18, 18, 0.96), rgba(7, 7, 7, 0.98));
  border: 1px solid rgba(215, 173, 92, 0.16);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.topbar-head {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
  padding-right: 124px;
}

.mobile-topbar::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(240, 203, 121, 0.55), transparent);
}

.brand-kicker {
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold-strong);
  margin-bottom: 8px;
}

.topbar-title {
  font-size: 20px;
  line-height: 2;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.card-desc,
.feature-desc {
  color: var(--muted);
  line-height: 1.65;
}

.card-desc {
  margin-top: 8px;
  font-size: 13px;
}

.topbar-actions {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 8px;
}

.topbar-actions > * {
  width: 112px;
}

.wallet-panel {
  margin-top: 12px;
  display: grid;
  gap: 12px;
}

.mobile-main {
  display: grid;
  gap: 18px;
  margin-top: 8px;
}

.page {
  display: none;
  gap: 18px;
}

.page.active {
  display: grid;
}

.card,
.log-card {
  position: relative;
  padding: 10px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid rgba(215, 173, 92, 0.14);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card::before,
.log-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(240, 203, 121, 0.72), transparent);
}

.hero-card {
  background:
    radial-gradient(circle at top right, rgba(215, 173, 92, 0.14), transparent 34%),
    linear-gradient(180deg, rgba(25, 21, 13, 0.98), rgba(11, 11, 11, 0.98));
}

.card-title {
  font-size: 18px;
  line-height: 1.35;
  font-weight: 700;
}

.page-heading {
  display: grid;
  gap: 14px;
}

.feature-list {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.feature-item {
  position: relative;
  display: grid;
  gap: 6px;
  width: 100%;
  text-align: left;
  padding: 20px 20px 20px 22px;
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(215, 173, 92, 0.06), transparent 44%),
    var(--panel-2);
  border: 1px solid rgba(215, 173, 92, 0.12);
  color: var(--text);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.feature-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 14px;
  width: 4px;
  border-radius: 0 6px 6px 0;
  background: linear-gradient(180deg, rgba(240, 203, 121, 0.92), rgba(170, 122, 38, 0.6));
  opacity: 0.5;
}

.feature-item:active {
  transform: scale(0.992);
}

.feature-item.active {
  border-color: rgba(240, 203, 121, 0.38);
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.28), inset 0 0 0 1px rgba(240, 203, 121, 0.08);
}

.feature-item.active::before {
  opacity: 1;
}

.feature-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.feature-desc {
  font-size: 12px;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.primary-btn,
.ghost-btn {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 5px;
  font-weight: 600;
  font-size: 12px;
}

.primary-btn,
.layui-btn.primary-btn,
.full-btn {
  color: #130d04;
  background: linear-gradient(180deg, #f4cf81, #d6a44d 78%, #bb8839);
  box-shadow: 0 12px 24px rgba(215, 173, 92, 0.24);
}

.ghost-btn,
.layui-btn.layui-btn-primary.ghost-btn {
  color: var(--gold-strong);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(215, 173, 92, 0.22);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.full-btn {
  width: 100%;
}

.top-back-btn {
  display: none;
  width: 112px;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-align: center;
  align-items: center;
  justify-content: center;
  color: #cfba90;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(215, 173, 92, 0.16);
  box-shadow: none;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  width: 112px;
  padding: 0 10px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  border: 1px solid rgba(215, 173, 92, 0.16);
}

.status-chip.idle {
  background: rgba(255, 255, 255, 0.03);
  color: #cfba90;
}

.status-chip.connecting {
  background: rgba(215, 173, 92, 0.14);
  color: var(--gold-strong);
}

.status-chip.ready {
  background: rgba(120, 192, 142, 0.12);
  color: var(--success);
}

.status-chip.failed {
  background: rgba(212, 92, 92, 0.12);
  color: var(--danger);
}

.info-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  font-size: 12px;
  line-height: 1.7;
}

.info-list.spaced {
  gap: 10px;
}

.form-grid {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.inline-field {
  margin-top: 12px;
}

.health-table-wrap {
  width: 100%;
  overflow-x: auto;
  margin-top: 12px;
  border-radius: 16px;
  border: 1px solid rgba(215, 173, 92, 0.12);
}

.health-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  background: #0f0f0f;
}

.health-table th,
.health-table td {
  border-bottom: 1px solid rgba(215, 173, 92, 0.1);
  padding: 11px 12px;
  text-align: left;
  vertical-align: top;
  font-size: 12px;
  line-height: 1.6;
}

.health-table thead th {
  background: #171717;
  color: var(--gold-strong);
  font-weight: 700;
}

.order-card {
  padding: 12px 14px;
  border: 1px dashed rgba(215, 173, 92, 0.26);
  border-radius: 14px;
  background: rgba(215, 173, 92, 0.05);
}

.log-output {
  min-height: 220px;
  max-height: 340px;
  overflow: auto;
  margin: 12px 0 0;
  padding: 14px;
  border-radius: 5px;
  background: #cfba90;
  border: 1px solid rgba(215, 173, 92, 0.1);
  color: #000;
  font-size: 12px;
  line-height: 1.2;
  white-space: pre-wrap
}

.login-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(10px);
  z-index: 100;
}

.login-overlay.active {
  display: flex;
}

.login-dialog {
  width: min(100%, 420px);
  padding: 26px 22px;
  border-radius: 26px;
  background:
    radial-gradient(circle at top, rgba(215, 173, 92, 0.12), transparent 34%),
    linear-gradient(180deg, rgba(18, 18, 18, 0.98), rgba(8, 8, 8, 0.98));
  border: 1px solid rgba(215, 173, 92, 0.18);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
}

.mobile-loading-box {
  width: 120px;
  padding: 8px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 0;
  background: transparent;
  color: var(--gold-strong);
}

.mobile-loading-layer,
.mobile-loading-layer .layui-layer-content,
.mobile-loading-layer .layui-m-layercont {
  background: transparent !important;
}

.mobile-loading-layer.layui-layer,
.mobile-loading-layer .layui-layer-content,
.mobile-loading-layer .layui-m-layersection {
  border: 0 !important;
  box-shadow: none !important;
}

.mobile-loading-layer .layui-layer-content,
.mobile-loading-layer .layui-m-layercont {
  padding: 0 !important;
}

.mobile-loading-spinner {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid rgba(215, 173, 92, 0.24);
  border-top-color: var(--gold-strong);
  animation: mobileSpin 0.8s linear infinite;
}

.mobile-loading-text {
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
  color: #d7ad5c;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.mobile-msg-layer {
  background: rgba(18, 18, 18, 0.96) !important;
  color: var(--gold-strong) !important;
  border: 1px solid rgba(215, 173, 92, 0.2) !important;
  border-radius: 10px !important;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35) !important;
}

.mobile-dialog-layer .layui-m-layerchild,
.mobile-dialog-layer .layui-layer,
.mobile-dialog-layer .layui-layer-content,
.mobile-dialog-layer .layui-m-layercont {
  background: transparent !important;
}

.mobile-dialog-layer .layui-m-layerbtn span,
.mobile-dialog-layer .layui-layer-btn a {
  color: var(--gold-strong) !important;
  border-color: rgba(215, 173, 92, 0.16) !important;
  background: rgba(255, 255, 255, 0.03) !important;
}

.mobile-dialog-layer .layui-m-layerbtn,
.mobile-dialog-layer .layui-layer-btn {
  background: rgba(10, 10, 10, 0.96) !important;
  border-top: 1px solid rgba(215, 173, 92, 0.12) !important;
}

.mobile-dialog-layer .layui-m-layerchild {
  border: 1px solid rgba(215, 173, 92, 0.18) !important;
  border-radius: 16px !important;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.46) !important;
  overflow: hidden !important;
}

.mobile-dialog-box {
  padding: 18px 16px 14px;
  background: linear-gradient(180deg, rgba(18, 18, 18, 0.98), rgba(8, 8, 8, 0.98));
  color: var(--gold-strong);
}

.mobile-dialog-title {
  margin-bottom: 10px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
}

.mobile-dialog-content {
  font-size: 13px;
  line-height: 1.7;
  color: #e9d3a3;
  word-break: break-word;
}

@keyframes mobileSpin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@media (min-width: 720px) {
  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .topbar-head {
    min-height: 68px;
    padding-right: 120px;
  }

  .topbar-title {
    font-size: 20px;
  }
}
