:root {
  color-scheme: dark;
  --bg: #171b27;
  --panel: #282c3a;
  --panel-2: #202535;
  --panel-3: #181d2b;
  --line: #34394a;
  --line-soft: #2e3343;
  --text: #edf6ff;
  --muted: #9aa2b2;
  --mint: #62ead4;
  --mint-2: #40d4bd;
  --blue: #2386ff;
  --purple: #7059e8;
  --yellow: #ffb31a;
  --green: #47d11d;
  --red: #ff4556;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  font-size: 14px;
  letter-spacing: 0;
}

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

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  overflow-x: hidden;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #181c28;
}

.delivery-public-page {
  min-height: 100vh;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 42px 0 80px;
}

.package-public-page {
  min-height: 100vh;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 80px;
}

.package-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
  padding: 18px 20px;
  border: 1px solid rgba(98, 234, 212, 0.28);
  border-radius: 8px;
  background: #202535;
}

.package-hero h1 {
  margin: 0 0 6px;
  color: var(--mint);
  font-size: 24px;
}

.package-hero p {
  margin: 0;
  color: var(--muted);
}

.delivery-auth-card {
  width: min(440px, 100%);
  margin: 48px auto 0;
  padding: 28px 24px 34px;
  border: 1px solid rgba(98, 234, 212, 0.35);
  border-radius: 16px;
  background: var(--panel);
}

.delivery-auth-card h1 {
  margin: 0 0 16px;
  color: var(--mint);
}

.delivery-auth-card p {
  color: var(--muted);
}

.delivery-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
  padding: 22px;
  border: 1px solid rgba(98, 234, 212, 0.28);
  border-radius: 16px;
  background: linear-gradient(90deg, rgba(98, 234, 212, 0.08), rgba(35, 134, 255, 0.08));
}

.delivery-hero h1 {
  margin: 0 0 8px;
  color: var(--mint);
  font-size: 28px;
}

.delivery-hero p {
  margin: 0;
  color: #b9c5d8;
}

.delivery-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(110px, 1fr));
  gap: 10px;
  flex: 1 1 560px;
}

.delivery-metrics div {
  min-height: 68px;
  padding: 10px 14px;
  border: 1px solid #35405a;
  border-radius: 10px;
  background: #151b2a;
}

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

.delivery-metrics strong {
  display: block;
  margin-top: 6px;
  color: var(--mint);
  font-size: 22px;
  overflow-wrap: anywhere;
}

.login-card {
  width: min(400px, 100%);
  background: #2a2e3c;
  border-radius: 14px;
  padding: 38px 40px 40px;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.24);
}

.redeem-card {
  width: min(520px, 100%);
}

.brand {
  margin: 0;
  color: var(--mint);
  text-align: center;
  font-size: 24px;
  font-weight: 800;
}

.brand-sub {
  margin: 10px 0 28px;
  color: var(--muted);
  text-align: center;
}

.login-tabs,
.nav-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--line);
}

.login-tabs {
  margin-bottom: 6px;
}

.login-tabs button,
.nav-tabs button {
  min-height: 40px;
  border: 0;
  background: transparent;
  color: var(--muted);
}

.login-tabs button {
  flex: 1;
}

.login-tabs button[hidden] {
  display: none;
}

.login-tabs .active,
.nav-tabs .active {
  color: var(--mint);
  border-bottom: 2px solid var(--mint);
}

.field {
  margin-top: 18px;
}

.login-info {
  margin-top: 14px;
  padding: 9px 12px;
  border: 1px solid var(--mint);
  border-radius: 6px;
  background: rgba(98, 234, 212, 0.08);
  color: var(--mint);
  font-size: 13px;
}

.login-info[hidden] {
  display: none;
}

.field label {
  display: block;
  margin-bottom: 8px;
  color: #d8e2f1;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: end;
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid #424858;
  border-radius: 7px;
  background: #171b27;
  color: var(--text);
  padding: 0 14px;
  outline: none;
}

.textarea {
  min-height: 96px;
  padding: 12px 14px;
  resize: vertical;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--mint);
}

.btn {
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: var(--mint);
  color: #08131a;
  font-weight: 800;
}

.btn:hover {
  filter: brightness(1.05);
}

.btn.full {
  width: 100%;
  min-height: 46px;
  margin-top: 26px;
}

.btn.outline {
  background: transparent;
  border-color: var(--mint);
  color: var(--mint);
}

.btn.blue {
  background: var(--blue);
  color: #fff;
}

.btn.purple {
  background: var(--purple);
  color: #fff;
}

.btn.green {
  background: var(--green);
  color: #06120a;
}

.btn.mint {
  background: #12bfc8;
  color: #061313;
}

.btn.red {
  background: #ff4d4f;
  border-color: var(--red);
  color: #fff;
}

.btn.yellow {
  background: var(--yellow);
  border-color: var(--yellow);
  color: #15100a;
}

.btn.ghost {
  background: #151b2a;
  border-color: #425071;
  color: #d9e4ff;
}

.btn.small {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.topbar {
  min-height: 56px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 24px;
  background: #202431;
  border-bottom: 1px solid var(--line);
}

.topbar-title {
  color: var(--mint);
  font-size: 20px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

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

.notice {
  height: 42px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 24px;
  background: #292d3a;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  white-space: nowrap;
}

.notice strong {
  color: var(--yellow);
  flex: 0 0 auto;
}

.notice span {
  display: inline-block;
  min-width: 100%;
  color: #c5c9d4;
  animation: notice-marquee 18s linear infinite;
  will-change: transform;
}

@keyframes notice-marquee {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(-100%);
  }
}

.page {
  width: min(1120px, calc(100% - 32px));
  margin: 24px auto 80px;
}

.admin-page {
  width: min(1220px, calc(100% - 40px));
  margin: 24px auto 80px;
}

.nav-tabs {
  flex-wrap: wrap;
  gap: 22px;
  padding: 0 24px;
  background: #202431;
}

.nav-tabs button {
  min-width: 96px;
  padding: 0 10px;
}

.function-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px;
  background: var(--panel);
  border-radius: 8px;
  margin-bottom: 14px;
}

.function-nav strong {
  color: var(--mint);
  margin-right: 8px;
}

.function-nav button {
  display: inline-flex;
  gap: 9px;
  align-items: center;
  min-height: 40px;
  min-width: 128px;
  padding: 0 14px;
  border: 1px solid #3b4663;
  border-radius: 8px;
  background: #182033;
  color: #dce8ff;
}

.function-nav button.active {
  border-color: var(--mint);
  background: rgba(98, 234, 212, 0.16);
  color: var(--mint);
}

.icon-box {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 5px;
  border: 1px solid #46557a;
  color: #a9c8ff;
  font-size: 12px;
}

.panel {
  background: var(--panel);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 18px;
}

.panel-head {
  min-height: 58px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  background: var(--panel);
  border-bottom: 1px solid var(--line-soft);
}

.panel-title {
  color: var(--mint);
  font-size: 16px;
  font-weight: 800;
}

.panel-body {
  padding: 20px;
}

.admin-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 14px 18px 16px;
  border-top: 1px solid var(--line-soft);
  background: #1e2331;
  color: #aeb8cf;
}

.pager-btn {
  min-width: 64px;
  height: 34px;
  border: 1px solid #3a4358;
  border-radius: 4px;
  background: #1f2431;
  color: #e7edf7;
  font-weight: 700;
  cursor: pointer;
}

.pager-btn:disabled {
  color: #5f6678;
  border-color: #303746;
  background: #1b202b;
  cursor: not-allowed;
}

.pager-info {
  min-width: 138px;
  text-align: center;
  font-size: 14px;
  white-space: nowrap;
}

.pager-size {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  white-space: nowrap;
}

.pager-size .select {
  width: 88px;
  min-height: 34px;
  padding: 0 26px 0 10px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(5, 8, 15, 0.64);
}

.modal {
  width: min(720px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

.compact-modal {
  width: min(420px, 100%);
}

.modal-head {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line-soft);
}

.modal-body {
  padding: 20px;
}

.stack-form {
  display: grid;
  gap: 14px;
}

.stack-form label {
  display: grid;
  gap: 7px;
  color: #dbe6f6;
}

.icon-btn {
  width: 34px;
  height: 34px;
  border: 1px solid #495269;
  border-radius: 6px;
  background: #171b27;
  color: var(--text);
  font-size: 20px;
  line-height: 1;
}

.token-import-textarea {
  min-height: 220px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.toolbar .input,
.toolbar .select {
  width: 160px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(150px, 1fr));
  gap: 16px;
}

.stat-card {
  min-height: 105px;
  display: grid;
  place-items: center;
  background: var(--panel);
  border-radius: 8px;
  text-align: center;
}

.stat-number {
  display: block;
  margin-bottom: 8px;
  color: var(--mint);
  font-size: 34px;
  font-weight: 900;
}

.stat-number.yellow {
  color: var(--yellow);
}

.stat-number.blue {
  color: var(--blue);
}

.stat-number.red {
  color: var(--red);
}

.stat-number.purple {
  color: #9a52ff;
}

.summary-row {
  display: grid;
  grid-template-columns: 1fr 120px 135px 80px;
  gap: 10px;
  margin-bottom: 20px;
}

.score-card {
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border: 1px solid var(--mint);
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(98, 234, 212, 0.08), rgba(71, 209, 29, 0.08));
}

.score-card .label {
  color: #bcc8d8;
}

.score-card .score {
  color: var(--mint);
  font-size: 34px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.metric-card {
  min-height: 100px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  font-size: 16px;
  font-weight: 900;
}

.metric-card.mint {
  background: var(--mint);
  color: #061313;
}

.table-wrap {
  width: 100%;
  overflow: auto;
}

.package-token-table {
  min-width: 1120px;
}

.package-token-table th,
.package-token-table td {
  padding: 14px 18px;
}

.package-actions {
  min-width: 280px;
}

.package-action-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 3px 0;
  white-space: nowrap;
}

.text-action {
  appearance: none;
  border: 0;
  background: transparent;
  color: #ffffff;
  padding: 2px 0;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.3;
  cursor: pointer;
}

.text-action:hover {
  text-decoration: underline;
}

.text-action:disabled {
  color: #6d7487;
  cursor: not-allowed;
  text-decoration: none;
}

.text-action.action-refresh {
  color: #39a2ff;
}

.text-action.action-success {
  color: #23d36b;
}

.text-action.action-danger {
  color: #ff4b5c;
}

.area-tag-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.area-tag-badge b {
  font-weight: 900;
}

.area-tag-q {
  color: #2563eb;
  background: rgba(37, 99, 235, 0.1);
  border-color: rgba(37, 99, 235, 0.35);
}

.area-tag-v {
  color: #15803d;
  background: rgba(34, 197, 94, 0.1);
  border-color: rgba(34, 197, 94, 0.35);
}

.area-tag-qv {
  color: #b45309;
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.42);
}

.simple-record-modal {
  max-width: 560px;
  background: #f6f6f6;
  color: #333;
}

.simple-record-head {
  border-bottom: 0;
}

.simple-record-body {
  padding-top: 8px;
}

.simple-record-list {
  display: grid;
  gap: 4px;
  padding: 0 10px 18px;
  border-bottom: 1px solid #ddd;
  color: #333;
}

.simple-record-list div {
  display: flex;
  gap: 4px;
}

.simple-record-list span {
  min-width: 58px;
}

.simple-record-actions {
  display: flex;
  justify-content: flex-start;
  padding: 12px 10px 0;
}

.admin-user-action-modal {
  max-width: 460px;
}

.settle-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.settle-metrics div {
  display: grid;
  gap: 4px;
  place-items: center;
  min-height: 78px;
  border-radius: 8px;
  background: #191e2e;
}

.settle-metrics strong {
  color: #39ff14;
  font-size: 26px;
  font-weight: 900;
}

.settle-metrics div:first-child strong {
  color: var(--yellow);
}

.settle-metrics div:last-child strong {
  color: var(--blue);
}

.settle-note-box {
  padding: 12px 14px;
  border: 1px dashed #565d70;
  border-radius: 8px;
  background: #171b27;
  color: #d7def0;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  min-height: 44px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: middle;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.admin-page th,
.admin-page td {
  padding: 13px 12px;
  font-size: 13px;
}

.admin-page .btn.small {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

.admin-page form.toolbar {
  display: grid;
  grid-template-columns: repeat(2, 150px) repeat(2, minmax(180px, 1fr)) repeat(7, auto);
  gap: 10px;
  align-items: center;
}

.admin-page form.toolbar .input,
.admin-page form.toolbar .select {
  width: 100%;
  min-height: 38px;
}

.admin-page .admin-token-filter-toolbar.no-color {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.admin-page .admin-token-filter-toolbar.with-color {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.admin-filter-row,
.admin-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.admin-page .admin-token-filter-toolbar .select {
  width: 122px;
  flex: 0 0 122px;
}

.admin-page .admin-token-filter-toolbar .input {
  width: 150px;
  flex: 0 0 150px;
}

.admin-page .admin-token-filter-toolbar .token-query {
  width: 190px;
  flex-basis: 190px;
}

.admin-page .admin-token-filter-toolbar .btn {
  min-width: 92px;
  padding-inline: 14px;
  white-space: nowrap;
}

th {
  background: #1d2232;
  color: var(--mint);
  font-weight: 800;
}

td:last-child {
  min-width: 150px;
}

tr:nth-child(even) td {
  background: rgba(48, 55, 73, 0.34);
}

.muted {
  color: var(--muted);
}

.mono {
  font-family: Consolas, "SFMono-Regular", monospace;
  overflow-wrap: anywhere;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  background: #344052;
  color: #f4f7ff;
  font-size: 12px;
  font-weight: 800;
}

.tag.green {
  background: #275333;
  color: #65ff3b;
}

.tag.yellow {
  background: #5c4925;
  color: #ffc233;
}

.tag.red {
  background: #542a35;
  color: #ff4354;
}

.tag.blue {
  background: #1d4b79;
  color: #25a6ff;
}

.tag.mint {
  background: #28595b;
  color: var(--mint);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 12px;
  align-items: end;
}

.form-grid.wide {
  grid-template-columns: repeat(5, minmax(140px, 1fr));
}

.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.details {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(19, 24, 37, 0.45);
}

.details summary {
  cursor: pointer;
  color: var(--mint);
  font-weight: 800;
}

.abnormal-strip {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px 20px;
  background: rgba(255, 69, 86, 0.12);
  color: #ff6d75;
}

.mini-stat {
  display: inline-grid;
  place-items: center;
  min-width: 86px;
  min-height: 42px;
  margin: 3px;
  padding: 6px 10px;
  border: 1px solid #35405a;
  border-radius: 7px;
  background: #171d2d;
  color: #edf6ff;
  font-size: 12px;
}

.config-list {
  display: grid;
  gap: 16px;
}

.config-item {
  display: grid;
  grid-template-columns: 1fr 160px;
  gap: 20px;
  align-items: center;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line-soft);
}

.config-item.skin-config {
  grid-template-columns: minmax(260px, 1fr) minmax(420px, 620px);
  align-items: start;
}

.config-item strong {
  display: block;
  margin-bottom: 5px;
}

.skins {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 10px 18px;
}

.skin-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 10px;
  border-radius: 8px;
  background: #151b2a;
  border: 1px solid #303a54;
}

.settings-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 14px;
  margin-bottom: 18px;
}

.settings-bar label {
  display: grid;
  gap: 6px;
  color: #dbe6f6;
}

.settings-bar .select {
  width: 180px;
}

.skin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, max-content));
  gap: 12px;
}

.skin-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid #36425e;
  border-radius: 8px;
  background: #101624;
}

.skin-card.selected {
  border-color: var(--mint);
  box-shadow: inset 0 0 0 1px rgba(98, 234, 212, 0.45);
}

.skin-card input {
  position: static;
  z-index: 1;
  flex: 0 0 auto;
}

.skin-card img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  border-radius: 4px;
  background: transparent;
}

.skin-card span {
  color: #edf6ff;
  font-size: 12px;
  line-height: 1.35;
  text-align: left;
  white-space: nowrap;
}

.skin-preview {
  display: grid;
  gap: 8px;
  justify-items: center;
  padding: 12px;
  border: 1px solid #35405a;
  border-radius: 8px;
  background: #151b2a;
  color: var(--mint);
  font-weight: 800;
}

.skin-preview img {
  width: min(180px, 100%);
  height: 160px;
  object-fit: contain;
}

.package-token-modal {
  width: min(760px, 100%);
}

.package-token-body,
.exchange-detail-body {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 18px;
  align-items: start;
}

.qr-card {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 16px;
  border: 1px solid #35405a;
  border-radius: 8px;
  background: #151b2a;
}

.qr-index {
  position: absolute;
  top: 8px;
  left: 8px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  font-weight: 900;
}

.qr-img,
.qr-canvas {
  width: 180px;
  height: 180px;
  border: 8px solid #fff;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}

.qr-img {
  object-fit: contain;
}

.qr-img[hidden],
.qr-canvas[hidden] {
  display: none !important;
}

.qr-img.large,
.qr-canvas.large {
  width: 220px;
  height: 260px;
}

.user-token-modal {
  width: min(510px, calc(100vw - 28px));
  background: #f4f4f4;
  color: #20242b;
  border-radius: 10px;
}

.user-token-modal .modal-head {
  border-bottom: 0;
  justify-content: center;
  padding: 28px 28px 10px;
}

.user-token-modal .panel-title {
  color: #20242b;
  font-size: 20px;
  font-weight: 800;
}

.user-token-modal .icon-btn {
  position: absolute;
  right: 14px;
  top: 14px;
  color: #777;
}

.user-token-body {
  display: grid;
  gap: 16px;
  padding: 8px 30px 30px;
}

.bind-qr-panel {
  display: grid;
  justify-items: center;
  gap: 9px;
  text-align: center;
}

.bind-qr-panel p {
  margin: 0;
  color: #343941;
  font-size: 14px;
}

.bind-qr-panel a {
  max-width: 100%;
  color: #0645d9;
  font-size: 12px;
  overflow-wrap: anywhere;
  line-height: 1.25;
}

.inline-error {
  max-width: 100%;
  color: var(--red);
  font-size: 12px;
  line-height: 1.35;
}

.qr-placeholder {
  position: relative;
  display: grid;
  place-items: center;
  width: 220px;
  height: 220px;
  border: 1px dashed #8d96a8;
  border-radius: 8px;
  background: #f3f5f8;
  color: #586174;
  font-size: 13px;
}

.qr-placeholder strong {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  color: #ff1515;
  font-size: 38px;
  line-height: 1;
  font-weight: 900;
}

.form-row.center {
  justify-content: center;
}

.bind-qr-wrap {
  position: relative;
  width: 220px;
  min-height: 260px;
  cursor: pointer;
}

.bind-qr-wrap .qr-img,
.bind-qr-wrap .qr-canvas {
  display: block;
}

.qr-copy-hint {
  margin-top: 4px;
  color: #667085;
  font-size: 12px;
}

.token-redeem-box {
  display: grid;
  gap: 11px;
}

.token-redeem-box > div {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 6px;
  color: #343941;
}

.token-redeem-box span {
  color: #343941;
}

.token-redeem-box strong {
  color: #20242b;
  font-weight: 600;
}

.token-redeem-box .input,
.token-redeem-box .select {
  background: #fff;
  border-color: #d3d6dd;
  color: #20242b;
}

.token-redeem-box .input {
  min-height: 34px;
}

.token-redeem-box .redeem-select-row,
.redeem-card .redeem-select-row {
  display: grid;
  gap: 6px;
  margin-top: 8px;
  color: #343941;
  font-weight: 700;
}

.redeem-card .redeem-select-row {
  color: #dbe6f6;
}

.token-redeem-box .redeem-select-row .select,
.redeem-card .redeem-select-row .select {
  width: 100%;
}

.btn.neutral {
  background: #d1d1d1;
  color: #1f2328;
}

.redeem-result-modal {
  position: relative;
  width: min(400px, calc(100vw - 28px));
  background: #f4f4f4;
  color: #20242b;
  border-radius: 10px;
}

.floating-close {
  position: absolute;
  right: 14px;
  top: 12px;
  color: #8a8a8a;
}

.redeem-result-body {
  display: grid;
  grid-template-columns: 110px 1fr;
  align-items: center;
  gap: 24px;
  padding: 48px 38px 40px;
}

.redeem-result-skin .skin-preview {
  padding: 0;
  border: 0;
  background: transparent;
  color: #20242b;
}

.redeem-result-skin .skin-preview img {
  width: 86px;
  height: 86px;
}

.redeem-result-skin .skin-preview span {
  display: none;
}

.redeem-result-info {
  display: grid;
  gap: 15px;
  font-size: 14px;
}

.redeem-result-info p {
  margin: 0;
}

.success-text {
  color: #0ba83f;
  font-weight: 800;
}

.fail-text {
  color: #e02b3d;
  font-weight: 800;
}

.token-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.token-info-grid div {
  min-height: 64px;
  padding: 10px 12px;
  border: 1px solid #35405a;
  border-radius: 7px;
  background: #151b2a;
}

.token-info-grid div.wide {
  grid-column: 1 / -1;
}

.token-info-grid span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
}

.token-info-grid strong {
  color: #edf6ff;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.exchange-detail-modal {
  width: min(820px, 100%);
}

.exchange-skin {
  min-width: 0;
}

.claim-token-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.claim-token-list div {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 7px;
  background: #151b2a;
}

.downline-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 16px;
  padding: 16px;
}

.downline-create {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 14px;
  border: 1px solid #35405a;
  border-radius: 8px;
  background: #151b2a;
}

.downline-create strong {
  color: var(--mint);
}

.submitter-page .function-nav {
  margin-bottom: 14px;
}

.submitter-nav button {
  min-width: 128px;
}

.submitter-stats {
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  margin-bottom: 28px;
}

.submitter-stat {
  min-height: 104px;
  border: 1px solid #3a465f;
  background: rgba(98, 234, 212, 0.06);
}

.submitter-stat.green {
  border-color: var(--green);
}

.submitter-stat.blue {
  border-color: var(--blue);
}

.submitter-stat small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.submitter-token-panel .panel-body {
  display: grid;
  gap: 18px;
}

.submitter-bulk-panel {
  margin-top: 18px;
}

.submitter-bulk-form {
  display: grid;
  gap: 12px;
}

.submitter-bulk-form label {
  color: #d8e2f1;
  font-weight: 700;
}

.submitter-bulk-textarea {
  min-height: 150px;
  resize: vertical;
}

.submitter-token-form {
  display: grid;
  gap: 14px;
}

.submitter-token-form label {
  display: grid;
  gap: 7px;
  color: #d8e2f1;
}

.phone-code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px;
  gap: 10px;
}

.phone-input {
  max-width: 100%;
  font-variant-numeric: tabular-nums;
}

.code-btn {
  white-space: nowrap;
}

.submitter-submit {
  margin-top: 2px;
}

.submitter-history-filter {
  display: grid;
  grid-template-columns: 140px 140px 120px minmax(180px, 1fr) minmax(220px, 1fr);
  gap: 10px;
  align-items: start;
}

.submitter-history-actions {
  display: flex;
  gap: 10px;
  grid-column: 1 / -1;
}

.token-copy-cell {
  cursor: pointer;
  color: #d5d9e5;
  text-decoration: none;
  text-underline-offset: 4px;
}

.token-copy-cell:hover {
  color: var(--mint);
}

.admin-token-cell {
  min-width: 150px;
  max-width: 190px;
  white-space: nowrap;
  word-break: normal;
  overflow-wrap: normal;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-token-table-wrap {
  padding: 4px 12px 14px;
}

.admin-token-table-wrap table,
.admin-token-table {
  min-width: 1120px;
  border-collapse: separate;
  border-spacing: 0 6px;
}

.admin-token-table th,
.admin-token-table td {
  height: 64px;
  vertical-align: middle;
}

.admin-token-table .token-actions {
  display: grid;
  grid-template-columns: repeat(2, max-content);
  gap: 6px;
  min-width: 190px;
  white-space: nowrap;
  word-break: normal;
}

.admin-token-table .nowrap,
.admin-token-table .phone-cell {
  white-space: nowrap;
}

.red-text {
  color: var(--red);
}

.submitter-history th,
.submitter-history td {
  white-space: nowrap;
  word-break: normal;
  overflow-wrap: normal;
}

.submitter-history td:nth-child(6) {
  white-space: normal;
  overflow-wrap: anywhere;
}

.nowrap,
.phone-cell {
  white-space: nowrap;
  word-break: normal;
  overflow-wrap: normal;
}

.announcement-form {
  display: grid;
  grid-template-columns: 1fr 120px auto;
  gap: 10px;
}

.announcement-content {
  max-width: 640px;
  white-space: normal;
}

.rank-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 20px;
}

.rank-row {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 6px;
  background: #1d2232;
}

.rank-row + .rank-row {
  margin-top: 6px;
}

.rank-row b {
  color: var(--mint);
}

.rank-row em {
  color: var(--yellow);
  font-style: normal;
  font-weight: 800;
}

.empty {
  padding: 44px;
  color: #737c8d;
  text-align: center;
}

.toast {
  position: fixed;
  left: 50%;
  top: 50%;
  right: auto;
  bottom: auto;
  transform: translate(-50%, -50%);
  z-index: 80;
  max-width: min(420px, calc(100vw - 32px));
  padding: 12px 14px;
  border: 1px solid var(--mint);
  border-radius: 8px;
  background: #111827;
  color: var(--mint);
  text-align: center;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
}

.loading {
  padding: 40px;
  color: var(--muted);
  text-align: center;
}

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

  .summary-row {
    grid-template-columns: minmax(220px, 1fr) minmax(96px, 120px) minmax(112px, 135px) minmax(74px, 90px);
  }

  .rank-grid {
    grid-template-columns: 1fr;
  }

  .form-grid,
  .form-grid.wide {
    grid-template-columns: 1fr 1fr;
  }

  .skins {
    grid-template-columns: 1fr 1fr;
  }

  .config-item.skin-config {
    grid-template-columns: 1fr;
  }

  .delivery-metrics {
    grid-template-columns: 1fr 1fr;
  }

  .admin-page form.toolbar {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }

  .admin-page .admin-token-filter-toolbar.no-color,
  .admin-page .admin-token-filter-toolbar.with-color {
    grid-template-columns: 1fr;
  }

  .package-token-body,
  .exchange-detail-body,
  .downline-layout,
  .submitter-history-filter {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 800px) {
  .user-app {
    padding-bottom: 92px;
  }

  .page {
    width: min(100% - 12px, 1120px);
    margin-top: 12px;
    margin-bottom: 28px;
  }

  .user-function-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 70;
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    margin: 0;
    padding: 10px 8px calc(10px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    border-radius: 0;
    overflow-x: auto;
    background: #181d2b;
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.28);
    -webkit-overflow-scrolling: touch;
  }

  .user-function-nav strong {
    display: none;
  }

  .user-function-nav button {
    flex: 0 0 92px;
    min-width: 92px;
    min-height: 58px;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    padding: 7px 6px;
    font-size: 12px;
    text-align: center;
    white-space: nowrap;
  }

  .user-function-nav .icon-box {
    width: 24px;
    height: 24px;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 13px;
  }

  .login-card {
    padding: 28px 22px;
  }

  .topbar {
    height: auto;
    min-height: 56px;
    align-items: center;
    gap: 8px;
    flex-direction: row;
    padding: 10px 14px;
  }

  .topbar-actions {
    flex-wrap: nowrap;
    gap: 8px;
    margin-left: auto;
  }

  .topbar-title {
    max-width: 38%;
    font-size: 18px;
    line-height: 1.25;
  }

  .topbar .btn {
    min-height: 36px;
    padding: 0 10px;
    font-size: 13px;
  }

  .notice {
    gap: 24px;
  }

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

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

  .summary-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(74px, 0.75fr);
  }

  .rank-grid,
  .form-grid,
  .form-grid.wide,
  .skins,
  .config-item {
    grid-template-columns: 1fr;
  }

  .announcement-form {
    grid-template-columns: 1fr;
  }

  .admin-page form.toolbar {
    grid-template-columns: 1fr;
  }

  .admin-page {
    width: calc(100% - 12px);
    margin-top: 14px;
  }

  .nav-tabs {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0;
    padding: 0 6px;
    overflow: visible;
  }

  .nav-tabs button {
    min-width: 0;
    min-height: 52px;
    padding: 6px 3px;
    font-size: 12px;
    line-height: 1.35;
    white-space: normal;
    word-break: break-all;
  }

  .score-card {
    min-height: 92px;
    padding: 14px 16px;
  }

  .score-card .score {
    font-size: 28px;
  }

  .score-card .label,
  .score-card .muted {
    font-size: 12px;
  }

  .summary-row .score-card {
    grid-column: 1 / -1;
  }

  .metric-card {
    min-height: 74px;
    padding: 0 8px;
    font-size: 14px;
  }

  .token-info-grid,
  .skin-grid {
    grid-template-columns: 1fr;
  }

  .package-hero {
    align-items: stretch;
  }

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

  .phone-code-row {
    grid-template-columns: 1fr;
  }

  .stat-card {
    min-height: 96px;
  }

  .stat-number {
    font-size: 30px;
  }

  .panel {
    margin-bottom: 14px;
  }

  .panel-head {
    min-height: 50px;
    padding: 12px 14px;
  }

  .panel-body {
    padding: 14px;
  }

  .toolbar {
    gap: 8px;
  }

  .toolbar .btn {
    min-height: 32px;
    padding: 0 10px;
    font-size: 12px;
  }

  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .table-wrap table {
    min-width: 760px;
  }

  .admin-token-table-wrap table,
  .admin-token-table {
    min-width: 1120px;
  }
}
