:root {
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    'PingFang SC',
    'Microsoft YaHei',
    sans-serif;
  color: #1d2939;
  background: #f3f6fa;
  font-size: 15px;
  --accent: #165bdb;
  --line: #e4eaf2;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  border: 0;
  border-radius: 8px;
  padding: 10px 16px;
  background: var(--accent);
  color: white;
  cursor: pointer;
  font-weight: 600;
  white-space: nowrap;
}
button:hover {
  filter: brightness(0.96);
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
button.secondary {
  background: #edf2fa;
  color: #344054;
}
button.danger {
  background: #fff1f0;
  color: #b42318;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid #92b8ff;
  outline-offset: 2px;
}
input,
textarea,
select {
  width: 100%;
  border: 1px solid #ccd6e4;
  border-radius: 8px;
  background: white;
  padding: 10px;
  color: inherit;
}
textarea {
  resize: vertical;
  min-height: 108px;
}
label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 14px;
  font-weight: 600;
}
label.check {
  flex-direction: row;
  align-items: center;
  font-weight: 400;
}
input[type='checkbox'] {
  width: auto;
}
form {
  display: grid;
  gap: 16px;
}
h1 {
  font-size: 28px;
  margin: 8px 0 10px;
  letter-spacing: -0.6px;
}
h2 {
  font-size: 19px;
  margin: 0 0 14px;
}
p {
  line-height: 1.65;
}
.muted {
  color: #667085;
}
.small,
small {
  font-size: 12px;
}
.eyebrow {
  font-size: 11px;
  letter-spacing: 2px;
  color: #667085;
  font-weight: 600;
}
.brand-mark {
  height: 48px;
  width: 48px;
  border-radius: 14px;
  background: var(--accent);
  color: white;
  display: grid;
  place-items: center;
  font-size: 32px;
}
.brand-mark.mini {
  height: 38px;
  width: 38px;
  border-radius: 11px;
  font-size: 26px;
}
.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: radial-gradient(ellipse at 20% 10%, #dce9ff, transparent 60%), #f3f6fa;
}
.login-card {
  width: min(430px, 100%);
  padding: 36px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 12px 50px #213a5c0c;
}
.login-card form {
  margin-top: 24px;
}
#login-error {
  color: #b42318;
}
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 26px;
  background: white;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
}
.brand small {
  display: block;
  color: #667085;
  margin-top: 3px;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.header-actions span {
  color: #667085;
  font-size: 13px;
}
.layout {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  min-height: calc(100vh - 76px);
}
nav {
  border-right: 1px solid var(--line);
  padding: 24px 14px;
  background: #fbfcfe;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
nav button {
  background: transparent;
  color: #667085;
  text-align: left;
  padding: 12px 16px;
}
nav button.active {
  background: #eaf1ff;
  color: var(--accent);
}
main {
  padding: 28px;
  max-width: 1500px;
  width: 100%;
  min-width: 0;
}
.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}
.page-heading h1 {
  margin: 0;
}
.page-heading p {
  margin: 8px 0 0;
}
.panel {
  background: white;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 20px;
  min-width: 0;
}
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.grid .panel {
  margin: 0;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}
.metric {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
}
.metric strong {
  display: block;
  font-size: 30px;
  margin-top: 10px;
}
.metric span {
  color: #667085;
}
.table-wrap {
  overflow-x: auto;
  max-width: 100%;
}
table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
  font-size: 13px;
}
th {
  text-align: left;
  color: #667085;
  font-weight: 500;
  background: #f8fafc;
}
td,
th {
  padding: 13px 12px;
  border-bottom: 1px solid #edf0f5;
}
td.wrap {
  white-space: normal;
  min-width: 180px;
  max-width: 450px;
  overflow-wrap: anywhere;
}
td button {
  padding: 6px 10px;
  margin-right: 6px;
  font-size: 12px;
}
.badge {
  display: inline-flex;
  border-radius: 20px;
  padding: 4px 9px;
  font-size: 12px;
  background: #edf2fa;
  color: #475467;
}
.badge.good {
  background: #e9f8ef;
  color: #147d45;
}
.badge.warn {
  background: #fff5e5;
  color: #a45c00;
}
.badge.bad {
  background: #ffeded;
  color: #b42318;
}
.empty {
  padding: 28px;
  text-align: center;
  color: #667085;
  border: 1px dashed var(--line);
  border-radius: 10px;
}
#notice:not(:empty) {
  padding: 12px 16px;
  margin-bottom: 20px;
  border-radius: 10px;
  background: #eaf1ff;
  color: #174caa;
}
#notice.error {
  background: #ffeded;
  color: #b42318;
}
.actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.resource {
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}
.resource h2 {
  margin-bottom: 10px;
}
.resource pre,
.preview-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: inherit;
  line-height: 1.65;
  background: #f8fafc;
  padding: 14px;
  border-radius: 9px;
}
.resource a {
  display: block;
  color: var(--accent);
  overflow-wrap: anywhere;
  margin: 8px 0;
}
.hint {
  border-left: 3px solid #a8c6ff;
  padding: 8px 12px;
  color: #667085;
  background: #f8faff;
}
.list {
  padding-left: 20px;
  line-height: 1.8;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 16px;
  max-width: min(780px, 95vw);
  width: 780px;
  max-height: 85vh;
  padding: 24px;
}
dialog::backdrop {
  background: #10223b66;
}
.dialog-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
[hidden] {
  display: none !important;
}
@media (max-width: 800px) {
  header {
    padding: 12px 16px;
  }
  .brand small {
    font-size: 10px;
  }
  .header-actions span {
    display: none;
  }
  .header-actions button {
    padding: 8px 10px;
    font-size: 12px;
  }
  .layout {
    display: block;
  }
  nav {
    flex-direction: row;
    overflow-x: auto;
    padding: 10px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  nav button {
    padding: 9px 12px;
    flex-shrink: 0;
  }
  main {
    padding: 18px 14px;
  }
  .grid {
    grid-template-columns: 1fr;
  }
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .metric {
    padding: 14px;
  }
  .panel {
    padding: 18px;
  }
  .form-row {
    grid-template-columns: 1fr;
  }
  .page-heading {
    margin-bottom: 18px;
  }
  h1 {
    font-size: 23px;
  }
}

.resource-line {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #e6ebf3;
  overflow-wrap: anywhere;
}
.link-button {
  display: inline-block;
  padding: 10px 16px;
  border-radius: 8px;
  background: #2463eb;
  color: white;
  text-decoration: none;
}
.link-button.success {
  background: #187f56;
}
.link-button.danger {
  background: #b83140;
}
@media (max-width: 640px) {
  .resource-line {
    flex-direction: column;
    align-items: flex-start;
  }
}

.button-editor {
  grid-column: 1/-1;
  padding: 16px;
  border: 1px solid #e6ebf3;
  border-radius: 10px;
}
.button-edit-row {
  display: grid;
  grid-template-columns: 1fr 2fr 80px 100px auto;
  gap: 12px;
  margin-bottom: 12px;
  align-items: end;
}
.button-edit-row label {
  margin: 0;
}
.button-preview {
  display: grid;
  gap: 8px;
}
@media (max-width: 900px) {
  .button-edit-row {
    grid-template-columns: 1fr 1fr;
  }
}
