:root {
  color-scheme: dark;
  --bg: #07080d;
  --panel: rgba(15, 18, 28, .9);
  --panel-strong: #101421;
  --line: rgba(255, 255, 255, .12);
  --text: #f7fbff;
  --muted: #9aa8bd;
  --cyan: #22e6ff;
  --green: #25e68a;
  --pink: #ff3df2;
  --red: #ff4c6a;
  --amber: #f59e0b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, "Microsoft YaHei", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 16% 8%, rgba(34, 230, 255, .18), transparent 28%),
    radial-gradient(circle at 86% 18%, rgba(255, 61, 242, .14), transparent 27%),
    linear-gradient(135deg, #05060a 0%, #101827 52%, #07080d 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

.page {
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
  padding: 26px 0 46px;
  position: relative;
}

.topbar,
.panel,
.side,
.notice {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 24px 80px rgba(0, 0, 0, .38);
  backdrop-filter: blur(16px);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  margin-bottom: 22px;
}

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

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  color: #041014;
  font-weight: 900;
  background: linear-gradient(135deg, var(--cyan), var(--pink));
  box-shadow: 0 0 30px rgba(34, 230, 255, .25);
}

.brand strong {
  display: block;
  font-size: 21px;
}

.brand span:not(.brand-mark) {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.buy-top,
.session-link,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border-radius: 8px;
  font-weight: 900;
  cursor: pointer;
}

.buy-top {
  padding: 0 18px;
  border: 1px solid rgba(34, 230, 255, .35);
  color: #dffcff;
  background: rgba(34, 230, 255, .08);
}

.workbench {
  display: grid;
  grid-template-columns: minmax(280px, 390px) minmax(0, 1fr);
  gap: 20px;
  align-items: stretch;
}

.side {
  padding: 26px;
  min-height: 560px;
}

.eyebrow {
  margin: 0;
  color: var(--cyan);
  font-size: 13px;
  font-weight: 900;
}

h1 {
  margin: 14px 0 28px;
  font-size: clamp(42px, 5.5vw, 68px);
  line-height: 1.05;
  letter-spacing: 0;
}

.steps {
  display: grid;
  gap: 12px;
}

.step {
  position: relative;
  display: grid;
  gap: 5px;
  padding: 16px 16px 16px 54px;
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: 8px;
  background: rgba(255, 255, 255, .04);
}

.step::before {
  content: attr(data-step-dot);
  position: absolute;
  left: 16px;
  top: 50%;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  color: var(--muted);
  border: 1px solid rgba(255, 255, 255, .14);
  transform: translateY(-50%);
}

.step.active {
  border-color: rgba(34, 230, 255, .45);
  background: rgba(34, 230, 255, .08);
}

.step.active::before {
  color: #071014;
  background: var(--cyan);
  box-shadow: 0 0 22px rgba(34, 230, 255, .35);
}

.step strong {
  font-size: 15px;
}

.step span {
  color: var(--muted);
  font-size: 13px;
}

.panel {
  padding: 28px;
  min-height: 560px;
}

.panel-head {
  margin-bottom: 22px;
}

.chip {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 0 10px;
  border-radius: 8px;
  color: #061014;
  background: linear-gradient(135deg, var(--cyan), var(--green));
  font-size: 12px;
  font-weight: 900;
}

h2 {
  margin: 14px 0 8px;
  font-size: 28px;
}

.panel-head p,
.notice p {
  color: var(--muted);
  line-height: 1.7;
}

label {
  display: grid;
  gap: 9px;
  margin-top: 16px;
  color: #eff7ff;
  font-weight: 900;
}

input,
textarea {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 8px;
  color: #fff;
  background: #080c14;
  font-size: 15px;
}

input {
  height: 52px;
  padding: 0 14px;
}

textarea {
  min-height: 210px;
  padding: 14px;
  resize: vertical;
  font-family: Consolas, monospace;
  line-height: 1.55;
}

input:focus,
textarea:focus {
  border-color: rgba(34, 230, 255, .9);
  outline: 3px solid rgba(34, 230, 255, .15);
}

button {
  width: 100%;
  border: 0;
  color: #fff;
  font-size: 16px;
}

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

.primary,
.session-link {
  margin-top: 18px;
  background: linear-gradient(135deg, #0fb9ff, #22e6ff 48%, #b83dff);
  box-shadow: 0 16px 38px rgba(34, 230, 255, .22);
}

.ghost {
  background: rgba(255, 255, 255, .08);
  border: 1px solid var(--line);
}

.actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
  gap: 12px;
  align-items: stretch;
}

.account-panel {
  display: grid;
  gap: 12px;
  margin: 16px 0 0;
}

.account-row {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 12px;
  border: 1px solid rgba(34, 230, 255, .2);
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(34, 230, 255, .08), rgba(255, 255, 255, .025));
}

.account-row span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
}

.account-row strong {
  overflow-x: auto;
  color: #22e6c3;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 800;
  text-shadow: 0 0 12px rgba(34, 230, 195, .32);
}

.checkline {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.checkline input {
  width: 18px;
  height: 18px;
  margin-top: 1px;
}

.message {
  min-height: 52px;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 8px;
  color: var(--muted);
  background: #080c14;
  line-height: 1.55;
}

.message.pending {
  border-color: rgba(255, 61, 242, .55);
  color: #ffe0fb;
}

.message.success {
  border-color: rgba(37, 230, 138, .5);
  color: #d8ffe9;
  background: rgba(37, 230, 138, .08);
}

.message.error {
  border-color: rgba(255, 76, 106, .62);
  color: #ffd6de;
  background: rgba(255, 76, 106, .08);
}

.notice {
  margin-top: 20px;
  padding: 22px 26px;
  border-left: 4px solid var(--cyan);
}

.stock-widget {
  position: fixed;
  right: 24px;
  top: 50%;
  z-index: 40;
  width: min(360px, calc(100vw - 28px));
  max-height: 58vh;
  transform: translateY(-50%);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 8px;
  background: rgba(10, 14, 24, .94);
  box-shadow: 0 24px 80px rgba(0, 0, 0, .34);
  backdrop-filter: blur(18px);
}

.stock-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .1);
}

.stock-head h3 {
  margin: 0;
  font-size: 18px;
}

.stock-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.stock-refresh {
  width: auto;
  min-width: 76px;
  height: 40px;
  border: 1px solid rgba(34, 230, 255, .24);
  border-radius: 8px;
  color: #e7fdff;
  background: rgba(34, 230, 255, .12);
  font-size: 13px;
  font-weight: 900;
}

.stock-list {
  max-height: calc(58vh - 76px);
  overflow: auto;
  padding: 14px;
  background: linear-gradient(180deg, rgba(11, 16, 26, .98) 0%, rgba(6, 10, 18, .98) 100%);
}

.stock-item {
  margin-bottom: 12px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 8px;
  background: rgba(255, 255, 255, .03);
}

.stock-item:last-child {
  margin-bottom: 0;
}

.stock-item-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.stock-item-head strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 16px;
}

.stock-status {
  font-size: 14px;
  font-weight: 900;
  white-space: nowrap;
}

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

.stock-status.bad {
  color: #ff6c84;
}

.stock-meta,
.stock-empty {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.stock-widget.is-empty {
  border-color: rgba(255, 76, 106, .25);
}

.notice h2 {
  margin-top: 0;
}

.hidden {
  display: none !important;
}

@media (max-width: 860px) {
  .topbar,
  .workbench,
  .actions,
  .account-row {
    grid-template-columns: 1fr;
  }

  .topbar {
    display: grid;
  }

  .side,
  .panel {
    min-height: auto;
  }

  .buy-top {
    width: 100%;
  }

  .stock-widget {
    position: static;
    width: 100%;
    max-height: none;
    margin-top: 20px;
    transform: none;
  }

  .stock-list {
    max-height: none;
  }
}
