:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  color: #172239;
  background: #f4f6fa;
  font-synthesis: none;
  --ink: #172239;
  --muted: #617089;
  --line: #e5eaf2;
  --blue: #315bec;
  --blue-hover: #244ad4;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
h1, h2, h3, p, dl, dd { margin: 0; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #7690ff; outline-offset: 3px; }
.symbol-library { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { display: inline-block; width: 19px; height: 19px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }

.topbar { min-height: 64px; padding: 0 38px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 24px; font-size: 13px; }
.topbar-brand { display: flex; align-items: center; gap: 9px; font-size: 15px; font-weight: 700; white-space: nowrap; }
.topbar-brand img { border-radius: 8px; }
.topbar-nav { display: flex; gap: 5px; }
.topbar-nav a { display: flex; align-items: center; white-space: nowrap; padding: 10px 12px; border-radius: 7px; color: var(--muted); font-weight: 600; }
.topbar-nav a[aria-current="page"], .topbar-nav a:hover { color: #2548ce; background: #eef2ff; }
.main { margin: 0 auto; max-width: 1500px; padding: 35px 38px 50px; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.page-heading h1 { font-size: 30px; letter-spacing: -.025em; font-weight: 750; line-height: 1.3; }
.page-heading p { color: var(--muted); font-size: 14px; margin-top: 9px; line-height: 1.55; }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; border: 1px solid transparent; border-radius: 8px; padding: 0 15px; font-size: 13px; font-weight: 650; white-space: nowrap; transition: background-color .16s, border-color .16s; }
.button .icon { width: 17px; height: 17px; }
.primary { background: var(--blue); color: white; box-shadow: 0 2px 3px #1c43db20; }
.primary:not(:disabled):hover { background: var(--blue-hover); }
.secondary { background: white; border-color: #dce3ef; color: #33435e; }
.secondary:hover { background: #f5f7fc; border-color: #b9c7e0; }

.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-bottom: 23px; }
.metric { min-height: 109px; display: flex; align-items: center; gap: 16px; padding: 19px 21px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 2px 4px #2b406104; }
.metric-icon, .dialog-icon { display: grid; place-items: center; width: 45px; height: 45px; border-radius: 11px; flex: 0 0 auto; }
.metric-icon .icon, .dialog-icon .icon { width: 22px; height: 22px; }
.blue { background: #ebf0ff; color: #3b60e7; }
.green { background: #e6f7ef; color: #14805d; }
.amber { background: #fff4e0; color: #a56410; }
.metric h2 { font-size: 13px; color: var(--muted); font-weight: 560; white-space: nowrap; }
.metric p { font-size: 29px; line-height: 1.22; margin-top: 4px; font-weight: 730; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }

.panel { background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 2px 4px #2b406104; overflow: hidden; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 21px 23px; }
.panel-heading h2 { font-size: 17px; line-height: 1.4; }
.panel-heading p { color: var(--muted); font-size: 12px; margin-top: 5px; line-height: 1.5; }
.filters { display: flex; gap: 9px; }
.search-box, .select-box { position: relative; }
.search-box .icon, .select-box .icon { position: absolute; top: 11px; width: 15px; height: 15px; color: #687892; pointer-events: none; }
.search-box .icon { left: 11px; }
.select-box .icon { right: 10px; }
.search-box input, .select-box select, .field input {
  height: 38px; border: 1px solid #dfe5ef; border-radius: 7px; background: white; color: var(--ink); font-size: 13px; padding: 0 11px;
}
.search-box input { width: min(19vw, 218px); padding-left: 34px; }
.select-box select { appearance: none; padding-right: 34px; min-width: 102px; }
input::placeholder { color: #687892; }
.table-scroll { overflow-x: auto; }
table { width: 100%; min-width: 670px; border-spacing: 0; text-align: left; font-size: 13px; }
th, td { padding: 13px 13px; white-space: nowrap; }
th:first-child, td:first-child { padding-left: 23px; }
th:last-child, td:last-child { padding-right: 23px; text-align: right; }
th { background: #f7f9fc; color: #4f5f78; border-block: 1px solid #eaf0f6; font-weight: 620; }
td { border-bottom: 1px solid #edf0f6; height: 64px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fbfcff; }
.account-id, .numeric { font-variant-numeric: tabular-nums; }
.account-id { font-weight: 690; }
.status-tag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 5px; line-height: 1.25; font-size: 12px; font-weight: 620; }
.status-tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-tag.unknown { background: #edf0f6; color: #506079; }
.row-action { border: none; background: transparent; color: #284ecb; font-weight: 650; padding: 5px 0 5px 8px; }
.row-action:hover { text-decoration: underline; }
.empty-state { min-height: 250px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 25px; }
.empty-icon { display: grid; place-items: center; width: 64px; height: 64px; background: #eef2ff; color: #4a6de3; border: 7px solid #f6f8ff; border-radius: 18px; margin-bottom: 15px; }
.empty-icon .icon { width: 27px; height: 27px; }
.empty-state h3 { font-size: 15px; font-weight: 680; }
.empty-state p { margin-top: 6px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.empty-state .button { margin-top: 16px; min-height: 36px; }
.panel-footer { min-height: 49px; border-top: 1px solid #eaf0f6; padding: 0 23px; display: flex; align-items: center; font-size: 12px; color: var(--muted); }

.dialog { border: 1px solid #dce3ef; border-radius: 15px; max-width: calc(100vw - 28px); max-height: calc(100dvh - 28px); padding: 0; color: var(--ink); box-shadow: 0 20px 70px #111c3d36; overflow: auto; }
.dialog::backdrop { background: #101b35a6; }
.login-dialog { width: 440px; }
.detail-dialog { width: 530px; }
.dialog-heading { position: relative; padding: 22px 24px 15px; }
.dialog-heading h2 { margin-top: 12px; font-size: 21px; }
.dialog-heading p { margin-top: 6px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.icon-button { width: 34px; height: 34px; padding: 0; display: inline-grid; place-items: center; border: 0; border-radius: 6px; background: transparent; color: #56657e; }
.icon-button:hover { background: #edf1f9; color: #233550; }
.dialog-heading .close-dialog { position: absolute; top: 15px; right: 16px; }
.form-body { display: grid; gap: 15px; padding: 4px 24px 22px; }
.field { display: grid; gap: 7px; font-size: 13px; font-weight: 640; }
.field input { width: 100%; height: 41px; font-weight: 450; }
.field small { color: var(--muted); font-size: 12px; font-weight: 450; }
.password-box { position: relative; }
.password-box input { padding-right: 45px; }
.password-box button { position: absolute; top: 4px; right: 4px; }
.captcha-row { display: grid; grid-template-columns: minmax(0, 1fr) 122px; gap: 9px; }
.captcha-button { height: 41px; display: grid; place-items: center; border: 1px solid #dfe5ef; border-radius: 7px; padding: 0; overflow: hidden; background: #f7f9fc; color: #4f5f78; font-size: 12px; }
.captcha-button:hover { border-color: #819bf8; }
.captcha-button img { width: 120px; height: 39px; object-fit: contain; }
.captcha-button span { display: flex; align-items: center; gap: 6px; }
.captcha-button .icon { width: 15px; height: 15px; }
.form-error { background: #fff1f0; color: #a32b27; font-size: 13px; border-radius: 7px; padding: 9px 11px; line-height: 1.5; overflow-wrap: anywhere; }
.dialog-footer { display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--line); background: #f9fafd; padding: 13px 24px; }
.detail-footer { justify-content: space-between; }
.detail-section { padding: 0 24px 19px; }
.detail-section h3 { font-size: 14px; margin: 4px 0 9px; }
.detail-section dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 9px; }
.detail-section dl > div { padding: 10px 13px; min-width: 0; }
.detail-section dt { color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.detail-section dd { font-size: 13px; font-weight: 620; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.plain-danger { color: #a42b29; background: transparent; }
.plain-danger:hover { background: #fff1f0; }
.danger { background: #b82e30; color: white; }
.danger:hover { background: #a12426; }
.remove-confirm { background: #fff6f5; padding: 14px 24px; }
.remove-confirm p { font-size: 13px; margin-bottom: 9px; }
.remove-confirm div { display: flex; gap: 8px; }
.remove-confirm .form-error { margin-top: 8px; }
.toast { position: fixed; z-index: 1; right: 24px; bottom: 23px; display: flex; gap: 9px; align-items: center; max-width: calc(100% - 48px); padding: 11px 14px; border-radius: 9px; background: #193e32; color: #fff; font-size: 13px; box-shadow: 0 6px 20px #12251e30; }

@media (max-width: 1020px) {
  .topbar { padding-inline: 27px; }
  .main { padding-inline: 27px; }
  .metric { padding-inline: 15px; gap: 10px; }
}
@media (max-width: 760px) {
  .main { padding: 23px 16px 36px; }
  .page-heading { align-items: flex-start; gap: 12px; margin-bottom: 20px; }
  .page-heading h1 { font-size: 24px; }
  .page-heading p { font-size: 12px; }
  .page-heading .button { min-height: 36px; padding-inline: 10px; }
  .metrics { gap: 8px; margin-bottom: 17px; }
  .metric { min-height: 94px; flex-direction: column; align-items: flex-start; gap: 6px; padding: 10px 8px; border-radius: 9px; }
  .metric-icon { width: 25px; height: 25px; border-radius: 6px; }
  .metric-icon .icon { width: 15px; height: 15px; }
  .metric h2 { font-size: 11px; }
  .metric p { margin-top: 1px; font-size: 23px; }
  .panel-heading { flex-direction: column; align-items: stretch; padding: 15px; gap: 12px; }
  .search-box { flex: 1; }
  .search-box input { width: 100%; }
  table { min-width: 0; table-layout: fixed; }
  th, td { padding-inline: 8px; overflow: hidden; text-overflow: ellipsis; }
  th:first-child { width: 22%; }
  th:last-child, td:last-child { padding-right: 12px; }
  th:first-child, td:first-child, .panel-footer { padding-left: 15px; }
  .empty-state { min-height: 235px; }
}
@media (max-width: 520px) {
  th:nth-child(5), td:nth-child(5) { display: none; }
  th:first-child { width: 24%; }
  th:last-child { width: 22%; }
}
@media (max-width: 370px) {
  th:nth-child(3), td:nth-child(3) { display: none; }
  th:first-child { width: 30%; }
  th:last-child { width: 25%; }
}
@media (prefers-reduced-motion: reduce) {
  .button { transition: none; }
}

.signed-in { display: flex; align-items: center; gap: 12px; margin-left: auto; font-size: 12px; color: #4f5f78; }
.signed-in span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 19vw; }
.signed-in .button { min-height: 34px; padding-inline: 10px; }
.group-bar { background: white; border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; margin-bottom: 16px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 9px; }
.group-picker, .group-actions { display: flex; gap: 8px; align-items: center; font-size: 13px; }
.group-picker { font-weight: 620; }
.group-picker > span:first-child { padding-left: 3px; }
.group-picker select { min-width: 132px; max-width: min(290px, 55vw); }
.group-actions .button { min-height: 34px; padding-inline: 10px; }
.move-control { padding: 0 24px 19px; font-size: 13px; }
.move-control > label { display: block; margin-bottom: 6px; font-weight: 650; }
.move-buttons { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.move-buttons select { max-width: min(260px, 48vw); }
.move-control .form-error { margin-top: 8px; }
.group-confirm-text { color: var(--muted); font-size: 14px; line-height: 1.55; overflow-wrap: anywhere; }
.toast.error { background: #8d2927; }
@media (max-width: 760px) {
  .topbar { min-height: 56px; flex-wrap: wrap; gap: 8px 12px; padding: 9px 16px; }
  .topbar-nav { order: 3; }
  .topbar-nav a { padding: 8px 9px; }
  .signed-in span { max-width: 58vw; }
}
@media (max-width: 540px) {
  .group-actions { flex-wrap: wrap; }
}

.password-option { display: inline-flex; align-items: center; gap: 6px; justify-self: start; color: var(--muted); font-size: 12px; font-weight: 450; }
.field .password-option input { width: 14px; height: 14px; margin: 0; accent-color: var(--blue); }
