:root {
  --ink: #182322;
  --muted: #6c7774;
  --line: #e3e8e5;
  --green: #225b50;
  --mint: #dff0e8;
  --sand: #f5f3ed;
  --orange: #d96b3d;
  --white: #fff;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font:
    14px/1.5 Inter,
    "PingFang SC",
    system-ui;
  color: var(--ink);
  background: #f7f8f6;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  border: 0;
  border-radius: 9px;
  padding: 10px 16px;
  background: var(--green);
  color: #fff;
  cursor: pointer;
}
button.secondary {
  background: #eef1ef;
  color: var(--ink);
}
.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
}
.auth-brand {
  background: linear-gradient(145deg, #163f38, #2d6d5f);
  color: #fff;
  padding: 10vw;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.logo,
.wordmark > span {
  width: 54px;
  height: 54px;
  border-radius: 15px;
  background: #f0c98f;
  color: #173f38;
  display: grid;
  place-items: center;
  font-weight: 900;
}
.auth-brand h1 {
  font-size: 48px;
  line-height: 1.16;
  margin: 32px 0 18px;
}
.auth-brand p {
  font-size: 17px;
  color: #d9e8e3;
  max-width: 460px;
}
.auth-card {
  width: min(460px, 86%);
  margin: auto;
  background: #fff;
  padding: 34px;
  border-radius: 18px;
  box-shadow: 0 24px 70px #152e2414;
}
.tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
}
.tabs button {
  flex: 1;
  background: none;
  color: var(--muted);
  border-radius: 0;
  padding: 12px 4px;
}
.tabs button.active {
  color: var(--green);
  border-bottom: 2px solid var(--green);
}
label {
  display: grid;
  gap: 7px;
  margin: 14px 0;
  color: #46504e;
  font-weight: 600;
}
input,
select,
textarea {
  width: 100%;
  border: 1px solid #d9dfdc;
  border-radius: 9px;
  padding: 11px 12px;
  background: #fff;
  color: var(--ink);
}
textarea {
  min-height: 95px;
  resize: vertical;
}
.auth-card form > button {
  width: 100%;
  margin-top: 12px;
  padding: 12px;
}
.hint {
  color: var(--muted);
  font-size: 12px;
}
#workspace {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 240px 1fr;
}
aside {
  background: #173f38;
  color: #fff;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.wordmark {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 0 8px 24px;
  font-size: 18px;
  font-weight: 800;
}
.wordmark > span {
  width: 38px;
  height: 38px;
  border-radius: 10px;
}
.wordmark small,
.account small {
  display: block;
  color: #9fb8b1;
  font-weight: 400;
  font-size: 11px;
}
nav {
  display: grid;
  gap: 5px;
}
nav button {
  background: transparent;
  text-align: left;
  color: #bed0cb;
  padding: 11px 13px;
}
nav button.active,
nav button:hover {
  background: #28574e;
  color: #fff;
}
.account {
  margin-top: auto;
  border-top: 1px solid #ffffff1c;
  padding: 18px 8px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.account button {
  padding: 5px;
  background: none;
  color: #9fb8b1;
}
main {
  padding: 36px 42px;
  min-width: 0;
}
header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  margin-bottom: 26px;
}
header h1 {
  margin: 3px 0 0;
  font-size: 28px;
}
header small {
  color: var(--muted);
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
  margin-bottom: 22px;
}
.stat,
.panel,
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 13px;
}
.stat {
  padding: 20px;
}
.stat strong {
  font-size: 30px;
  display: block;
}
.stat small {
  color: var(--muted);
}
.panel {
  padding: 22px;
}
.panel h2 {
  font-size: 17px;
  margin: 0 0 16px;
}
.empty {
  padding: 48px;
  text-align: center;
  color: var(--muted);
}
.list {
  display: grid;
  gap: 10px;
}
.card {
  padding: 17px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
}
.card h3 {
  margin: 0 0 4px;
  font-size: 15px;
}
.card p {
  margin: 0;
  color: var(--muted);
}
.meta {
  display: flex;
  gap: 8px;
  margin-top: 9px;
}
.badge {
  background: var(--mint);
  color: var(--green);
  padding: 3px 8px;
  border-radius: 99px;
  font-size: 12px;
}
.badge.warn {
  background: #fae9df;
  color: #9c4423;
}
.actions {
  display: flex;
  gap: 8px;
  white-space: nowrap;
}
.actions button {
  padding: 7px 11px;
}
.actions .danger {
  color: #a23d31;
  background: #fae7e4;
}
table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}
th,
td {
  text-align: left;
  border-bottom: 1px solid var(--line);
  padding: 13px;
}
th {
  color: var(--muted);
  font-size: 12px;
}
.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.dialog-head button {
  background: none;
  color: var(--muted);
  font-size: 22px;
  padding: 4px;
}
dialog {
  border: 0;
  border-radius: 15px;
  padding: 0;
  width: min(560px, 92vw);
  box-shadow: 0 25px 80px #0003;
}
dialog::backdrop {
  background: #10221d99;
}
#modal-form {
  padding: 24px;
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 20px;
}
#toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  background: #192d29;
  color: #fff;
  padding: 12px 18px;
  border-radius: 9px;
  opacity: 0;
  transform: translateY(10px);
  transition: 0.2s;
  pointer-events: none;
}
#toast.show {
  opacity: 1;
  transform: none;
}
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.progress {
  height: 7px;
  background: #edf0ee;
  border-radius: 9px;
  overflow: hidden;
  margin-top: 8px;
}
.progress i {
  display: block;
  height: 100%;
  background: var(--green);
}
@media (max-width: 800px) {
  .auth-shell {
    grid-template-columns: 1fr;
  }
  .auth-brand {
    display: none;
  }
  #workspace {
    grid-template-columns: 1fr;
  }
  aside {
    height: auto;
    position: static;
  }
  .wordmark {
    padding-bottom: 12px;
  }
  nav {
    display: flex;
    overflow: auto;
  }
  .account {
    display: none;
  }
  main {
    padding: 22px 16px;
  }
  .stats {
    grid-template-columns: 1fr 1fr;
  }
  .card {
    align-items: flex-start;
    flex-direction: column;
  }
}
[hidden] {
  display: none !important;
}
button:disabled {
  opacity: 0.6;
  cursor: wait;
}
.success-mark {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--mint);
  color: var(--green);
  font-size: 27px;
  margin-bottom: 16px;
}
.content-frame {
  width: 100%;
  height: calc(100vh - 150px);
  min-height: 720px;
  border: 0;
  border-radius: 13px;
  background: #fff;
}
#success-dialog {
  padding: 28px;
  text-align: center;
}
#success-dialog .success-mark {
  margin: 0 auto 16px;
}
#success-dialog p {
  color: var(--muted);
}
#success-dialog button {
  width: 100%;
  margin-top: 10px;
}
.nav-label {
  color: #78958d;
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 16px 13px 5px;
}
.tabs button {
  font-size: 12px;
  padding-inline: 2px;
}
.download-button {
  display: inline-block;
  border: 1px solid var(--green);
  border-radius: 9px;
  padding: 9px 14px;
  color: var(--green);
  text-decoration: none;
  font-weight: 700;
}
.stat span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 5px;
}
.week-panel {
  margin-bottom: 22px;
}
.week-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(105px, 1fr));
  gap: 10px;
  margin-top: 18px;
  overflow-x: auto;
}
.week-day {
  min-width: 105px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #f8faf9;
}
.week-day > div:first-child {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
}
.week-day > div:first-child strong {
  color: var(--ink);
}
.week-day b {
  display: block;
  font-size: 20px;
  margin-top: 14px;
}
.week-day span {
  color: var(--muted);
  font-size: 11px;
}
.week-day.complete {
  border-color: #9fcbbb;
  background: #f1f9f5;
}
.model-warning {
  padding: 13px 15px;
  margin: 16px 0;
  background: #fff3dc;
  color: #7d5b17;
  border-radius: 9px;
}
.merchant-filter {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(180px, 240px) auto;
  gap: 18px;
  align-items: end;
  margin: 0 0 14px;
}
.merchant-filter label {
  margin: 0;
}
.merchant-filter > div {
  display: grid;
  gap: 6px;
  padding-bottom: 10px;
}
.merchant-filter small,
.merchant-result-count {
  color: var(--muted);
}
.merchant-result-count {
  margin: 0 0 12px 2px;
  font-size: 12px;
}
.merchant-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(540px, 100%), 1fr));
  gap: 18px;
  margin-bottom: 22px;
}
.merchant-card {
  min-width: 0;
  padding: 22px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 15px;
  box-shadow: 0 8px 28px #173f3808;
}
.merchant-card-head,
.merchant-identity,
.merchant-contact,
.merchant-section-title,
.merchant-card-actions {
  display: flex;
  align-items: center;
}
.merchant-card-head,
.merchant-section-title {
  justify-content: space-between;
  gap: 14px;
}
.merchant-identity {
  gap: 11px;
  min-width: 0;
}
.merchant-identity h2 {
  margin: 0;
  font-size: 19px;
}
.merchant-identity p {
  margin: 2px 0 0;
  color: var(--muted);
}
.merchant-identity input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  accent-color: var(--green);
}
.risk-level {
  flex: 0 0 auto;
  padding: 4px 10px;
  border-radius: 99px;
  background: #eef1ef;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.risk-高 {
  background: #fae7e4;
  color: #a23d31;
}
.risk-中 {
  background: #fff1d7;
  color: #8b6318;
}
.risk-低 {
  background: var(--mint);
  color: var(--green);
}
.merchant-contact {
  flex-wrap: wrap;
  gap: 7px 18px;
  color: var(--muted);
  font-size: 12px;
  padding: 13px 0 17px;
  border-bottom: 1px solid var(--line);
}
.merchant-metrics,
.merchant-status-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
  margin-top: 16px;
}
.merchant-metrics > div,
.merchant-status-grid > div {
  min-width: 0;
  padding: 12px;
  border-radius: 10px;
  background: #f7f9f8;
}
.merchant-metrics small,
.merchant-metrics span,
.merchant-status-grid small,
.merchant-status-grid span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}
.merchant-metrics strong,
.merchant-status-grid strong {
  display: block;
  margin: 4px 0;
  overflow-wrap: anywhere;
}
.merchant-trend {
  margin-top: 19px;
}
.merchant-section-title span {
  color: var(--muted);
  font-size: 12px;
}
.merchant-bars {
  height: 155px;
  display: grid;
  grid-template-columns: repeat(12, minmax(17px, 1fr));
  gap: 6px;
  align-items: end;
  margin-top: 12px;
  padding-top: 10px;
  border-bottom: 1px solid #cad8d2;
}
.merchant-bar {
  height: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 5px;
}
.merchant-bar i {
  width: 100%;
  max-width: 28px;
  min-height: 3px;
  border-radius: 5px 5px 0 0;
  background: linear-gradient(180deg, #65a693, #225b50);
}
.merchant-bar span {
  color: var(--muted);
  font-size: 10px;
}
.merchant-bar.missing i {
  height: 4px !important;
  background: #dfe5e2;
}
.merchant-bar.missing span {
  color: #a6aeab;
}
.risk-summary {
  margin-top: 12px;
  padding: 13px 15px;
  border-left: 3px solid var(--green);
  background: #f2f7f5;
  border-radius: 7px;
}
.risk-summary p {
  margin: 4px 0 0;
  color: #4d5c58;
}
.merchant-card-actions {
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}
.merchant-card-actions .danger {
  background: #fae7e4;
  color: #a23d31;
}
.risk-reports {
  margin-top: 22px;
}
.prompt-admin-note {
  margin-bottom: 18px;
}
.prompt-admin-note p {
  margin: 0;
  color: var(--muted);
}
.prompt-admin-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.prompt-node-list {
  max-height: calc(100vh - 180px);
  overflow: auto;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  position: sticky;
  top: 20px;
}
.prompt-node-list > div + div {
  margin-top: 19px;
}
.prompt-node-list > div > strong {
  display: block;
  padding: 0 7px 7px;
  color: var(--muted);
  font-size: 11px;
}
.prompt-node-list button {
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 10px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}
.prompt-node-list button:hover,
.prompt-node-list button.active {
  background: var(--mint);
  color: var(--green);
}
.prompt-node-list button i {
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  white-space: nowrap;
}
.prompt-body {
  min-height: 420px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  line-height: 1.65;
}
.prompt-schema {
  max-height: 260px;
  overflow: auto;
  padding: 14px;
  background: #162521;
  color: #dcece7;
  border-radius: 9px;
  white-space: pre-wrap;
}
.prompt-editor-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 16px;
}
.prompt-editor-actions small {
  color: var(--muted);
}
.table-scroll {
  overflow-x: auto;
  margin-top: 18px;
}
.risk-workbench table {
  min-width: 1020px;
}
.risk-workbench td small {
  display: block;
  color: var(--muted);
  margin-top: 3px;
}
.risk-outlook {
  min-width: 250px;
  max-width: 390px;
}
.risk-workbench input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: var(--green);
}
.panel-title,
.chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.panel-title h2,
.chart-head h2 {
  margin: 0;
}
.chart-panel {
  overflow: hidden;
  margin-bottom: 22px;
}
.chart-empty {
  min-height: 190px;
  display: grid;
  place-items: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 10px;
  margin-top: 18px;
}
.bar-chart {
  height: 250px;
  display: flex;
  align-items: stretch;
  gap: 10px;
  padding-top: 24px;
  margin-top: 10px;
  overflow-x: auto;
}
.bar-column {
  min-width: 56px;
  flex: 1;
  display: grid;
  grid-template-rows: 22px 1fr 34px;
  gap: 7px;
  text-align: center;
}
.bar-column strong {
  color: var(--green);
  font-size: 12px;
}
.bar-column span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bar-track {
  height: 100%;
  display: flex;
  align-items: flex-end;
  background: linear-gradient(to top, #f2f6f4, transparent);
  border-bottom: 1px solid #cad8d2;
  border-radius: 7px 7px 0 0;
  overflow: hidden;
}
.bar-track i {
  display: block;
  width: 100%;
  background: linear-gradient(180deg, #4d907f, #225b50);
  border-radius: 7px 7px 0 0;
  min-height: 2px;
}
.bar-column.missing .bar-track {
  background: repeating-linear-gradient(
    -45deg,
    #f4f6f5,
    #f4f6f5 6px,
    #eaeeec 6px,
    #eaeeec 12px
  );
}
.bar-column.missing strong {
  color: #9aa5a1;
}
.line-chart {
  width: 100%;
  overflow-x: auto;
  margin-top: 12px;
}
.line-chart svg {
  width: 100%;
  min-width: 680px;
  display: block;
}
.grid-line {
  stroke: #e7ece9;
  stroke-width: 1;
}
.axis-text {
  fill: #7b8783;
  font-size: 11px;
}
.missing-text {
  fill: #9aa5a1;
  font-size: 10px;
}
.trend-line {
  fill: none;
  stroke: #225b50;
  stroke-width: 4;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.trend-point {
  fill: #f0c98f;
  stroke: #225b50;
  stroke-width: 3;
}
#workspace.content-mode > main {
  height: 100vh;
  overflow: hidden;
  padding: 0;
}
#workspace.content-mode > main > header {
  display: none;
}
#workspace.content-mode #content {
  height: 100%;
}
#workspace.content-mode .content-frame {
  display: block;
  height: 100vh;
  min-height: 0;
  border-radius: 0;
}
@media (max-width: 800px) {
  #workspace.content-mode > main {
    height: auto;
    overflow: visible;
  }
  #workspace.content-mode .content-frame {
    height: calc(100vh - 98px);
    min-height: 680px;
  }
  .bar-chart {
    gap: 7px;
  }
  .bar-column {
    min-width: 52px;
  }
  .week-grid {
    grid-template-columns: repeat(7, 110px);
  }
  .risk-workbench .panel-title {
    align-items: flex-start;
    flex-direction: column;
  }
  .risk-workbench .actions {
    flex-wrap: wrap;
  }
  .merchant-filter {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .merchant-filter > div {
    padding-bottom: 0;
  }
  .merchant-card {
    padding: 17px;
  }
  .merchant-metrics,
  .merchant-status-grid {
    grid-template-columns: 1fr 1fr;
  }
  .merchant-bars {
    gap: 4px;
  }
  .merchant-bar span {
    font-size: 9px;
  }
  .merchant-card-actions {
    flex-wrap: wrap;
  }
  .prompt-admin-layout {
    grid-template-columns: 1fr;
  }
  .prompt-node-list {
    position: static;
    max-height: 300px;
  }
  .prompt-editor-actions {
    align-items: flex-start;
    flex-direction: column;
  }
}
@media (max-width: 480px) {
  .merchant-card-head {
    align-items: flex-start;
  }
  .merchant-metrics,
  .merchant-status-grid {
    grid-template-columns: 1fr;
  }
  .merchant-bars {
    height: 130px;
  }
}
