:root {
  --font:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", sans-serif;
  --sidebar-w: 224px;
}
body {
  min-height: 100dvh;
}
button,
a,
input,
select {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}
a {
  color: var(--primary-dk);
}
.muted {
  color: var(--text-muted);
}
.icon {
  flex-shrink: 0;
}
svg {
  vertical-align: middle;
}
.sidebar-brand {
  height: 68px;
  padding: 0 20px;
}
.brand-icon {
  background: transparent;
  color: #27d8ba;
  width: 28px;
}
.brand-name {
  font-size: 16px;
  letter-spacing: 1px;
}
.brand-sub {
  color: #7992a8;
  font-size: 10px;
  letter-spacing: 2px;
  display: block;
  margin-top: 3px;
}
.sidebar-nav {
  padding-top: 18px;
}
.nav-link {
  min-height: 46px;
  margin: 3px 10px;
  border-radius: 5px;
  font-size: 13px;
  gap: 12px;
}
.nav-label {
  font-size: 10px;
  letter-spacing: 1px;
  padding: 15px 22px 7px;
}
.sidebar-user {
  padding: 18px;
  display: flex;
  gap: 12px;
  align-items: center;
  border-top: 1px solid var(--sidebar-border);
  color: white;
}
.avatar-circle {
  display: grid;
  place-items: center;
  background: #1ca98f;
  color: white;
  width: 33px;
  height: 33px;
  border-radius: 50%;
  font-size: 12px;
}
.user-sub {
  font-size: 10px;
  color: #8c9bab;
  margin-top: 3px;
}
.sidebar-footnote {
  font-size: 11px;
  color: #8c9bab;
  padding: 12px 20px;
  border-top: 1px solid var(--sidebar-border);
}
.appmain {
  margin-left: var(--sidebar-w);
  min-height: 100dvh;
}
.app-topbar {
  height: 68px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  gap: 16px;
}
.top-left,
.top-right,
.inline-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.top-right {
  font-size: 12px;
  white-space: nowrap;
}
.top-search {
  display: flex;
  align-items: center;
  background: var(--body-bg);
  border: 1px solid var(--border-color);
  border-radius: 5px;
  padding: 7px 12px;
  gap: 10px;
  width: 300px;
}
.top-search input {
  background: none;
  border: 0;
  outline: none;
  color: var(--text);
  width: 100%;
  font-size: 12px;
}
.icon-button {
  background: transparent;
  border: 0;
  color: var(--text-secondary);
  padding: 6px;
  display: inline-grid;
  place-items: center;
  border-radius: 5px;
  min-width: 30px;
  min-height: 30px;
  font-size: 20px;
}
.icon-button:hover {
  background: var(--body-bg);
}
.content-wrap {
  max-width: 1740px;
  margin: auto;
  padding: 28px 30px 18px;
}
.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}
.page-heading h1 {
  font-size: 25px;
  font-weight: 650;
  letter-spacing: 0.3px;
  margin: 3px 0 7px;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 1.6px;
  color: var(--text-muted);
}
.subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.8;
}
.btn {
  font-size: 12px;
  gap: 7px;
  min-height: 34px;
  white-space: nowrap;
}
.btn-sm {
  padding: 4px 9px;
  min-height: 27px;
  font-size: 11px;
}
.btn-danger-outline {
  color: var(--red);
  border: 1px solid #d6393944;
  background: transparent;
}
.notice {
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
  color: #916923;
  background: #fff8e8;
  border: 1px solid #f1e5c5;
  border-radius: 5px;
  margin-bottom: 20px;
}
.notice strong {
  font-weight: 600;
}
.notice a {
  margin-left: auto;
}
.notice-live {
  color: var(--text-secondary);
  background: var(--bg-surface-secondary);
  border-color: var(--border-color);
}
[data-theme="dark"] .notice {
  background: #302c20;
  color: #e5c981;
  border-color: #4d4229;
}
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}
.stat-card {
  min-height: 116px;
  padding: 20px;
  display: flex;
  align-items: flex-start;
  gap: 13px;
}
.stat-card .stat-icon {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  margin: 0;
  display: grid;
  place-items: center;
}
.stat-card .stat-icon svg {
  width: 21px;
  height: 21px;
}
.stat-card .stat-value {
  font-size: 29px;
  line-height: 1.35;
  font-weight: 650;
  margin: 3px 0;
}
.stat-card .stat-label {
  font-size: 12px;
  text-transform: none;
  letter-spacing: 0;
}
.stat-foot {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 4px;
}
.color-teal {
  color: #0d9e83;
  background: #e6f8f3;
}
.color-blue {
  color: #2583cf;
  background: #ebf3fe;
}
.color-gray {
  color: #7c899a;
  background: #eff2f6;
}
.color-orange {
  color: #d58e22;
  background: #fff5df;
}
.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(320px, 1fr);
  gap: 20px;
  margin-bottom: 20px;
}
.card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border-color-light);
  gap: 12px;
}
.card-heading h2 {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
}
.card-heading a {
  font-size: 11px;
}
.card-heading small {
  font-size: 11px;
  color: var(--text-muted);
}
.chart {
  height: 276px;
  padding: 5px 8px;
}
.chart-summary {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 18px 22px 0;
  color: var(--text-secondary);
  font-size: 11px;
}
.chart-summary strong {
  font-size: 23px;
  color: var(--text);
  margin-right: 6px;
}
.tenant-row {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color-light);
  display: flex;
  align-items: center;
  gap: 12px;
}
.tenant-logo {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 600;
  background: var(--primary-lt);
  color: var(--primary-dk);
}
.tenant-row h3 {
  font-size: 12px;
  margin-bottom: 4px;
}
.tenant-row p {
  font-size: 10px;
  color: var(--text-muted);
}
.tenant-metrics {
  margin-left: auto;
  text-align: right;
  font-size: 13px;
}
.usage-bar {
  height: 4px;
  background: var(--border-color);
  border-radius: 4px;
  overflow: hidden;
  width: 80px;
  margin-top: 7px;
}
.usage-bar span {
  display: block;
  height: 100%;
  background: var(--primary);
}
.table-wrap {
  overflow: auto;
}
.sa-table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
  text-align: left;
}
.sa-table th {
  background: var(--bg-surface-secondary);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.3px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border-color);
}
.sa-table td {
  padding: 13px 18px;
  font-size: 12px;
  border-bottom: 1px solid var(--border-color-light);
  vertical-align: middle;
}
.sa-table tbody tr:hover {
  background: var(--primary-lt);
}
.sa-table td .subline {
  display: block;
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 5px;
  max-width: 210px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.device-name {
  font-weight: 550;
}
.device-name svg {
  color: var(--text-muted);
  margin-right: 7px;
  width: 17px;
}
.sa-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 4px;
  padding: 3px 7px;
  font-size: 10px;
  white-space: nowrap;
  background: var(--body-bg);
  color: var(--text-secondary);
}
.sa-badge.success {
  color: #139278;
  background: var(--primary-lt);
}
.sa-badge.danger {
  color: var(--red);
  background: var(--red-lt);
}
.sa-badge.demo {
  background: #fff2d8;
  color: #9b6b16;
}
.sa-badge.root {
  background: var(--blue-lt);
  color: var(--blue);
}
/* 经服务器（中继 relay）来源：与桥接/演示两种来源在视觉上明确区分 */
.sa-badge.relay {
  background: #e6f0fb;
  color: #1c5aa8;
}
.timeline {
  padding: 5px 20px 12px;
}
.timeline-item {
  padding: 15px 0 12px 19px;
  border-left: 1px solid var(--border-color);
  position: relative;
  margin-left: 4px;
}
.timeline-item:before {
  content: "";
  position: absolute;
  width: 7px;
  height: 7px;
  background: var(--primary);
  border: 2px solid var(--bg-surface);
  border-radius: 50%;
  left: -4px;
  top: 18px;
}
.timeline-item p {
  font-size: 12px;
}
.timeline-item small {
  display: block;
  color: var(--text-muted);
  font-size: 10px;
  margin-top: 5px;
}
.timeline-item time {
  float: right;
  color: var(--text-muted);
  font-size: 10px;
}
.panel-foot {
  padding: 13px 18px;
  color: var(--text-muted);
  font-size: 11px;
  border-top: 1px solid var(--border-color-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.page-footer {
  margin-top: 28px;
  color: var(--text-muted);
  font-size: 10px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
}
.filter-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 18px;
  flex-wrap: wrap;
}
.filter-toolbar input {
  min-width: 220px;
  flex: 1;
}
.filter-toolbar select {
  max-width: 240px;
}
.form-control {
  font-size: 12px;
  min-height: 36px;
  width: 100%;
  background: var(--bg-surface);
  color: var(--text);
  border: 1px solid var(--border-color);
  border-radius: 5px;
  padding: 8px 11px;
}
.scope-tabs {
  display: flex;
  gap: 24px;
  padding: 0 18px;
  border-bottom: 1px solid var(--border-color);
  overflow: auto;
}
.scope-tab {
  background: transparent;
  border: 0;
  padding: 15px 0;
  font-size: 12px;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.scope-tab.active {
  color: var(--primary-dk);
  border-bottom-color: var(--primary);
}
.scope-tab span {
  margin-left: 7px;
  font-size: 10px;
  color: var(--text-muted);
}
.directory-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 18px;
}
.org-tree {
  padding: 8px 9px;
  max-height: 700px;
  overflow: auto;
}
.tree-row {
  display: flex;
  align-items: center;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  text-align: left;
  padding: 9px 6px;
  font-size: 11px;
  border-radius: 4px;
  gap: 7px;
}
.tree-row:hover,
.tree-row.selected {
  background: var(--primary-lt);
  color: var(--primary-dk);
}
.tree-row svg {
  width: 14px;
}
.tree-row .count {
  margin-left: auto;
  color: var(--text-muted);
  font-size: 10px;
}
.tree-indent-1 {
  padding-left: 13px;
}
.tree-indent-2 {
  padding-left: 25px;
}
.tree-indent-3 {
  padding-left: 38px;
}
.tree-details > summary {
  list-style: none;
  cursor: pointer;
}
.tree-details > summary::-webkit-details-marker {
  display: none;
}
.tree-details > summary .tree-row:before {
  content: "▸";
  font-size: 10px;
}
.tree-details[open] > summary .tree-row:before {
  content: "▾";
}
.scope-summary {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-color);
  font-size: 12px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.small-stats {
  display: flex;
  gap: 24px;
  padding: 17px 20px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.small-stats strong {
  font-size: 20px;
  margin-left: 10px;
}
.empty-state {
  text-align: center;
  padding: 70px 20px;
  color: var(--text-muted);
}
.empty-state > svg {
  width: 34px;
  height: 34px;
  margin-bottom: 12px;
}
.empty-state h3 {
  font-size: 15px;
  color: var(--text);
  margin: 8px 0;
}
.empty-state p {
  font-size: 12px;
  line-height: 1.8;
}
.loading-state {
  padding: 100px;
  text-align: center;
  color: var(--text-muted);
}
.favorite {
  color: #d8a02b;
}
.link-button {
  border: 0;
  background: none;
  color: var(--primary-dk);
  font-size: 11px;
  padding: 4px;
  cursor: pointer;
}
.pagination {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 11px;
}
.pagination select {
  width: 75px;
  min-height: 28px;
  padding: 3px 8px;
}
dialog {
  border: 1px solid var(--border-color);
  border-radius: 9px;
  padding: 0;
  width: min(560px, calc(100vw - 32px));
  color: var(--text);
  background: var(--bg-surface);
  margin: auto;
  box-shadow: 0 20px 90px #0003;
  max-height: 90dvh;
}
dialog::backdrop {
  background: #15203366;
  backdrop-filter: blur(2px);
}
.modal-heading {
  padding: 19px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
}
.modal-heading h2 {
  font-size: 17px;
}
.modal-content {
  padding: 22px 24px;
  overflow: auto;
  max-height: 65dvh;
  line-height: 1.7;
  font-size: 13px;
}
.modal-actions {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 16px;
}
.field > span {
  font-size: 12px;
  color: var(--text-secondary);
}
.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
}
.form-error {
  font-size: 12px;
  color: var(--red);
  min-height: 16px;
  margin-top: 12px;
}
.form-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 18px;
  line-height: 1.8;
}
.settings-layout {
  display: grid;
  grid-template-columns: minmax(300px, 650px) 1fr;
  gap: 24px;
}
.settings-form {
  padding: 24px;
}
.settings-note {
  padding: 24px;
  font-size: 12px;
  line-height: 2;
}
.settings-note h3 {
  font-size: 14px;
  margin-bottom: 12px;
}
.settings-note p {
  margin-bottom: 12px;
  color: var(--text-secondary);
}
#toasts {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 500;
  display: grid;
  gap: 8px;
}
.toast-item {
  padding: 12px 20px;
  border: 1px solid var(--primary);
  border-radius: 6px;
  background: var(--bg-surface);
  box-shadow: var(--shadow);
  font-size: 12px;
  max-width: 440px;
  color: var(--text);
}
.toast-item.error {
  border-color: var(--red);
}
.auth-layout {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  background: var(--body-bg);
  gap: 30px;
}
.auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
}
.auth-brand > svg {
  color: var(--primary);
  width: 25px;
  height: 25px;
}
.auth-brand > span {
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--text-muted);
  border-left: 1px solid var(--border-color);
  padding-left: 15px;
  margin-left: 5px;
}
.auth-box {
  width: min(420px, calc(100vw - 32px));
  padding: 32px;
}
.auth-symbol {
  color: var(--primary);
  margin-bottom: 16px;
}
.auth-box h1 {
  font-size: 23px;
  margin-bottom: 9px;
}
.auth-box > p {
  font-size: 12px;
  margin-bottom: 25px;
}
.auth-box form > .btn {
  width: 100%;
  margin-top: 8px;
}
.auth-note {
  font-size: 11px;
  margin-top: 25px;
  color: var(--text-muted);
  text-align: center;
}
.control-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  background: var(--bg-surface);
  padding: 15px 24px;
  border-bottom: 1px solid var(--border-color);
}
.control-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 600;
}
.control-path {
  color: var(--text-muted);
  font-size: 11px;
  margin-top: 6px;
}
.control-breadcrumb {
  background: var(--sidebar-bg);
  color: #acb7c6;
  padding: 9px 24px;
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.control-breadcrumb a {
  color: #6ed9c5;
}
.feature-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  overflow-x: auto;
}
.feature-btn {
  border: 0;
  border-radius: 5px;
  padding: 10px 14px;
  font-size: 12px;
  background: transparent;
  color: var(--text-secondary);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.feature-btn.active {
  background: var(--primary);
  color: white;
}
.feature-btn:hover:not(.active) {
  background: var(--body-bg);
}
.feature-nav details {
  position: relative;
}
.feature-nav summary {
  list-style: none;
}
.feature-menu {
  position: fixed;
  z-index: 20;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  box-shadow: 0 6px 20px #0002;
  border-radius: 6px;
  padding: 6px;
  min-width: 150px;
}
.feature-menu button {
  display: block;
  width: 100%;
  text-align: left;
}
.control-body {
  padding: 18px 22px;
}
.screen-toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 12px 15px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 6px 6px 0 0;
  font-size: 12px;
}
.screen-toolbar select {
  width: auto;
  min-width: 90px;
}
.screen-toolbar .push {
  margin-left: auto;
}
.switch-label {
  display: flex;
  align-items: center;
  gap: 8px;
}
.switch-label input {
  accent-color: var(--primary);
  width: 17px;
  height: 17px;
}
.screen-stage {
  background: #141b27;
  min-height: 400px;
  height: calc(100dvh - 325px);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.screen-stage canvas {
  height: 100%;
  max-width: 100%;
  object-fit: contain;
  touch-action: none;
  outline: none;
}
.screen-stage:fullscreen {
  height: 100dvh;
  width: 100vw;
}
.screen-stage .empty-state {
  color: #a6b5c9;
}
.screen-stage .empty-state h3 {
  color: #e4ecf5;
}
.screen-status {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  padding: 10px 14px;
  color: var(--text-muted);
  font-size: 11px;
  border-radius: 0 0 6px 6px;
}
.device-log {
  margin-top: 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 5px;
  padding: 11px 14px;
  font-size: 11px;
  color: var(--text-secondary);
}
.device-log summary {
  cursor: pointer;
}
.device-log pre {
  max-height: 120px;
  overflow: auto;
  font-size: 11px;
  margin-top: 10px;
  white-space: pre-wrap;
}
.files-layout {
  display: grid;
  grid-template-columns: 180px 1fr;
  min-height: 390px;
}
.file-locations {
  padding: 15px;
  border-right: 1px solid var(--border-color);
}
.file-locations h4 {
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 15px;
}
.file-locations button {
  width: 100%;
  border: 0;
  text-align: left;
  color: var(--text-secondary);
  padding: 11px;
  background: none;
  font-size: 12px;
  border-radius: 5px;
}
.file-locations button.active {
  background: var(--primary-lt);
  color: var(--primary-dk);
}
.file-locations svg {
  margin-right: 8px;
  width: 15px;
}
.file-main {
  min-width: 0;
}
.file-path {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
  font-family: var(--font-mono);
  font-size: 12px;
}
.file-main .sa-table td {
  padding: 11px 16px;
}
.transfer-panel {
  margin-top: 18px;
}
.transfer-panel progress {
  width: 140px;
  height: 6px;
  accent-color: var(--primary);
}
.terminal-panel {
  background: #101722;
  border: 1px solid #263344;
  border-radius: 6px;
  min-height: 500px;
  display: flex;
  flex-direction: column;
}
.terminal-output {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.8;
  padding: 22px;
  color: #c4d6e5;
  flex: 1;
  white-space: pre-wrap;
  max-height: 60dvh;
  overflow: auto;
}
.terminal-input {
  display: flex;
  border-top: 1px solid #263344;
  padding: 15px;
  color: #43cbb0;
  gap: 12px;
}
.terminal-input input {
  background: transparent;
  border: 0;
  color: white;
  flex: 1;
  font-family: var(--font-mono);
  min-width: 0;
}
.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.info-list {
  padding: 6px 22px;
}
.info-list div {
  display: flex;
  gap: 20px;
  justify-content: space-between;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-color-light);
  font-size: 12px;
}
.info-list span {
  color: var(--text-muted);
}
.mobile-menu {
  display: none;
}
.route-error {
  padding: 50px;
  text-align: center;
}
@media (min-width: 1700px) {
  .content-wrap {
    padding: 32px 40px;
  }
  .stat-card {
    min-height: 130px;
  }
  .chart {
    height: 330px;
  }
  .sa-table td {
    padding-top: 16px;
    padding-bottom: 16px;
  }
}
@media (max-width: 1200px) {
  :root {
    --sidebar-w: 196px;
  }
  .content-wrap {
    padding: 24px 20px;
  }
  .top-search {
    width: 230px;
  }
  .stat-card {
    padding: 16px 12px;
    gap: 9px;
  }
  .stat-card .stat-value {
    font-size: 25px;
  }
  .dashboard-grid {
    grid-template-columns: minmax(0, 1.4fr) minmax(290px, 1fr);
  }
  .directory-layout {
    grid-template-columns: 185px minmax(0, 1fr);
  }
}
@media (max-width: 960px) {
  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .directory-layout {
    grid-template-columns: 1fr;
  }
  .tree-panel {
    display: none;
  }
  .settings-layout {
    grid-template-columns: 1fr;
  }
  .top-search {
    display: none;
  }
  .page-heading {
    align-items: flex-start;
  }
  .page-heading > .inline-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  .app-topbar {
    padding: 0 20px;
  }
}
@media (max-width: 767px) {
  .sidebar {
    transform: translateX(-100%);
  }
  body.sidebar-open .sidebar {
    transform: translateX(0);
    box-shadow: 0 0 0 100vw #0005;
  }
  .appmain {
    margin-left: 0;
  }
  .mobile-menu {
    display: inline-grid;
  }
  .content-wrap {
    padding: 20px 14px;
  }
  .app-topbar {
    height: 58px;
    padding: 0 14px;
  }
  .top-right {
    gap: 7px;
  }
  .top-right .top-account-name {
    display: none;
  }
  .page-heading h1 {
    font-size: 22px;
  }
  .page-heading {
    flex-direction: column;
    gap: 12px;
  }
  .stat-grid {
    gap: 10px;
  }
  .stat-card .stat-icon {
    width: 29px;
    height: 29px;
  }
  .stat-card .stat-value {
    font-size: 24px;
  }
  .stat-foot {
    font-size: 9px;
  }
  .notice {
    align-items: flex-start;
    line-height: 1.8;
  }
  .notice a {
    display: none;
  }
  .control-header {
    padding: 14px;
    flex-wrap: wrap;
  }
  .control-body {
    padding: 12px;
  }
  .feature-nav {
    padding: 8px;
  }
  .feature-btn {
    padding: 9px 11px;
  }
  .files-layout {
    grid-template-columns: 1fr;
  }
  .file-locations {
    display: none;
  }
  .info-grid {
    grid-template-columns: 1fr;
  }
  .screen-toolbar {
    gap: 9px;
    padding: 10px;
  }
  .screen-stage {
    min-height: 260px;
    height: 50dvh;
  }
  .screen-toolbar .push {
    margin-left: 0;
  }
  .page-footer {
    flex-direction: column;
    gap: 5px;
  }
  .modal-content {
    padding: 20px;
  }
  .panel-foot {
    flex-wrap: wrap;
    gap: 14px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

.terminal-panel .terminal-output {
  background: #101722;
  color: #c4d6e5;
  border: 0;
  border-radius: 6px 6px 0 0;
  margin: 0;
}

.dashboard-grid > .card,
.directory-layout > .card,
.settings-layout > .card,
.info-grid > .card {
  min-width: 0;
}
.table-wrap {
  max-width: 100%;
}

/* ---- 真实桥接（device.js / app.js 新增视图） ---- */
.screen-stage {
  position: relative;
}
.pixel-canvas {
  image-rendering: pixelated;
  height: 100%;
}
.screen-stage.actual {
  overflow: auto;
  align-items: flex-start;
  justify-content: flex-start;
}
.screen-stage.actual .pixel-canvas {
  height: auto;
  max-width: none;
  width: auto;
}
.screen-veil {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  text-align: center;
  color: #c7d4e2;
  background: rgba(14, 20, 30, 0.72);
}
.screen-veil[hidden] {
  display: none;
}
.cred-masked .secret-cell {
  filter: blur(4px);
}
.secret-cell {
  font-family: var(--font-mono);
  font-size: 12px;
  word-break: break-all;
}
.transfer-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 0;
  font-size: 12px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
}
.transfer-row .push {
  margin-left: auto;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 15px;
}
.source-badge {
  margin-left: 7px;
  vertical-align: middle;
}
.bridge-panel {
  display: grid;
  gap: 10px;
}
.bridge-panel .bridge-row {
  display: flex;
  align-items: center;
  gap: 9px;
  justify-content: space-between;
  font-size: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border-color);
}
.bridge-panel code {
  font-family: var(--font-mono);
  font-size: 11px;
  word-break: break-all;
}
