:root {
  --sidebar-width: 220px;
  --primary: #009688;
  --primary-dark: #00796b;
  --primary-deep: #00695c;
  --primary-soft: #e0f2f1;
  --sidebar-bg: #1b2740;
  --bg: #f3f5f9;
  --card: #ffffff;
  --text: #333333;
  --text-secondary: #666666;
  --muted: #999999;
  --line: #e6e8ea;
  --line-strong: #dcdfe3;
  --danger: #f56c6c;
  --warning: #fc8b27;
  --blue: #337dc4;
  --shadow: 0 1px 2px rgba(22, 34, 51, .03), 0 6px 20px rgba(22, 34, 51, .035);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", "Noto Sans SC", "Segoe UI", sans-serif;
  font-size: 13px;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

svg {
  display: block;
  width: 18px;
  height: 18px;
}

::selection {
  color: #fff;
  background: rgba(32, 201, 151, .9);
}

.app-shell {
  min-height: 100vh;
}

/* ---------------- Sidebar ---------------- */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 50;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  overflow: hidden;
  color: #b9c4d8;
  background:
    radial-gradient(circle at 25% 0%, rgba(61, 91, 137, .24), transparent 34%),
    linear-gradient(180deg, #202d49 0%, #19243b 52%, #141d2e 100%);
  box-shadow: 8px 0 28px rgba(13, 21, 35, .08);
  transition: width .24s ease, transform .24s ease;
}

.brand {
  display: flex;
  height: 78px;
  flex-shrink: 0;
  align-items: center;
  gap: 11px;
  padding: 0 20px;
  border-bottom: 1px solid rgba(255, 255, 255, .055);
}

.brand-logo {
  display: flex;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  color: #fff;
  border-radius: 9px;
  background: linear-gradient(145deg, #00b39f, #009688);
  box-shadow: 0 5px 14px rgba(0, 150, 136, .28);
}

.brand-logo svg {
  width: 23px;
  height: 23px;
}

.brand-name {
  color: #f2f6ff;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .2px;
  white-space: nowrap;
}

.main-nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
}

.nav-link {
  position: relative;
  display: flex;
  width: 100%;
  height: 45px;
  align-items: center;
  gap: 12px;
  margin-bottom: 3px;
  padding: 0 13px;
  color: #b7c2d6;
  border: 0;
  border-radius: 8px;
  background: transparent;
  font-size: 14px;
  text-align: left;
  transition: color .16s ease, background .16s ease;
}

.nav-link:hover {
  color: #f2f7ff;
  background: rgba(255, 255, 255, .055);
}

.nav-link.active {
  color: #fff;
  background: rgba(255, 255, 255, .06);
}

.nav-icon {
  display: flex;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  color: #9eabc3;
}

.nav-icon svg {
  width: 19px;
  height: 19px;
}

.nav-link:hover .nav-icon,
.nav-link.active .nav-icon {
  color: #d8e2f2;
}

.nav-parent {
  cursor: pointer;
  font-size: 14px;
}

.nav-chevron {
  width: 15px !important;
  height: 15px !important;
  margin-left: auto;
  color: #78869f;
  transition: transform .18s ease;
}

.nav-group.collapsed .nav-chevron {
  transform: rotate(-90deg);
}

.nav-group.collapsed .subnav {
  display: none;
}

.subnav {
  padding: 2px 0 5px;
}

.subnav-link {
  position: relative;
  display: flex;
  height: 43px;
  align-items: center;
  gap: 10px;
  margin: 0 2px;
  padding: 0 17px 0 34px;
  color: #aebbd0;
  border-radius: 7px;
  font-size: 13.5px;
  transition: color .16s ease, background .16s ease;
}

.subnav-link:hover {
  color: #eef5ff;
  background: rgba(255, 255, 255, .055);
}

.subnav-link.active {
  color: #fff;
  background: #009688;
  box-shadow: 0 7px 18px rgba(0, 150, 136, .18);
}

.subnav-dot {
  width: 5px;
  height: 5px;
  flex-shrink: 0;
  border-radius: 50%;
  background: currentColor;
  opacity: .65;
}

.subnav-link.active .subnav-dot {
  opacity: 1;
}

.sidebar-version {
  flex-shrink: 0;
  padding: 18px 0 23px;
  color: #5e6d88;
  font-size: 11px;
  letter-spacing: .4px;
  text-align: center;
}

.sidebar-scrim {
  display: none;
}

/* ---------------- Main shell ---------------- */
.main-shell {
  min-width: 0;
  min-height: 100vh;
  margin-left: var(--sidebar-width);
  transition: margin-left .24s ease;
}

.app-shell.sidebar-collapsed .main-shell {
  margin-left: 0;
}

/* 妗岄潰绔敹璧峰悗淇濈暀鍥炬爣鏍忥紝鑰屼笉鏄妸鏁翠釜渚ф爮绉诲嚭灞忓箷銆?*/
@media (min-width: 901px) {
  .app-shell.sidebar-collapsed .sidebar {
    width: 74px;
    transform: none;
  }

  .app-shell.sidebar-collapsed .main-shell {
    margin-left: 74px;
  }

  .app-shell.sidebar-collapsed .brand {
    justify-content: center;
    padding: 0;
  }

  .app-shell.sidebar-collapsed .brand-logo {
    margin: 0 auto;
  }

  .app-shell.sidebar-collapsed .brand-name {
    display: none;
  }

  .app-shell.sidebar-collapsed .main-nav {
    padding: 16px 10px;
  }

  .app-shell.sidebar-collapsed .nav-link {
    width: 52px;
    height: 46px;
    justify-content: center;
    gap: 0;
    margin: 0 auto 5px;
    padding: 0;
    border-radius: 9px;
  }

  .app-shell.sidebar-collapsed .nav-link > span:not(.nav-icon),
  .app-shell.sidebar-collapsed .nav-chevron,
  .app-shell.sidebar-collapsed .subnav,
  .app-shell.sidebar-collapsed .sidebar-version {
    display: none;
  }

  .app-shell.sidebar-collapsed .nav-icon {
    width: 22px;
    height: 22px;
  }

  .app-shell.sidebar-collapsed .nav-icon svg {
    width: 20px;
    height: 20px;
  }

  .app-shell.sidebar-collapsed .nav-link.active {
    color: #fff;
    background: #009688;
    box-shadow: 0 7px 18px rgba(0, 150, 136, .24);
  }

  .app-shell.sidebar-collapsed .nav-link.active .nav-icon {
    color: #fff;
  }

  .app-shell.sidebar-collapsed .nav-group.group-active > .nav-parent {
    color: #fff;
    background: rgba(0, 150, 136, .18);
  }

  .app-shell.sidebar-collapsed .nav-group.group-active > .nav-parent .nav-icon {
    color: #5de0c5;
  }

  .app-shell.sidebar-collapsed .nav-group.group-active > .nav-parent:hover {
    background: rgba(0, 150, 136, .24);
  }
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  height: 60px;
  align-items: center;
  gap: 13px;
  padding: 0 22px;
  border-bottom: 1px solid #e9edf4;
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(10px);
}

.icon-button {
  display: inline-flex;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  color: #687386;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
}

.icon-button:hover {
  color: var(--text);
  background: #f4f6fa;
}

.icon-button svg {
  width: 20px;
  height: 20px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #8b95a6;
  font-size: 12.5px;
  white-space: nowrap;
}

.breadcrumb a:hover {
  color: var(--primary-dark);
}

.breadcrumb > svg {
  width: 15px;
  height: 15px;
  color: #a0a9b7;
}

.crumb-sep {
  color: #c3cad5;
}

.crumb-current {
  color: #4a5668;
  font-weight: 500;
}

.crumb-parent {
  color: #8b95a6;
}

.topbar-spacer {
  flex: 1;
}

.service-state {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #8a94a4;
  font-size: 11.5px;
}

.service-state span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #009688;
  box-shadow: 0 0 0 3px rgba(0, 150, 136, .12);
}

.content {
  padding: 16px 12px 26px;
}

.view {
  display: none;
  animation: viewIn .2s ease;
}

.view.active {
  display: block;
}

@keyframes viewIn {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------------- Filter & buttons ---------------- */
.filter-card {
  display: flex;
  align-items: flex-end;
  gap: 19px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding: 15px 17px;
  border: 1px solid #edf0f5;
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}

.filter-item {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 34px;
}

.filter-item > label {
  flex-shrink: 0;
  color: #596578;
  font-size: 12.5px;
}

.input-with-icon {
  position: relative;
}

.input-with-icon > svg {
  position: absolute;
  top: 50%;
  left: 10px;
  width: 15px;
  height: 15px;
  color: #a4adba;
  transform: translateY(-50%);
  pointer-events: none;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="email"],
input[type="url"],
input[type="tel"],
select,
textarea {
  height: 34px;
  padding: 0 10px;
  color: #354052;
  border: 1px solid #dde3ec;
  border-radius: 6px;
  outline: none;
  background: #fff;
  font-size: 12.5px;
  transition: border-color .16s ease, box-shadow .16s ease;
}

input::placeholder,
textarea::placeholder {
  color: #b1b9c6;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="email"]:focus,
input[type="url"]:focus,
input[type="tel"]:focus,
select:focus,
textarea:focus {
  border-color: #55d8b7;
  box-shadow: 0 0 0 3px rgba(32, 201, 151, .1);
}

select {
  padding-right: 28px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='m7 9.5 5 5 5-5' stroke='%238b96a6' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  cursor: pointer;
}

#keyword {
  width: 230px;
  padding-left: 32px;
}

#filterISP {
  width: 125px;
}

.date-range {
  display: flex;
  align-items: center;
  gap: 7px;
}

.date-range span {
  color: #9aa4b3;
  font-size: 12px;
}

.date-range input[type="date"] {
  width: 130px;
  padding: 0 8px;
  color: #596578;
}

.date-range input[type="date"]::-webkit-calendar-picker-indicator {
  width: 14px;
  height: 14px;
  opacity: .45;
  cursor: pointer;
}

.filter-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
}

.filter-hint {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding-top: 2px;
  color: #a0a9b7;
  font-size: 10.5px;
  line-height: 1.5;
}

.filter-hint svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  color: #9aa5b4;
}

.btn {
  display: inline-flex;
  height: 34px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 14px;
  color: #4b5769;
  border: 1px solid #dfe5ee;
  border-radius: 6px;
  background: #fff;
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  transition: color .16s ease, background .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.btn svg {
  width: 14px;
  height: 14px;
}

.btn:hover {
  color: var(--primary-dark);
  border-color: #b7e8db;
  background: #f7fffd;
}

.btn-primary {
  color: #fff;
  border-color: var(--primary);
  background: var(--primary);
  box-shadow: 0 3px 8px rgba(0, 150, 136, .12);
}

.btn-primary:hover {
  color: #fff;
  border-color: var(--primary-dark);
  background: var(--primary-dark);
}

.btn-outline {
  color: #526073;
  background: #fff;
}

.btn-ghost {
  border-color: transparent;
  background: transparent;
}

.btn-sm {
  height: 32px;
  padding: 0 12px;
  font-size: 12px;
}

.btn-xs {
  height: 28px;
  padding: 0 10px;
  font-size: 11.5px;
}

.btn-danger {
  color: #fff;
  border-color: #e45d62;
  background: #e45d62;
  box-shadow: 0 4px 10px rgba(228, 93, 98, .16);
}

.btn-danger:hover {
  color: #fff;
  border-color: #d84d52;
  background: #d84d52;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: .55;
}

/* ---------------- Table card ---------------- */
.table-card {
  overflow: hidden;
  border: 1px solid #ebedee;
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}

.toolbar {
  display: flex;
  min-height: 51px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
}

.toolbar-left,
.toolbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.selected-label {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 2px;
  color: #666;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
}

.selected-label input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.custom-check {
  display: inline-flex;
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border: 1px solid #cfd6e1;
  border-radius: 2px;
  background: #fff;
}

.custom-check::after {
  display: none;
  width: 7px;
  height: 4px;
  content: "";
  border-bottom: 1.7px solid #fff;
  border-left: 1.7px solid #fff;
  transform: translateY(-1px) rotate(-45deg);
}

.selected-label input:checked + .custom-check,
.selected-label input:indeterminate + .custom-check {
  border-color: var(--primary);
  background: var(--primary);
}

.selected-label input:checked + .custom-check::after {
  display: block;
}

.selected-label input:indeterminate + .custom-check::after {
  display: block;
  width: 7px;
  height: 0;
  border-bottom: 1.8px solid #fff;
  border-left: 0;
  transform: none;
}

.selected-label input:focus-visible + .custom-check {
  outline: 2px solid rgba(0, 150, 136, .22);
  outline-offset: 2px;
}

.selected-label b {
  color: #333;
  font-weight: 600;
}

.selected-label.has-selection b {
  color: var(--primary-dark);
}

.toolbar-sep {
  display: none;
}

.action-btn {
  display: inline-flex;
  height: 30px;
  align-items: center;
  gap: 5px;
  padding: 0 11px;
  color: #fff;
  border: 1px solid transparent;
  border-radius: 3px;
  font-size: 13px;
  white-space: nowrap;
  transition: background .15s ease, border-color .15s ease, transform .12s ease;
}

.action-btn svg {
  width: 15px;
  height: 15px;
}

.action-btn:active {
  transform: translateY(1px);
}

.action-test {
  color: #075e54;
  border-color: #9bcac4;
  background: #aed6d1;
}

.action-test:hover {
  color: #054a42;
  border-color: #86bdb6;
  background: #9dcdc7;
}

.action-delete {
  color: #8f2d2d;
  border-color: #efb3b3;
  background: #f8cfcf;
}

.action-delete:hover {
  color: #742222;
  border-color: #e7a0a0;
  background: #f3bdbd;
}

.action-copy {
  color: #1b4f86;
  border-color: #aac9ea;
  background: #d2e5fa;
}

.action-copy:hover {
  color: #143f6c;
  border-color: #93b9e2;
  background: #c0daf6;
}

.action-more {
  color: #0f5f70;
  border-color: #9fd3df;
  background: #c5e9f0;
}

.action-more:hover {
  color: #0a4c5a;
  border-color: #87c5d4;
  background: #b1dfe8;
}

.action-duplicate {
  color: #563b88;
  border-color: #c9bae6;
  background: #e2d8f7;
}

.action-duplicate:hover {
  color: #442d6e;
  border-color: #b7a4dc;
  background: #d6c8f1;
}

.action-duplicate.active {
  color: #fff;
  border-color: #5b4b8a;
  background: #5b4b8a;
}

.duplicate-filter-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: -2px 0 10px;
  padding: 7px 10px;
  color: #5b4b8a;
  border: 1px solid #ddd3f2;
  border-radius: 5px;
  background: #f7f4fd;
  font-size: 10.5px;
}

.duplicate-filter-notice[hidden] {
  display: none;
}

.duplicate-filter-notice .link-btn {
  flex-shrink: 0;
  color: #5b4b8a;
  font-size: 10.5px;
}

.modal.modal-dup {
  width: 680px;
}

.dup-port-table-wrap {
  max-height: 360px;
  overflow: auto;
  border: 1px solid #edf0f4;
  border-radius: 7px;
}

.dup-port-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 11px;
}

.dup-port-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 8px 10px;
  color: #8994a4;
  border-bottom: 1px solid #e9edf2;
  background: #f8fafc;
  font-size: 10.5px;
  font-weight: 500;
  text-align: left;
}

.dup-port-table th:nth-child(1) { width: 120px; }
.dup-port-table th:nth-child(2) { width: 100px; }

.dup-port-table td {
  padding: 8px 10px;
  color: #5f6b7d;
  border-bottom: 1px solid #f0f3f6;
}

.dup-port-table tbody tr:last-child td {
  border-bottom: 0;
}

.dup-port-value {
  color: #2f6fae;
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 12px;
}

.dup-port-count {
  display: inline-flex;
  min-width: 22px;
  height: 19px;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  color: #8a4f4f;
  border-radius: 10px;
  background: #fdeeee;
  font-size: 10.5px;
  font-weight: 600;
}

.dup-port-proxies {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow: hidden;
  white-space: nowrap;
}

.dup-port-chip {
  padding: 1px 5px;
  color: #657184;
  border-radius: 3px;
  background: #f2f5f9;
  font-size: 10px;
}

.dup-port-more {
  color: #9aa4b2;
  font-size: 10px;
}

.dup-port-empty {
  display: flex;
  min-height: 130px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  text-align: center;
}

.dup-port-empty strong {
  color: #667285;
  font-size: 12px;
}

.dup-port-empty span {
  color: #9aa4b2;
  font-size: 10.5px;
}

.action-copy:hover {
  color: #143f6c;
  border-color: #93b9e2;
  background: #c0daf6;
}

.action-edit {
  color: #7a4b12;
  border-color: #e7c98f;
  background: #f6e3bb;
}

.action-edit:hover {
  color: #623b0c;
  border-color: #dcba78;
  background: #f1d9a4;
}

.action-renew {
  color: #22613d;
  border-color: #a9d4b8;
  background: #cfe9d8;
}

.action-renew:hover {
  color: #194a2e;
  border-color: #92c6a5;
  background: #bfe1cb;
}

.action-btn:disabled,
.action-btn:disabled:hover {
  color: #b7bec8;
  border-color: #e7eaee;
  background: #f5f6f7;
  box-shadow: none;
  cursor: not-allowed;
  opacity: 1;
  transform: none;
}

.action-btn:disabled svg {
  opacity: .55;
}

.action-btn.loading {
  pointer-events: none;
  opacity: .7;
}

.action-btn.loading::before {
  width: 11px;
  height: 11px;
  content: "";
  border: 1.5px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin .65s linear infinite;
}

.action-btn.loading svg {
  display: none;
}

.table-meta {
  color: #555;
  font-size: 13px;
  white-space: nowrap;
}

.table-meta b {
  color: #333;
  font-weight: 600;
}

.meta-sep {
  display: none;
}

.toolbar-right {
  gap: 10px;
}

.toolbar-right .btn {
  height: 32px;
  margin-left: 0;
  font-size: 13px;
}

.plus {
  margin-top: -1px;
  font-size: 17px;
  font-weight: 400;
  line-height: 1;
}

/* ---------------- Table ---------------- */
.table-wrap {
  position: relative;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  scrollbar-color: #c2cad6 #f1f3f6;
}

.table-wrap::-webkit-scrollbar {
  height: 11px;
}

.table-wrap::-webkit-scrollbar-track {
  border-radius: 6px;
  background: #f1f3f6;
}

.table-wrap::-webkit-scrollbar-thumb {
  border: 2px solid #f1f3f6;
  border-radius: 6px;
  background: #c2cad6;
}

.table-wrap::-webkit-scrollbar-thumb:hover {
  background: #aab5c4;
}

.proxy-table {
  width: 100%;
  min-width: 1805px;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  color: #333;
  font-size: 13px;
  white-space: nowrap;
}

.proxy-table th {
  height: 34px;
  padding: 0 3px;
  color: #333;
  border-right: 1px solid #eef0f2;
  border-bottom: 1px solid #ebedee;
  background: #f4f5f6;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0;
}

.proxy-table td {
  height: 31px;
  padding: 0 3px;
  color: #333;
  border-right: 1px solid #eef0f2;
  border-bottom: 1px solid #eef0f2;
  background: #fff;
  font-size: 13px;
  text-align: center;
  vertical-align: middle;
}

/* 娓犻亾鍜屽崗璁爣绛捐緝瀹斤紝鍑忓皯鍗曞厓鏍肩暀鐧斤紝閬垮厤鏍囩椤跺埌缃戞牸绾裤€?*/
.proxy-table th.col-channel,
.proxy-table td.col-channel,
.proxy-table th.col-protocol,
.proxy-table td.col-protocol {
  padding-left: 3px;
  padding-right: 3px;
}

.proxy-table th:last-child,
.proxy-table td:last-child {
  border-right: 0;
}

.proxy-table tbody td {
  transition: background .12s ease;
}

.proxy-table tbody tr:hover td {
  background: #e3f3ee;
}

.proxy-table tbody tr.selected td {
  background: #d3ede5;
}

.proxy-table tbody tr:last-child td {
  border-bottom: 0;
}

.proxy-table th.sortable {
  cursor: pointer;
  user-select: none;
}

.proxy-table th.sortable:hover {
  color: var(--primary-dark);
}

.th-inner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  line-height: 1;
  vertical-align: middle;
  white-space: nowrap;
}

.sort-icon {
  display: inline-flex;
  width: 6px;
  height: 11px;
  flex: 0 0 6px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  margin-left: 0;
  vertical-align: middle;
}

.sort-icon::before,
.sort-icon::after {
  width: 0;
  height: 0;
  content: "";
  border-right: 3px solid transparent;
  border-left: 3px solid transparent;
}

.sort-icon::before {
  border-bottom: 4px solid #aeb4bd;
}

.sort-icon::after {
  border-top: 4px solid #aeb4bd;
}

.proxy-table th.sort-asc .sort-icon::before {
  border-bottom-color: var(--primary);
}

.proxy-table th.sort-desc .sort-icon::after {
  border-top-color: var(--primary);
}

.col-check { width: 27px; }
.col-host { width: 108px; }
.col-realip { width: 100px; }
.col-port { width: 48px; }
.col-account { width: 73px; }
.col-password { width: 104px; }
.col-region { width: 94px; }
.col-isp { width: 62px; }
.col-channel { width: 60px; }
.col-relay { width: 100px; }
.col-relay-port { width: 66px; }
.col-protocol { width: 69px; }
.col-encryption { width: 90px; }
.col-latency { width: 68px; }
.col-status { width: 46px; }
.col-money { width: 62px; text-align: center !important; }
.col-expire { width: 106px; }
.col-created { width: 116px; }
.col-updated { width: 116px; }
.col-remark { width: 66px; }
.col-actions { width: 100px; }

th.col-check input,
td.col-check input {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: var(--primary);
  cursor: pointer;
}

.cell-host,
.cell-relay {
  display: block;
  overflow: hidden;
  width: 100%;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cell-relay {
  max-width: 100%;
}

.cell-relay-stack {
  display: flex;
  width: 100%;
  height: 100%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  line-height: 1.15;
  text-align: center;
}

.cell-relay-stack .cell-relay {
  color: #333;
  font-size: 11px;
  line-height: 1.15;
}

.cell-relay-domain {
  display: block;
  width: 100%;
  overflow: hidden;
  color: #0f9f7c;
  font-size: 10px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.proxy-table td.col-host,
.proxy-table td.col-region {
  text-align: left;
}

.proxy-table td.col-relay {
  text-align: center;
}

.cell-host {
  color: #333;
  font-weight: 400;
}

.cell-realip {
  color: #2f6fae;
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 11.5px;
}

.cell-port,
.cell-relay-port,
.num {
  font-variant-numeric: tabular-nums;
}

.password-header {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.password-header .password-eye {
  width: 18px;
  height: 18px;
}

.cell-password {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: #a1a1a1;
  font-size: 13px;
  letter-spacing: .5px;
}

.password-value {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cell-password.revealed .password-value {
  color: #3f4b5d;
  font-family: inherit;
  font-size: 13px;
  letter-spacing: 0;
}

.password-eye {
  display: inline-flex;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: #8b9aae;
  border: 0;
  border-radius: 4px;
  background: transparent;
}

.password-eye:hover {
  color: #337dc4;
  background: #edf5ff;
}

.password-eye:disabled {
  opacity: .5;
}

.password-eye svg {
  width: 14px;
  height: 14px;
}

.password-eye .eye-off {
  display: none;
}

.password-eye.revealed .eye-open {
  display: none;
}

.password-eye.revealed .eye-off {
  display: block;
}

.cell-region {
  overflow: hidden;
  color: #333;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cell-datetime {
  color: #666;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.cell-remark {
  display: block;
  overflow: hidden;
  width: 100%;
  color: #666;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.proxy-table td.col-remark {
  text-align: left;
}

.tag {
  display: inline-flex;
  height: 20px;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  border: 1px solid transparent;
  border-radius: 2px;
  font-size: 13px;
  font-weight: 400;
  line-height: 1;
}

.tag-isp-mobile {
  color: #15803d;
  border-color: #d2efdd;
  background: #e9f8ef;
}

.tag-isp-unicom {
  color: #b45309;
  border-color: #fbe3c6;
  background: #fff4e8;
}

.tag-isp-telecom {
  color: #2456c4;
  border-color: #d6e2fb;
  background: #eaf0ff;
}

.tag-isp-bgp {
  color: #6338c9;
  border-color: #e1d7fb;
  background: #f2edff;
}

.tag-channel-third {
  color: #6b7280;
  border-color: #e5e7eb;
  background: #f3f4f6;
}

.tag-channel-tianyi {
  color: #2f6fd0;
  border-color: #d8e6fb;
  background: #eaf2ff;
}

.tag-channel-yidong {
  color: #0e7490;
  border-color: #ccecf5;
  background: #e8f8fc;
}

.tag-channel-huawei {
  color: #be123c;
  border-color: #f7d5df;
  background: #fff1f4;
}

.tag-channel-ali {
  color: #c97606;
  border-color: #fbe4c2;
  background: #fff5e6;
}

.tag-channel-volcano {
  color: #6d4bd8;
  border-color: #e2d9fb;
  background: #f1edff;
}

.relay-text {
  color: #666;
}

.proto {
  display: inline-flex;
  min-width: 28px;
  height: 20px;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  color: #2b7bbf;
  border: 1px solid #d5e5f7;
  border-radius: 2px;
  background: #eff7ff;
  font-size: 12px;
  font-weight: 400;
}

.proto.socks {
  color: #b45309;
  border-color: #f1d2a5;
  background: #fff7e8;
}

.enc-text {
  color: #666;
  font-size: 12px;
}

.latency {
  color: #666;
  font-size: 12px;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}

.latency small {
  margin-left: 1px;
  color: inherit;
  font-size: 12px;
  font-weight: 400;
}
.latency.good { color: #18a44b; }
.latency.mid { color: #fd7e14; }
.latency.bad { color: #fd7e14; }
.latency.none { color: #666; font-weight: 400; }

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #c4c4c4;
  vertical-align: middle;
}

.status-dot.online {
  background: #12a594;
  box-shadow: 0 0 0 3px rgba(18, 165, 148, .09);
}

.status-dot.offline {
  background: #fa4b4b;
  box-shadow: 0 0 0 3px rgba(250, 75, 75, .08);
}

.status-dot.unknown {
  background: #c4c4c4;
  box-shadow: 0 0 0 3px rgba(196, 196, 196, .1);
}

.money {
  color: #333;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.proxy-table td.col-cost {
  color: #b26a1f;
}

.proxy-table td.col-price {
  color: #2f6fae;
}

.proxy-table td.col-profit.profit-positive {
  color: #0f9f7c;
}

.proxy-table td.col-profit.profit-negative {
  color: #d9534f;
}

.profit-positive {
  color: #0f9f7c;
}

.profit-negative {
  color: #d9534f;
}

.cell-expire {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.expire-date {
  color: #333;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.days-badge {
  display: inline-flex;
  min-width: 20px;
  height: 18px;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border-radius: 2px;
  color: #15803d;
  background: #e9f7ef;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.days-badge.ok {
  color: #15803d;
  background: #e9f7ef;
}

.days-badge.warn {
  color: #c2760b;
  background: #fff4e6;
}

.days-badge.expired {
  color: #d46b08;
  background: #fff2e8;
}

.cell-actions {
  padding-left: 6px !important;
  text-align: center;
  white-space: nowrap;
}

.proxy-table th.col-actions,
.proxy-table td.col-actions {
  position: sticky;
  right: 0;
  z-index: 2;
  background: #fff;
  box-shadow: -7px 0 12px -10px rgba(15, 23, 42, .45);
}

.proxy-table th.col-actions {
  z-index: 3;
  background: #f4f5f6;
}

.proxy-table tbody tr:hover td.col-actions {
  background: #e3f3ee;
}

.proxy-table tbody tr.selected td.col-actions {
  background: #d3ede5;
}

.proxy-row-actions {
  display: flex;
  height: 100%;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.row-icon-btn {
  display: inline-flex;
  width: 26px;
  height: 26px;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: #337dc4;
  border: 0;
  border-radius: 5px;
  background: transparent;
  transition: color .16s ease, background .16s ease;
}

.row-icon-btn svg {
  width: 15px;
  height: 15px;
}

.row-icon-btn[data-action="logs"] svg {
  width: 16px;
  height: 16px;
}

.row-log-btn {
  position: relative;
}

.log-badge {
  position: absolute;
  top: -2px;
  right: -3px;
  min-width: 11px;
  height: 11px;
  padding: 0 2px;
  color: #fff;
  border-radius: 5.5px;
  background: #ff1a1a;
  box-shadow: 0 0 0 1px #fff;
  font-size: 8px;
  font-weight: 700;
  line-height: 11px;
  text-align: center;
  pointer-events: none;
}

.row-icon-btn:hover {
  color: #1f66ad;
  background: #edf5ff;
}

.row-icon-btn:focus-visible {
  outline: 2px solid rgba(51, 125, 196, .35);
  outline-offset: 1px;
}

.row-icon-btn.danger {
  color: #f56c6c;
}

.row-icon-btn.danger:hover {
  color: #d94f4f;
  background: #fff1f0;
}

.row-icon-btn.danger:focus-visible {
  outline-color: rgba(245, 108, 108, .35);
}

.proxy-log-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 18px;
  padding: 10px 0 0;
  color: #98a2b1;
  font-size: 10.5px;
}

.proxy-log-old {
  color: #9aa4b2;
  text-decoration: line-through;
}

.proxy-log-new {
  color: #0f9f7c;
  font-weight: 500;
}

.proxy-log-hint {
  margin: 9px 0 2px;
  padding: 7px 10px;
  color: #8a95a5;
  border: 1px solid #edf1f5;
  border-radius: 5px;
  background: #f8fafc;
  font-size: 10.5px;
  line-height: 1.55;
}

.proxy-log-empty {
  display: flex;
  min-height: 122px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 20px;
  text-align: center;
}

.proxy-log-empty strong {
  color: #667285;
  font-size: 12px;
  font-weight: 600;
}

.proxy-log-empty span {
  max-width: 330px;
  color: #9aa4b2;
  font-size: 10.5px;
  line-height: 1.6;
}

.proxy-log-table-wrap {
  max-height: 360px;
  overflow: auto;
  border: 1px solid #edf0f4;
  border-radius: 7px;
}

.proxy-log-table {
  width: 100%;
  min-width: 678px;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 11px;
}

.proxy-log-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
}

.proxy-log-foot-left {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
}

.proxy-log-selected {
  color: #7f8a9a;
  font-size: 10.5px;
}

.proxy-log-delete-confirm {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 9px;
  padding: 8px 10px;
  color: #8a4f4f;
  border: 1px solid #f3d9d9;
  border-radius: 6px;
  background: #fff7f7;
  font-size: 10.5px;
}

.proxy-log-delete-confirm[hidden] {
  display: none;
}

.proxy-log-delete-actions {
  display: flex;
  flex-shrink: 0;
  gap: 6px;
}

.proxy-log-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 9px;
  color: #7f8a9a;
  font-size: 10.5px;
}

.proxy-log-page-buttons {
  display: flex;
  align-items: center;
  gap: 4px;
}

.log-page-btn {
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  color: #667285;
  border: 1px solid #e5eaf0;
  border-radius: 4px;
  background: #fff;
  font-size: 10.5px;
  line-height: 22px;
}

.log-page-btn:hover:not(:disabled) {
  border-color: #b9d7ce;
  color: #0f9f7c;
}

.log-page-btn.active {
  color: #fff;
  border-color: var(--primary);
  background: var(--primary);
}

.log-page-btn:disabled {
  opacity: .45;
}

.log-page-ellipsis {
  padding: 0 2px;
  color: #9aa4b2;
  font-size: 10.5px;
}

.proxy-log-check {
  width: 34px !important;
  text-align: center !important;
}

.proxy-log-check input {
  width: 13px;
  height: 13px;
  margin: 0;
  accent-color: var(--primary);
  vertical-align: middle;
}

.proxy-log-table tbody tr.selected td {
  background: #f2f9f7;
}

.proxy-log-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 7px 8px;
  color: #8994a4;
  border-bottom: 1px solid #e9edf2;
  background: #f8fafc;
  font-size: 10.5px;
  font-weight: 500;
  text-align: left;
  white-space: nowrap;
}

.proxy-log-table th:nth-child(2) { width: 122px; }
.proxy-log-table th:nth-child(3) { width: 64px; }
.proxy-log-table th:nth-child(4) { width: 150px; }
.proxy-log-table th:nth-child(5) { width: 150px; }
.proxy-log-table th:nth-child(6) { width: 70px; }
.proxy-log-table th:nth-child(7) { width: 88px; }

.proxy-log-table td {
  padding: 7px 8px;
  color: #5f6b7d;
  border-bottom: 1px solid #f0f3f6;
  vertical-align: middle;
}

.proxy-log-table tbody tr:last-child td {
  border-bottom: 0;
}

.proxy-log-table tbody tr:hover td {
  background: #fbfcfd;
}

.proxy-log-table td,
.proxy-log-table th {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.proxy-log-time {
  color: #7f8a9a !important;
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
}

.proxy-log-field {
  display: inline-block;
  padding: 1px 5px;
  color: #5b6779;
  border-radius: 3px;
  background: #f1f4f8;
  font-size: 10px;
  line-height: 1.5;
}

.proxy-log-old-value {
  color: #98a2b1 !important;
}

.proxy-log-new-value {
  color: #0f9f7c !important;
  font-weight: 500;
}

.proxy-log-operator,
.proxy-log-ip {
  color: #7c8797 !important;
  font-size: 10px;
}

.proxy-log-table .proxy-log-empty {
  min-height: 150px;
  border-bottom: 0;
}

/* More detection */
.more-test-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.more-test-action {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 10px;
  padding: 10px;
  color: inherit;
  border: 1px solid #e9edf2;
  border-radius: 8px;
  background: #fff;
  text-align: left;
  transition: border-color .16s ease, background .16s ease;
}

.more-test-action:hover {
  border-color: #cfe5de;
  background: #fafdfc;
}

.more-test-action:disabled {
  opacity: .65;
}

.more-test-icon {
  display: flex;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}

.more-test-icon svg {
  width: 18px;
  height: 18px;
}

.more-test-icon.green {
  color: #0f9f7c;
  background: #eaf9f4;
}

.more-test-icon.blue {
  color: #2f6fae;
  background: #edf5fc;
}

.more-test-icon.orange {
  color: #b26a1f;
  background: #fff7e8;
}

.more-test-copy {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 2px;
}

.more-test-copy strong {
  color: #3b4658;
  font-size: 12px;
  font-weight: 600;
}

.more-test-copy small {
  overflow: hidden;
  color: #98a2b1;
  font-size: 10px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.more-test-arrow {
  flex-shrink: 0;
  color: #b3bcc8;
  font-size: 18px;
  line-height: 1;
}

.import-result-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.modal.modal-import {
  width: 440px;
}

.modal.modal-import .modal-body {
  padding: 16px 18px;
}

.import-result-status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid #f3dede;
  border-radius: 7px;
  background: #fff8f8;
}

.import-result-icon {
  display: flex;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  color: #fff;
  border-radius: 50%;
  background: #e35f65;
  font-size: 16px;
  font-weight: 700;
}

.import-result-status > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.import-result-status strong {
  color: #5b4650;
  font-size: 12px;
  font-weight: 600;
}

.import-result-status span {
  color: #9a7d84;
  font-size: 10.5px;
  line-height: 1.5;
}

.import-error-list {
  max-height: 140px;
  margin: 9px 0 0;
  padding: 8px 10px;
}

.import-result-note {
  margin: 8px 0 0;
  color: #9aa4b2;
  font-size: 10px;
  line-height: 1.5;
}

.import-result-stats > div {
  padding: 12px 10px;
  border: 1px solid #e6f2ed;
  border-radius: 7px;
  background: #f5fbf8;
  text-align: center;
}

.import-result-stats > div.danger {
  border-color: #f4dede;
  background: #fff7f7;
}

.import-result-stats strong {
  display: block;
  color: #0f9f7c;
  font-size: 22px;
  line-height: 1.2;
}

.import-result-stats .danger strong {
  color: #d9534f;
}

.import-result-stats span {
  color: #8a95a5;
  font-size: 10.5px;
}

.import-error-list {
  display: flex;
  max-height: 140px;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 0;
  padding: 8px 10px;
  overflow-y: auto;
  color: #a25b5b;
  border: 1px solid #f3dede;
  border-radius: 6px;
  background: #fffafa;
  font-size: 10.5px;
  line-height: 1.55;
}

.import-result p.import-result-note {
  margin: 8px 0 0;
  color: #9aa4b2;
  font-size: 10px;
  line-height: 1.5;
}

.import-result p {
  margin: 0;
  color: #8a95a5;
  font-size: 10.5px;
  line-height: 1.6;
}

.import-result p b {
  color: #667285;
}

/* Domain management */
.domain-head-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.domain-total {
  color: #8a95a5;
  font-size: 11px;
}

.domain-total b {
  color: #0f9f7c;
  font-size: 13px;
}

.domain-table th:nth-child(1) { width: 150px; }
.domain-table th:nth-child(2) { width: 220px; }
.domain-table th:nth-child(3) { width: 100px; }
.domain-table th:nth-child(5) { width: 140px; }

.domain-bindings {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow: hidden;
  color: #8a95a5;
  font-size: 10.5px;
  white-space: nowrap;
}

.domain-binding-edit {
  display: flex;
  align-items: center;
  gap: 6px;
}

.domain-binding-input {
  width: 100%;
  min-width: 0;
  height: 25px;
  padding: 0 7px;
  flex: 1;
  color: #2f6fae;
  border: 1px solid #e5eaf0;
  border-radius: 4px;
  background: #fff;
  font-size: 11px;
}

.domain-binding-input::placeholder {
  color: #b0b8c4;
}

.domain-binding-input:focus {
  border-color: #9ed7c8;
  outline: none;
  box-shadow: 0 0 0 2px rgba(32, 201, 151, .1);
}

.domain-binding-input:disabled {
  background: #f7f9fb;
}

.domain-binding-status {
  min-width: 32px;
  color: #0f9f7c;
  font-size: 9.5px;
  white-space: nowrap;
}

.domain-binding-status.error {
  color: #d9534f;
}

.domain-chip {
  padding: 1px 6px;
  color: #2f6fae;
  border-radius: 3px;
  background: #eef5fc;
}

.domain-empty-value {
  color: #b0b8c4;
}

.domain-ip {
  color: #2f6fae;
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 12px;
}

.domain-count {
  display: inline-flex;
  min-width: 22px;
  height: 19px;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  color: #0f7e65;
  border-radius: 10px;
  background: #eaf9f4;
  font-size: 10.5px;
  font-weight: 600;
}

.domain-proxies {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow: hidden;
  color: #8a95a5;
  font-size: 10.5px;
  white-space: nowrap;
}

.domain-proxy-chip {
  padding: 1px 5px;
  color: #657184;
  border-radius: 3px;
  background: #f2f5f9;
}

.domain-empty {
  padding: 42px 20px;
  text-align: center;
}

.domain-empty strong {
  display: block;
  margin-bottom: 5px;
  color: #667285;
  font-size: 12px;
}

.domain-empty span {
  color: #9aa4b2;
  font-size: 10.5px;
}

.link-btn {
  padding: 0;
  color: #337dc4;
  border: 0;
  background: transparent;
  font-size: 13px;
}

.link-btn:hover {
  color: #1f66ad;
  text-decoration: underline;
}

.link-btn.danger {
  margin-left: 6px;
  color: #f56c6c;
}

.link-btn.danger:hover {
  color: #d94f4f;
}

.op-sep {
  display: none;
}

.proxy-table tfoot td {
  height: 31px;
  padding: 0 6px;
  color: #333;
  border-top: 1px solid #eef0f2;
  border-right: 0;
  border-bottom: 0;
  background: #fff;
  font-size: 13px;
}

.summary-row .summary-label {
  padding-right: 12px;
  color: #333;
  font-weight: 400;
  text-align: right;
}

.summary-row .summary-label b {
  font-weight: 400;
}

.summary-row .summary-money {
  padding: 0 4px;
  font-size: 13px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  text-align: center;
  white-space: nowrap;
}

.summary-row .summary-money.profit {
  color: #333;
}

.empty-state {
  padding: 70px 20px !important;
  text-align: center !important;
}

.empty-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: #98a2b1;
}

.empty-inner svg {
  width: 42px;
  height: 42px;
  color: #c3cad6;
}

.empty-inner strong {
  color: #5f6b7d;
  font-size: 13px;
  font-weight: 500;
}

.empty-inner span {
  font-size: 11.5px;
}

.table-loading {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: #7d8796;
  background: rgba(255, 255, 255, .84);
  font-size: 12px;
  backdrop-filter: blur(1px);
}

.table-loading.show {
  display: flex;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #cceee5;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---------------- Summary / pagination ---------------- */
.table-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  flex-wrap: wrap;
  padding: 9px 14px;
  border-top: 1px solid #eef0f2;
  background: #fbfcfd;
}

.table-summary-label {
  color: #6c7787;
  font-size: 12px;
  white-space: nowrap;
}

.table-summary-label b {
  color: #3d485a;
  font-weight: 600;
}

.table-summary-totals {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
  margin-left: auto;
}

.table-summary-item {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  color: #8b96a5;
  font-size: 11px;
  white-space: nowrap;
}

.table-summary-item b {
  color: #354052;
  font-size: 13px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.table-summary-item.profit b {
  color: #0f9f7c;
}

.table-summary-item #summaryProfit.negative {
  color: #df5f65;
}

.pagination {
  display: flex;
  min-height: 47px;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px 12px;
  border-top: 1px solid var(--line);
}

.page-total {
  color: #333;
  font-size: 13px;
  white-space: nowrap;
}

.page-total b {
  color: #333;
  font-weight: 600;
}

.page-buttons {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
}

.page-btn {
  display: inline-flex;
  min-width: 32px;
  height: 28px;
  align-items: center;
  justify-content: center;
  padding: 0 9px;
  color: #555;
  border: 1px solid #e2e5e9;
  border-radius: 3px;
  background: #fff;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.page-btn:hover:not(:disabled):not(.active) {
  color: var(--primary-dark);
  border-color: #a7d8d2;
}

.page-btn.active {
  color: #fff;
  border-color: var(--primary);
  background: var(--primary);
  box-shadow: none;
}

.page-btn:disabled {
  color: #c0c4cc;
  cursor: not-allowed;
  background: #fff;
}

.page-ellipsis {
  display: inline-flex;
  width: 21px;
  justify-content: center;
  color: #999;
  font-size: 12px;
}

.page-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 8px;
  color: #555;
  font-size: 13px;
  white-space: nowrap;
}

.page-tools select {
  height: 30px;
  padding: 0 26px 0 8px;
  color: #333;
  border-color: #dcdfe3;
  font-size: 13px;
}

#jumpPage {
  width: 44px;
  height: 30px;
  padding: 0 6px;
  color: #333;
  text-align: center;
  border-color: #dcdfe3;
  font-size: 12.5px;
}

#jumpPage::-webkit-inner-spin-button {
  margin: 0;
  appearance: none;
}

.jump-text {
  color: #555;
}

/* ---------------- Modals ---------------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(18, 28, 44, .46);
  opacity: 0;
  backdrop-filter: blur(2px);
  transition: opacity .16s ease;
}

.modal-backdrop.open {
  opacity: 1;
}

.modal-backdrop.closing {
  pointer-events: none;
  opacity: 0;
}

.modal {
  display: flex;
  width: 720px;
  max-width: 100%;
  max-height: min(88vh, 860px);
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .4);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 28px 70px rgba(16, 27, 45, .25);
  opacity: 1;
  transform: translateY(0) scale(1);
  transition: transform .19s ease, opacity .19s ease;
}

.modal-backdrop .modal {
  opacity: 0;
  transform: translateY(8px) scale(.99);
}

.modal-backdrop.open .modal {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.modal-backdrop.closing .modal {
  opacity: 0;
  transform: translateY(8px) scale(.985);
}

.modal.modal-sm { width: 470px; }
.modal.modal-xs { width: 360px; }
.modal.modal-md { width: 560px; }
.modal.modal-lg { width: 820px; }
.modal.modal-xl { width: 715px; max-height: 96vh; }

.modal.modal-log {
  width: 760px;
}

.modal.modal-log .modal-head {
  height: 44px;
  padding: 0 16px;
}

.modal.modal-log .modal-title-wrap {
  gap: 8px;
}

.modal.modal-log .modal-title-wrap h3 {
  font-size: 14px;
}

.modal.modal-log .modal-subtitle {
  font-size: 11px;
}

.modal.modal-log .modal-close {
  width: 26px;
  height: 26px;
  font-size: 19px;
}

.modal.modal-log .modal-body {
  padding: 15px 18px;
}

.modal.modal-log .modal-foot {
  min-height: 54px;
  padding: 8px 16px;
}

.modal-head {
  display: flex;
  height: 60px;
  flex-shrink: 0;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  border-bottom: 1px solid #edf0f4;
}

.modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-title-wrap h3 {
  margin: 0;
  color: #2c3749;
  font-size: 15px;
  font-weight: 600;
}

.modal-subtitle {
  color: #98a2b1;
  font-size: 11.5px;
}

.modal-close {
  display: inline-flex;
  width: 30px;
  height: 30px;
  align-items: center;
  justify-content: center;
  color: #9ba5b4;
  border: 0;
  border-radius: 6px;
  background: transparent;
  font-size: 21px;
  line-height: 1;
}

.modal-close:hover {
  color: #4e5a6c;
  background: #f4f6f9;
}

.modal-body {
  flex: 1;
  padding: 20px 22px;
  overflow-y: auto;
}

.modal-foot {
  display: flex;
  min-height: 64px;
  flex-shrink: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 22px;
  border-top: 1px solid #edf0f4;
  background: #fbfcfe;
}

.modal-foot .btn {
  min-width: 76px;
}

.modal .btn:focus {
  outline: 2px solid rgba(32, 201, 151, .32);
  outline-offset: 2px;
}

.modal-foot .left-note {
  margin-right: auto;
  color: #98a2b1;
  font-size: 11px;
}

/* Forms */
.form-section {
  margin-bottom: 18px;
}

.form-section:last-child {
  margin-bottom: 0;
}

.form-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  color: #4f5b6d;
  font-size: 12px;
  font-weight: 600;
}

.form-section-title::after {
  height: 1px;
  flex: 1;
  content: "";
  background: #eff2f6;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px 16px;
}

.field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 6px;
}

.field.span-2 {
  grid-column: span 2;
}

.field > span,
.field > label {
  color: #657184;
  font-size: 11.5px;
}

.field em {
  margin-left: 2px;
  color: #e46066;
  font-style: normal;
}

.field input,
.field select,
.field textarea {
  width: 100%;
}

.field textarea {
  height: 76px;
  padding: 9px 10px;
  resize: vertical;
  line-height: 1.55;
}

.field .hint {
  color: #a2abb8;
  font-size: 10.5px;
  line-height: 1.4;
}

.form-error {
  display: none;
  margin-bottom: 13px;
  padding: 8px 10px;
  color: #c94f55;
  border: 1px solid #f4d7d9;
  border-radius: 5px;
  background: #fff5f5;
  font-size: 11.5px;
}

.form-error.show {
  display: block;
}

.checkline {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #667284;
  font-size: 11.5px;
}

.checkline input {
  accent-color: var(--primary);
}

/* Confirmation & misc modal */
.confirm-box {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.confirm-icon {
  display: flex;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  color: #df5e64;
  border-radius: 50%;
  background: #fff0f0;
}

.confirm-icon svg {
  width: 21px;
  height: 21px;
}

.confirm-icon.success {
  color: #0f9f7c;
  background: #eaf9f4;
}

.confirm-copy strong {
  display: block;
  margin: 1px 0 7px;
  color: #3b4658;
  font-size: 13px;
  font-weight: 600;
}

.confirm-copy p {
  margin: 0;
  color: #858f9f;
  font-size: 11.5px;
  line-height: 1.7;
}

.confirm-copy b {
  color: #4e5b6e;
  font-weight: 600;
}

/* Action result */
.action-result {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2px 4px 1px;
  text-align: center;
}

.modal-xs .modal-body {
  padding: 16px 18px;
}

.modal-xs .modal-foot {
  min-height: 54px;
  padding: 9px 16px;
}

.action-result-icon {
  display: flex;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  color: #0f9f7c;
  border-radius: 50%;
  background: #eaf9f4;
}

.action-result-icon svg {
  width: 25px;
  height: 25px;
}

.action-result-icon.danger {
  color: #df5e64;
  background: #fff0f0;
}

.action-result-icon.info {
  color: #4d84c6;
  background: #eef5ff;
}

.action-result h3 {
  margin: 0 0 8px;
  color: #303b4e;
  font-size: 17px;
  font-weight: 600;
}

.action-result p {
  max-width: 300px;
  margin: 0;
  color: #7e8998;
  font-size: 11.5px;
  line-height: 1.6;
}

.action-result-detail {
  max-width: 310px;
  margin-top: 9px;
  padding: 6px 9px;
  color: #5f6b7d;
  border: 1px solid #edf0f4;
  border-radius: 5px;
  background: #f8fafb;
  font-size: 10.5px;
  line-height: 1.5;
  word-break: break-all;
}

.action-result-toast {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 120;
  display: flex;
  width: 300px;
  height: 80px;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #e5ebf1;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 14px 36px rgba(15, 23, 42, .16);
  transform: translate(-50%, -50%);
  animation: actionResultIn .18s ease-out;
}

@keyframes actionResultIn {
  from {
    opacity: 0;
    transform: translate(-50%, calc(-50% - 6px));
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

.action-result-toast-icon {
  display: flex;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  color: #0f9f7c;
  border-radius: 50%;
  background: #eaf9f4;
}

.action-result-toast-icon svg {
  width: 21px;
  height: 21px;
}

.action-result-toast.danger .action-result-toast-icon {
  color: #df5e64;
  background: #fff0f0;
}

.action-result-toast-copy {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 3px;
}

.action-result-toast-copy strong {
  overflow: hidden;
  color: #303b4e;
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.action-result-toast-copy > span {
  overflow: hidden;
  color: #818c9b;
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.action-result-toast-close {
  display: flex;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: #a1aab8;
  border: 0;
  border-radius: 4px;
  background: transparent;
  font-size: 17px;
  line-height: 1;
}

.action-result-toast-close:hover {
  color: #5f6b7d;
  background: #f2f5f8;
}

.selected-proxy-list {
  display: flex;
  max-height: 76px;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  overflow-y: auto;
}

.selected-chip {
  padding: 3px 7px;
  color: #607085;
  border: 1px solid #e5eaf1;
  border-radius: 4px;
  background: #fafbfc;
  font-size: 10.5px;
}

.copy-area {
  width: 100%;
  height: 245px !important;
  padding: 10px 12px !important;
  color: #566174;
  border: 1px solid #dfe5ed;
  border-radius: 6px;
  background: #fbfcfd;
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 11px;
  line-height: 1.65;
  resize: vertical;
}

.renew-options {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 4px 0 16px;
}

.renew-option {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 12px 8px;
  color: #647085;
  border: 1px solid #e2e8f0;
  border-radius: 7px;
  background: #fff;
  cursor: pointer;
  transition: all .15s ease;
}

.renew-option input {
  position: absolute;
  opacity: 0;
}

.renew-option strong {
  font-size: 14px;
  font-weight: 600;
}

.renew-option small {
  color: #9ba5b4;
  font-size: 10px;
}

.renew-option:has(input:checked) {
  color: var(--primary-dark);
  border-color: #59d6b7;
  background: #f1fcf8;
  box-shadow: 0 0 0 2px rgba(32, 201, 151, .08);
}

.renew-option:has(input:checked) small {
  color: #54b89e;
}

.custom-days {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #6c7789;
  font-size: 12px;
}

.custom-days input {
  width: 115px;
}

/* ---------------- Toasts ---------------- */
.toast-root {
  position: fixed;
  top: 50%;
  left: 50%;
  right: auto;
  z-index: 200;
  display: flex;
  width: 350px;
  max-width: calc(100vw - 32px);
  flex-direction: column;
  align-items: center;
  gap: 9px;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.toast {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 14px;
  color: #4a5668;
  border: 1px solid #e5eaf0;
  border-left: 3px solid var(--primary);
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(26, 39, 58, .12);
  font-size: 12px;
  line-height: 1.55;
  text-align: center;
  animation: toastIn .2s ease;
  pointer-events: auto;
}

.toast.success { border-left-color: var(--primary); }
.toast.error { border-left-color: #e35f65; }
.toast.warning { border-left-color: #e9a23b; }
.toast.info { border-left-color: #5a86dd; }

.toast-icon {
  display: flex;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  color: #fff;
  border-radius: 50%;
  background: var(--primary);
  font-size: 11px;
  font-weight: 700;
}

.toast.error .toast-icon { background: #e35f65; }
.toast.warning .toast-icon { background: #e9a23b; }
.toast.info .toast-icon { background: #5a86dd; }

.toast-message {
  flex: 0 1 auto;
  text-align: center;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------------- Other views ---------------- */
.view-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 3px 0 17px;
}

.view-heading h2 {
  margin: 0 0 5px;
  color: #273244;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -.2px;
}

.view-heading p {
  margin: 0;
  color: #8c96a6;
  font-size: 12px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.stat-card {
  padding: 16px 17px;
  border: 1px solid #edf0f5;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  color: #8791a2;
  font-size: 11.5px;
}

.stat-icon {
  display: flex;
  width: 31px;
  height: 31px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}

.stat-icon svg { width: 17px; height: 17px; }
.stat-icon.mint { color: #1caf89; background: #e9faf4; }
.stat-icon.green { color: #21a97d; background: #eaf9f2; }
.stat-icon.amber { color: #d9972f; background: #fff6e8; }
.stat-icon.blue { color: #4f7fdc; background: #eef4ff; }
.stat-icon.rose { color: #c26376; background: #fdf0f3; }
.stat-icon.violet { color: #7c63c8; background: #f3f0ff; }

.stat-card > strong {
  display: block;
  margin-bottom: 8px;
  color: #2a3546;
  font-size: 24px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.4px;
}

.stat-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #98a2b1;
  font-size: 10.5px;
}

.stat-sub .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #20c997;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.panel {
  padding: 17px;
  border: 1px solid #edf0f5;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.panel-wide {
  grid-column: span 2;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 17px;
}

.panel-head h3 {
  margin: 0;
  color: #394456;
  font-size: 13px;
  font-weight: 600;
}

.panel-head span {
  color: #a0a9b6;
  font-size: 10.5px;
}

.status-breakdown {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.status-line {
  display: grid;
  grid-template-columns: 62px 1fr 64px;
  align-items: center;
  gap: 10px;
}

.status-line-label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #687487;
  font-size: 11.5px;
}

.status-line .track,
.bar-track {
  height: 7px;
  overflow: hidden;
  border-radius: 4px;
  background: #f1f4f8;
}

.status-line .track span,
.bar-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #20c997;
  transition: width .4s ease;
}

.status-line:nth-child(2) .track span { background: #ed6369; }
.status-line:nth-child(3) .track span { background: #b3bcc8; }

.status-line b {
  color: #566275;
  font-size: 11.5px;
  font-weight: 500;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.bar-list {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.bar-row {
  display: grid;
  grid-template-columns: 45px 1fr 30px;
  align-items: center;
  gap: 10px;
  color: #687487;
  font-size: 11px;
}

.bar-row b {
  color: #576376;
  font-weight: 500;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.bar-track span { background: #53d4b2; }
.bar-row:nth-child(2) .bar-track span { background: #6e9aea; }
.bar-row:nth-child(3) .bar-track span { background: #f0b05a; }
.bar-row:nth-child(4) .bar-track span { background: #a788e4; }

.region-chart-layout {
  display: grid;
  grid-template-columns: 188px minmax(0, 1fr);
  gap: 28px;
  align-items: center;
  padding: 12px 4px 10px;
}

.region-donut {
  position: relative;
  width: 168px;
  height: 168px;
  margin: 0 auto;
  border-radius: 50%;
  background: #f1f4f8;
}

.region-donut::after {
  position: absolute;
  inset: 34px;
  border-radius: 50%;
  background: #fff;
  content: "";
}

.region-donut-center {
  position: absolute;
  inset: 34px;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.region-donut-center strong {
  color: #334155;
  font-size: 23px;
  font-weight: 600;
  line-height: 1.1;
}

.region-donut-center span {
  color: #97a2b1;
  font-size: 9.5px;
}

.region-legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px 20px;
}

.region-legend-row {
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr) 30px 48px;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 0 4px;
  border-bottom: 1px dashed #f0f3f7;
  font-size: 10.5px;
}

.region-legend-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.region-legend-name {
  overflow: hidden;
  color: #5d6a7e;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.region-legend-row b {
  color: #475569;
  font-size: 10.5px;
  font-weight: 600;
  text-align: right;
}

.region-legend-row em {
  color: #9aa4b2;
  font-size: 9.5px;
  font-style: normal;
  text-align: right;
}

.region-empty {
  color: #9aa4b2;
  font-size: 11px;
}

.dashboard-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 17px;
  padding: 10px 12px;
  color: #8a95a5;
  border-radius: 6px;
  background: #f8fafc;
  font-size: 11px;
  line-height: 1.5;
}

.note-mark {
  display: inline-flex;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  color: #4f88d8;
  border-radius: 50%;
  background: #e8f1ff;
  font-size: 10px;
  font-weight: 600;
}

/* Settings */
.settings-card {
  overflow: hidden;
  max-width: 920px;
  border: 1px solid #edf0f5;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.settings-section {
  padding: 21px 22px;
  border-bottom: 1px solid #eff2f6;
}

.settings-section h3 {
  margin: 0 0 5px;
  color: #3b4658;
  font-size: 13px;
  font-weight: 600;
}

.settings-section > p {
  margin: 0 0 17px;
  color: #98a2b1;
  font-size: 11.5px;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px 20px;
}

.settings-grid .field > span {
  color: #5f6b7d;
  font-size: 12px;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 0;
  border-top: 1px solid #f2f5f8;
}

.setting-row:first-of-type {
  border-top: 0;
  padding-top: 2px;
}

.setting-row strong {
  display: block;
  margin-bottom: 4px;
  color: #4a5668;
  font-size: 12px;
  font-weight: 500;
}

.setting-row p {
  margin: 0;
  color: #98a2b1;
  font-size: 11px;
  line-height: 1.55;
}

.switch {
  display: flex;
  width: 34px;
  height: 19px;
  flex-shrink: 0;
  align-items: center;
  padding: 2px;
  border-radius: 10px;
  background: #d8dee8;
}

.switch.on {
  justify-content: flex-end;
  background: var(--primary);
}

.switch > span {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(30, 42, 60, .16);
}

.settings-footer {
  display: flex;
  justify-content: flex-end;
  padding: 15px 22px;
  background: #fbfcfe;
}

.auto-test-status {
  margin-top: 10px;
  padding: 9px 11px;
  color: #7f8a9a;
  border: 1px solid #edf1f5;
  border-radius: 5px;
  background: #f8fafc;
  font-size: 10.5px;
  line-height: 1.6;
}

.auto-test-footer {
  padding: 12px 0 0;
  border-top: 0;
  background: transparent;
}

.idle-warning {
  position: fixed;
  inset: 0;
  z-index: 320;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(18, 28, 44, .34);
  backdrop-filter: blur(2px);
}

.idle-warning[hidden] {
  display: none;
}

.idle-warning-card {
  position: relative;
  width: 370px;
  max-width: 100%;
  padding: 22px 22px 20px;
  border: 1px solid #e8edf3;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(15, 23, 42, .24);
  text-align: center;
}

.idle-warning-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  color: #9aa4b2;
  border: 0;
  border-radius: 6px;
  background: transparent;
  font-size: 20px;
  line-height: 1;
}

.idle-warning-close:hover {
  color: #5f6b7d;
  background: #f4f6f9;
}

.idle-warning-icon {
  display: flex;
  width: 46px;
  height: 46px;
  align-items: center;
  justify-content: center;
  margin: 0 auto 10px;
  color: #b26a1f;
  border-radius: 50%;
  background: #fff7e8;
}

.idle-warning-icon svg {
  width: 26px;
  height: 26px;
}

.idle-warning-card h3 {
  margin: 0 0 7px;
  color: #303b4e;
  font-size: 16px;
  font-weight: 600;
}

.idle-warning-card p {
  margin: 0 0 16px;
  color: #7e8998;
  font-size: 11.5px;
  line-height: 1.65;
}

.idle-warning-card p b {
  color: #b26a1f;
  font-size: 17px;
  font-variant-numeric: tabular-nums;
}

/* Simple table pages */
.simple-card {
  overflow-x: auto;
}

.simple-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  font-size: 12px;
}

.simple-table th {
  height: 43px;
  padding: 0 18px;
  color: #7e8898;
  border-bottom: 1px solid #e9eef5;
  background: #f8fafc;
  font-size: 11.5px;
  font-weight: 600;
  text-align: left;
}

.simple-table td {
  height: 63px;
  padding: 0 18px;
  color: #5c687a;
  border-bottom: 1px solid #f1f4f8;
}

.simple-table tbody tr:last-child td {
  border-bottom: 0;
}

.user-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  display: inline-flex;
  width: 33px;
  height: 33px;
  align-items: center;
  justify-content: center;
  color: #fff;
  border-radius: 50%;
  background: linear-gradient(145deg, #36d7ab, #17b98b);
  font-size: 12px;
}

.avatar.blue { background: linear-gradient(145deg, #7aa7f0, #5685db); }
.avatar.purple { background: linear-gradient(145deg, #b498e9, #8d6ed7); }

.user-cell strong {
  display: block;
  margin-bottom: 3px;
  color: #3c485a;
  font-size: 12px;
  font-weight: 500;
}

.user-cell small {
  color: #a0a9b6;
  font-size: 10.5px;
}

.role-pill {
  display: inline-flex;
  padding: 3px 7px;
  color: #5e6e84;
  border: 1px solid #e5eaf1;
  border-radius: 4px;
  background: #fafbfc;
  font-size: 10.5px;
}

.status-text {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
}

.status-text i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #aeb6c2;
}

.status-text.online { color: #189b74; }
.status-text.online i { background: #20c997; }
.status-text.offline { color: #a1aab8; }
.status-text.offline i { background: #c2c9d3; }

.log-table td {
  height: 53px;
}

.log-table td:first-child {
  color: #8d97a6;
  font-size: 11px;
  white-space: nowrap;
}

.log-action {
  display: inline-flex;
  padding: 3px 7px;
  color: #159d77;
  border-radius: 4px;
  background: #e9f8f2;
  font-size: 10.5px;
}

.log-detail {
  color: #858f9f;
  font-size: 11px;
}

/* ---------------- WeChat payment ---------------- */
.heading-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 5px;
}

.heading-title-row h2 {
  margin: 0;
}

.payment-status-pill {
  display: inline-flex;
  height: 21px;
  align-items: center;
  gap: 5px;
  padding: 0 8px;
  color: #8b95a5;
  border: 1px solid #e4e8ee;
  border-radius: 11px;
  background: #f7f9fb;
  font-size: 10.5px;
  font-weight: 500;
}

.payment-status-pill::before {
  width: 5px;
  height: 5px;
  content: "";
  border-radius: 50%;
  background: #b3bac5;
}

.payment-status-pill.configured {
  color: #2f6fd0;
  border-color: #d8e6fb;
  background: #eef5ff;
}

.payment-status-pill.configured::before {
  background: #4f8ee8;
}

.payment-status-pill.enabled {
  color: #087f6d;
  border-color: #c6eadd;
  background: #ecfaf5;
}

.payment-status-pill.enabled::before {
  background: #12a58a;
}

.payment-heading {
  align-items: flex-start;
}

.heading-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.payment-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 336px;
  gap: 14px;
  align-items: start;
}

.payment-main,
.payment-aside {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 14px;
}

.payment-card {
  max-width: none;
}

.payment-card > .form-error {
  margin: 14px 21px 0;
}

.payment-card .settings-section {
  padding: 19px 21px;
}

.payment-card .settings-section > p {
  max-width: 850px;
  margin-bottom: 15px;
  line-height: 1.65;
}

.payment-pem {
  height: 104px !important;
  padding: 9px 10px !important;
  color: #536074;
  background: #fbfcfd;
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 11px;
  line-height: 1.6;
  resize: vertical;
}

.field-label-row {
  display: flex;
  align-items: center;
  gap: 7px;
}

.secret-flag {
  display: inline-flex;
  height: 16px;
  align-items: center;
  padding: 0 5px;
  color: #a0a8b4;
  border-radius: 8px;
  background: #f2f4f7;
  font-size: 9.5px;
  font-weight: 400;
}

.secret-flag.set {
  color: #0b8f71;
  background: #e8f7f1;
}

.payment-optional {
  color: #a1aab6;
  font-size: 9.5px;
  font-weight: 400;
}

.payment-test-result {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #eef1f5;
}

.payment-result-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.payment-result-head > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.payment-result-head strong {
  color: #3e4a5c;
  font-size: 13px;
  font-weight: 600;
}

.payment-result-head span {
  color: #98a2b1;
  font-size: 10.5px;
}

.payment-result-body {
  display: flex;
  align-items: flex-start;
  gap: 20px;
}

.payment-qr-wrap {
  display: flex;
  width: 224px;
  flex-shrink: 0;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.payment-qr {
  display: block;
  width: 220px;
  height: 220px;
  padding: 6px;
  border: 1px solid #e8edf2;
  border-radius: 6px;
  background: #fff;
}

.payment-qr-wrap > span {
  color: #8e98a6;
  font-size: 10.5px;
}

.payment-result-detail {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 10px;
}

.payment-code-line {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.payment-code-line > span {
  color: #98a2b1;
  font-size: 10px;
}

.payment-code-line code {
  display: block;
  max-height: 60px;
  overflow: auto;
  padding: 7px 8px;
  color: #536074;
  border-radius: 4px;
  background: #f7f9fb;
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 10px;
  line-height: 1.5;
  word-break: break-all;
}

.payment-order-string {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.payment-order-string > span {
  color: #98a2b1;
  font-size: 10px;
}

.payment-order-string textarea {
  height: 84px;
  padding: 7px 8px;
  color: #536074;
  border-color: #e3e8ef;
  background: #f7f9fb;
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 10px;
  line-height: 1.5;
  word-break: break-all;
  resize: vertical;
}

.payment-enable-field {
  gap: 8px;
}

.switch-row {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #7d8797;
  font-size: 11.5px;
  cursor: pointer;
  user-select: none;
}

.switch-row input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.switch-row .switch {
  justify-content: flex-start;
  cursor: pointer;
  transition: background .18s ease;
}

.switch-row input:checked + .switch {
  justify-content: flex-end;
  background: var(--primary);
}

.switch-row input:focus-visible + .switch {
  outline: 2px solid rgba(0, 150, 136, .2);
  outline-offset: 2px;
}

.switch-copy {
  color: #8d97a6;
}

.payment-form-footer {
  justify-content: flex-end;
  gap: 8px;
}

.payment-save-state {
  margin-right: auto;
  color: #98a2b1;
  font-size: 11px;
}

.payment-test-panel {
  border-color: #e8ecef;
}

.test-summary {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-bottom: 14px;
  padding: 10px 12px;
  color: #687488;
  border-radius: 6px;
  background: #f7f9fb;
  font-size: 11.5px;
  line-height: 1.6;
}

.test-summary::before {
  display: inline-flex;
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  align-items: center;
  justify-content: center;
  content: "i";
  color: #fff;
  border-radius: 50%;
  background: #9aa4b2;
  font-size: 10px;
  font-weight: 600;
}

.test-summary.success {
  color: #087f6d;
  background: #edfaf6;
}

.test-summary.success::before {
  content: "鉁?;
  background: #12a58a;
}

.test-summary.error {
  color: #b54b4f;
  background: #fff5f5;
}

.test-summary.error::before {
  content: "!";
  background: #e36166;
}

.payment-check-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.payment-check-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid #f1f4f7;
}

.payment-check-item:last-child {
  border-bottom: 0;
}

.check-mark {
  display: inline-flex;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
  color: #fff;
  border-radius: 50%;
  background: #c8ced7;
  font-size: 9px;
  font-weight: 700;
}

.payment-check-item.ok .check-mark {
  background: #16a37f;
}

.payment-check-item.fail .check-mark {
  background: #e36166;
}

.payment-check-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.payment-check-copy strong {
  color: #596578;
  font-size: 11px;
  font-weight: 500;
}

.payment-check-copy span {
  overflow: hidden;
  color: #9aa4b2;
  font-size: 10px;
  line-height: 1.45;
  text-overflow: ellipsis;
}

.payment-check-item.fail .payment-check-copy strong {
  color: #b54b4f;
}

.empty-checks {
  padding: 14px 0 8px;
  color: #a2abb8;
  font-size: 11px;
  text-align: center;
}

.payment-steps {
  display: flex;
  flex-direction: column;
  gap: 13px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.payment-steps li {
  display: flex;
  gap: 9px;
}

.payment-steps li > span {
  display: inline-flex;
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
  color: #0b8f71;
  border-radius: 50%;
  background: #e8f7f1;
  font-size: 10px;
  font-weight: 600;
}

.payment-steps strong {
  display: block;
  margin-bottom: 3px;
  color: #536074;
  font-size: 11.5px;
  font-weight: 500;
}

.payment-steps p {
  margin: 0;
  color: #98a2b1;
  font-size: 10.5px;
  line-height: 1.55;
}

.payment-security p {
  margin: 0;
  color: #98a2b1;
  font-size: 11px;
  line-height: 1.65;
}

.payment-doc-link {
  margin: 14px 0 0;
  padding-top: 12px;
  color: #9aa4b2;
  border-top: 1px solid #f1f4f7;
  font-size: 10.5px;
}

.payment-doc-link a {
  color: #337dc4;
}

.payment-doc-link a:hover {
  text-decoration: underline;
}

.payment-endpoints .panel-head {
  margin-bottom: 8px;
}

.endpoint-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-top: 1px solid #f1f4f7;
  font-size: 10.5px;
}

.endpoint-row:first-of-type {
  border-top: 0;
}

.endpoint-row code {
  color: #2f6f9f;
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 10.5px;
}

.endpoint-row span {
  color: #9aa4b2;
}

.verify-public[hidden],
.verify-platform[hidden] {
  display: none !important;
}

@media (max-width: 1280px) {
  .payment-layout {
    grid-template-columns: 1fr;
  }

  .payment-aside {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }

  .payment-security {
    grid-column: span 2;
  }
}

@media (max-width: 720px) {
  .payment-aside {
    display: flex;
  }

  .payment-security {
    grid-column: auto;
  }

  .payment-form-footer {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .payment-save-state {
    width: 100%;
  }
}

/* ---------------- User management ---------------- */
.user-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.user-summary-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border: 1px solid #edf0f5;
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}

.permission-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.permission-user-panel,
.permission-config-panel {
  border: 1px solid #edf0f5;
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}

.permission-user-panel {
  padding: 16px;
}

.permission-panel-head,
.permission-group-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.permission-panel-head strong,
.permission-group-head strong {
  color: #364255;
  font-size: 12px;
  font-weight: 600;
}

.permission-panel-head span,
.permission-group-head span {
  color: #9aa4b2;
  font-size: 10px;
}

.permission-user-select {
  width: 100%;
  height: 36px;
  margin-top: 12px;
  padding: 0 10px;
  color: #405066;
  border: 1px solid #dfe5ed;
  border-radius: 6px;
  background: #fff;
  font-size: 11.5px;
}

.permission-user-meta {
  min-height: 34px;
  margin-top: 9px;
  padding: 8px 9px;
  color: #7d8999;
  border-radius: 5px;
  background: #f7f9fc;
  font-size: 10.5px;
  line-height: 1.6;
}

.permission-tip {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 14px;
  padding: 10px;
  border: 1px solid #e1e9f2;
  border-radius: 6px;
  background: #f5f9fd;
}

.permission-tip strong {
  color: #45627d;
  font-size: 10.5px;
}

.permission-tip span {
  color: #8391a2;
  font-size: 10px;
  line-height: 1.6;
}

.permission-config-panel {
  padding: 16px;
}

.permission-group + .permission-group {
  margin-top: 18px;
  padding-top: 17px;
  border-top: 1px solid #f0f3f7;
}

.permission-check-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 11px;
}

.permission-check-grid.compact {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.permission-check-grid.fields {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.permission-check {
  display: flex;
  min-height: 31px;
  align-items: center;
  gap: 7px;
  padding: 6px 8px;
  color: #5f6d80;
  border: 1px solid #edf0f4;
  border-radius: 5px;
  background: #fbfcfe;
  font-size: 10.5px;
  cursor: pointer;
}

.permission-check:hover {
  border-color: #cfe2ef;
  background: #f6fbfd;
}

.permission-check input {
  width: 13px;
  height: 13px;
  margin: 0;
  accent-color: #0f9f7c;
}

.permission-check.disabled {
  color: #a4adb9;
  background: #f7f8fa;
  cursor: not-allowed;
}

.permission-check.disabled input {
  accent-color: #b8c1cc;
}

.permission-user-select:disabled {
  color: #9aa4b2;
  background: #f5f7f9;
}

@media (max-width: 900px) {
  .permission-layout {
    grid-template-columns: 1fr;
  }

  .permission-check-grid,
  .permission-check-grid.compact,
  .permission-check-grid.fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.user-summary-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 16px;
  border: 1px solid #edf0f5;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.user-summary-icon {
  display: flex;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
}

.user-summary-icon svg {
  width: 20px;
  height: 20px;
}

.user-summary-icon.total { color: #337dc4; background: #eef5ff; }
.user-summary-icon.active { color: #0f9f7c; background: #eaf9f4; }
.user-summary-icon.disabled { color: #a2aab7; background: #f3f5f8; }
.user-summary-icon.admin { color: #8a63d2; background: #f5efff; }

.user-summary-card > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.user-summary-card span {
  color: #8f99a8;
  font-size: 11px;
}

.user-summary-card strong {
  color: #303b4d;
  font-size: 21px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.user-filter #userKeyword {
  width: 250px;
}

.user-filter #userRoleFilter,
.user-filter #userStatusFilter {
  width: 124px;
}

.table-section-head {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 16px;
  border-bottom: 1px solid #eef1f5;
}

.table-section-title {
  display: flex;
  align-items: baseline;
  gap: 9px;
}

.table-section-title strong {
  color: #394456;
  font-size: 13px;
  font-weight: 600;
}

.table-section-title span {
  color: #9ba5b3;
  font-size: 11px;
}

.user-table {
  min-width: 1360px;
}

.user-table th {
  text-align: left;
}

.user-table th:nth-child(2),
.user-table th:nth-child(3) {
  width: 110px;
}

.user-table th:nth-child(4) {
  width: 130px;
}

.user-table th:nth-child(5),
.user-table th:nth-child(8) {
  width: 150px;
}

.user-table th:nth-child(6) {
  width: 90px;
}

.user-table th:nth-child(7) {
  width: 140px;
}

.user-table th:nth-child(9) {
  width: 300px;
}

.user-table td {
  height: 67px;
  padding: 0 18px;
  vertical-align: middle;
}

.user-table .user-cell {
  gap: 11px;
}

.user-table .user-cell strong {
  font-size: 12.5px;
}

.user-table .user-cell small {
  font-size: 10.5px;
}

.user-table .user-cell .username-line {
  margin-top: 2px;
  color: #a1aab8;
  font-size: 10px;
}

.user-table .avatar {
  width: 34px;
  height: 34px;
  font-size: 12px;
}

.role-pill.role-super_admin {
  color: #7a4ac2;
  border-color: #e7dbfa;
  background: #f7f2ff;
}

.role-pill.role-operator {
  color: #2f6fd0;
  border-color: #dbe7fa;
  background: #eff5ff;
}

.role-pill.role-support {
  color: #0f8c72;
  border-color: #d5eee7;
  background: #ecfaf6;
}

.role-pill.role-finance {
  color: #b27612;
  border-color: #f4e4c5;
  background: #fff8ea;
}

.user-table .status-text {
  font-size: 11.5px;
}

.user-table .time-cell {
  color: #778295;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}

.user-table .time-cell.muted {
  color: #a4adb9;
}

.user-table .login-count {
  color: #4f5b6d;
  font-weight: 500;
}

.user-table .login-ip {
  color: #6f7b8d;
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 11px;
}

.user-actions {
  display: flex;
  align-items: center;
  gap: 0;
  white-space: nowrap;
}

.user-actions .link-btn {
  font-size: 12px;
}

.user-actions .action-divider {
  width: 1px;
  height: 11px;
  margin: 0 9px;
  background: #e7eaef;
}

.user-actions .link-btn:disabled {
  color: #c3c9d2;
  cursor: not-allowed;
  text-decoration: none;
}

.user-actions .link-btn.disabled-link {
  color: #c3c9d2;
  cursor: not-allowed;
}

.user-table .empty-user-cell {
  padding: 54px 20px !important;
  text-align: center;
  color: #9aa4b2;
}

.user-table .empty-user-cell strong {
  display: block;
  margin-bottom: 5px;
  color: #5e6a7c;
  font-size: 12.5px;
}

.user-table .empty-user-cell span {
  font-size: 11px;
}

.user-log-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 16px;
  border-bottom: 1px solid #eef1f5;
}

.user-log-profile-copy {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 3px;
}

.user-log-profile-copy strong {
  color: #3d485a;
  font-size: 13px;
  font-weight: 600;
}

.user-log-profile-copy span {
  color: #98a2b1;
  font-size: 10.5px;
}

.user-log-profile .status-text {
  flex-shrink: 0;
}

.user-log-timeline {
  padding-top: 17px;
}

.user-log-item {
  position: relative;
  padding: 0 0 17px 20px;
}

.user-log-item:last-child {
  padding-bottom: 0;
}

.user-log-item::before {
  position: absolute;
  top: 10px;
  bottom: 0;
  left: 4px;
  width: 1px;
  content: "";
  background: #e8edf2;
}

.user-log-item:last-child::before {
  display: none;
}

.user-log-dot {
  position: absolute;
  top: 3px;
  left: 0;
  width: 9px;
  height: 9px;
  border: 2px solid #dff3ed;
  border-radius: 50%;
  background: #0fa88a;
  box-sizing: content-box;
}

.user-log-entry {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.user-log-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.user-log-head strong {
  color: #556274;
  font-size: 12px;
  font-weight: 500;
}

.user-log-head time {
  color: #a2abb8;
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.user-log-entry p {
  margin: 0;
  color: #8b95a5;
  font-size: 11px;
  line-height: 1.55;
}

.user-log-operator {
  color: #a8b0bc;
  font-size: 10px;
}

.user-form-hint {
  margin: 0 0 14px;
  padding: 9px 11px;
  color: #7d8898;
  border: 1px solid #e8edf3;
  border-radius: 5px;
  background: #f9fbfc;
  font-size: 11px;
  line-height: 1.6;
}

.user-form-hint strong {
  color: #556274;
  font-weight: 500;
}

.user-modal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  margin-top: 14px;
  padding: 10px 12px;
  color: #8e98a6;
  border-radius: 5px;
  background: #f8fafc;
  font-size: 10.5px;
}

.user-modal-meta b {
  color: #667284;
  font-weight: 500;
}

.user-password-wrap {
  position: relative;
}

.user-password-wrap input {
  padding-right: 38px;
}

.user-password-toggle {
  position: absolute;
  top: 50%;
  right: 9px;
  display: inline-flex;
  width: 24px;
  height: 24px;
  align-items: center;
  justify-content: center;
  color: #98a2b1;
  border: 0;
  border-radius: 4px;
  background: transparent;
  transform: translateY(-50%);
}

.user-password-toggle:hover {
  color: #5f6b7d;
  background: #f2f5f8;
}

.user-password-toggle svg {
  width: 15px;
  height: 15px;
}

@media (max-width: 1280px) {
  .user-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .user-summary-grid {
    grid-template-columns: 1fr;
  }

  .user-filter #userKeyword {
    width: 100%;
  }
}

@media (max-width: 600px) {
  .payment-result-body {
    flex-direction: column;
  }

  .payment-qr-wrap {
    width: 100%;
  }
}

/* ---------------- Proxy editor ---------------- */
.proxy-form .form-error {
  margin-bottom: 12px;
}

.proxy-form .field input,
.proxy-form .field select {
  height: 34px;
}

.proxy-form .field textarea {
  height: 52px;
}

.proxy-editor-intro {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  padding: 10px 13px;
  border: 1px solid #e3f0ec;
  border-radius: 8px;
  background: linear-gradient(135deg, #f5fcf9 0%, #f9fbfc 100%);
}

.proxy-editor-mark {
  display: flex;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  color: #0f9f7c;
  border-radius: 8px;
  background: #e4f7f0;
}

.proxy-editor-mark svg {
  width: 20px;
  height: 20px;
}

.proxy-editor-copy {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 3px;
}

.proxy-editor-copy strong {
  color: #354052;
  font-size: 13px;
  font-weight: 600;
}

.proxy-editor-copy span {
  overflow: hidden;
  color: #95a0ae;
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.proxy-status-pill {
  display: inline-flex;
  height: 23px;
  flex-shrink: 0;
  align-items: center;
  gap: 5px;
  padding: 0 8px;
  color: #8b95a5;
  border: 1px solid #e4e8ee;
  border-radius: 12px;
  background: #fff;
  font-size: 10.5px;
}

.proxy-status-pill i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #b5bdc8;
}

.proxy-status-pill.online {
  color: #0c8f71;
  border-color: #d1eee6;
  background: #f2fcf8;
}

.proxy-status-pill.online i {
  background: #13a88a;
}

.proxy-status-pill.offline {
  color: #dd5f65;
  border-color: #f5d8da;
  background: #fff8f8;
}

.proxy-status-pill.offline i {
  background: #ed6369;
}

.proxy-new-badge {
  display: inline-flex;
  height: 20px;
  align-items: center;
  padding: 0 7px;
  color: #0f9f7c;
  border: 1px solid #ccece3;
  border-radius: 4px;
  background: #effbf7;
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: .3px;
}

.proxy-section {
  margin-bottom: 7px;
  padding: 8px 13px 9px;
  border: 1px solid #e8edf2;
  border-radius: 8px;
  background: #fff;
}

.proxy-section:last-of-type {
  margin-bottom: 0;
}

.proxy-section-head {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-bottom: 7px;
  padding-bottom: 6px;
  border-bottom: 1px solid #f0f3f7;
}

.proxy-section-index {
  display: inline-flex;
  height: 20px;
  flex-shrink: 0;
  align-items: center;
  padding: 0 5px;
  color: #109e7d;
  border-radius: 4px;
  background: #eaf8f3;
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 10px;
  font-weight: 600;
}

.proxy-section-head h4 {
  margin: 0 0 3px;
  color: #3b4658;
  font-size: 12.5px;
  font-weight: 600;
}

.proxy-section-head p {
  margin: 0;
  color: #9aa4b2;
  font-size: 10.5px;
}

.proxy-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px 14px;
}

.proxy-grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.proxy-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.proxy-grid-flat {
  gap: 9px 14px;
}

.proxy-grid .span-3 {
  grid-column: span 3;
}

.proxy-grid .span-4 {
  grid-column: span 4;
}

.region-selects {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.region-selects select {
  width: 100%;
  min-width: 0;
}

@media (max-width: 520px) {
  .region-selects {
    grid-template-columns: 1fr;
  }
}

.proxy-grid .field {
  gap: 5px;
}

.proxy-grid .field > span {
  color: #5d697b;
  font-size: 11px;
}

.proxy-grid .field .hint {
  color: #a2abb8;
  font-size: 9.5px;
}

.password-input {
  position: relative;
}

.password-input input {
  width: 100%;
  padding-right: 36px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 4px;
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  color: #9aa4b2;
  border: 0;
  border-radius: 4px;
  background: transparent;
  transform: translateY(-50%);
}

.password-toggle:hover {
  color: #5d697b;
  background: #f2f5f8;
}

.password-toggle svg {
  width: 16px;
  height: 16px;
}

.expiry-input-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.expiry-input-row input {
  min-width: 110px;
  flex: 1;
}

.expiry-shortcut {
  height: 34px;
  padding: 0 9px;
  color: #40738f;
  border: 1px solid #dce7ee;
  border-radius: 5px;
  background: #f7fbfc;
  font-size: 10.5px;
  white-space: nowrap;
}

.expiry-shortcut:hover {
  color: #0f7f91;
  border-color: #b9dce4;
  background: #effafc;
}

.proxy-profit-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 12px;
  border: 1px solid #e8f1ed;
  border-radius: 6px;
  background: #f7fcfa;
}

.proxy-profit-preview > div {
  display: flex;
  align-items: baseline;
  gap: 9px;
}

.proxy-profit-preview span {
  color: #85919f;
  font-size: 10.5px;
}

.proxy-profit-preview strong {
  color: #0d8f72;
  font-size: 16px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.proxy-profit-preview strong.negative {
  color: #df6267;
}

.proxy-profit-preview p {
  max-width: 330px;
  margin: 0;
  color: #9aa4b2;
  font-size: 10px;
  line-height: 1.5;
}

.modal-foot-note {
  margin-right: auto;
  color: #9aa4b2;
  font-size: 10.5px;
}

.modal-foot-note em {
  color: #e36166;
  font-style: normal;
}

@media (max-width: 960px) {
  .proxy-grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .proxy-grid .span-3,
  .proxy-grid .span-4 {
    grid-column: span 2;
  }
}

@media (max-width: 820px) {
  .proxy-grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .proxy-grid {
    grid-template-columns: 1fr;
  }

  .proxy-grid .field.span-2,
  .proxy-grid .span-3,
  .proxy-grid .span-4 {
    grid-column: span 1;
  }

  .proxy-editor-intro {
    align-items: flex-start;
  }

  .proxy-status-pill,
  .proxy-new-badge {
    display: none;
  }

  .proxy-profit-preview {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }
}

/* ---------------- Responsive ---------------- */
@media (max-width: 1360px) {
  .filter-actions {
    margin-left: 0;
  }

  #keyword {
    width: 205px;
  }

  .toolbar-left {
    gap: 5px;
  }

  .action-btn {
    padding: 0 8px;
  }
}

@media (max-width: 1120px) {
  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filter-item.filter-keyword {
    flex: 1 1 260px;
  }

  #keyword {
    width: 100%;
  }

  .input-with-icon {
    flex: 1;
  }

  .toolbar-right {
    width: 100%;
    justify-content: flex-end;
    border-top: 1px solid #f2f5f8;
    padding-top: 9px;
  }

  .toolbar-left {
    width: 100%;
  }
}

@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .app-shell.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .app-shell.sidebar-open .sidebar-scrim {
    position: fixed;
    inset: 0;
    z-index: 45;
    display: block;
    background: rgba(18, 28, 44, .35);
  }

  .main-shell {
    margin-left: 0;
  }

  .app-shell.sidebar-collapsed .main-shell {
    margin-left: 0;
  }

  .content {
    padding: 14px;
  }

  .topbar {
    padding: 0 14px;
  }

  .filter-card {
    gap: 13px;
  }

  .filter-item {
    width: 100%;
  }

  .filter-item > label {
    width: 60px;
  }

  .filter-actions {
    width: 100%;
    justify-content: flex-end;
  }

  #keyword {
    width: 100%;
  }

  .input-with-icon {
    flex: 1;
  }

  .date-range {
    flex: 1;
  }

  .date-range input[type="date"] {
    flex: 1;
    width: auto;
  }

  .panel-wide {
    grid-column: span 1;
  }
}

@media (max-width: 700px) {
  .region-chart-layout {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .region-legend {
    grid-template-columns: 1fr;
  }

  .service-state {
    display: none;
  }

  .stat-grid,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .view-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .toolbar-right {
    justify-content: flex-start;
  }

  .toolbar-right .table-meta,
  .toolbar-right .meta-sep {
    display: none;
  }

  .pagination {
    justify-content: center;
  }

  .page-total {
    width: 100%;
    text-align: center;
  }

  .page-tools {
    width: 100%;
    justify-content: center;
  }

  .summary-values {
    gap: 15px;
  }

  .modal-body {
    padding: 17px;
  }

  .form-grid,
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .field.span-2 {
    grid-column: span 1;
  }

  .renew-options {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ---------------- Login ---------------- */
.login-screen[hidden],
.app-shell[hidden] {
  display: none !important;
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  overflow: auto;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  background:
    radial-gradient(circle at 14% 8%, rgba(32, 201, 151, .16), transparent 30%),
    radial-gradient(circle at 85% 92%, rgba(56, 132, 255, .12), transparent 32%),
    linear-gradient(145deg, #101b2d 0%, #17253c 52%, #0d1625 100%);
}

.login-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
}

.login-glow-a {
  top: -180px;
  right: 10%;
  width: 420px;
  height: 420px;
  background: rgba(0, 184, 169, .12);
}

.login-glow-b {
  bottom: -200px;
  left: 8%;
  width: 460px;
  height: 460px;
  background: rgba(61, 112, 201, .14);
}

.login-wrap {
  position: relative;
  z-index: 1;
  display: flex;
  width: 100%;
  max-width: 430px;
  flex-direction: column;
  align-items: center;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.login-logo {
  display: flex;
  width: 46px;
  height: 46px;
  align-items: center;
  justify-content: center;
  color: #fff;
  border-radius: 12px;
  background: linear-gradient(145deg, #20c997, #009688);
  box-shadow: 0 12px 28px rgba(0, 150, 136, .3);
}

.login-logo svg {
  width: 29px;
  height: 29px;
}

.login-brand-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.login-brand-copy strong {
  color: #f4f8ff;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: .3px;
}

.login-brand-copy span {
  color: #7d8ca5;
  font-size: 9px;
  letter-spacing: 1.8px;
}

.login-card {
  width: 100%;
  padding: 28px 30px 22px;
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 26px 70px rgba(4, 12, 25, .4);
}

.login-heading {
  margin-bottom: 21px;
}

.login-heading h1 {
  margin: 0 0 6px;
  color: #263247;
  font-size: 20px;
  font-weight: 600;
}

.login-heading p {
  margin: 0;
  color: #929cab;
  font-size: 11.5px;
}

.login-card .field {
  margin-bottom: 14px;
}

.login-card .field > span {
  color: #4e5a6c;
  font-size: 11.5px;
}

.login-card .field input {
  height: 40px;
  padding: 0 12px;
  border-color: #dfe5ee;
  border-radius: 7px;
  font-size: 13px;
}

.login-card .field input:focus {
  border-color: #2bc7a6;
  box-shadow: 0 0 0 3px rgba(32, 201, 151, .11);
}

.login-captcha-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 122px;
  gap: 9px;
}

.login-captcha {
  display: flex;
  height: 40px;
  align-items: center;
  justify-content: center;
  padding: 0;
  overflow: hidden;
  border: 1px solid #dfe5ee;
  border-radius: 7px;
  background: #f7fafc;
}

.login-captcha img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.login-submit {
  width: 100%;
  height: 40px;
  margin-top: 5px;
  border-radius: 7px;
  font-size: 13px;
}

.login-card .form-error {
  margin-bottom: 13px;
}

.login-hint {
  margin-top: 17px;
  color: #a0a9b5;
  font-size: 10px;
  line-height: 1.6;
  text-align: center;
}

.login-hint b {
  color: #637083;
  font-weight: 500;
}

.login-foot {
  margin-top: 18px;
  color: #67758c;
  font-size: 10px;
  letter-spacing: .4px;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 7px;
  padding-left: 13px;
  border-left: 1px solid #edf0f4;
}

.topbar-avatar {
  display: flex;
  width: 27px;
  height: 27px;
  align-items: center;
  justify-content: center;
  color: #fff;
  border-radius: 50%;
  background: linear-gradient(145deg, #2dc9a9, #0b9b82);
  font-size: 11px;
  font-weight: 500;
}

.topbar-user-name {
  max-width: 90px;
  overflow: hidden;
  color: #5e6a7c;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logout-button {
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  color: #97a2b1;
  border: 0;
  border-radius: 5px;
  background: transparent;
}

.logout-button[hidden] {
  display: none !important;
}

.logout-button:hover {
  color: #d25b62;
  background: #fff2f2;
}

.logout-button svg {
  width: 16px;
  height: 16px;
}

@media (max-width: 900px) {
  .topbar-user-name {
    display: none;
  }
}

@media (max-width: 520px) {
  .login-screen {
    padding: 20px 14px;
  }

  .login-card {
    padding: 24px 20px 18px;
  }
}

