:root {
  --bg: #f5f7fb;
  --sidebar: #111827;
  --panel: #ffffff;
  --ink: #182230;
  --muted: #667085;
  --line: #e4eaf3;
  --accent: #2563eb;
  --accent-2: #14a38b;
  --danger: #b42318;
  --warning: #b54708;
  --shadow: 0 16px 42px rgba(31, 41, 55, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: "Microsoft YaHei", "Segoe UI", sans-serif;
}

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

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 248px;
  display: flex;
  flex-direction: column;
  padding: 18px;
  background: var(--sidebar);
  color: #e5e7eb;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.brand span {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #ffffff;
  font-weight: 900;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  margin-top: 3px;
  color: #9ca3af;
}

nav {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

nav a {
  padding: 12px 13px;
  border-radius: 10px;
  color: #cbd5e1;
  text-decoration: none;
  font-weight: 800;
}

nav a:hover,
nav a.active {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.logout {
  width: 100%;
  height: 40px;
  margin-top: auto;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  background: transparent;
  color: #e5e7eb;
  cursor: pointer;
}

.main {
  min-height: 100vh;
  margin-left: 248px;
  padding: 24px;
}

.page-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 26px;
  letter-spacing: 0;
}

h2 {
  font-size: 18px;
}

p {
  color: var(--muted);
  line-height: 1.55;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 5px;
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

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

.metrics article,
.panel {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.metrics article {
  display: grid;
  gap: 5px;
  padding: 16px;
}

.metrics span,
.metrics small {
  color: var(--muted);
}

.metrics strong {
  font-size: 28px;
}

.panel {
  margin-bottom: 16px;
  padding: 16px;
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.panel-title a {
  color: var(--accent);
  font-weight: 900;
  text-decoration: none;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  margin-left: 8px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  color: var(--accent);
  font-weight: 900;
  text-decoration: none;
}

.button-link:hover {
  border-color: rgba(37, 99, 235, 0.28);
  background: #f7faff;
}

.code-block {
  max-height: 360px;
  overflow: auto;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fafc;
  color: #344054;
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

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

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

label {
  display: grid;
  gap: 7px;
  color: #344054;
  font-size: 13px;
  font-weight: 900;
}

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

.sub-title {
  display: block;
  margin-bottom: 8px;
  color: #344054;
  font-size: 13px;
}

.product-check-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.check-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
}

.check-item input {
  width: 16px;
  height: 16px;
}

.check-item span {
  display: grid;
  gap: 2px;
}

.check-item small {
  color: var(--muted);
  font-weight: 500;
}

.api-secret {
  font-family: Consolas, "Microsoft YaHei", sans-serif;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  color: var(--ink);
  outline: none;
}

input,
select {
  height: 40px;
  padding: 0 11px;
}

textarea {
  min-height: 98px;
  resize: vertical;
  padding: 10px 11px;
  line-height: 1.5;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(37, 99, 235, 0.62);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

button,
.primary {
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  font-weight: 900;
}

.primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #ffffff;
}

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

th,
td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: #475467;
  font-size: 12px;
  text-transform: uppercase;
}

td {
  font-size: 13px;
}

code {
  padding: 2px 5px;
  border-radius: 6px;
  background: #f1f5f9;
}

.status {
  display: inline-flex;
  padding: 4px 8px;
  border-radius: 999px;
  background: #eef2ff;
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
}

.status.active {
  background: #eafaf7;
  color: #087568;
}

.status.unused {
  background: #f2f4f7;
  color: #475467;
}

.status.disabled,
.status.expired {
  background: #fff1f0;
  color: var(--danger);
}

.inline-form {
  display: inline;
}

.inline-form button {
  height: 30px;
  padding: 0 10px;
}

.generated-box {
  display: grid;
  gap: 8px;
  grid-column: 1 / -1;
  padding: 12px;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  background: #eff6ff;
}

.generated-box textarea {
  min-height: 180px;
  font-family: Consolas, monospace;
}

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

.button-link,
.table-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--accent);
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
}

.button-link {
  height: 40px;
}

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

.danger-button {
  border-color: #fecdca;
  background: #fff1f0;
  color: var(--danger);
}

.login-body {
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 14% 18%, rgba(37, 99, 235, 0.12), transparent 30%),
    radial-gradient(circle at 84% 20%, rgba(20, 163, 139, 0.12), transparent 26%),
    linear-gradient(135deg, #f8fbff 0%, #eef7ff 46%, #f6fffb 100%);
}

.login-shell {
  display: grid;
  grid-template-columns: minmax(360px, 0.92fr) minmax(420px, 1fr);
  align-items: center;
  gap: 48px;
  width: min(1180px, calc(100vw - 48px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 48px 0;
}

.login-intro {
  display: grid;
  gap: 34px;
}

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

.login-brand span {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 15px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-size: 20px;
  font-weight: 900;
  box-shadow: 0 18px 36px rgba(37, 99, 235, 0.22);
}

.login-brand strong,
.login-brand small {
  display: block;
}

.login-brand strong {
  font-size: 19px;
}

.login-brand small {
  margin-top: 3px;
  color: #6b778d;
}

.login-copy h1 {
  max-width: 560px;
  font-size: clamp(34px, 4.2vw, 54px);
  line-height: 1.12;
  letter-spacing: 0;
}

.login-copy p {
  max-width: 560px;
  margin-top: 18px;
  color: #53627a;
  font-size: 17px;
}

.login-points {
  display: grid;
  gap: 12px;
  max-width: 560px;
}

.login-points article {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 15px 17px;
  border: 1px solid rgba(228, 234, 243, 0.92);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 12px 30px rgba(31, 41, 55, 0.055);
  backdrop-filter: blur(14px);
}

.login-points strong {
  color: #132033;
  font-size: 15px;
}

.login-points span {
  color: #667085;
  font-size: 13px;
  text-align: right;
}

.login-panel {
  display: flex;
  justify-content: flex-end;
}

.login-card {
  display: grid;
  gap: 18px;
  width: min(460px, 100%);
  padding: 34px;
  border: 1px solid rgba(213, 221, 233, 0.9);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 24px 70px rgba(31, 41, 55, 0.13);
  backdrop-filter: blur(18px);
}

.login-card-head {
  display: grid;
  gap: 6px;
}

.login-card h2 {
  font-size: 28px;
}

.login-card label {
  color: #344054;
  font-size: 14px;
}

.login-card input {
  height: 48px;
  border-radius: 14px;
  background: #f8fbff;
  font-weight: 800;
}

.login-card input:-webkit-autofill,
.login-card input:-webkit-autofill:hover,
.login-card input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--ink);
  box-shadow: 0 0 0 1000px #f8fbff inset;
  transition: background-color 9999s ease-out;
}

.login-submit {
  height: 50px;
  margin-top: 4px;
  border-radius: 14px;
  font-size: 16px;
}

.error {
  padding: 10px 12px;
  border: 1px solid #fecdca;
  border-radius: 10px;
  background: #fff1f0;
  color: var(--danger);
}

.login-body .error {
  border-radius: 12px;
  font-size: 14px;
  font-weight: 800;
}

@media (max-width: 1080px) {
  .sidebar {
    position: static;
    width: auto;
  }

  .main {
    margin-left: 0;
  }

  .metrics,
  .split,
  .generate-form {
    grid-template-columns: 1fr;
  }

  .login-shell {
    grid-template-columns: 1fr;
    gap: 28px;
    width: min(680px, calc(100vw - 32px));
  }

  .login-panel {
    justify-content: stretch;
  }

  .login-card {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .login-shell {
    width: min(100% - 24px, 520px);
    padding: 24px 0;
  }

  .login-intro {
    gap: 22px;
  }

  .login-copy h1 {
    font-size: 32px;
  }

  .login-points article {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .login-points span {
    text-align: left;
  }

  .login-card {
    padding: 24px;
    border-radius: 20px;
  }
}
