:root {
  --accent: #ce3737;
  --ink: #243043;
  --muted: #8390a0;
  --line: #e5e9ef;
  --side: #18212e;
  --bg: #f2f4f7;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: 14px;
}
[hidden] {
  display: none !important;
}
.layui-btn {
  background: var(--accent);
}
.layui-btn-primary {
  background: #fff;
  color: var(--ink);
  border-color: #d9e0e8;
}
.layui-btn-primary:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.layui-form-checked[lay-skin="primary"] > i {
  background: var(--accent);
  border-color: var(--accent);
}
.layui-laypage .layui-laypage-curr .layui-laypage-em {
  background: var(--accent);
}
#sidebar {
  width: 224px;
  background: var(--side);
  color: #cbd3dd;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s;
}
.brand {
  height: 82px;
  display: flex;
  align-items: center;
  padding: 0 23px;
  gap: 12px;
  color: #fff;
  font-size: 21px;
  font-weight: 650;
  border-bottom: 1px solid #283342;
}
.brand-icon {
  font-size: 40px;
  color: #f06464;
  line-height: 1;
}
.brand small {
  display: block;
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 1.8px;
  color: #7f91a5;
  margin-top: 5px;
}
nav {
  padding: 15px 0;
  overflow: auto;
  flex: 1;
}
.nav-group {
  padding: 16px 25px 9px;
  color: #6f8198;
  letter-spacing: 1px;
  font-size: 11px;
}
.nav-button {
  border: 0;
  width: 100%;
  background: none;
  color: #b7c3d1;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 14px 24px;
  text-align: left;
  cursor: pointer;
  font-size: 14px;
  position: relative;
}
.nav-button i {
  font-size: 17px;
  color: #8090a5;
}
.nav-button:hover {
  background: #212d3d;
  color: white;
}
.nav-button.active {
  background: #b93236;
  color: white;
}
.nav-button.active i {
  color: white;
}
.nav-button.active:before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: #ff9a9a;
}
.side-footer {
  border-top: 1px solid #2b3545;
  padding: 20px 23px;
  font-size: 12px;
  color: #aab8c8;
}
.side-footer small {
  display: block;
  color: #697c92;
  margin-top: 9px;
}
.dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 50%;
  background: #bd8550;
}
.dot.live {
  background: #60b599;
}
.workspace {
  margin-left: 224px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin 0.2s;
}
.topbar {
  height: 61px;
  background: #fff;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 0 23px;
  gap: 19px;
}
.icon-button {
  border: 0;
  background: none;
  color: #738092;
  font-size: 18px;
  cursor: pointer;
}
.breadcrumb {
  color: #8793a2;
  font-size: 13px;
}
.breadcrumb b {
  font-weight: 500;
  color: #455269;
}
.top-actions {
  margin-left: auto;
  display: flex;
  gap: 20px;
  align-items: center;
  font-size: 12px;
}
.timezone {
  color: #8f99a8;
}
.text-button {
  border: 0;
  background: none;
  color: #6e7a8b;
  cursor: pointer;
  font-size: 12px;
}
.text-button:hover {
  color: var(--accent);
}
.tabs {
  height: 41px;
  background: #fff;
  display: flex;
  align-items: stretch;
  padding-left: 17px;
  border-bottom: 1px solid var(--line);
  overflow: auto;
}
.tab {
  padding: 12px 16px;
  white-space: nowrap;
  font-size: 12px;
  color: #8893a2;
  cursor: pointer;
  border-right: 1px solid #eff2f5;
}
.tab.selected {
  color: var(--accent);
  background: #fff7f6;
  border-bottom: 2px solid var(--accent);
}
main {
  padding: 25px 27px;
  flex: 1;
  min-width: 0;
}
.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 21px;
  gap: 15px;
}
.page-head h1 {
  font-size: 21px;
  font-weight: 600;
  margin: 0;
}
.page-head p {
  font-size: 12px;
  color: #8b97a7;
  margin: 7px 0 0;
}
.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 21px 23px;
  margin-bottom: 20px;
}
.panel-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 18px;
}
.filters {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.filters input {
  width: 200px;
  height: 36px;
}
.filters select,
.plain-select {
  height: 36px;
  background: #fff;
  border: 1px solid #dfe5ed;
  border-radius: 2px;
  padding: 0 11px;
  color: #47536a;
  min-width: 170px;
}
.filters label {
  color: #7c8798;
  font-size: 12px;
}
.filters .date-field {
  width: 145px;
}
.filters .layui-btn {
  height: 36px;
  line-height: 36px;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.metric {
  background: white;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 20px 22px;
  min-height: 104px;
}
.metric-label {
  font-size: 12px;
  color: #8b97a5;
}
.metric-value {
  font-family: Arial, sans-serif;
  font-size: 25px;
  color: #334159;
  font-weight: 500;
  margin-top: 13px;
  letter-spacing: 0.2px;
  overflow-wrap: anywhere;
}
.metric-value.accent {
  color: var(--accent);
}
.metric-value small {
  font-size: 10px;
  margin-left: 8px;
  color: #9ba5b3;
  font-weight: normal;
}
.secondary-metrics .metric {
  min-height: 85px;
  padding: 16px 20px;
}
.secondary-metrics .metric-value {
  font-size: 21px;
  margin-top: 10px;
}
.charts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.chart {
  height: 285px;
}
.charts .panel {
  min-width: 0;
}
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 15px;
}
.panel-header .panel-title {
  margin: 0;
}
.chip {
  display: inline-block;
  font-size: 11px;
  color: #758397;
  border: 1px solid #e2e8ee;
  padding: 3px 8px;
  border-radius: 3px;
}
.notice {
  font-size: 12px;
  color: #8b97a7;
  line-height: 1.8;
  margin: 0 0 15px;
}
.empty {
  padding: 70px 15px;
  text-align: center;
  color: #8997a8;
}
.empty b {
  display: block;
  color: #4b5970;
  font-size: 19px;
  font-weight: 500;
  margin-bottom: 12px;
}
.table-panel {
  padding: 18px 20px;
}
.table-panel .layui-table-view {
  margin: 16px 0 0;
  border-color: var(--line);
}
.layui-table-header th {
  background: #f7f8fa;
  color: #657289;
  font-weight: 500;
}
.layui-table-cell {
  font-size: 12px;
}
.layui-table-body td {
  border-bottom-color: #eef1f5;
}
.row-link {
  border: 0;
  background: none;
  color: #507297;
  cursor: pointer;
  font-size: 12px;
  margin-right: 9px;
  padding: 0;
}
.row-link.danger {
  color: #c34949;
}
.status-pill {
  background: #edf5f1;
  color: #459477;
  padding: 3px 7px;
  border-radius: 3px;
  font-size: 11px;
}
.status-pill.warn {
  background: #fff3e7;
  color: #ad793f;
}
.status-pill.bad {
  background: #fceeee;
  color: #b35252;
}
.mono {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}
.money {
  font-family: Arial, sans-serif;
  color: #405873;
}
.dim {
  color: #99a3b0;
}
.small {
  font-size: 12px;
}
.footer {
  padding: 18px 28px;
  font-size: 11px;
  color: #98a3b2;
  display: flex;
  justify-content: space-between;
}
.footer span {
  color: #aab2be;
}
.modal-form {
  padding: 22px 25px 10px;
}
.modal-form label {
  display: block;
  font-size: 12px;
  color: #66768b;
  margin: 0 0 7px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px 18px;
}
.form-field.wide {
  grid-column: 1/-1;
}
.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  border: 1px solid #dfe5ed;
  padding: 9px 10px;
  color: #35465d;
  border-radius: 2px;
  font-size: 13px;
  background: #fff;
}
.form-field textarea {
  min-height: 90px;
  resize: vertical;
}
.form-hint {
  font-size: 11px;
  color: #93a0b1;
  line-height: 1.6;
  margin-top: 5px;
}
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  border-top: 1px solid #edf0f4;
  margin-top: 22px;
  padding: 17px 0;
}
.form-message {
  font-size: 12px;
  color: #ab5454;
  line-height: 1.7;
  padding-top: 10px;
}
.rule-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.rule-table th,
.rule-table td {
  border-bottom: 1px solid #edf0f4;
  padding: 10px;
  text-align: left;
}
.rule-table th {
  background: #f7f8fa;
  font-size: 12px;
  color: #7c8899;
  font-weight: 500;
}
.rule-table input[type="text"] {
  width: 100%;
  max-width: 145px;
  border: 1px solid #e0e5ed;
  padding: 7px 9px;
  font-size: 13px;
  color: #43536b;
}
.rule-table input[type="checkbox"] {
  accent-color: var(--accent);
}
.rule-scroll {
  overflow: auto;
}
.rule-actions {
  margin-top: 20px;
  display: flex;
  gap: 12px;
  align-items: center;
}
.code-detail {
  white-space: pre-wrap;
  word-break: break-word;
  font:
    12px/1.9 ui-monospace,
    Consolas,
    monospace;
  padding: 22px;
  max-height: 65vh;
  overflow: auto;
  color: #536279;
}
.login-screen {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #edf0f4;
  padding: 30px;
}
.login-panel {
  width: 430px;
  background: #fff;
  padding: 38px 42px 30px;
  border: 1px solid #dfe5ec;
  border-radius: 4px;
  box-shadow: 0 12px 35px #253a5110;
}
.logo-dice {
  color: var(--accent);
  font-size: 45px;
  line-height: 1;
}
.login-panel h1 {
  font-size: 24px;
  font-weight: 600;
  margin-top: 19px;
}
.login-panel > p {
  color: #8b97a7;
  font-size: 12px;
  margin: 9px 0 29px;
}
.login-panel label {
  display: block;
  font-size: 12px;
  color: #738097;
  margin: 17px 0 8px;
}
.login-panel .layui-input {
  height: 43px;
}
.full {
  width: 100%;
  height: 43px;
  margin-top: 14px;
}
.login-panel small {
  display: block;
  text-align: center;
  color: #a0aab8;
  font-size: 10px;
  margin-top: 25px;
}
.login-panel #login-error {
  font-size: 12px;
  color: #b65353;
  padding-top: 12px;
  min-height: 29px;
}
.sidebar-collapsed #sidebar {
  transform: translateX(-224px);
}
.sidebar-collapsed .workspace {
  margin-left: 0;
}
@media (min-width: 1550px) {
  .metrics {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}
@media (max-width: 1050px) {
  .metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .charts {
    grid-template-columns: 1fr;
  }
  .timezone {
    display: none;
  }
  .top-actions {
    gap: 12px;
  }
  .breadcrumb {
    font-size: 12px;
  }
}
@media (max-width: 760px) {
  #sidebar {
    transform: translateX(-224px);
  }
  .workspace {
    margin-left: 0;
  }
  .sidebar-collapsed #sidebar {
    transform: translateX(0);
  }
  main {
    padding: 18px 13px;
  }
  .topbar {
    padding: 0 13px;
    gap: 12px;
  }
  .breadcrumb {
    display: none;
  }
  .top-actions {
    gap: 11px;
  }
  .top-actions .text-button {
    font-size: 11px;
  }
  .page-head h1 {
    font-size: 19px;
  }
  .panel {
    padding: 16px 14px;
  }
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .metric {
    padding: 16px;
    min-height: 96px;
  }
  .metric-value {
    font-size: 20px;
  }
  .metric-value small {
    display: block;
    margin: 6px 0 0;
  }
  .metric-value small:empty {
    display: none;
  }
  .filters input {
    width: 100%;
  }
  .filters .plain-select {
    flex: 1;
  }
  .filters .date-field {
    width: 135px;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .form-field.wide {
    grid-column: 1;
  }
  .modal-form {
    padding: 17px;
  }
  .footer span {
    display: none;
  }
  .login-panel {
    padding: 30px 26px;
    width: 100%;
  }
  .rule-table {
    min-width: 630px;
  }
  .layui-layer-page {
    max-width: 96vw;
  }
  .top-actions #admin-name {
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}
