:root {
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    'PingFang SC',
    'Microsoft YaHei',
    sans-serif;
  color: #23372f;
  background: #f7f8f5;
  font-size: 14px;
  font-synthesis: none;
  --green: #225e49;
  --ink: #20372d;
  --muted: #77837b;
  --line: #e1e7df;
  --white: #fff;
  --red: #b03c37;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}
button,
a,
input,
select,
textarea {
  outline-offset: 4px;
}
button:focus-visible,
a:focus-visible {
  outline: 2px solid #36846a;
}
a {
  color: var(--green);
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: 28px;
  letter-spacing: -0.8px;
  font-weight: 650;
}
h2 {
  font-size: 18px;
  font-weight: 650;
}
h3 {
  font-size: 15px;
  font-weight: 650;
}
p {
  line-height: 1.75;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 12px;
}
.mono,
code {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}
.boot {
  padding: 80px;
  text-align: center;
  color: var(--muted);
}
.shell {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  background: #eef2eb;
  border-right: 1px solid var(--line);
  padding: 28px 18px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.5px;
}
.logo {
  display: grid;
  place-items: center;
  background: var(--green);
  color: white;
  width: 37px;
  height: 37px;
  border-radius: 11px;
  font-size: 25px;
  font-weight: 400;
}
.brand small {
  display: block;
  font-size: 10px;
  letter-spacing: 2px;
  color: #819086;
  margin-top: 4px;
}
.sidebar-label {
  font-size: 10px;
  letter-spacing: 1.6px;
  color: #869187;
  margin: 0 12px 12px;
}
.nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.nav button {
  background: none;
  border: 0;
  border-radius: 9px;
  text-align: left;
  padding: 12px 14px;
  color: #66756a;
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 500;
}
.nav button span {
  width: 20px;
  text-align: center;
  font-size: 17px;
}
.nav button.active {
  background: #fff;
  color: var(--green);
  box-shadow: 0 2px 8px #23372d06;
}
.nav button:hover {
  background: #ffffffa8;
}
.sidebar-foot {
  margin-top: auto;
  padding: 16px 12px;
  border-top: 1px solid #d9e1d5;
  font-size: 11px;
  color: #7a887e;
  line-height: 1.8;
}
.workspace {
  min-width: 0;
}
.topbar {
  height: 78px;
  padding: 0 38px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff88;
  gap: 16px;
}
.breadcrumb {
  color: #7f8c82;
  font-size: 12px;
}
.breadcrumb b {
  color: #354b3e;
  font-weight: 500;
  margin-left: 14px;
}
.top-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}
.online {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #64816f;
  font-size: 11px;
}
.dot {
  width: 6px;
  height: 6px;
  background: #5d9475;
  border-radius: 50%;
}
.text-btn {
  background: none;
  border: 0;
  color: var(--muted);
  font-size: 12px;
  padding: 7px;
}
.main {
  padding: 34px 38px 48px;
  max-width: 1450px;
  margin: auto;
}
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 28px;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 2px;
  color: #8a968b;
  margin-bottom: 10px;
}
.subtitle {
  color: var(--muted);
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.7;
}
.app-picker {
  margin-top: 10px;
  display: flex;
  gap: 8px;
}
.app-picker select {
  min-width: 180px;
  max-width: 250px;
}
.btn {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px 16px;
  color: var(--ink);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  white-space: nowrap;
}
.btn:hover {
  background: #f4f6f1;
}
.btn.primary {
  background: var(--green);
  color: white;
  border-color: var(--green);
}
.btn.primary:hover {
  background: #174632;
}
.btn.danger {
  color: var(--red);
  border-color: #e8cdca;
  background: #fff;
}
.btn.compact {
  font-size: 12px;
  padding: 7px 12px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 26px;
}
.stat {
  padding: 21px 22px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.stat-label {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
}
.stat-value {
  font-size: 30px;
  font-weight: 550;
  letter-spacing: -1px;
  margin-top: 15px;
  color: var(--ink);
}
.stat-value small {
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: 0;
  margin-left: 6px;
}
.stat-foot {
  font-size: 10px;
  color: #99a296;
  margin-top: 10px;
}
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 19px;
}
.segments {
  display: inline-flex;
  padding: 4px;
  background: #e9eee7;
  border-radius: 9px;
  gap: 3px;
}
.segments button {
  border: 0;
  background: transparent;
  color: #79877e;
  padding: 8px 23px;
  border-radius: 6px;
  font-size: 12px;
}
.segments button.active {
  background: #fff;
  color: var(--green);
  box-shadow: 0 1px 4px #19331e0a;
  font-weight: 600;
}
.revision {
  color: #89948b;
  font-size: 11px;
}
.grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(270px, 1fr);
  gap: 22px;
  align-items: start;
}
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 13px;
  overflow: hidden;
}
.card-header {
  padding: 22px 25px;
  border-bottom: 1px solid #edf0e9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.card-header p {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}
.card-body {
  padding: 24px 25px;
}
.card-footer {
  padding: 17px 25px;
  background: #fafbf8;
  border-top: 1px solid #edf0e9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.stack {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.mode-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.mode-option {
  padding: 15px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  cursor: pointer;
  background: white;
}
.mode-option:has(input:checked) {
  background: #f0f6ee;
  border-color: #50816a;
}
.mode-option input {
  width: auto;
  accent-color: var(--green);
  margin: 0 0 14px;
}
.mode-option strong {
  display: block;
  font-size: 13px;
  margin-bottom: 7px;
}
.mode-option small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
  display: block;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}
.field:last-child {
  margin-bottom: 0;
}
.field > label,
.field-label {
  font-size: 12px;
  font-weight: 550;
  color: #4d6053;
}
input,
select,
textarea {
  background: #fff;
  border: 1px solid #dce3d8;
  color: #23382c;
  border-radius: 7px;
  padding: 10px 12px;
  max-width: 100%;
  width: 100%;
  min-width: 0;
}
input::placeholder,
textarea::placeholder {
  color: #a0aaa1;
}
input:focus,
textarea:focus,
select:focus {
  outline: 2px solid #a9c5b3;
  outline-offset: 0;
  border-color: #6f977f;
}
input[type='checkbox'],
input[type='radio'] {
  width: auto;
  accent-color: var(--green);
}
textarea {
  resize: vertical;
  min-height: 72px;
  line-height: 1.6;
}
.help {
  font-size: 11px;
  color: #8c978c;
  line-height: 1.65;
}
.row {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.row > .field {
  flex: 1;
  min-width: 0;
}
.divider {
  height: 1px;
  background: #edf0e9;
  margin: 24px 0;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 550;
  border-radius: 5px;
  padding: 5px 8px;
  background: #edf2e9;
  color: #607451;
  white-space: nowrap;
}
.badge.a {
  background: #edf0eb;
  color: #7b8778;
}
.badge.b {
  background: #e3f0e8;
  color: #2b7051;
}
.badge.red {
  background: #fbefec;
  color: var(--red);
}
.badge.blue {
  background: #ebf1f6;
  color: #527994;
}
.steps {
  display: flex;
  flex-direction: column;
}
.step {
  display: flex;
  gap: 14px;
  padding: 13px 0;
  align-items: flex-start;
  border-bottom: 1px solid #f0f2ed;
}
.step:last-child {
  border: 0;
}
.step-num {
  display: grid;
  place-items: center;
  font-size: 10px;
  color: #849180;
  width: 23px;
  height: 23px;
  flex-shrink: 0;
  border: 1px solid #e1e8dc;
  border-radius: 50%;
}
.step strong {
  font-size: 12px;
  font-weight: 500;
}
.step p {
  font-size: 11px;
  color: #97a090;
  margin-top: 4px;
}
.note {
  border-radius: 9px;
  padding: 15px 17px;
  background: #f0f4eb;
  font-size: 12px;
  color: #748368;
  line-height: 1.8;
}
.note.warn {
  background: #fff5e6;
  color: #977647;
}
.inline-error {
  background: #fdf1ee;
  color: #a54a3d;
  padding: 12px 15px;
  border-radius: 8px;
  margin-bottom: 18px;
  line-height: 1.65;
  font-size: 12px;
  white-space: pre-line;
}
.empty {
  text-align: center;
  padding: 58px 25px;
  color: #8e9b8c;
}
.empty-icon {
  font-size: 32px;
  color: #9fae97;
  margin-bottom: 18px;
}
.empty h3 {
  color: #586c55;
  margin-bottom: 10px;
}
.empty p {
  font-size: 12px;
  margin-bottom: 22px;
}
.rule-card {
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 16px;
}
.rule-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 17px;
}
.rule-title {
  display: flex;
  align-items: center;
  gap: 10px;
}
.rule-title .number {
  font-size: 10px;
  color: #99a390;
}
.rule-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.rule-grid .field {
  margin-bottom: 10px;
}
.check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #7c887b;
}
.rule-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.filters {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.filters input {
  max-width: 330px;
}
.filters select {
  width: auto;
  min-width: 110px;
}
.table-wrap {
  overflow: auto;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 12px;
  text-align: left;
}
th {
  font-size: 10px;
  letter-spacing: 0.2px;
  font-weight: 500;
  background: #f9fbf7;
  color: #8b9787;
  white-space: nowrap;
}
th,
td {
  padding: 15px 18px;
  border-bottom: 1px solid #edf0e9;
}
td {
  color: #60705d;
  vertical-align: middle;
}
td .mono {
  font-size: 11px;
}
td .note-cell {
  max-width: 240px;
  overflow-wrap: anywhere;
}
td .time {
  font-size: 10px;
  color: #98a18f;
  white-space: nowrap;
}
.nowrap {
  white-space: nowrap;
}
.pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  color: #929c8b;
  font-size: 11px;
}
.pager > div {
  display: flex;
  gap: 8px;
}
.actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.result-box {
  padding: 28px;
  text-align: center;
  background: #f1f6ed;
  border-radius: 10px;
}
.result-letter {
  font-size: 64px;
  line-height: 1.2;
  color: var(--green);
  font-weight: 600;
}
.result-reason {
  margin: 12px 0;
  color: #72836a;
  font-size: 13px;
}
.result-url {
  font-size: 12px;
  overflow-wrap: anywhere;
  color: #718066;
}
.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
}
.login-story {
  background: #244f3e;
  padding: 60px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #e7efdf;
  position: relative;
  overflow: hidden;
}
.login-story .brand {
  color: #eff6e9;
}
.login-story .logo {
  background: #ffffff17;
}
.login-story .brand small {
  color: #acc4b1;
}
.story-content {
  max-width: 450px;
  padding: 70px 0;
}
.story-content h1 {
  font-size: 48px;
  line-height: 1.3;
  letter-spacing: -1.4px;
  font-weight: 500;
}
.story-content p {
  color: #a4bba7;
  font-size: 14px;
  margin-top: 25px;
}
.route-art {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 45px;
}
.route-art .route-node {
  width: 76px;
  height: 76px;
  border: 1px solid #789881;
  border-radius: 20px;
  display: grid;
  place-items: center;
  font-size: 31px;
  color: #d1e1c3;
}
.route-art .route-node:last-child {
  background: #d7e5bb;
  color: #36573f;
  border-color: #d7e5bb;
}
.route-line {
  width: 90px;
  height: 1px;
  background: #789881;
  position: relative;
}
.route-line:after {
  content: '→';
  position: absolute;
  right: -2px;
  top: -10px;
  color: #93ad98;
}
.login-panel {
  display: grid;
  place-items: center;
  padding: 40px;
}
.login-form {
  width: 100%;
  max-width: 360px;
}
.login-form h2 {
  font-size: 25px;
  margin: 13px 0;
}
.login-form .subtitle {
  margin-bottom: 35px;
}
.login-form .btn {
  width: 100%;
  margin-top: 10px;
}
.login-foot {
  font-size: 11px;
  color: #a1aa9c;
  margin-top: 26px;
  text-align: center;
}
#toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  padding: 13px 22px;
  border-radius: 10px;
  background: #244f3e;
  color: #fff;
  box-shadow: 0 5px 30px #21332225;
  z-index: 20;
  max-width: 90vw;
  font-size: 13px;
}
#toast.error {
  background: #973e34;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 28px;
  width: min(560px, 92vw);
  box-shadow: 0 20px 100px #18352025;
  color: var(--ink);
}
dialog::backdrop {
  background: #21362255;
  backdrop-filter: blur(3px);
}
dialog h2 {
  margin-bottom: 20px;
}
dialog .actions {
  justify-content: flex-end;
  margin-top: 22px;
}
pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: #f4f7f1;
  padding: 18px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.7;
}
.code-secret {
  padding: 15px;
  background: #eff4e9;
  border: 1px dashed #a0b893;
  border-radius: 8px;
  overflow-wrap: anywhere;
  font-family: monospace;
  margin: 16px 0;
}
.section-gap {
  margin-top: 22px;
}
.save-hint {
  color: #8d9987;
  font-size: 11px;
}
.hidden,
[hidden] {
  display: none !important;
}
@media (min-width: 1500px) {
  .main {
    padding-top: 45px;
  }
  .sidebar {
    padding-top: 32px;
  }
  .grid {
    gap: 26px;
  }
}
@media (max-width: 1100px) {
  .shell {
    grid-template-columns: 195px minmax(0, 1fr);
  }
  .main {
    padding: 28px 24px;
  }
  .topbar {
    padding: 0 24px;
  }
  .grid {
    grid-template-columns: 1fr;
  }
  .stats {
    gap: 10px;
  }
  .stat {
    padding: 18px;
  }
  .stat-value {
    font-size: 25px;
  }
  .rule-grid {
    grid-template-columns: 1fr;
  }
  .rule-grid > .field {
    margin-bottom: 14px;
  }
  .page-head {
    flex-wrap: wrap;
  }
  .app-picker {
    margin-top: 0;
  }
  .sidebar {
    padding: 23px 12px;
  }
  .login-story {
    padding: 40px;
  }
  .story-content h1 {
    font-size: 39px;
  }
}
@media (max-width: 720px) {
  .shell {
    display: block;
  }
  .sidebar {
    padding: 16px 18px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    gap: 17px;
  }
  .sidebar .brand {
    font-size: 15px;
  }
  .sidebar .logo {
    width: 31px;
    height: 31px;
    font-size: 22px;
  }
  .brand small {
    display: none;
  }
  .sidebar-label,
  .sidebar-foot {
    display: none;
  }
  .nav {
    flex-direction: row;
    overflow: auto;
    gap: 4px;
  }
  .nav button {
    padding: 9px 11px;
    white-space: nowrap;
    font-size: 12px;
  }
  .nav button span {
    display: none;
  }
  .topbar {
    height: 55px;
    padding: 0 20px;
  }
  .top-actions .online {
    display: none;
  }
  .main {
    padding: 25px 18px 35px;
  }
  .page-head {
    margin-bottom: 22px;
  }
  h1 {
    font-size: 24px;
  }
  .subtitle {
    font-size: 12px;
  }
  .app-picker {
    width: 100%;
  }
  .app-picker select {
    max-width: none;
    flex: 1;
    min-width: 0;
  }
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 22px;
  }
  .stat {
    padding: 16px;
  }
  .stat-value {
    margin-top: 10px;
    font-size: 25px;
  }
  .stat-foot {
    font-size: 9px;
  }
  .card-header {
    padding: 19px;
  }
  .card-body {
    padding: 19px;
  }
  .card-footer {
    padding: 15px 19px;
    flex-wrap: wrap;
  }
  .mode-options {
    gap: 7px;
  }
  .mode-option {
    padding: 13px 9px;
  }
  .mode-option strong {
    font-size: 12px;
  }
  .mode-option small {
    font-size: 10px;
  }
  .toolbar {
    flex-wrap: wrap;
  }
  .row {
    flex-direction: column;
    gap: 0;
  }
  .row > .field {
    width: 100%;
  }
  .rule-card {
    padding: 17px;
  }
  .rule-head {
    flex-wrap: wrap;
  }
  .filters input {
    max-width: none;
  }
  .login-page {
    display: block;
    background: #f7f8f5;
  }
  .login-story {
    padding: 25px 28px;
  }
  .story-content {
    padding: 36px 0 10px;
  }
  .story-content h1 {
    font-size: 30px;
  }
  .story-content p {
    margin-top: 13px;
    font-size: 12px;
  }
  .route-art,
  .login-story > p {
    display: none;
  }
  .login-panel {
    padding: 40px 28px;
  }
  .login-form {
    max-width: 420px;
  }
  .login-form .subtitle {
    margin-bottom: 25px;
  }
  .login-form h2 {
    font-size: 22px;
  }
  .revision {
    font-size: 10px;
  }
}

.filter-values input + input {
  margin-top: 8px;
}
