:root {
  color-scheme: light;
  --ink:#232c35;
  --muted:#6e7c88;
  --border:#dce3e8;
  --surface:#f5f7f9;
  --blue:#3569ba;
  --blue-wash:#edf3fc;
  --green:#15765e;
  --amber:#925a12;
  --red:#b43843;
}
* {
  box-sizing: border-box;
  letter-spacing: 0;
}
body {
  margin: 0;
  color: var(--ink);
  background: var(--surface);
  font:
    14px/1.6 "PingFang TC",
    "Microsoft JhengHei",
    system-ui,
    sans-serif;
}
a {
  color: inherit;
  text-decoration: none;
}
button,
input,
select {
  font: inherit;
}
button,
a,
input,
select {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
  opacity: .45;
}
:focus-visible {
  outline: 3px solid #90b4e8;
  outline-offset: 3px;
}
svg {
  flex-shrink: 0;
  width: 19px;
  height: 19px;
  stroke-width: 1.75;
}
[hidden] {
  display: none !important;
}
h1,
h2,
p {
  margin: 0;
}
h1 {
  font-size: 27px;
  font-weight: 650;
  line-height: 1.4;
}
h2 {
  font-size: 17px;
  font-weight: 650;
}
.mono {
  font-family:
    "SFMono-Regular",
    Consolas,
    monospace;
  font-size: 12px;
}
.muted {
  color: var(--muted);
}
.app-shell {
  display: flex;
  min-height: 100dvh;
}
.sidebar {
  width: 224px;
  flex: none;
  background: #fff;
  border-right: 1px solid var(--border);
  padding: 30px 18px 20px;
  position: fixed;
  inset: 0 auto 0 0;
  display: flex;
  flex-direction: column;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.5;
}
.brand small {
  display: block;
  font: 10px/1.6 system-ui, sans-serif;
  color: var(--muted);
  font-weight: 600;
  margin-top: 2px;
}
.brand-mark {
  display: grid;
  place-items: center;
  background: var(--blue);
  color: #fff;
  width: 37px;
  height: 41px;
  border-radius: 6px;
  flex: none;
}
.brand-mark svg {
  width: 24px;
  height: 24px;
}
.sidebar nav {
  display: grid;
  gap: 7px;
  margin-top: 47px;
}
.nav-item {
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  color: #667480;
  border-radius: 6px;
  font-weight: 550;
}
.nav-item:hover {
  background: var(--surface);
}
.nav-item.selected {
  background: var(--blue-wash);
  color: var(--blue);
}
.sidebar-foot {
  margin-top: auto;
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 11px;
  padding: 14px;
}
.sidebar-foot .mono {
  margin-left: auto;
  font-size: 10px;
}
.version-dot,
.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
  background: currentColor;
  flex: none;
}
.version-dot {
  color: #95a2ac;
}
.workspace {
  margin-left: 224px;
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.topbar {
  height: 76px;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 38px;
  border-bottom: 1px solid var(--border);
  background: #fff;
}
.topbar-account {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #eaf0f5;
  color: #4e6376;
  font-size: 13px;
  flex: none;
}
.account-name {
  font-size: 12px;
  max-width: 180px;
  overflow-wrap: anywhere;
}
.account-name small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.3;
}
.mode-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid #e9dabd;
  padding: 4px 9px;
  border-radius: 4px;
  font-size: 11px;
  color: var(--amber);
  background: #fff9ed;
  white-space: nowrap;
}
.mode-badge.live {
  color: var(--red);
  background: #fff1f1;
  border-color: #ecd0d2;
}
.mode-badge.disabled {
  color: var(--muted);
  background: var(--surface);
  border-color: var(--border);
}
.mobile-brand {
  display: none;
}
main#main {
  padding: 34px 38px 38px;
  width: 100%;
  max-width: 1510px;
  margin: 0 auto;
  flex: 1;
  min-width: 0;
}
.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 26px;
}
.eyebrow {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 4px;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 9px 15px;
  border: 1px solid transparent;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 600;
  flex: none;
}
.primary {
  background: var(--blue);
  color: #fff;
}
.primary:hover {
  background: #2a58a4;
}
.secondary {
  color: var(--ink);
  background: #fff;
  border-color: var(--border);
}
.secondary:hover {
  background: var(--surface);
}
.icon-button {
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  height: 34px;
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 5px;
  padding: 7px;
}
.icon-button:hover {
  color: var(--blue);
  background: var(--blue-wash);
}
.destructive:hover {
  color: var(--red);
  background: #fff0f1;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin: 0 0 25px;
  padding: 20px 0;
}
.metrics > div {
  padding: 0 25px;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.metrics > div:first-child {
  padding-left: 0;
}
.metrics > div:last-child {
  border-right: 0;
}
.metrics span {
  color: var(--muted);
  font-size: 12px;
}
.metrics strong {
  font:
    550 28px/1.4 "SFMono-Regular",
    Consolas,
    monospace;
}
.list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 15px;
  color: var(--muted);
  font-size: 12px;
}
.search-field {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  min-width: 0;
  width: 300px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 0 11px;
}
.search-field input {
  border: 0;
  background: transparent;
  min-width: 0;
  width: 100%;
  padding: 9px 0;
  outline: none;
  font-size: 12px;
}
.search-field svg {
  width: 16px;
  height: 16px;
}
.table-scroll {
  min-width: 0;
  overflow-x: auto;
}
.resource-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 12px;
}
.resource-table th {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  padding: 11px 14px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.resource-table td {
  padding: 18px 14px;
  border-bottom: 1px solid var(--border);
  overflow-wrap: anywhere;
  vertical-align: middle;
}
.resource-table th:first-child,
.resource-table td:first-child {
  padding-left: 0;
}
.resource-table td:last-child {
  padding-right: 0;
}
.resource-table strong {
  font-weight: 600;
}
.resource-table small {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-top: 3px;
}
.resource-table tbody tr:hover {
  background: #eef3f8;
}
.identity {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}
.identity > span:last-child {
  min-width: 0;
}
.item-symbol {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  color: #687e91;
  flex: none;
}
.row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}
.row-actions form {
  display: flex;
}
.actions-heading {
  text-align: right;
}
.badge {
  display: inline-block;
  font-size: 10px;
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--muted);
  background: #fff;
  white-space: nowrap;
}
.badge.blue {
  color: var(--blue);
  background: var(--blue-wash);
  border-color: #dbe5f6;
}
.badge.green {
  color: var(--green);
  background: #ebf7f1;
  border-color: #d2e9df;
}
.badge.amber {
  color: var(--amber);
  background: #fff7e9;
  border-color: #e9dabd;
}
.badge.red {
  color: var(--red);
  background: #fff0f1;
  border-color: #efd5d7;
}
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-width: 260px;
}
.tag {
  font-size: 10px;
  padding: 3px 7px;
  background: #edf0f3;
  color: #607282;
  border-radius: 3px;
  overflow-wrap: anywhere;
}
.state-text {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--muted);
}
.state-text.enabled {
  color: var(--green);
}
.notice {
  padding: 12px 15px;
  border: 1px solid #d1e7db;
  border-radius: 5px;
  color: var(--green);
  background: #edf8f2;
  margin-bottom: 20px;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 9px;
  overflow-wrap: anywhere;
}
.notice.danger {
  color: var(--red);
  border-color: #eed0d5;
  background: #fff2f3;
}
.notice.warning {
  color: var(--amber);
  border-color: #ebdec5;
  background: #fff8ed;
}
.empty {
  border-top: 1px solid var(--border);
  padding: 55px 20px;
  text-align: center;
  color: var(--muted);
}
.empty > svg {
  width: 32px;
  height: 32px;
  margin-bottom: 10px;
}
.empty h2 {
  font-size: 15px;
  font-weight: 500;
  margin-bottom: 6px;
}
.empty p {
  font-size: 12px;
}
.small-empty {
  padding: 30px;
  font-size: 12px;
}
.page-foot {
  display: flex;
  justify-content: space-between;
  color: #8c98a2;
  font-size: 10px;
  padding: 16px 38px;
  border-top: 1px solid var(--border);
}
.page-foot .mono {
  font-size: 10px;
}
dialog {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
  width: min(510px, calc(100% - 32px));
  max-height: calc(100dvh - 40px);
  overflow: auto;
  color: var(--ink);
  box-shadow: 0 15px 70px #17293c22;
}
dialog::backdrop {
  background: #17233166;
}
.dialog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  gap: 12px;
}
.dialog-heading h2 {
  font-size: 18px;
}
.form-stack {
  display: grid;
  gap: 18px;
}
.form-stack label {
  display: grid;
  gap: 6px;
  color: #51616f;
  font-size: 12px;
  min-width: 0;
}
input:not([type=checkbox]):not([type=radio]),
select {
  min-height: 41px;
  width: 100%;
  min-width: 0;
  border: 1px solid #cfd8df;
  border-radius: 5px;
  background: #fff;
  color: var(--ink);
  padding: 9px 11px;
}
input::placeholder {
  color: #98a4ad;
  font-size: 12px;
}
.form-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}
fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}
legend {
  color: #51616f;
  font-size: 12px;
  margin-bottom: 9px;
  padding: 0;
}
.radio-row {
  display: flex;
  gap: 25px;
}
.form-stack .radio-row label,
.form-stack .check-list label,
.form-stack .toggle-label {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
}
input[type=checkbox],
input[type=radio] {
  accent-color: var(--blue);
  width: 16px;
  height: 16px;
  margin: 0;
  flex: none;
}
.check-list {
  display: grid;
  gap: 10px;
  max-height: 160px;
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 5px;
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid var(--border);
  padding-top: 19px;
  margin-top: 6px;
}
.open-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  border-top: 1px solid var(--border);
  margin-bottom: 20px;
  gap: 14px;
}
.open-toolbar > span {
  color: var(--muted);
  font-size: 12px;
}
.open-toolbar strong {
  color: var(--ink);
  font-size: 17px;
  margin-right: 4px;
}
.open-toolbar label {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
  color: var(--muted);
  min-width: 0;
}
.open-toolbar select {
  min-width: 140px;
  max-width: 220px;
  font-size: 12px;
}
.device-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.device-item {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 21px;
  min-width: 0;
}
.device-item-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 31px;
  margin-bottom: 17px;
}
.device-symbol {
  color: var(--green);
  display: flex;
}
.device-symbol svg {
  width: 27px;
  height: 27px;
}
.device-item h2 {
  font-size: 17px;
  margin-bottom: 6px;
  overflow-wrap: anywhere;
}
.device-state {
  display: flex;
  gap: 6px;
  align-items: center;
  color: #8a969f;
  font-size: 10px;
  margin: 16px 0;
}
.open-button {
  background: var(--green);
  color: #fff;
}
.open-button:hover {
  background: #11624e;
}
.device-item > .button {
  width: 100%;
}
.recent-section {
  margin-top: 34px;
}
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.section-heading h2 {
  font-size: 15px;
}
.text-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--blue);
}
.text-link svg {
  width: 15px;
  height: 15px;
}
.command-id {
  color: var(--muted);
}
.time-cell {
  white-space: nowrap;
  font-size: 10px;
}
.open-confirm-device {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 20px 0;
  font-size: 19px;
  overflow-wrap: anywhere;
}
.open-confirm-device svg {
  width: 29px;
  height: 29px;
  color: var(--green);
}
#open-confirm-warning {
  font-size: 12px;
  margin-bottom: 24px;
}
#open-result {
  padding: 12px;
  border-radius: 5px;
  font-size: 12px;
  background: #edf7f1;
  color: var(--green);
  margin-bottom: 18px;
  overflow-wrap: anywhere;
}
#open-result.failed {
  background: #fff5e9;
  color: var(--amber);
}
#open-result small {
  display: block;
  color: var(--muted);
  margin-top: 8px;
  font: 10px/1.5 monospace;
}
.compact-heading {
  font-size: 12px;
  font-weight: 500;
}
.account-summary {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 20px 0 26px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.account-summary .badge {
  margin-left: auto;
}
.large-avatar {
  width: 45px;
  height: 45px;
  font-size: 18px;
}
.account-password {
  max-width: 440px;
  margin-top: 28px;
}
.account-password h2 {
  margin-bottom: 20px;
}
.account-password .button {
  justify-self: start;
}
.login-page {
  min-height: 100dvh;
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 62px 24px 24px;
}
.login-brand {
  margin-bottom: 62px;
}
.login-form {
  width: 100%;
  max-width: 370px;
}
.login-form h1 {
  font-size: 25px;
  margin-bottom: 12px;
}
.login-mode {
  margin-bottom: 29px;
}
.login-form .eyebrow {
  font-size: 12px;
}
.login-form .form-stack {
  gap: 20px;
}
.login-form input {
  min-height: 46px;
}
.login-submit {
  margin-top: 7px;
  justify-content: space-between;
  min-height: 46px;
  font-size: 14px;
}
.password-field {
  display: flex;
  position: relative;
}
.password-field input {
  padding-right: 43px;
}
.password-field .icon-button {
  position: absolute;
  right: 5px;
  top: 6px;
}
.login-foot {
  margin-top: auto;
  padding-top: 55px;
  font-size: 10px;
  color: var(--muted);
  display: flex;
  gap: 6px;
}
.error-page {
  max-width: 540px;
  margin: 16vh auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: flex-start;
}
.error-code {
  font-size: 36px;
  color: var(--muted);
}
.error-page .button {
  margin-top: 12px;
}
.search-field input:not([type=checkbox]):not([type=radio]) {
  border: 0;
  background: transparent;
  padding: 9px 0;
}
.open-toolbar label > span {
  white-space: nowrap;
}
.device-item-heading .tag {
  max-width: calc(100% - 38px);
  white-space: normal;
  overflow-wrap: anywhere;
}
@media (min-width: 1600px) {
  .device-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
@media (max-width: 1100px) {
  .sidebar {
    width: 196px;
    padding-inline: 14px;
  }
  .workspace {
    margin-left: 196px;
  }
  .topbar {
    padding-inline: 25px;
  }
  main#main {
    padding: 28px 25px;
  }
  .device-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .resource-table th,
  .resource-table td {
    padding-inline: 10px;
  }
}
@media (max-width: 700px) {
  h1 {
    font-size: 23px;
  }
  .sidebar {
    width: 100%;
    height: 66px;
    inset: auto 0 0;
    padding: 0;
    border: 0;
    border-top: 1px solid var(--border);
    background: #fff;
    z-index: 10;
  }
  .sidebar > .brand,
  .sidebar-foot {
    display: none;
  }
  .sidebar nav {
    display: flex;
    align-items: stretch;
    justify-content: space-evenly;
    gap: 0;
    margin: 0;
    height: 100%;
  }
  .nav-item {
    padding: 7px 2px 5px;
    flex: 1;
    min-width: 0;
    min-height: 0;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    border-radius: 0;
    font-size: 9px;
    line-height: 1.3;
  }
  .nav-item svg {
    width: 20px;
    height: 20px;
  }
  .nav-item.selected {
    background: transparent;
    border-top: 2px solid var(--blue);
    padding-top: 5px;
  }
  .nav-item span {
    white-space: nowrap;
  }
  .workspace {
    margin-left: 0;
    padding-bottom: 66px;
  }
  .topbar {
    padding: 0 17px;
    height: 64px;
    gap: 10px;
    flex-wrap: nowrap;
  }
  .mobile-brand {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    font-weight: 700;
  }
  .mobile-brand svg {
    color: var(--blue);
    width: 23px;
    height: 23px;
  }
  .mode-badge {
    font-size: 9px;
    padding: 3px 6px;
    gap: 5px;
  }
  .topbar-account {
    gap: 4px;
  }
  .topbar-account .avatar {
    display: none;
  }
  .account-name {
    font-size: 10px;
    max-width: 75px;
  }
  .account-name small {
    font-size: 9px;
  }
  main#main {
    padding: 26px 17px;
  }
  .page-heading {
    gap: 9px;
    margin-bottom: 23px;
  }
  .page-heading > .button {
    padding: 8px 10px;
    font-size: 11px;
    gap: 5px;
  }
  .metrics {
    padding: 17px 0;
    gap: 0;
  }
  .metrics > div {
    padding: 0 14px;
  }
  .metrics span {
    font-size: 10px;
  }
  .metrics strong {
    font-size: 25px;
  }
  .list-toolbar {
    font-size: 10px;
    gap: 10px;
  }
  .search-field {
    width: 210px;
  }
  .table-scroll {
    overflow: visible;
  }
  .resource-table {
    display: block;
  }
  .resource-table thead {
    display: none;
  }
  .resource-table tbody {
    display: block;
  }
  .resource-table tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 13px 12px;
    padding: 18px 0;
    border-bottom: 1px solid var(--border);
  }
  .resource-table tr:first-child {
    border-top: 1px solid var(--border);
  }
  .resource-table td,
  .resource-table td:first-child {
    display: block;
    padding: 0;
    border: 0;
    min-width: 0;
    font-size: 12px;
  }
  .resource-table td:first-child {
    grid-column: 1/-1;
  }
  .resource-table td[data-label]:not(:first-child)::before {
    content: attr(data-label);
    display: block;
    font:
      10px/1.5 "PingFang TC",
      system-ui,
      sans-serif;
    color: var(--muted);
    margin-bottom: 5px;
  }
  .resource-table .row-actions {
    display: flex;
    align-items: end;
    justify-content: flex-end;
  }
  .resource-table .row-actions::before {
    display: none;
  }
  .resource-table .identity {
    gap: 10px;
  }
  .tag-list {
    max-width: 100%;
  }
  .device-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .device-item {
    padding: 19px;
  }
  .device-item-heading {
    margin-bottom: 12px;
  }
  .device-item h2 {
    font-size: 18px;
  }
  .device-item .open-button {
    min-height: 43px;
  }
  .device-state {
    margin: 12px 0 17px;
  }
  .open-toolbar {
    align-items: center;
  }
  .open-toolbar label {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 3px;
    font-size: 10px;
    max-width: 180px;
  }
  .open-toolbar select {
    min-width: 140px;
    max-width: 180px;
  }
  .page-foot {
    padding: 15px 17px;
  }
  .command-table .time-cell {
    white-space: normal;
  }
  .command-table .command-id {
    grid-column: auto;
  }
  dialog {
    padding: 21px 18px;
    margin: auto;
  }
  .form-pair {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .dialog-actions .button {
    flex: 1;
  }
  .dialog-heading {
    margin-bottom: 20px;
  }
  .login-page {
    padding-top: 42px;
  }
  .login-brand {
    margin-bottom: 48px;
  }
  .login-form h1 {
    font-size: 24px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation: none !important;
    transition: none !important;
  }
}
