* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
body {
  margin: 0;
  background: #f3f5f7;
  color: #17202a;
  font:
    14px/1.45 system-ui,
    sans-serif;
}
.login {
  max-width: 420px;
  margin: 12vh auto;
  background: #fff;
  padding: 24px;
  border: 1px solid #d6dbe1;
  border-radius: 8px;
}
input,
select,
button {
  font: inherit;
}
.input {
  width: 100%;
  padding: 9px;
  border: 1px solid #b9c2cc;
  border-radius: 5px;
}
.btn {
  border: 0;
  border-radius: 5px;
  padding: 8px 12px;
  background: #147dab;
  color: #fff;
  white-space: nowrap;
}
.btn.gray {
  background: #5c6875;
}
.btn.red {
  background: #b42318;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}
.stat,
.panel {
  background: #fff;
  border: 1px solid #d6dbe1;
  border-radius: 7px;
  padding: 16px;
}
.panel {
  overflow-x: auto;
}
.stat b {
  display: block;
  font-size: 25px;
}
table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  min-width: 780px;
}
th,
td {
  padding: 10px;
  border-bottom: 1px solid #e2e7ec;
  text-align: left;
}
th {
  background: #f8fafb;
}
.toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.quota-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.quota-grid label {
  display: grid;
  gap: 5px;
}
.toggle {
  width: 18px;
  height: 18px;
}
.hidden {
  display: none;
}
.muted {
  color: #687382;
  font-size: 12px;
}
.override {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) 130px auto auto auto;
  gap: 6px;
  margin-top: 7px;
}
@media (max-width: 800px) {
  .stats {
    grid-template-columns: 1fr 1fr;
  }
  .toolbar {
    overflow-x: auto;
  }
  .quota-grid {
    grid-template-columns: 1fr 1fr;
  }
  .override {
    grid-template-columns: 1fr 1fr;
  }
  .override .btn {
    width: 100%;
  }
}
.hidden {
  display: none !important;
}
.login-fields {
  display: grid;
  gap: 12px;
}
.bootstrap {
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid #e2e7ec;
}
.account-create {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(180px, 1fr) auto;
  gap: 8px;
  margin-bottom: 16px;
}
.role-setting {
  display: grid;
  grid-template-columns: 90px 165px;
  gap: 6px;
  align-items: center;
  margin-bottom: 5px;
}
@media (max-width: 800px) {
  .account-create {
    grid-template-columns: 1fr;
  }
  .role-setting {
    grid-template-columns: 90px minmax(120px, 1fr);
  }
}
.feature-groups {
  display: grid;
  gap: 12px;
}
.feature-group {
  background: #fff;
  border: 1px solid #d6dbe1;
  border-radius: 7px;
  overflow: hidden;
}
.feature-group summary {
  cursor: pointer;
  padding: 14px 16px;
  font-size: 16px;
  font-weight: 700;
  background: #f8fafb;
}
.feature-group .table-wrap {
  overflow-x: auto;
}
.permission-guide {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin-bottom: 16px;
  border: 1px solid #d6dbe1;
  background: #d6dbe1;
}
.permission-guide > div {
  background: #fff;
  padding: 13px 15px;
}
.permission-guide b {
  display: block;
  margin-bottom: 3px;
}
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 22px 0 10px;
}
.section-head h2 {
  margin: 0;
  font-size: 18px;
}
.feature-group summary {
  display: flex;
  justify-content: space-between;
}
.permission-item {
  padding: 16px;
  border-top: 1px solid #e2e7ec;
}
.permission-item:first-child {
  border-top: 0;
}
.permission-item.is-disabled {
  background: #fafbfc;
}
.permission-top {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 260px) auto;
  gap: 16px;
  align-items: center;
}
.permission-title {
  font-size: 16px;
  font-weight: 750;
}
.permission-key {
  color: #7a8795;
  font:
    12px ui-monospace,
    monospace;
}
.permission-desc {
  margin-top: 4px;
  color: #55616f;
}
.global-control {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  align-items: center;
  padding: 9px 11px;
  border-left: 3px solid #16803c;
  background: #eef9f1;
}
.is-disabled .global-control {
  border-color: #8a96a3;
  background: #eef1f4;
}
.global-control input {
  width: 18px;
  height: 18px;
}
.global-control b,
.global-control small {
  display: block;
}
.global-control small {
  color: #52606d;
  margin-top: 2px;
}
.role-matrix {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 8px;
  margin-top: 14px;
}
.role-cell {
  padding: 10px;
  background: #f7f9fb;
  border: 1px solid #e0e5ea;
}
.role-cell.is-off {
  background: #f3f4f5;
  color: #79838d;
}
.role-cell label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: 700;
}
.role-parameter {
  display: grid;
  gap: 4px;
  margin-top: 9px;
}
.role-parameter span {
  color: #687382;
  font-size: 12px;
}
.permission-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}
.save-state {
  min-height: 20px;
  color: #12652f;
  font-size: 12px;
}
.notice {
  display: none;
  margin: 10px 0;
  padding: 9px 11px;
  border-left: 3px solid #147dab;
  background: #edf7fb;
}
.notice.error {
  display: block;
  border-color: #b42318;
  background: #fff1f0;
  color: #8d1d16;
}
.notice.success {
  display: block;
  border-color: #16803c;
  background: #eef9f1;
  color: #12652f;
}
.pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}
.log-summary {
  margin: 0 0 10px;
}
.toolbar.wrap {
  flex-wrap: wrap;
}
.toolbar .date-field {
  display: grid;
  gap: 3px;
}
.toolbar .date-field span {
  font-size: 12px;
  color: #687382;
}
.filter-panel {
  display: grid;
  grid-template-columns:
    minmax(220px, 2fr) repeat(3, minmax(130px, 1fr))
    auto;
  gap: 9px;
  align-items: end;
  margin-bottom: 12px;
  padding: 13px;
  background: #fff;
  border: 1px solid #d6dbe1;
  border-radius: 7px;
}
.filter-field {
  display: grid;
  gap: 4px;
}
.filter-field > span {
  color: #687382;
  font-size: 12px;
}
.result-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.btn.small {
  padding: 5px 8px;
  font-size: 12px;
}
.status-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 10px;
  background: #eef1f4;
  font-size: 12px;
  font-weight: 650;
}
.status-badge.active {
  background: #e7f6ec;
  color: #12652f;
}
.status-badge.warn {
  background: #fff3df;
  color: #8a4b08;
}
@media (max-width: 1440px) {
  .filter-panel {
    grid-template-columns: 1fr 1fr;
  }
  .filter-panel .search-main,
  .filter-panel .filter-actions {
    grid-column: 1 / -1;
  }
  .override {
    grid-template-columns: 1fr 1fr;
  }
  .override .btn {
    width: 100%;
  }
  table.responsive-table {
    min-width: 0;
    background: transparent;
  }
  .responsive-table thead {
    display: none;
  }
  .responsive-table tbody {
    display: grid;
    gap: 12px;
  }
  .responsive-table tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 18px;
    padding: 12px;
    border: 1px solid #d6dbe1;
    border-radius: 6px;
    background: #fff;
  }
  .responsive-table td {
    display: block;
    width: 100%;
    padding: 9px 0;
    border: 0;
    border-bottom: 1px solid #edf0f2;
  }
  .responsive-table td:nth-last-child(-n + 2) {
    border-bottom: 0;
  }
  .responsive-table td:last-child {
    grid-column: 1 / -1;
  }
  .responsive-table td::before {
    display: block;
    margin-bottom: 5px;
    color: #687382;
    font-size: 12px;
    font-weight: 700;
  }
  #userRows td:nth-child(1)::before {
    content: "用户与时间";
  }
  #userRows td:nth-child(2)::before {
    content: "会员与积分";
  }
  #userRows td:nth-child(3)::before {
    content: "业务数据";
  }
  #userRows td:nth-child(4)::before {
    content: "单独功能授权";
  }
  #userRows td:nth-child(5)::before {
    content: "账号操作";
  }
  #taskRows td:nth-child(1)::before {
    content: "任务";
  }
  #taskRows td:nth-child(2)::before {
    content: "用户";
  }
  #taskRows td:nth-child(3)::before {
    content: "来源与目标";
  }
  #taskRows td:nth-child(4)::before {
    content: "状态与断点";
  }
  #taskRows td:nth-child(5)::before {
    content: "操作";
  }
  #monitorRows td:nth-child(1)::before {
    content: "监控";
  }
  #monitorRows td:nth-child(2)::before {
    content: "用户";
  }
  #monitorRows td:nth-child(3)::before {
    content: "来源与目标";
  }
  #monitorRows td:nth-child(4)::before {
    content: "配置";
  }
  #monitorRows td:nth-child(5)::before {
    content: "操作";
  }
}
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.page-head h1 {
  margin: 0;
}
.profile-layout {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 16px;
}
.form-grid,
.field {
  display: grid;
  gap: 12px;
}
.field {
  gap: 5px;
}
.field label {
  font-weight: 650;
}
.field-help {
  margin-top: -7px;
}
textarea.input {
  resize: vertical;
}
.filter-panel input,
.filter-panel select {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid #b9c2cc;
  border-radius: 5px;
  background: #fff;
  color: #17202a;
}
.filter-panel input:focus,
.filter-panel select:focus,
.input:focus {
  border-color: #147dab;
  outline: 3px solid rgba(20, 125, 171, 0.12);
}
.filter-actions .btn {
  min-height: 40px;
}
dialog.admin-dialog {
  width: min(920px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
  padding: 0;
  border: 0;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(13, 26, 38, 0.3);
}
dialog.admin-dialog::backdrop {
  background: rgba(16, 27, 38, 0.55);
}
.dialog-head,
.dialog-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid #e2e7ec;
  background: #fff;
}
.dialog-head h2 {
  margin: 0;
}
.dialog-foot {
  justify-content: flex-end;
  border-top: 1px solid #e2e7ec;
  border-bottom: 0;
}
.dialog-body {
  max-height: calc(100vh - 150px);
  padding: 18px;
  overflow: auto;
}
.editor-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.editor-grid .full {
  grid-column: 1 / -1;
}
.editor-group {
  margin: 14px 0 0;
  padding: 12px;
  border: 1px solid #d6dbe1;
  border-radius: 6px;
}
.editor-group summary {
  cursor: pointer;
  font-weight: 700;
}
.task-editor-modes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-bottom: 14px;
  padding: 4px;
  border: 1px solid #d6dbe1;
  border-radius: 7px;
  background: #f3f5f7;
}
.task-editor-modes button {
  min-height: 38px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #53606d;
  font-weight: 700;
  cursor: pointer;
}
.task-editor-modes button.active {
  background: #147dab;
  color: #fff;
  box-shadow: 0 1px 3px rgba(13, 26, 38, 0.18);
}
.editor-mode-note {
  margin: -5px 0 12px;
  color: #687382;
  font-size: 12px;
}
.profile-select-grid {
  margin-top: 10px;
}
.profile-source-note {
  margin-top: 10px;
  padding: 9px 10px;
  border-left: 3px solid #147dab;
  background: #edf7fb;
  color: #42505e;
  font-size: 12px;
}
.type-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 10px;
}
.failure-item {
  padding: 12px 0;
  border-bottom: 1px solid #e2e7ec;
}
.failure-item pre {
  max-height: 220px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  padding: 10px;
  background: #f4f6f8;
}
.failure-item details {
  margin-top: 10px;
  padding: 8px 10px;
  background: #f8fbff;
}
.failure-item details > summary {
  cursor: pointer;
  font-weight: 600;
}
.failure-context {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 6px 18px;
  margin-top: 9px;
}
.failure-context code {
  white-space: normal;
  overflow-wrap: anywhere;
}
.check-field {
  display: flex;
  align-items: center;
  gap: 8px;
}
.profile-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid #e2e7ec;
}
.profile-item:last-child {
  border-bottom: 0;
}
.profile-actions {
  display: flex;
  gap: 6px;
}
.badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 10px;
  background: #edf7fb;
  color: #0d668c;
  font-size: 12px;
}
@media (max-width: 980px) {
  .profile-layout {
    grid-template-columns: 1fr;
  }
  .permission-top {
    grid-template-columns: 1fr auto;
  }
  .global-control {
    grid-column: 1;
    grid-row: 2;
  }
  .permission-top > .btn {
    grid-column: 2;
    grid-row: 1 / span 2;
  }
  .role-matrix {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 800px) {
  .editor-grid {
    grid-template-columns: 1fr;
  }
  .editor-grid .full {
    grid-column: auto;
  }
  .filter-panel {
    grid-template-columns: 1fr 1fr;
  }
  .filter-panel .search-main,
  .filter-panel .filter-actions {
    grid-column: 1 / -1;
  }
  table.responsive-table {
    min-width: 0;
  }
  .responsive-table thead {
    display: none;
  }
  .responsive-table tbody,
  .responsive-table tr,
  .responsive-table td {
    display: block;
    width: 100%;
  }
  .responsive-table tr {
    grid-template-columns: 1fr;
    padding: 8px 0;
    border-bottom: 1px solid #d6dbe1;
  }
  .responsive-table td {
    padding: 8px 4px;
    border: 0;
  }
  .responsive-table td[data-label]::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 4px;
    color: #687382;
    font-size: 12px;
    font-weight: 700;
  }
  .toolbar.wrap {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .toolbar.wrap .wide {
    grid-column: 1/-1;
  }
  .pager {
    justify-content: space-between;
  }
  .page-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .permission-guide {
    grid-template-columns: 1fr;
  }
  .permission-top {
    display: grid;
    grid-template-columns: 1fr;
  }
  .permission-top > .btn,
  .global-control {
    grid-column: 1;
    grid-row: auto;
  }
  .role-matrix {
    grid-template-columns: 1fr;
  }
  .permission-foot {
    align-items: stretch;
    flex-direction: column;
  }
}
