:root {
  --bg: #f3f5f6;
  --surface: #ffffff;
  --surface-soft: #f8f9f9;
  --surface-strong: #edf0f1;
  --text: #20272c;
  --text-soft: #5f6c74;
  --text-faint: #879198;
  --border: #dce1e3;
  --border-strong: #c7ced1;
  --sidebar: #1e272c;
  --sidebar-soft: #29343a;
  --blue: #1769a6;
  --blue-soft: #e9f2f8;
  --green: #167a57;
  --green-soft: #e7f4ee;
  --amber: #a9610a;
  --amber-soft: #fcf1df;
  --red: #b3423d;
  --red-soft: #faeceb;
  --violet: #71559a;
  --violet-soft: #f0ebf6;
  --cyan: #176f82;
  --cyan-soft: #e5f2f4;
  --radius: 6px;
  --shadow: 0 1px 2px rgba(24, 33, 38, 0.04), 0 8px 24px rgba(24, 33, 38, 0.04);
  --sidebar-width: 236px;
  --focus: 0 0 0 3px rgba(23, 105, 166, 0.2);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: "Segoe UI Variable", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  color: inherit;
  font: inherit;
  letter-spacing: 0;
}

button,
select {
  cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

code,
pre,
textarea {
  font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
}

h1,
h2,
h3,
p {
  margin: 0;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hidden {
  display: none !important;
}

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

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  display: flex;
  width: var(--sidebar-width);
  min-height: 100vh;
  flex-direction: column;
  color: #dbe2e5;
  background: var(--sidebar);
  border-right: 1px solid #151b1f;
}

.brand {
  display: flex;
  min-height: 76px;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  flex: 0 0 auto;
  color: #fff;
  background: var(--green);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 5px;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 14px;
  font-weight: 700;
}

.brand-copy {
  min-width: 0;
}

.brand-copy strong,
.brand-copy span {
  display: block;
}

.brand-copy strong {
  color: #fff;
  font-size: 15px;
  font-weight: 650;
}

.brand-copy span {
  margin-top: 2px;
  color: #91a0a7;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 10px;
  text-transform: uppercase;
}

.nav {
  display: grid;
  gap: 4px;
  padding: 14px 10px;
}

.nav-item {
  position: relative;
  display: grid;
  min-height: 44px;
  grid-template-columns: 22px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  color: #aebbc1;
  background: transparent;
  border: 0;
  border-radius: 5px;
  text-align: left;
  transition: color 160ms ease, background-color 160ms ease;
}

.nav-item::before {
  position: absolute;
  inset: 10px auto 10px 0;
  width: 3px;
  content: "";
  background: transparent;
  border-radius: 2px;
}

.nav-item:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.055);
}

.nav-item.active {
  color: #fff;
  background: var(--sidebar-soft);
}

.nav-item.active::before {
  background: #45b985;
}

.nav-count {
  min-width: 22px;
  padding: 1px 6px;
  color: #b9c5ca;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  font-size: 11px;
  line-height: 18px;
  text-align: center;
}

.sidebar-status {
  display: flex;
  min-height: 72px;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding: 14px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-status strong,
.sidebar-status span {
  display: block;
}

.sidebar-status strong {
  color: #dfe7ea;
  font-size: 12px;
  font-weight: 600;
}

.sidebar-status div > span {
  margin-top: 1px;
  color: #829198;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 10px;
}

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  background: var(--text-faint);
  border-radius: 50%;
}

.status-dot.online {
  background: #39ad79;
  box-shadow: 0 0 0 3px rgba(57, 173, 121, 0.13);
}

.main {
  width: calc(100% - var(--sidebar-width));
  min-height: 100vh;
  margin-left: var(--sidebar-width);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 25;
  display: flex;
  min-height: 76px;
  align-items: center;
  gap: 16px;
  padding: 12px 28px;
  background: rgba(243, 245, 246, 0.96);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
}

.page-heading {
  min-width: 0;
}

.page-heading h1 {
  font-size: 20px;
  font-weight: 680;
  line-height: 1.25;
}

.page-heading p {
  margin-top: 3px;
  color: var(--text-soft);
  font-size: 12px;
}

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

.context-account {
  max-width: 260px;
  overflow: hidden;
  padding-right: 8px;
  color: var(--text-soft);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-menu {
  display: none !important;
}

.page {
  display: none;
  width: min(100%, 1460px);
  margin: 0 auto;
  padding: 24px 28px 40px;
}

.page.active {
  display: block;
  animation: page-in 180ms ease-out;
}

@keyframes page-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.panel-head {
  display: flex;
  min-height: 66px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.panel-head h2,
.compact-form h2 {
  font-size: 14px;
  font-weight: 680;
  line-height: 1.35;
}

.panel-head p,
.compact-form p {
  margin-top: 2px;
  color: var(--text-soft);
  font-size: 11px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.metric {
  position: relative;
  min-height: 116px;
  overflow: hidden;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.metric::after {
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  content: "";
  background: var(--border-strong);
}

.metric.success::after { background: var(--green); }
.metric.danger::after { background: var(--red); }
.metric.accent::after { background: var(--blue); }

.metric > span,
.metric > strong,
.metric > small {
  display: block;
}

.metric > span {
  color: var(--text-soft);
  font-size: 12px;
}

.metric > strong {
  margin-top: 8px;
  font-family: "Bahnschrift", "Segoe UI Variable", sans-serif;
  font-size: 28px;
  font-weight: 650;
  line-height: 1;
}

.metric > strong.text-value {
  overflow: hidden;
  font-size: 18px;
  line-height: 28px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric > small {
  margin-top: 9px;
  overflow: hidden;
  color: var(--text-faint);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(300px, 0.8fr);
  gap: 16px;
  margin-bottom: 16px;
}

.service-list {
  padding: 4px 18px 10px;
}

.service-row {
  display: grid;
  min-height: 66px;
  grid-template-columns: 38px 1fr auto;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid #edf0f1;
}

.service-row:last-child {
  border-bottom: 0;
}

.service-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: var(--blue);
  background: var(--blue-soft);
  border-radius: 5px;
}

.service-row strong,
.service-row small {
  display: block;
}

.service-row strong {
  font-size: 13px;
  font-weight: 620;
}

.service-row small {
  margin-top: 2px;
  color: var(--text-faint);
  font-size: 11px;
}

.state-pill,
.count-badge,
.method {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  justify-content: center;
  padding: 2px 9px;
  color: var(--text-soft);
  background: var(--surface-strong);
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 650;
  white-space: nowrap;
}

.state-pill.success {
  color: var(--green);
  background: var(--green-soft);
}

.state-pill.error {
  color: var(--red);
  background: var(--red-soft);
}

.state-pill.warning {
  color: var(--amber);
  background: var(--amber-soft);
}

.state-pill.neutral {
  color: var(--text-soft);
  background: var(--surface-strong);
}

.quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 18px;
}

.quick-actions button {
  display: flex;
  min-height: 70px;
  align-items: center;
  gap: 10px;
  padding: 14px;
  color: var(--text);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 5px;
  text-align: left;
  transition: border-color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.quick-actions button:hover {
  background: #fff;
  border-color: var(--blue);
  transform: translateY(-1px);
}

.quick-actions .icon {
  color: var(--blue);
}

.recent-panel {
  margin-bottom: 16px;
}

.account-list.compact {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 22px;
  padding: 4px 18px 12px;
}

.recent-account {
  display: grid;
  min-height: 66px;
  grid-template-columns: 38px 1fr auto;
  align-items: center;
  gap: 11px;
  border-bottom: 1px solid #edf0f1;
}

.account-list.compact .recent-account:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.account-copy {
  min-width: 0;
}

.account-copy strong,
.account-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-copy strong {
  font-size: 12px;
}

.account-copy small {
  margin-top: 2px;
  color: var(--text-faint);
  font-size: 10px;
}

.auth-panel .secret-value {
  display: block;
  margin: 18px;
  overflow: hidden;
  padding: 13px 14px;
  color: #314047;
  background: var(--surface-soft);
  border: 1px dashed var(--border-strong);
  border-radius: 4px;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.secret-value.masked {
  color: var(--text-soft);
  letter-spacing: 2px;
}

.btn,
.icon-btn,
.text-btn {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 620;
  transition: color 150ms ease, background-color 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.btn {
  padding: 0 15px;
  border: 1px solid transparent;
}

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

.btn.primary:hover {
  background: #125a8f;
  border-color: #125a8f;
}

.btn.secondary {
  color: var(--text);
  background: #fff;
  border-color: var(--border-strong);
}

.btn.secondary:hover {
  color: var(--blue);
  border-color: var(--blue);
}

.btn.danger-outline {
  color: var(--red);
  background: #fff;
  border-color: #dba5a2;
}

.btn.danger-outline:hover {
  background: var(--red-soft);
  border-color: var(--red);
}

.btn.full {
  width: 100%;
}

.btn.is-loading .icon,
.icon-btn.is-loading .icon {
  animation: spin 800ms linear infinite;
}

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

.icon-btn {
  width: 44px;
  padding: 0;
  color: var(--text-soft);
  background: #fff;
  border: 1px solid var(--border);
}

.icon-btn:hover {
  color: var(--blue);
  border-color: var(--border-strong);
}

.icon-btn.subtle {
  background: var(--surface-soft);
}

.icon-btn.dark {
  color: #bcc7cc;
  background: #2c353a;
  border-color: #465158;
}

.icon-btn.dark:hover {
  color: #fff;
  border-color: #75828a;
}

.text-btn {
  padding: 0 4px;
  color: var(--blue);
  background: transparent;
  border: 0;
}

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

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

label {
  display: grid;
  gap: 6px;
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 9px 11px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

textarea {
  min-height: 92px;
  resize: vertical;
  font-size: 12px;
  line-height: 1.55;
}

input:hover,
select:hover,
textarea:hover {
  border-color: #aab4b8;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
}

.filters {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 190px;
  gap: 12px;
  padding: 14px 18px;
  background: var(--surface-soft);
  border-bottom: 1px solid var(--border);
}

.account-toolbar .count-badge {
  margin-left: 5px;
  vertical-align: 1px;
}

.account-table {
  width: 100%;
}

.account-table-head,
.account-row {
  display: grid;
  grid-template-columns: minmax(190px, 1.1fr) minmax(180px, 1fr) 110px 150px minmax(290px, auto);
  align-items: center;
  gap: 14px;
}

.account-table-head {
  min-height: 42px;
  padding: 0 18px;
  color: var(--text-faint);
  background: var(--surface-soft);
  border-bottom: 1px solid var(--border);
  font-size: 10px;
  font-weight: 650;
  text-transform: uppercase;
}

.account-row {
  min-height: 78px;
  padding: 12px 18px;
  border-bottom: 1px solid #edf0f1;
}

.account-row:last-child {
  border-bottom: 0;
}

.account-row:hover {
  background: #fafbfb;
}

.account-identity {
  display: grid;
  min-width: 0;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.avatar {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  overflow: hidden;
  flex: 0 0 auto;
  color: #fff;
  background: #52636c;
  border-radius: 5px;
  font-size: 13px;
  font-weight: 700;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mono-cell {
  min-width: 0;
  overflow: hidden;
  color: #46555c;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-health small {
  display: block;
  max-width: 180px;
  margin-top: 4px;
  overflow: hidden;
  color: var(--text-faint);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.row-btn {
  display: inline-flex;
  min-width: 44px;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  padding: 0 9px;
  color: var(--text-soft);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 11px;
}

.row-btn:hover {
  color: var(--blue);
  border-color: var(--blue);
}

.row-btn.danger:hover {
  color: var(--red);
  background: var(--red-soft);
  border-color: var(--red);
}

.empty-state {
  display: grid;
  min-height: 150px;
  place-items: center;
  padding: 28px;
  color: var(--text-faint);
  font-size: 12px;
  text-align: center;
}

.login-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.7fr);
  gap: 16px;
}

.qr-stage {
  display: grid;
  grid-template-columns: 260px minmax(260px, 1fr);
  align-items: center;
  gap: 28px;
  min-height: 340px;
  padding: 28px;
}

.qr-box {
  display: grid;
  width: 240px;
  height: 240px;
  place-items: center;
  overflow: hidden;
  background: var(--surface-soft);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
}

.qr-box img {
  width: 220px;
  height: 220px;
  object-fit: contain;
}

.qr-placeholder {
  display: grid;
  place-items: center;
  gap: 10px;
  color: var(--text-faint);
}

.qr-placeholder-icon {
  width: 48px;
  height: 48px;
  fill: none;
  stroke: #9ca8ad;
  stroke-width: 1.3;
}

.qr-controls {
  display: grid;
  max-width: 360px;
  gap: 18px;
}

.qr-controls h3 {
  font-size: 18px;
  font-weight: 680;
}

.qr-controls p {
  margin-top: 4px;
  color: var(--text-soft);
  font-size: 12px;
}

.login-result {
  align-self: start;
}

.signed-user {
  display: grid;
  grid-template-columns: 48px 1fr;
  align-items: center;
  gap: 12px;
  padding: 22px 18px;
}

.signed-user .avatar {
  width: 48px;
  height: 48px;
}

.signed-user strong,
.signed-user code {
  display: block;
}

.signed-user code {
  margin-top: 4px;
  color: var(--text-faint);
  font-size: 10px;
}

.login-result > .btn {
  width: calc(100% - 36px);
  margin: 0 18px 18px;
}

.context-bar {
  position: sticky;
  top: 88px;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(210px, 0.7fr) minmax(260px, 1fr) auto;
  align-items: end;
  gap: 12px;
  margin-bottom: 12px;
  padding: 12px;
  background: #eef1f2;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  box-shadow: 0 5px 15px rgba(24, 33, 38, 0.04);
}

.context-ready {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  color: var(--text-soft);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 11px;
  white-space: nowrap;
}

.context-ready.ready .status-dot {
  background: var(--green);
}

.workbench-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
  padding: 4px;
  background: #e7ebed;
  border-radius: 6px;
}

.workbench-tabs button {
  min-width: 110px;
  min-height: 40px;
  padding: 0 14px;
  color: var(--text-soft);
  background: transparent;
  border: 0;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 620;
}

.workbench-tabs button:hover {
  color: var(--text);
}

.workbench-tabs button.active {
  color: var(--text);
  background: #fff;
  box-shadow: 0 1px 3px rgba(24, 33, 38, 0.1);
}

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

.tool-tab {
  display: none;
}

.tool-tab.active {
  display: grid;
  gap: 12px;
}

.tool-panel > label,
.tool-panel > .form-grid,
.tool-panel > .btn {
  margin: 14px 18px 0;
}

.tool-panel > .btn {
  margin-bottom: 18px;
}

.capability-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 18px;
}

.capability-grid > button {
  display: grid;
  min-height: 78px;
  grid-template-columns: 38px 1fr 18px;
  grid-template-rows: auto auto;
  align-items: center;
  gap: 0 11px;
  padding: 12px;
  color: var(--text);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 5px;
  text-align: left;
  transition: background-color 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.capability-grid > button:hover {
  background: #fff;
  border-color: var(--blue);
  transform: translateY(-1px);
}

.capability-grid strong {
  align-self: end;
  font-size: 12px;
}

.capability-grid small {
  align-self: start;
  color: var(--text-faint);
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 9px;
}

.cap-icon {
  display: grid;
  width: 38px;
  height: 38px;
  grid-row: 1 / 3;
  place-items: center;
  border-radius: 5px;
}

.cap-icon.green { color: var(--green); background: var(--green-soft); }
.cap-icon.blue { color: var(--blue); background: var(--blue-soft); }
.cap-icon.amber { color: var(--amber); background: var(--amber-soft); }
.cap-icon.violet { color: var(--violet); background: var(--violet-soft); }
.cap-icon.cyan { color: var(--cyan); background: var(--cyan-soft); }

.cap-arrow {
  grid-column: 3;
  grid-row: 1 / 3;
  color: var(--text-faint);
}

.form-grid {
  display: grid;
  gap: 12px;
}

.form-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.compact-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 0.8fr) auto;
  align-items: end;
  gap: 14px;
  padding: 16px 18px;
}

.compact-form .btn {
  margin: 0;
}

.result-panel {
  position: sticky;
  top: 164px;
  min-height: 520px;
  overflow: hidden;
  color: #d5dcdf;
  background: #20282d;
  border: 1px solid #313b40;
  border-radius: 6px;
  box-shadow: var(--shadow);
}

.result-head {
  display: flex;
  min-height: 66px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  border-bottom: 1px solid #384248;
}

.result-head strong,
.result-kicker {
  display: block;
}

.result-head strong {
  margin-top: 3px;
  color: #fff;
  font-size: 12px;
}

.result-kicker {
  color: #7f929b;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 9px;
}

.result-panel pre {
  min-height: 452px;
  max-height: calc(100vh - 250px);
  margin: 0;
  overflow: auto;
  padding: 16px;
  color: #c8d2d6;
  font-size: 11px;
  line-height: 1.65;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

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

.proxy-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.62fr) minmax(0, 1.38fr);
  align-items: start;
  gap: 16px;
}

.proxy-form > label,
.proxy-form > .inline-actions,
.proxy-form > .inline-result {
  margin: 14px 18px 0;
}

.proxy-form > .inline-actions,
.proxy-form > .inline-result:last-child {
  margin-bottom: 18px;
}

.inline-result {
  max-height: 240px;
  overflow: auto;
  padding: 12px;
  color: #d5dcdf;
  background: #20282d;
  border-radius: 4px;
  font-size: 10px;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.proxy-list {
  display: grid;
}

.proxy-row {
  display: grid;
  min-height: 76px;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid #edf0f1;
}

.proxy-row:last-child {
  border-bottom: 0;
}

.proxy-row.active {
  background: #f4faf7;
}

.proxy-symbol {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: var(--cyan);
  background: var(--cyan-soft);
  border-radius: 5px;
}

.proxy-symbol .icon {
  width: 17px;
  height: 17px;
}

.proxy-meta {
  min-width: 0;
}

.proxy-meta strong,
.proxy-meta code {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.proxy-meta strong {
  font-size: 12px;
}

.proxy-meta code {
  margin-top: 4px;
  color: var(--text-faint);
  font-size: 9px;
}

.api-table-wrap {
  overflow-x: auto;
}

.api-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}

.api-table th,
.api-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #edf0f1;
  text-align: left;
}

.api-table th {
  color: var(--text-faint);
  background: var(--surface-soft);
  font-size: 10px;
  font-weight: 650;
  text-transform: uppercase;
}

.api-table td {
  font-size: 12px;
}

.api-table tbody tr:hover {
  background: #fafbfb;
}

.api-table code {
  color: var(--blue);
  font-size: 11px;
}

.method {
  min-height: 22px;
  font-family: "Cascadia Mono", Consolas, monospace;
}

.method.post { color: var(--blue); background: var(--blue-soft); }
.method.get { color: var(--green); background: var(--green-soft); }

.compat-details {
  margin: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 5px;
}

.compat-details summary {
  min-height: 44px;
  padding: 11px 14px;
  color: var(--text-soft);
  background: var(--surface-soft);
  border-radius: 5px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 650;
}

.alias-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--border);
}

.alias-grid code {
  overflow: hidden;
  padding: 9px 10px;
  color: #48575f;
  background: var(--surface-soft);
  border-radius: 3px;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.request-example {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 16px;
  margin: 16px 18px 18px;
  overflow: hidden;
  color: #d5dcdf;
  background: #20282d;
  border-radius: 5px;
}

.request-example > div {
  padding: 16px;
  border-right: 1px solid #394348;
}

.request-example strong,
.request-example span {
  display: block;
}

.request-example strong {
  color: #fff;
  font-size: 12px;
}

.request-example span {
  margin-top: 4px;
  color: #8fa0a8;
  font-size: 10px;
}

.request-example pre {
  margin: 0;
  padding: 16px;
  font-size: 11px;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 100;
  max-width: min(390px, calc(100vw - 32px));
  padding: 12px 16px;
  color: #fff;
  background: #263137;
  border-left: 3px solid #48b583;
  border-radius: 5px;
  box-shadow: 0 12px 32px rgba(24, 33, 38, 0.25);
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.err {
  border-left-color: #d45d57;
}

/* Operational status affordances */
.runtime-chip,
.topbar-updated,
.panel-meta,
.context-hint {
  color: var(--text-faint);
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 10px;
}

.runtime-chip {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  color: var(--green);
  background: var(--green-soft);
  border: 1px solid #c8e6d7;
  border-radius: 999px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 650;
  transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

.runtime-chip.error {
  color: var(--red);
  background: var(--red-soft);
  border-color: #e8c6c4;
}

.topbar-updated {
  white-space: nowrap;
}

.panel-head > .panel-meta {
  margin-left: auto;
  white-space: nowrap;
}

.context-hint {
  grid-column: 1 / -1;
  margin: -3px 2px 0;
  color: var(--text-soft);
  font-family: inherit;
  font-size: 11px;
  font-weight: 500;
}

.status-dot.online {
  animation: status-pulse 2.4s ease-in-out infinite;
}

@keyframes status-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(57, 173, 121, 0.13); }
  50% { box-shadow: 0 0 0 5px rgba(57, 173, 121, 0.04); }
}

.mobile-scrim {
  position: fixed;
  inset: 0;
  z-index: 35;
  display: none;
  background: rgba(20, 27, 31, 0.48);
}

/* Standalone console login */
.login-body {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background: #e9edef;
}

.console-login-shell {
  display: grid;
  width: min(860px, 100%);
  min-height: 500px;
  grid-template-columns: minmax(280px, 0.85fr) minmax(340px, 1.15fr);
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(24, 33, 38, 0.14);
}

.login-aside {
  display: flex;
  flex-direction: column;
  padding: 34px;
  color: #dbe2e5;
  background: var(--sidebar);
}

.login-aside .brand {
  min-height: auto;
  padding: 0;
  border: 0;
}

.login-aside-copy {
  margin-top: auto;
  padding-top: 60px;
}

.login-aside-copy strong {
  display: block;
  max-width: 260px;
  color: #fff;
  font-size: 23px;
  font-weight: 650;
  line-height: 1.35;
}

.login-aside-copy p {
  max-width: 270px;
  margin-top: 12px;
  color: #9cabb2;
  font-size: 12px;
}

.login-aside-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  color: #aebbc1;
  font-size: 11px;
}

.login-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 52px;
}

.login-card h1 {
  font-size: 22px;
  font-weight: 680;
}

.login-card > p {
  margin: 6px 0 28px;
  color: var(--text-soft);
  font-size: 12px;
}

.login-field {
  display: grid;
  gap: 7px;
  margin-bottom: 16px;
}

.login-field label {
  color: var(--text-soft);
  font-size: 11px;
}

.login-btn {
  width: 100%;
  min-height: 46px;
  margin-top: 6px;
  color: #fff;
  background: var(--blue);
  border: 1px solid var(--blue);
  border-radius: 5px;
  font-weight: 650;
}

.login-btn:hover {
  background: #125a8f;
}

.login-err {
  display: none;
  margin-top: 14px;
  padding: 10px 12px;
  color: var(--red);
  background: var(--red-soft);
  border: 1px solid #ebc4c2;
  border-radius: 4px;
  font-size: 11px;
}

.login-err.show {
  display: block;
}

.login-foot {
  margin-top: 22px;
  color: var(--text-faint);
  font-size: 10px;
  text-align: center;
}

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

  .account-table-head,
  .account-row {
    grid-template-columns: minmax(180px, 1.2fr) minmax(150px, 0.8fr) 100px minmax(270px, auto);
  }

  .account-table-head > :nth-child(4),
  .account-row > :nth-child(4) {
    display: none;
  }

  .workbench-layout {
    grid-template-columns: minmax(0, 1fr) minmax(310px, 0.55fr);
  }

  .capability-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .sidebar {
    width: min(290px, calc(100vw - 48px));
    transform: translateX(-105%);
    transition: transform 200ms ease;
  }

  body.nav-open .sidebar {
    transform: translateX(0);
  }

  body.nav-open .mobile-scrim {
    display: block;
  }

  .main {
    width: 100%;
    margin-left: 0;
  }

  .mobile-menu {
    display: inline-flex !important;
  }

  .topbar {
    padding: 10px 18px;
  }

  .page {
    padding: 20px 18px 32px;
  }

  .overview-grid,
  .login-layout,
  .proxy-layout,
  .workbench-layout {
    grid-template-columns: 1fr;
  }

  .result-panel {
    position: static;
    min-height: 360px;
  }

  .result-panel pre {
    min-height: 292px;
    max-height: 520px;
  }

  .context-bar {
    top: 76px;
  }

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

  .account-table-head {
    display: none;
  }

  .account-row {
    grid-template-columns: minmax(200px, 1fr) minmax(120px, 0.6fr) auto;
  }

  .account-row > :nth-child(3),
  .account-row > :nth-child(4) {
    display: none;
  }

  .row-actions {
    flex-wrap: wrap;
    max-width: 220px;
  }
}

@media (max-width: 640px) {
  .topbar {
    min-height: 68px;
    gap: 10px;
    padding: 8px 12px;
  }

  .page-heading p,
  .context-account,
  .topbar-updated {
    display: none;
  }

  .panel-head > .panel-meta {
    display: none;
  }

  .page-heading h1 {
    font-size: 17px;
  }

  .page {
    padding: 14px 12px 28px;
  }

  .metric-grid,
  .proxy-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .metric {
    min-height: 102px;
    padding: 14px;
  }

  .metric > strong {
    font-size: 24px;
  }

  .overview-grid {
    gap: 12px;
  }

  .panel-head {
    min-height: 62px;
    padding: 12px 14px;
  }

  .account-list.compact {
    grid-template-columns: 1fr;
    padding-inline: 14px;
  }

  .account-list.compact .recent-account:nth-last-child(2) {
    border-bottom: 1px solid #edf0f1;
  }

  .filters {
    grid-template-columns: 1fr;
    padding: 12px 14px;
  }

  .account-row {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 14px;
  }

  .account-row > :nth-child(2) {
    display: block;
  }

  .row-actions {
    max-width: none;
    justify-content: flex-start;
  }

  .row-btn {
    min-height: 40px;
    flex: 1 1 auto;
  }

  .qr-stage {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 22px;
    padding: 22px 14px;
  }

  .qr-box {
    width: 224px;
    height: 224px;
  }

  .qr-box img {
    width: 206px;
    height: 206px;
  }

  .qr-controls {
    width: 100%;
    max-width: 360px;
  }

  .context-bar {
    position: static;
    grid-template-columns: 1fr;
  }

  .context-ready {
    display: none;
  }

  .context-hint {
    grid-column: auto;
    margin-top: 0;
  }

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

  .workbench-tabs button {
    min-width: 0;
    padding: 0 6px;
    font-size: 11px;
  }

  .capability-grid,
  .form-grid.two,
  .compact-form {
    grid-template-columns: 1fr;
  }

  .compact-form .btn {
    width: 100%;
  }


  .proxy-row {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .proxy-row .row-actions {
    grid-column: 1 / -1;
  }

  .alias-grid,
  .request-example {
    grid-template-columns: 1fr;
  }

  .request-example > div {
    border-right: 0;
    border-bottom: 1px solid #394348;
  }

  .auth-panel .panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .console-login-shell {
    grid-template-columns: 1fr;
  }

  .login-aside {
    min-height: 180px;
    padding: 24px;
  }

  .login-aside-copy {
    display: none;
  }

  .login-card {
    padding: 34px 24px;
  }
}

@media (max-width: 420px) {
  .metric-grid,
  .proxy-metrics {
    grid-template-columns: 1fr;
  }

  .runtime-chip {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ====== 原生账号/计费/代理管理样式（保留给复用组件）====== */
.nav-sep {
  margin: 14px 12px 6px;
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--muted, #8a94a3);
  text-transform: uppercase;
}
.nav-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted-light, #b7c0cf);
  margin-left: auto;
}
.nav-dot.online { background: #2ea56f; box-shadow: 0 0 0 3px rgba(46,165,111,.18); }

.gw-status-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  margin-bottom: 14px;
  background: var(--surface, #fff);
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 10px;
  font-size: 14px;
}
.gw-status-bar .status-dot { width: 9px; height: 9px; border-radius: 50%; background: #cbd5e1; }
.gw-status-bar .status-dot.online { background: #2ea56f; }
.gw-status-bar .status-dot.offline { background: #dc2f3c; }
.gw-version { margin-left: auto; color: var(--muted, #64748b); font-size: 12px; }

.gw-tab-panel { display: none; }
.gw-tab-panel.active { display: block; animation: fadeIn .2s ease; }

.gw-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  border: 1px solid var(--line, #e6ecf4);
  border-radius: 9px;
  margin-bottom: 8px;
  background: var(--surface, #fff);
}
.gw-row:hover { background: var(--tr-hover, #f7faff); }
.gw-row-main { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.gw-row-main strong { font-size: 14px; }
.gw-row-main code { font-size: 12px; }
.gw-row-side { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.gw-muted { color: var(--muted, #64748b); font-size: 12px; }
.gw-err { color: var(--danger, #dc2f3c); font-size: 12px; }

.gw-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 14px;
}

.form-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.form-field label { font-size: 13px; color: var(--muted, #5b6678); }

