:root {
  --ink: rgba(0,0,0,.85);
  --paper: #f0f2f5;
  --line: #f0f0f0;
  --aside: 210px;
}
html, body { height: 100%; margin: 0; overflow: hidden; overscroll-behavior: none; }
.app-body {
  min-height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--ink);
}
.desk-body { background: var(--paper); overflow: hidden; }
.auth-scroll, html.auth-html { overflow: hidden; overscroll-behavior: none; }
.hidden { display: none !important; }
.ant-message { z-index: 1300; top: 16px; }

@keyframes blob {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(28px, -18px) scale(1.08); }
}
.app-login {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background:
    radial-gradient(900px 520px at 12% -8%, rgba(59,130,246,.42), transparent 58%),
    radial-gradient(760px 480px at 108% 8%, rgba(99,102,241,.32), transparent 52%),
    radial-gradient(720px 420px at 50% 118%, rgba(14,165,233,.22), transparent 55%),
    linear-gradient(165deg, #07101f 0%, #0b1224 42%, #111827 100%);
}
.app-login::before, .app-login::after {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  filter: blur(80px);
  opacity: .55;
  animation: blob 12s ease-in-out infinite;
  pointer-events: none;
}
.app-login::before { background: #2563eb; left: -120px; top: -90px; }
.app-login::after { background: #4f46e5; right: -100px; bottom: -120px; animation-delay: -5s; }
.login-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: 52px 52px;
  -webkit-mask-image: radial-gradient(ellipse at center, #000 18%, transparent 72%);
  mask-image: radial-gradient(ellipse at center, #000 18%, transparent 72%);
  pointer-events: none;
}
.app-login-scroll {
  position: relative;
  z-index: 1;
  height: 100%;
  width: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: none;
  display: grid;
  place-items: center;
  place-items: safe center;
  padding: 24px;
  box-sizing: border-box;
}
.app-login-card {
  position: relative;
  z-index: 1;
  width: 380px;
  max-width: 100%;
  margin: auto;
}
.app-login-name {
  text-align: center;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: .18em;
  margin: 8px 0 28px;
  color: rgba(0,0,0,.85);
}
.app-login-card .ant-btn-block { margin-top: 8px; }

#app-page { height: 100%; }
.app-shell.ant-layout { height: 100%; display: flex; flex-direction: row; background: var(--paper); overflow: hidden; }
.app-aside {
  width: var(--aside);
  flex: 0 0 var(--aside);
  max-width: var(--aside);
  min-width: var(--aside);
  background: #fff;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width .2s cubic-bezier(.645,.045,.355,1), min-width .2s cubic-bezier(.645,.045,.355,1), max-width .2s cubic-bezier(.645,.045,.355,1), transform .2s cubic-bezier(.645,.045,.355,1);
}
.app-aside.ant-layout-sider { background: #fff; }
.app-aside.collapsed { width: 64px; flex-basis: 64px; min-width: 64px; max-width: 64px; }
.app-logo {
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  flex-shrink: 0;
}
.app-logo-text {
  font-weight: 600; font-size: 16px; text-align: center; white-space: nowrap;
  overflow: hidden; width: 100%;
  display: inline-flex; align-items: baseline; justify-content: center; gap: 6px;
}
.app-logo-text .app-ver { font-weight: 400; font-size: 12px; color: rgba(0,0,0,.45); }
.app-aside.collapsed .app-logo { padding: 0 8px; }
.app-aside.collapsed .app-logo-text { font-size: 14px; }
.app-aside.collapsed .app-ver { display: none; }
.app-aside.collapsed .menu-title, .app-aside.collapsed .ant-menu-title-content { display: none; }
.app-menu.ant-menu { flex: 1; overflow-y: auto; overflow-x: hidden; border-right: 0; }
.app-menu::-webkit-scrollbar { width: 0; height: 0; }
.ant-menu-item { margin: 0 !important; width: 100% !important; padding: 0 !important; }
.app-menu.ant-menu-inline > .ant-menu-item {
  height: 46px !important;
  line-height: 46px !important;
}
.ant-menu-item .app-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 46px;
  min-height: 46px;
  padding: 0 16px 0 24px;
  color: inherit;
  text-decoration: none;
  line-height: 46px;
}
.ant-menu-inline .ant-menu-item::after { border-right: 3px solid #1890ff; }
.app-menu-ico { width: 18px; height: 18px; flex-shrink: 0; display: grid; place-items: center; }
.app-menu-ico svg { width: 16px; height: 16px; display: block; }
.menu-title { display: inline-flex; align-items: center; }

.app-right, .app-right.ant-layout { flex: 1; min-width: 0; display: flex; flex-direction: column; height: 100%; background: var(--paper); overflow: hidden; }
.app-navbar.ant-layout-header {
  height: 48px; line-height: 48px; flex-shrink: 0; display: flex; align-items: center; justify-content: space-between;
  background: #fff; padding: 0 16px; z-index: 20; box-shadow: 0 1px 4px rgba(0,21,41,.08); overflow: visible;
}
.app-navbar-left, .app-navbar-right { display: flex; align-items: center; height: 100%; }
.app-navbar-left { gap: 12px; }
.app-fold.ant-btn { width: 32px; padding: 0; color: rgba(0,0,0,.65); }
.app-user-trigger {
  position: relative; display: flex; align-items: center; gap: 8px; height: 48px;
  padding: 0 8px 0 12px; cursor: pointer; transition: background .3s;
}
.app-user-trigger:hover { background: #fafafa; }
.ant-avatar-blue { background: #1890ff; color: #fff; }
.app-user-trigger .ant-avatar {
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0; width: 32px; height: 32px; line-height: 32px;
  overflow: hidden; vertical-align: middle;
}
.app-user-trigger .ant-avatar-string {
  position: static; left: auto; top: auto; transform: none;
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%; line-height: 1; font-size: 14px;
}
.app-avatar-name { font-size: 14px; color: rgba(0,0,0,.85); line-height: 1; }
.app-ver { font-size: 13px; color: rgba(0,0,0,.45); line-height: 1; white-space: nowrap; }
.app-caret { font-size: 12px; color: rgba(0,0,0,.45); line-height: 1; display: inline-flex; transition: transform .3s; }
.app-caret svg { display: block; }
.app-user-trigger.open .app-caret { transform: rotate(180deg); }
.app-user-trigger .ant-dropdown {
  position: absolute; left: auto; right: 0; top: 100%;
  width: max-content; min-width: 100%; z-index: 1050;
}
.app-user-trigger .ant-dropdown-menu {
  width: max-content; min-width: 100% !important; box-sizing: border-box;
}
.app-user-trigger .ant-dropdown-menu-item { white-space: nowrap; }
.app-user-trigger .ant-dropdown[hidden] { display: none !important; }

.app-main { flex: 1; min-height: 0; background: #f5f7fa; padding: 12px; overflow-x: hidden; overflow-y: auto; }
.page-head { margin-bottom: 8px; animation: antFadeIn .25s ease; }
.app-main .ant-page-header { padding: 0 0 8px; }
.app-main .ant-page-header-heading-title { font-size: 20px; }
.page-body {
  background: #fff; border-radius: 2px; padding: 18px;
  box-shadow: 0 1px 2px 0 rgba(0,0,0,.03), 0 1px 6px -1px rgba(0,0,0,.02), 0 2px 4px 0 rgba(0,0,0,.02);
  animation: antFadeIn .3s ease;
  overflow: visible; min-width: 0; max-width: 100%;
}
.app-mask { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 30; animation: antFadeIn .2s ease; }

.ant-form-item { display: block; margin-bottom: 16px; }
.ant-form-item-label,
.ant-form-item-label > label {
  display: block; float: none; width: auto; overflow: visible;
  margin-bottom: 8px; color: rgba(0,0,0,.85); font-size: 14px;
  text-align: left; white-space: normal;
}
.ant-form-item-control { display: block; }
.ant-btn { white-space: nowrap; }
.ant-switch[data-act="toggle"] { cursor: pointer; }
.ant-switch[data-act="toggle"]:active .ant-switch-handle::before,
.ant-switch-checked[data-act="toggle"]:active .ant-switch-handle::before {
  left: 0 !important;
  right: 0 !important;
}

.tool-bar {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; margin-bottom: 16px; flex-wrap: nowrap;
}
.app-search { width: 260px; max-width: 46%; flex: 1 1 auto; min-width: 0; }
.tool-bar .ant-btn { flex-shrink: 0; }
.app-copy-line { display: flex; width: 100%; flex-wrap: nowrap; align-items: stretch; min-width: 0; }
.app-copy-line .ant-input {
  flex: 1 1 auto; width: 100% !important; min-width: 120px; border-radius: 2px 0 0 2px;
}
.app-copy-line .ant-btn {
  flex-shrink: 0; border-radius: 0 2px 2px 0; margin-left: -1px; z-index: 1;
}
.app-copy-line .ant-btn:hover, .app-copy-line .ant-btn:focus { z-index: 2; }
.app-batch {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 12px; border-bottom: 1px solid #f0f0f0; margin-bottom: 12px;
}
.app-batch-n { color: rgba(0,0,0,.45); font-size: 13px; }
.app-row-actions { display: flex; gap: 6px; flex-wrap: nowrap; justify-content: flex-start; }
.app-sub { color: rgba(0,0,0,.45); font-size: 12px; margin-top: 4px; }
.app-empty { text-align: center; color: rgba(0,0,0,.45); padding: 42px 8px; }
.app-pager {
  display: flex; justify-content: flex-start; padding: 16px 12px 12px;
  border-top: 1px solid #f0f0f0;
}
.app-pager .ant-pagination {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin: 0; padding: 0; list-style: none;
}
.app-pager .ant-pagination > li { float: none; }
.app-pager .ant-pagination-total-text {
  height: 32px; line-height: 32px; margin-right: 4px; color: rgba(0,0,0,.85);
}
.app-pager .ant-pagination-item,
.app-pager .ant-pagination-prev,
.app-pager .ant-pagination-next,
.app-pager .ant-pagination-jump {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 32px; height: 32px; margin: 0; padding: 0;
  border: 1px solid #d9d9d9; border-radius: 2px; background: #fff;
  cursor: pointer; user-select: none;
}
.app-pager .ant-pagination-item a,
.app-pager .ant-pagination-jump a,
.app-pager .ant-pagination-item-link {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 30px; height: 30px; padding: 0 6px; color: rgba(0,0,0,.85);
  background: transparent; border: 0; cursor: pointer; line-height: 30px;
}
.app-pager .ant-pagination-item-active {
  border-color: #1890ff; font-weight: 500;
}
.app-pager .ant-pagination-item-active a { color: #1890ff; }
.app-pager .ant-pagination-item:hover,
.app-pager .ant-pagination-prev:hover,
.app-pager .ant-pagination-next:hover,
.app-pager .ant-pagination-jump:hover { border-color: #1890ff; }
.app-pager .ant-pagination-item:hover a,
.app-pager .ant-pagination-jump:hover a,
.app-pager .ant-pagination-prev:hover .ant-pagination-item-link,
.app-pager .ant-pagination-next:hover .ant-pagination-item-link { color: #1890ff; }
.app-pager .ant-pagination-disabled,
.app-pager .ant-pagination-disabled:hover { border-color: #d9d9d9; cursor: not-allowed; }
.app-pager .ant-pagination-disabled .ant-pagination-item-link,
.app-pager .ant-pagination-disabled:hover .ant-pagination-item-link { color: rgba(0,0,0,.25); cursor: not-allowed; }
.app-pager .ant-pagination-options { display: inline-flex; align-items: center; margin-left: 4px; }
.app-page-size {
  height: 32px; min-width: 96px; padding: 0 28px 0 11px;
  border: 1px solid #d9d9d9; border-radius: 2px; background: #fff;
  color: rgba(0,0,0,.85); font-size: 14px; line-height: 30px; cursor: pointer;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, rgba(0,0,0,.45) 50%), linear-gradient(135deg, rgba(0,0,0,.45) 50%, transparent 50%);
  background-position: calc(100% - 16px) 14px, calc(100% - 11px) 14px;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
}
.app-page-size:hover, .app-page-size:focus { border-color: #1890ff; outline: none; }
.app-mono { font-family: SFMono-Regular, Consolas, Menlo, monospace; word-break: break-all; }
.app-box {
  background: #fafafa; border: 1px solid #d9d9d9; border-radius: 2px;
  padding: 4px 11px; min-height: 32px; line-height: 1.5715;
}
.app-hint { color: rgba(0,0,0,.45); margin-top: 8px; }
.app-docs-h { margin: 18px 0 8px; font-weight: 600; }
.app-svc-ok { color: #52c41a; font-weight: 600; }
.app-svc-off { color: #ff4d4f; font-weight: 400; }
.app-share-layout { display: flex; gap: 18px; align-items: flex-start; }
.qr-img { width: 168px; height: 168px; background: #fff; border-radius: 2px; flex-shrink: 0; }
.app-gutter { margin-left: -8px; margin-right: -8px; }
.app-gutter > .ant-col { padding: 0 8px 16px; }

.gauge-card { background: #fafafa; }
.gauge-card .ant-card-body { text-align: center; padding: 20px 12px 16px; }
.gauge { position: relative; width: 132px; height: 132px; margin: 0 auto; }
.gauge svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.g-bg { fill: none; stroke: #f0f0f0; stroke-width: 10; }
.g-fg { fill: none; stroke-width: 10; stroke-linecap: round; transition: stroke-dashoffset .35s ease; }
.g-fg.blue { stroke: #1890ff; }
.g-fg.purple { stroke: #722ed1; }
.g-fg.cyan { stroke: #13c2c2; }
.g-fg.green { stroke: #52c41a; }
.g-num {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.g-num b { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.g-num span { margin-top: 2px; color: rgba(0,0,0,.45); font-size: 12px; }
.g-sub { color: rgba(0,0,0,.45); font-size: 12px; margin-top: 10px; min-height: 16px; }

.app-proto-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.app-proto.ant-card { cursor: pointer; }
.app-proto .ant-card-body { padding: 12px; }
.app-proto b { display: block; margin-bottom: 4px; }
.app-proto span { color: rgba(0,0,0,.45); font-size: 12px; }
.app-proto-on { border-color: #1890ff !important; }
.app-ip-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.app-ip.ant-card { cursor: pointer; min-width: 160px; }
.app-ip .ant-card-body { padding: 10px 12px; }
.app-ip b { display: block; font-size: 13px; }
.app-ip span { color: rgba(0,0,0,.45); font-size: 12px; }
.app-ip-on { border-color: #1890ff !important; }
.soft { display: none !important; }
.soft.show { display: block !important; }
.app-cert-log {
  margin-top: 12px; background: #141414; color: rgba(255,255,255,.85);
  border-radius: 2px; padding: 12px 14px; height: min(360px, 46vh);
  overflow: auto; font-size: 12px; line-height: 1.65; white-space: pre-wrap; word-break: break-all;
}
#modal-root .ant-modal { top: 48px; }
#modal-root .ant-modal.modal-sm { top: 100px; }
#modal-root .ant-modal.modal-add { top: 28px; }
#modal-root .ant-modal-body { max-height: calc(100vh - 160px); overflow: auto; }

.ant-table-wrapper, .app-table-wrap { width: 100%; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.app-ib-table { min-width: 1180px; width: max-content; }
.app-ib-table th, .app-ib-table td { white-space: nowrap; }
.app-ib-table .app-sub { white-space: nowrap; }
.app-ib-table .app-row-actions { flex-wrap: nowrap; width: max-content; }
.app-ib-table .traffic {
  font-variant-numeric: tabular-nums;
  font-family: SFMono-Regular, Consolas, Menlo, monospace;
  font-size: 12px;
}
.app-ib-table td.acts { text-align: left; }
.app-ib-table th:last-child { text-align: left; }

@media (max-width: 768px) {
  .app-aside { position: fixed; left: 0; top: 0; bottom: 0; z-index: 40; transform: translateX(-100%); }
  .app-aside.open { transform: translateX(0); }
  .app-avatar-name, .app-caret, .ant-breadcrumb { display: none; }
  .app-proto-grid { grid-template-columns: 1fr; }
  .app-search { width: auto; max-width: none; flex: 1 1 auto; }
  .gauge { width: 108px; height: 108px; }
  .g-num b { font-size: 16px; }
  .app-share-layout { flex-direction: column; }
}
