:root {
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "Microsoft YaHei",
    sans-serif;
  color: #20232b;
  background: #f6f7f9;
  font-size: 14px;
  --line: #e5e7eb;
  --muted: #7a8190;
  --ink: #222b3a;
  --blue: #245cce;
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
body {
  margin: 0;
}
button,
input,
textarea,
select {
  font: inherit;
}
button {
  cursor: pointer;
}
button:disabled {
  opacity: 0.6;
  cursor: wait;
}
a {
  color: var(--blue);
  text-decoration: none;
}
button:focus-visible,
a:focus-visible {
  outline: 3px solid #9ebbf9;
  outline-offset: 3px;
}
input,
select,
textarea {
  border: 1px solid #d4d9e2;
  border-radius: 6px;
  background: #fff;
  color: #273143;
  padding: 10px 12px;
  width: 100%;
  min-width: 0;
}
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid #b8d1ff;
  outline-offset: 0;
  border-color: #739cf0;
}
input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--blue);
  flex-shrink: 0;
}
textarea {
  min-height: 110px;
  resize: vertical;
  line-height: 1.7;
}
label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12px;
  color: #596273;
  margin-bottom: 17px;
}
label.check {
  flex-direction: row;
  align-items: center;
  gap: 9px;
  margin: 6px 0;
}
.muted,
.hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}
.hint {
  margin: 5px 0 18px;
}
.error {
  color: #c94040;
  font-size: 12px;
  min-height: 18px;
  line-height: 1.6;
}
.primary,
.secondary,
.danger {
  border-radius: 6px;
  min-height: 39px;
  padding: 9px 16px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid #263245;
}
.primary {
  background: #263245;
  color: white;
}
.primary:hover {
  background: #394964;
}
.secondary {
  background: white;
  color: #4a566a;
  border-color: #d7dce5;
}
.secondary:hover {
  background: #f4f6f9;
}
.danger {
  background: #fff5f5;
  border-color: #edc9c9;
  color: #b84343;
}
.text-button {
  border: 0;
  background: none;
  color: var(--blue);
  font-size: 12px;
  padding: 4px;
}
.text-button.danger-text {
  color: #bf5050;
}
.wordmark {
  font-size: 24px;
  letter-spacing: -1px;
  font-weight: 800;
  color: #222c3c;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.wordmark span {
  font-size: 9px;
  letter-spacing: 3.6px;
  color: #9ba3b2;
  font-weight: 500;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 2px;
  color: #969eac;
  margin-top: 35px;
}
.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 30px;
}
.login-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  width: min(420px, 100%);
  padding: 38px;
  box-shadow: 0 12px 50px #16234006;
}
.login-card h1 {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.5px;
  margin: 12px 0;
}
.card-test-card {
  width: min(620px, 100%);
  line-height: 1.65;
}
.login-card > .muted {
  margin-bottom: 30px;
}
.login-card .primary {
  width: 100%;
  height: 44px;
}
.login-help {
  font-size: 10px;
  color: #a0a6b1;
  line-height: 1.8;
  margin: 22px 0 0;
}
.app-shell {
  display: flex;
  min-height: 100vh;
}
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 216px;
  background: white;
  border-right: 1px solid var(--line);
  padding: 33px 19px;
  display: flex;
  flex-direction: column;
  z-index: 10;
}
.sidebar .wordmark {
  margin-left: 15px;
}
.sidebar-caption {
  font-size: 10px;
  color: #a2a8b4;
  margin: 34px 15px 13px;
}
.sidebar nav {
  display: grid;
  gap: 5px;
}
.sidebar nav button {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  padding: 10px 15px;
  border: 0;
  background: none;
  color: #727c8c;
  border-radius: 6px;
  text-align: left;
  font-size: 13px;
}
.sidebar nav button > span {
  width: 18px;
  font-size: 17px;
  font-weight: 400;
}
.sidebar nav button.active {
  background: #eef3ff;
  color: #2e5db5;
  font-weight: 500;
}
.sidebar nav button:hover {
  background: #f5f7fb;
}
.sidebar-bottom {
  margin: auto 12px 0;
  font-size: 10px;
  color: #8e98a8;
  line-height: 1.9;
}
.sidebar-bottom > div {
  font-size: 9px;
  margin-left: 12px;
  color: #aeb5c1;
}
.connection-dot {
  display: inline-block;
  background: #4bb592;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  margin-right: 7px;
}
.main-shell {
  margin-left: 216px;
  width: calc(100% - 216px);
}
.topbar {
  height: 76px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 34px;
  font-size: 12px;
  gap: 12px;
}
.breadcrumb-label {
  color: #929aaa;
}
.slash {
  margin: 0 14px;
  color: #c2c7d0;
}
.account {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 11px;
  color: #737f92;
}
#content {
  max-width: 1600px;
  margin: auto;
  padding: 32px 34px 45px;
}
.page-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 25px;
}
.page-title h1 {
  margin: 0 0 8px;
  font-size: 24px;
  letter-spacing: -0.5px;
  font-weight: 600;
}
.page-title p {
  font-size: 12px;
  color: #8c94a2;
  margin: 0;
  line-height: 1.8;
}
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.toolbar input {
  max-width: 260px;
}
.toolbar select {
  max-width: 180px;
}
.toolbar button {
  white-space: nowrap;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 23px;
}
.stat-card,
.card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 9px;
}
.stat-card {
  padding: 22px;
}
.stat-label {
  font-size: 12px;
  color: #858e9d;
  display: flex;
  justify-content: space-between;
}
.stat-card strong {
  display: block;
  font-size: 29px;
  letter-spacing: -1px;
  margin: 15px 0 9px;
  font-weight: 600;
}
.stat-card small {
  font-size: 10px;
  color: #9da5b2;
}
.card {
  margin-bottom: 22px;
  overflow: hidden;
}
.card-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 22px;
  border-bottom: 1px solid #eff0f4;
  gap: 10px;
}
.card-heading h2 {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
}
.card-heading span {
  font-size: 11px;
  color: #99a0ad;
}
.table-scroll {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  white-space: nowrap;
}
th {
  font-size: 11px;
  color: #939baa;
  background: #fafbfc;
  padding: 14px 20px;
  border-bottom: 1px solid #eef0f4;
  font-weight: 500;
}
td {
  font-size: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid #eff1f5;
  color: #687387;
  line-height: 1.6;
}
tr:last-child td {
  border-bottom: 0;
}
td strong {
  color: #344157;
  font-weight: 500;
}
td .sub {
  font-size: 10px;
  color: #a1a9b7;
  margin-top: 4px;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  padding: 3px 7px;
  border-radius: 4px;
  background: #f0f2f5;
  color: #7d8796;
}
.badge.on,
.badge.paid {
  color: #319275;
  background: #ebf7f1;
}
.badge.off,
.badge.cancelled,
.badge.failed {
  color: #b75a5a;
  background: #fff0f0;
}
.badge.processing {
  color: #ad8635;
  background: #fff7e4;
}
.badge.pending {
  color: #647aa7;
  background: #eef3fc;
}
.badge.test {
  font-size: 9px;
  background: #f3f0fc;
  color: #8b74b3;
}
.badge.live {
  font-size: 9px;
  background: #eff7f1;
  color: #5e926c;
}
.actions {
  display: flex;
  gap: 9px;
  align-items: center;
}
.actions button {
  white-space: nowrap;
}
.empty {
  padding: 55px 25px;
  text-align: center;
  color: #a0a8b6;
  font-size: 12px;
}
.pagination {
  padding: 16px 21px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: #929cac;
}
.notice {
  border: 1px solid #dce6f4;
  background: #f3f7fd;
  padding: 15px 18px;
  border-radius: 7px;
  font-size: 12px;
  color: #7185a3;
  line-height: 1.9;
  margin-bottom: 22px;
}
.revenue-grid {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  padding: 22px;
}
.revenue-item {
  border-left: 2px solid #d8e4f8;
  padding-left: 15px;
  min-width: 190px;
}
.revenue-item small {
  color: #8c95a4;
  font-size: 10px;
}
.revenue-item strong {
  display: block;
  font-size: 22px;
  margin-top: 8px;
  color: #3d4a60;
  font-weight: 500;
}
.admin-footer {
  border-top: 1px solid var(--line);
  font-size: 10px;
  color: #aab2bf;
  padding: 23px 34px;
}
dialog {
  width: min(660px, calc(100% - 28px));
  max-height: 90vh;
  border: 1px solid #dfe4ec;
  border-radius: 10px;
  padding: 0;
  color: #334058;
  box-shadow: 0 25px 90px #10203926;
}
dialog::backdrop {
  background: #16243b60;
}
.dialog-header {
  position: sticky;
  top: 0;
  z-index: 1;
  background: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 21px 25px;
  border-bottom: 1px solid var(--line);
}
.dialog-header h2 {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
}
.dialog-header button {
  border: 0;
  background: none;
  color: #9aa5b5;
  font-size: 25px;
}
#editor-body {
  padding: 25px;
}
.form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  column-gap: 18px;
}
.certificate-fields {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.certificate-fields [data-certificate-fields] {
  margin-top: 8px;
}
.full {
  grid-column: 1/-1;
}
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
  margin-top: 10px;
}
.check-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  margin: 0 0 20px;
}
.check-grid label {
  font-size: 12px;
}
.field-caption {
  color: #606e83;
  font-size: 12px;
  margin: 0 0 12px;
}
.detail-list {
  display: grid;
  gap: 14px;
  font-size: 12px;
}
.detail-list > div {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 13px;
  border-bottom: 1px solid #edf0f5;
}
.detail-list strong {
  font-weight: 500;
  overflow-wrap: anywhere;
  text-align: right;
}
.detail-title {
  font-size: 13px;
  font-weight: 600;
  margin: 25px 0 15px;
}
.address-box {
  padding: 15px;
  background: #f7f8fb;
  border: 1px solid #e9edf3;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.9;
  margin-bottom: 12px;
}
.code-box {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 12px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: #f5f7fa;
  border: 1px solid #e1e6ee;
  padding: 16px;
  border-radius: 6px;
  line-height: 1.8;
}
.secret-value {
  min-height: 90px;
  font-family: ui-monospace, Consolas, monospace;
}
.settings-card {
  max-width: 600px;
  padding: 25px;
}
.audit-valid {
  font-size: 11px;
  color: #439678;
}
#toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 13px 23px;
  border-radius: 7px;
  background: #28374d;
  color: white;
  font-size: 12px;
  z-index: 1000;
  box-shadow: 0 8px 30px #17243a24;
  max-width: 90%;
  line-height: 1.8;
}
@media (max-width: 1100px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .sidebar {
    width: 185px;
    padding: 30px 12px;
  }
  .main-shell {
    margin-left: 185px;
    width: calc(100% - 185px);
  }
  #content {
    padding: 27px 23px;
  }
  .topbar {
    padding: 0 23px;
  }
}
@media (max-width: 760px) {
  .sidebar {
    position: static;
    width: 100%;
    padding: 20px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .sidebar .wordmark {
    margin: 0;
    font-size: 23px;
  }
  .sidebar .wordmark span {
    font-size: 8px;
  }
  .sidebar-caption,
  .sidebar-bottom {
    display: none;
  }
  .sidebar nav {
    display: flex;
    overflow: auto;
    margin-top: 20px;
    gap: 6px;
  }
  .sidebar nav button {
    white-space: nowrap;
    min-height: 36px;
    padding: 7px 10px;
    font-size: 11px;
  }
  .sidebar nav button > span {
    display: none;
  }
  .app-shell {
    display: block;
  }
  .main-shell {
    margin: 0;
    width: 100%;
  }
  .topbar {
    height: 59px;
    padding: 0 20px;
    font-size: 11px;
  }
  .account {
    gap: 10px;
    font-size: 10px;
  }
  .account .text-button {
    font-size: 10px;
  }
  .breadcrumb-label,
  .slash {
    display: none;
  }
  #content {
    padding: 24px 17px;
  }
  .page-title {
    align-items: flex-start;
  }
  .page-title h1 {
    font-size: 21px;
  }
  .page-title p {
    font-size: 11px;
  }
  .page-title .primary {
    font-size: 11px;
    padding: 8px 11px;
  }
  .stats-grid {
    gap: 12px;
  }
  .stat-card {
    padding: 17px;
  }
  .stat-label {
    font-size: 11px;
  }
  .stat-card strong {
    font-size: 25px;
  }
  .toolbar {
    gap: 8px;
  }
  .toolbar input {
    max-width: 100%;
  }
  .toolbar select {
    max-width: calc(50% - 4px);
  }
  th,
  td {
    padding: 13px 16px;
  }
  .card-heading {
    padding: 17px;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .form-grid > * {
    grid-column: 1;
  }
  .dialog-header {
    padding: 18px 20px;
  }
  #editor-body {
    padding: 20px;
  }
  .login-card {
    padding: 28px;
  }
  .admin-footer {
    padding: 20px;
    font-size: 9px;
  }
  .footer .primary {
    font-size: 11px;
  }
  input,
  select,
  textarea {
    font-size: 16px;
  }
  .check-grid {
    grid-template-columns: 1fr 1fr;
  }
  .check-grid label {
    font-size: 11px;
  }
  .notice {
    font-size: 11px;
  }
  .table-scroll {
    max-width: 100%;
  }
  .detail-list > div {
    gap: 15px;
  }
}
.integration-card {
  padding: 24px;
  margin-top: 20px;
}
.integration-values {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 14px;
  font-size: 13px;
  line-height: 1.7;
}
.integration-values dt {
  color: #748097;
}
.integration-values dd {
  margin: 0;
  overflow-wrap: anywhere;
}
@media (max-width: 650px) {
  .integration-values {
    grid-template-columns: 1fr;
    gap: 7px;
  }
  .integration-values dd {
    margin-bottom: 12px;
  }
}
