:root {
  color-scheme: light;
  --ink: #17202a;
  --muted: #65717d;
  --line: #dfe4e8;
  --paper: #fff;
  --bg: #f3f5f6;
  --side: #151c20;
  --accent: #d5a72f;
  --danger: #ba3e3e;
  --good: #257553;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "Microsoft YaHei", "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: 15px;
  letter-spacing: 0;
}
button,
input,
select {
  font: inherit;
}
button,
a {
  transition: 0.16s ease;
}
.auth-page {
  display: grid;
  place-items: center;
  background: #11181c;
  min-height: 100vh;
}
.auth-shell {
  width: min(440px, calc(100% - 32px));
}
.auth-panel {
  background: #fff;
  border-top: 4px solid var(--accent);
  padding: 34px;
  box-shadow: 0 24px 60px #0008;
}
.brand-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  background: #172026;
  color: #f4c94f;
  font-size: 22px;
  font-weight: 800;
}
.auth-panel h1 {
  font-size: 25px;
  margin: 20px 0 8px;
}
.auth-panel p {
  color: var(--muted);
  line-height: 1.7;
  margin: 0 0 24px;
}
label {
  display: grid;
  gap: 8px;
  font-weight: 700;
  margin: 0 0 17px;
}
input,
select {
  width: 100%;
  min-height: 46px;
  border: 1px solid #cfd6db;
  background: #fff;
  padding: 10px 12px;
  color: var(--ink);
  outline: none;
}
input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px #d5a72f22;
}
.primary,
.secondary,
.download,
.actions button,
.logout-form button {
  border: 1px solid transparent;
  min-height: 42px;
  padding: 9px 15px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}
.primary {
  background: var(--accent);
  color: #111;
}
.secondary,
.actions button {
  background: #fff;
  border-color: #cfd6db;
  color: var(--ink);
}
.primary:hover {
  background: #e3b638;
}
.secondary:hover,
.actions button:hover {
  border-color: #9ea8af;
}
.wide {
  width: 100%;
}
.inline-error {
  background: #fff0f0;
  color: #9d2d2d;
  border: 1px solid #ebc0c0;
  padding: 12px;
  margin-bottom: 18px;
}
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 250px;
  background: var(--side);
  color: #dce2e5;
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 5px 22px;
  border-bottom: 1px solid #ffffff16;
}
.sidebar-brand span {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--accent);
  color: #f2c750;
  font-weight: 800;
}
.sidebar-brand strong {
  font-size: 17px;
}
.sidebar nav {
  display: grid;
  gap: 5px;
  margin-top: 20px;
}
.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #c9d1d5;
  text-decoration: none;
  padding: 11px 12px;
  border-left: 3px solid transparent;
}
.sidebar nav a i {
  font-style: normal;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid #455159;
}
.sidebar nav a.active,
.sidebar nav a:hover {
  background: #283239;
  color: #fff;
  border-left-color: var(--accent);
}
.sidebar nav a.active i {
  color: #f3c84d;
  border-color: #cba02e;
}
.logout-form {
  margin-top: auto;
}
.logout-form button {
  width: 100%;
  background: #20292e;
  color: #d8dfe2;
  border-color: #3b464d;
}
.workspace {
  margin-left: 250px;
  min-height: 100vh;
}
.workspace > header {
  height: 76px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 13px 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.workspace > header h1 {
  font-size: 22px;
  margin: 0 0 4px;
}
.workspace > header p {
  margin: 0;
  color: var(--muted);
}
.admin-chip {
  border: 1px solid var(--line);
  padding: 9px 14px;
  background: #fafbfb;
}
.workspace > section {
  margin: 20px 30px;
}
.metric-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  background: #fff;
  border: 1px solid var(--line);
}
.metric-grid > div {
  padding: 20px;
  border-right: 1px solid var(--line);
}
.metric-grid > div:last-child {
  border-right: 0;
}
.metric-grid span {
  display: block;
  color: var(--muted);
  margin-bottom: 10px;
}
.metric-grid strong {
  font-size: 28px;
}
.section,
.form-panel,
.empty-panel {
  background: #fff;
  border: 1px solid var(--line);
}
.section-head {
  min-height: 60px;
  padding: 12px 17px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.section h2,
.form-panel h2,
.empty-panel h2 {
  font-size: 19px;
  margin: 0;
}
.table-wrap {
  overflow: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 780px;
}
th,
td {
  text-align: left;
  padding: 13px 15px;
  border-bottom: 1px solid #e8ecee;
  vertical-align: middle;
}
th {
  background: #f7f8f9;
  color: #52606a;
  font-weight: 700;
}
td strong {
  font-size: 15px;
}
.sub {
  display: block;
  color: var(--muted);
  margin-top: 5px;
}
.status {
  display: inline-flex;
  padding: 5px 9px;
  border: 1px solid #cfd6db;
  background: #f8f9f9;
}
.status-active {
  color: var(--good);
  border-color: #a7d4c0;
  background: #eef8f3;
}
.status-expired,
.status-revoked {
  color: #9d3030;
  border-color: #e1b9b9;
  background: #fff1f1;
}
.status-paused {
  color: #8a6312;
  border-color: #dec987;
  background: #fff9e8;
}
.split-layout {
  display: grid;
  grid-template-columns: minmax(280px, 360px) 1fr;
  gap: 18px;
  align-items: start;
}
.form-panel {
  padding: 20px;
}
.form-panel h2 {
  margin-bottom: 20px;
}
.actions {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}
.actions form {
  margin: 0;
}
.actions button {
  min-height: 34px;
  padding: 6px 10px;
}
.actions .danger {
  color: var(--danger);
  border-color: #e0b4b4;
}
.download-panel {
  padding: 20px;
  display: grid;
  gap: 13px;
}
.download {
  background: #1d282e;
  color: #fff;
  width: 100%;
}
.download-panel p,
.empty-panel p {
  color: var(--muted);
  line-height: 1.7;
}
.empty-panel {
  padding: 30px;
}
.notice-backdrop {
  position: fixed;
  inset: 0;
  background: #0009;
  display: grid;
  place-items: center;
  z-index: 50;
  padding: 20px;
}
.notice-dialog {
  background: #fff;
  width: min(460px, 100%);
  padding: 28px;
  text-align: center;
  border-top: 4px solid var(--accent);
  box-shadow: 0 28px 80px #0008;
}
.notice-mark {
  margin: auto;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #eaf7f0;
  color: var(--good);
  font-size: 26px;
  font-weight: 900;
}
.notice-mark.error {
  background: #fff0f0;
  color: var(--danger);
}
.notice-dialog h2 {
  font-size: 22px;
  margin: 16px 0 8px;
}
.notice-dialog p {
  color: var(--muted);
  line-height: 1.7;
}
.notice-dialog .primary {
  margin-top: 14px;
  min-width: 120px;
}
.license-code {
  font:
    700 19px Consolas,
    monospace;
  background: #151c20;
  color: #f4ca52;
  padding: 15px;
  margin: 18px 0 7px;
  word-break: break-all;
}
.license-number {
  color: var(--muted);
  margin-bottom: 12px;
}
@media (max-width: 1050px) {
  .metric-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .split-layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
    width: 210px;
  }
  .workspace {
    margin-left: 210px;
  }
}
@media (max-width: 720px) {
  .sidebar {
    position: static;
    width: 100%;
    height: auto;
  }
  .sidebar nav {
    grid-template-columns: repeat(2, 1fr);
  }
  .logout-form {
    margin-top: 15px;
  }
  .workspace {
    margin-left: 0;
  }
  .workspace > header {
    padding: 12px 16px;
  }
  .workspace > section {
    margin: 14px;
  }
  .metric-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .metric-grid > div {
    border-bottom: 1px solid var(--line);
  }
  .auth-panel {
    padding: 24px;
  }
}

.payment-layout {
  display: grid;
  gap: 18px;
  min-width: 0;
}
.payment-layout > *,
.payment-config-grid > * {
  min-width: 0;
}
.payment-config-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(320px, 1fr));
  gap: 18px;
  align-items: start;
}
.status-neutral {
  color: #52606a;
  border-color: #cfd6db;
  background: #f8f9f9;
}
.empty-cell {
  padding: 34px;
  color: var(--muted);
  text-align: center;
}
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 17px;
  background: #fafbfb;
  border-top: 1px solid var(--line);
}
.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}
.page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  min-height: 36px;
  padding: 7px 10px;
  color: var(--ink);
  text-decoration: none;
  background: #fff;
  border: 1px solid #cfd6db;
}
.page-direction {
  min-width: 66px;
}
.page-link:hover {
  color: #8a6312;
  border-color: var(--accent);
}
.page-link.active {
  color: #111;
  font-weight: 700;
  background: var(--accent);
  border-color: var(--accent);
}
.page-link.disabled {
  pointer-events: none;
  opacity: 0.45;
}
.page-gap,
.page-summary {
  color: var(--muted);
}
.page-summary {
  flex: 0 0 auto;
  white-space: nowrap;
}
.page-summary strong {
  color: var(--ink);
}

@media (max-width: 1050px) {
  .payment-config-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .payment-config-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .pagination-bar {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    padding: 12px 14px;
  }
  .pagination {
    justify-content: flex-start;
    width: 100%;
  }
  .page-summary {
    width: auto;
  }
}
