:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --panel: #ffffff;
  --text: #17202a;
  --muted: #6b7785;
  --line: #dfe5ec;
  --accent: #0d8f73;
  --accent-strong: #08745e;
  --danger: #c2410c;
  --soft: #eef8f5;
  --shadow: 0 12px 34px rgba(25, 35, 45, 0.08);
}

* {
  box-sizing: border-box;
}

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

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.shell,
.admin-shell {
  width: min(1120px, calc(100% - 28px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.auth-card {
  width: min(420px, 100%);
  margin: 8vh auto 0;
  padding: 26px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

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

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 22px;
  line-height: 1.25;
}

h2 {
  font-size: 18px;
  line-height: 1.35;
}

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

.tabs,
.asset-tabs {
  display: flex;
  gap: 8px;
}

.tabs {
  margin-bottom: 16px;
}

.tab,
.asset-tab {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: 8px;
  padding: 10px 14px;
  min-height: 42px;
}

.tab.active,
.asset-tab.active {
  border-color: var(--accent);
  background: var(--soft);
  color: var(--accent-strong);
  font-weight: 700;
}

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

.inline-form {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(180px, 1.3fr) minmax(160px, 1fr) auto;
  gap: 10px;
  margin-top: 14px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

input {
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--text);
  outline: none;
  background: #fff;
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(13, 143, 115, 0.12);
}

.primary,
.secondary,
.ghost {
  min-height: 40px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0 14px;
}

.primary {
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}

.secondary {
  background: var(--soft);
  border-color: rgba(13, 143, 115, 0.25);
  color: var(--accent-strong);
  font-weight: 700;
}

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

.message {
  min-height: 20px;
  color: var(--danger);
  font-size: 13px;
}

.topbar,
.admin-topbar,
.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.topbar,
.admin-topbar {
  margin-bottom: 18px;
}

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

.balance-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.balance-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  min-height: 102px;
}

.balance-card strong {
  display: block;
  margin-top: 10px;
  font-size: 22px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  margin-top: 14px;
  box-shadow: var(--shadow);
}

.asset-tabs {
  flex-wrap: wrap;
  margin: 16px 0;
}

.address-box {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.address-box img {
  width: 220px;
  height: 220px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.address-info {
  min-width: 0;
}

.address-line {
  display: flex;
  gap: 10px;
  align-items: stretch;
  margin: 10px 0;
}

code {
  flex: 1;
  display: block;
  min-height: 42px;
  padding: 11px 12px;
  border-radius: 8px;
  background: #f7f9fb;
  border: 1px solid var(--line);
  overflow-wrap: anywhere;
  color: #1f2937;
}

.hint {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.records {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.record {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

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

.record code {
  min-height: auto;
  padding: 0;
  background: transparent;
  border: 0;
  font-size: 12px;
}

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

.status-grid.compact {
  grid-template-columns: repeat(4, minmax(90px, 1fr));
  margin-top: 10px;
}

.status-item {
  padding: 13px;
  border-radius: 8px;
  background: #f7f9fb;
  border: 1px solid var(--line);
}

.status-item strong {
  display: block;
  margin-top: 6px;
  overflow-wrap: anywhere;
}

.table-wrap {
  margin-top: 14px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1060px;
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 13px;
}

th {
  color: var(--muted);
  background: #f7f9fb;
  font-weight: 700;
}

td code {
  font-size: 12px;
}

.mini-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.mini-actions button {
  min-height: 32px;
  padding: 0 9px;
  font-size: 12px;
}

.key-export {
  margin-top: 14px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid rgba(194, 65, 12, 0.25);
  border-radius: 8px;
  background: #fff7ed;
}

.key-export code {
  margin: 8px 0;
}

.api-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.api-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfcfd;
}

.api-card-head,
.api-key-row {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  align-items: center;
}

.api-key-row {
  margin-top: 10px;
}

.api-key-row code {
  min-height: 38px;
}

@media (max-width: 760px) {
  .shell,
  .admin-shell {
    width: min(100% - 20px, 1120px);
    padding-top: 16px;
  }

  .auth-card {
    margin-top: 20px;
    padding: 20px;
  }

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

  .inline-form,
  .api-card-head,
  .api-key-row {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

  .address-box {
    grid-template-columns: 1fr;
  }

  .address-box img {
    width: 180px;
    height: 180px;
    margin: 0 auto;
  }

  .address-line,
  .topbar,
  .admin-topbar,
  .panel-head {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar {
    justify-content: stretch;
  }

  .toolbar button {
    flex: 1;
  }
}
