:root {
  color-scheme: dark;
  font: 15px/1.55 "Microsoft YaHei UI", system-ui, sans-serif;
  color: #eef5ff;
  background: #0a1120;
  --muted: #b1c2d7;
  --rim: #657d9c66;
  --glass: linear-gradient(145deg, #263951df, #111c30ed 70%);
}
* { box-sizing: border-box }
[hidden] { display: none !important }
body { margin: 0; min-height: 100vh; background: radial-gradient(ellipse at 76% -10%, #314d79, transparent 54%), radial-gradient(ellipse at 12% 60%, #182939, transparent 57%); }
header { min-height: 74px; padding: 14px max(20px, calc((100vw - 1060px)/2)); display: flex; align-items: center; justify-content: space-between; gap: 8px; border-bottom: 1px solid var(--rim); background: #101c2cbf }
.brand { display: flex; align-items: center; gap: 12px }
.brand strong { font-size: 21px; letter-spacing: .02em }
.brand span { padding-left: 12px; border-left: 1px solid var(--rim); color: var(--muted) }
main { max-width: 1100px; margin: 0 auto; padding: 36px 20px }
.connection { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; margin-bottom: 18px; padding: 12px 16px; border: 1px solid var(--rim); border-radius: 12px; background: #102036 }
.connection-address,.connection-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; min-width: 0 }
#connectionAddress { color: var(--muted); overflow-wrap: anywhere }
#connectionState[data-state="connected"] { color: #9fe4c5 }
#connectionState[data-state="error"] { color: #ffd4a7 }
.connection-actions button { padding: 5px 10px }
h1,h2 { margin: 0; line-height: 1.3 }
h1 { font-size: clamp(24px,4vw,32px) }
h2 { margin-bottom: 20px; font-size: 22px }
button,input { font: inherit; border-radius: 10px; padding: 9px 14px }
input { color: inherit; background: #0b1729; border: 1px solid #7187a2; min-width: 0 }
input::placeholder { color: #9aafc7 }
button { cursor: pointer; font-weight: 600; background: #c3ddf7; color: #102235; border: 1px solid transparent }
button:hover { filter: brightness(1.12) }
button:active { transform: translateY(1px) }
button:disabled { opacity: .55; cursor: default }
button.light,.close { color: #dbe9fa; background: #20334b; border-color: var(--rim) }
button:focus-visible,input:focus-visible { outline: 2px solid #a5d9ff; outline-offset: 3px }
#login,#workspace,dialog { border: 1px solid var(--rim); border-radius: 20px; background: var(--glass); box-shadow: 0 18px 56px #03091255; }
#login { max-width: 396px; padding: 32px; margin: clamp(30px,10vh,110px) auto 0 }
#login label { display: block; margin: 24px 0 7px; color: var(--muted) }
#login input,#login button { width: 100% }
#login button { margin-top: 18px }
#workspace { padding: clamp(16px,3vw,30px) }
.toolbar,.filters { display: flex; align-items: center; gap: 8px }
.toolbar { justify-content: space-between }
.filters { margin: 20px 0 14px; flex-wrap: wrap }
.filters input { flex: 1 1 180px }
.scroll { overflow-x: auto }
table { width: 100%; border-collapse: collapse; text-align: left }
th,td { padding: 12px 8px; border-bottom: 1px solid #61799444; white-space: nowrap }
th { font-size: 13px; font-weight: 500; color: var(--muted) }
td:first-child { font-variant-numeric: tabular-nums }
td button { font-size: 13px; padding: 4px 8px; margin: 2px }
dialog { width: min(510px,94vw); max-height: 80vh; color: inherit; padding: 24px; background-color: #152235; overflow-wrap: anywhere }
dialog::backdrop { background: #030b17b3 }
dialog input { display: block; margin: 6px 0 16px; width: 100% }
.close { float: right; padding: 1px 9px; font-size: 20px }
#message { color: #ffd4a7; text-align: center }
@media (max-width: 480px) {
  header { padding: 12px }
  .brand { gap: 7px }
  .brand strong { font-size: 17px }
  .brand span { padding-left: 7px; font-size: 13px }
  main { padding: 24px 12px }
}
@media (prefers-reduced-motion: no-preference) {
  button { transition: background .15s,filter .15s,transform .1s }
  dialog[open] { animation: appear .14s ease-out }
  @keyframes appear { from { opacity: 0; transform: translateY(5px) } }
}
