:root {
  font:
    15px/1.6 system-ui,
    "Microsoft YaHei",
    sans-serif;
  color: #243248;
  background: #f4f6fa;
  --accent: #295dd1;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
.button {
  cursor: pointer;
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 7px;
  padding: 9px 16px;
  text-decoration: none;
  display: inline-block;
}
button.secondary {
  background: #e9eef9;
  color: #254a91;
}
button.danger {
  background: #ab3443;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
input,
select,
textarea {
  border: 1px solid #cbd4e2;
  padding: 9px;
  border-radius: 6px;
  background: #fff;
  max-width: 100%;
}
textarea {
  width: 100%;
  min-height: 100px;
}
label {
  display: block;
  margin: 12px 0;
}
label input,
label select {
  display: block;
  width: 100%;
  margin-top: 5px;
}
.layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 100vh;
}
aside {
  background: #17243d;
  color: #fff;
  padding: 28px 18px;
}
aside h2 {
  font-size: 19px;
  margin: 0 0 28px;
}
nav button {
  display: block;
  text-align: left;
  background: none;
  width: 100%;
  margin: 5px 0;
  color: #c8d6ef;
}
nav button.active {
  background: #315180;
  color: white;
}
main {
  padding: 30px;
  min-width: 0;
}
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
h1 {
  font-size: 25px;
  margin: 0;
}
h2 {
  font-size: 18px;
}
.card {
  padding: 22px;
  background: #fff;
  border: 1px solid #e0e6ef;
  border-radius: 10px;
  margin: 16px 0;
}
.login {
  max-width: 430px;
  margin: 10vh auto;
  padding: 30px;
}
.muted,
small {
  color: #65748a;
}
.notice {
  background: #fff5dc;
  padding: 12px;
  border-radius: 6px;
}
.row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
table {
  width: 100%;
  border-collapse: collapse;
}
td,
th {
  text-align: left;
  padding: 12px 8px;
  border-bottom: 1px solid #e6eaf0;
  vertical-align: top;
}
td button {
  padding: 5px 10px;
  margin: 2px;
}
code {
  overflow-wrap: anywhere;
}
pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: #f1f4f9;
  padding: 12px;
}
iframe {
  width: 100%;
  height: 65vh;
  border: 1px solid #ccd5e1;
  background: white;
}
#toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #17243d;
  color: white;
  padding: 12px 20px;
  border-radius: 8px;
  display: none;
  z-index: 100;
}
dialog {
  border: 0;
  border-radius: 12px;
  max-width: 900px;
  width: 90vw;
  max-height: 90vh;
  overflow: auto;
}
dialog::backdrop {
  background: #17243d88;
}
.badge {
  font-size: 12px;
  background: #edf2fa;
  padding: 3px 8px;
  border-radius: 4px;
}
.scroll {
  overflow: auto;
}
@media (max-width: 760px) {
  .layout {
    grid-template-columns: 1fr;
  }
  aside {
    padding: 15px;
  }
  aside h2 {
    margin: 0;
  }
  nav {
    display: flex;
    flex-wrap: wrap;
  }
  nav button {
    width: auto;
    font-size: 13px;
  }
  main {
    padding: 16px;
  }
  table {
    font-size: 13px;
  }
}
.rule-picker {
  min-width: 0;
  border: 1px solid #d6dce4;
  border-radius: 8px;
  padding: 12px;
}
.rule-options {
  max-height: 210px;
  overflow: auto;
  border-top: 1px solid #e5e7eb;
  margin: 8px 0;
}
.rule-options label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 0;
  font-size: 14px;
}
.rule-options input {
  width: auto;
  flex: 0 0 auto;
  margin-top: 4px;
}
.rule-options span {
  overflow-wrap: anywhere;
}
.rule-picker > input {
  width: 100%;
}
.rule-picker details {
  min-width: 0;
}
.rule-picker summary {
  cursor: pointer;
  padding: 8px 0;
  overflow-wrap: anywhere;
}
.rule-picker p {
  overflow-wrap: anywhere;
}
.rule-picker details > input {
  width: 100%;
  min-width: 0;
}
@media (max-width: 600px) {
  .ruleFields,
  .rule-picker {
    min-width: 0;
  }
  .rule-options {
    max-height: 180px;
  }
}
