.archive-feed-page {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}

/* 数据同步后台：主内容区全屏撑满视口 */
body[data-layout="archive"] .page-main.panel-wide {
  overflow: hidden;
}

body[data-layout="archive"] .page-main.panel-wide > .page-panel > .card {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-width: none;
}

body[data-layout="archive"] .feed-page.page-card--enhanced,
body[data-layout="archive"] .corp-page.page-card--enhanced {
  flex: 1;
  min-height: 0;
  max-width: none;
}

body[data-layout="archive"] .feed-page.page-card--enhanced .page-head-bar,
body[data-layout="archive"] .feed-page.page-card--enhanced .page-hero,
body[data-layout="archive"] .corp-page.page-card--enhanced .page-head-bar,
body[data-layout="archive"] .corp-page.page-card--enhanced .page-hero {
  flex-shrink: 0;
}

body[data-layout="archive"] .corp-card-grid {
  overflow-y: auto;
}

/* —— 浏览页 FeedPageShell —— */
.feed-page.page-card--enhanced {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  max-width: none;
  gap: 0;
}

.page-icon--feed-msg {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
}

.page-icon--feed-events {
  background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%);
}

body[data-layout="archive"] .feed-page .page-stat-bar .page-stat {
  align-items: center;
  text-align: center;
}

.feed-page.page-card--enhanced .feed-page-body {
  flex: 1;
  min-height: 0;
  align-items: stretch;
  padding: 0 4px 4px;
}

.feed-page {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: none;
  min-height: 0;
  flex: 1;
}

.feed-error-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(239, 68, 68, 0.28);
  background: rgba(254, 242, 242, 0.9);
  color: #dc2626;
  font-size: 13px;
}

.feed-page-body {
  display: flex;
  min-height: 0;
  flex: 1;
  gap: 16px;
  overflow: hidden;
}

.feed-corp-aside {
  width: 224px;
  flex-shrink: 0;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
  min-height: 0;
}

@media (max-width: 900px) {
  .feed-page-body {
    flex-direction: column;
  }
  .feed-corp-aside {
    width: 100%;
    max-height: 220px;
  }
  .feed-help-aside {
    display: none !important;
  }
}

.feed-corp-aside-head {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(248, 250, 252, 0.85);
}

.feed-corp-aside-title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
}

.feed-corp-aside-count {
  margin: 2px 0 0;
  font-size: 11px;
  color: var(--muted, #64748b);
}

.feed-corp-list {
  list-style: none;
  margin: 0;
  padding: 8px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.feed-corp-item {
  width: 100%;
  border: none;
  background: transparent;
  border-radius: 10px;
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
  color: inherit;
  font: inherit;
  transition: background 0.15s ease;
}

.feed-corp-item:hover {
  background: rgba(241, 245, 249, 0.9);
}

.feed-corp-item.is-active {
  background: rgba(99, 102, 241, 0.12);
  color: #4f46e5;
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.18);
}

.feed-corp-name {
  display: block;
  font-size: 13px;
  line-height: 1.35;
}

.feed-corp-id {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: var(--muted, #64748b);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feed-corp-empty {
  padding: 24px 12px;
  text-align: center;
  font-size: 13px;
  color: var(--muted, #64748b);
}

.feed-main-card {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
}

.feed-main-hint {
  padding: 10px 16px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
  font-size: 11px;
  color: var(--muted, #64748b);
  background: rgba(248, 250, 252, 0.7);
}

.feed-main-toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(255, 255, 255, 0.85);
  font-size: 13px;
  text-align: center;
}

.feed-main-toolbar[hidden] {
  display: none !important;
}

.feed-main-seq-label {
  color: var(--muted, #64748b);
  font-weight: 600;
  font-size: 12px;
}

.feed-main-seq-value {
  font-size: 15px;
  font-weight: 700;
  color: var(--text, #0f172a);
}

.feed-main-content {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding: 12px 16px;
}

.feed-placeholder {
  position: absolute;
  inset: 12px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  color: var(--muted, #64748b);
  border-radius: 12px;
  background: rgba(248, 250, 252, 0.65);
}

.feed-placeholder[hidden],
.feed-thread[hidden] {
  display: none !important;
}

.feed-placeholder svg {
  width: 40px;
  height: 40px;
  opacity: 0.55;
}

.feed-placeholder-title {
  margin: 8px 0 0;
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
}

.feed-placeholder-desc {
  margin: 0;
  max-width: 18rem;
  font-size: 12px;
  line-height: 1.45;
}

.feed-help-aside {
  display: none;
  width: 256px;
  flex-shrink: 0;
  flex-direction: column;
  gap: 12px;
  align-self: stretch;
  min-height: 0;
}

@media (min-width: 1280px) {
  .feed-help-aside {
    display: flex;
  }
}

.feed-help-card {
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: #fff;
  padding: 14px 16px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
}

.feed-help-card h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
}

.feed-help-card p,
.feed-help-card ul {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted, #64748b);
}

.feed-help-card ul {
  padding-left: 18px;
}

.feed-thread {
  position: absolute;
  inset: 12px 16px;
  overflow-y: hidden;
  border-radius: 12px;
  background: rgba(248, 250, 252, 0.65);
  padding: 4px 2px 12px;
}

.feed-thread.feed-thread--scrollable {
  overflow-y: auto;
}

.feed-thread:not([hidden]) {
  display: block;
}

.feed-list-inner {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 48rem;
  margin: 0 auto;
  padding: 0 4px;
}

.feed-bubble {
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 16px;
  padding: 12px 14px;
  background: #fff;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
}

.feed-bubble-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: 11px;
  color: var(--muted, #64748b);
  margin-bottom: 6px;
}

.feed-type-badge {
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(148, 163, 184, 0.14);
  color: #334155;
  font-weight: 600;
}

.feed-bubble-participants {
  margin: 0 0 8px;
  font-size: 12px;
  color: var(--muted, #64748b);
  word-break: break-all;
}

.feed-bubble-body {
  font-size: 13px;
  line-height: 1.5;
}

.feed-body {
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.feed-event-card {
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 12px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
}

.feed-event-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.feed-event-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 4px 10px;
  border-radius: 8px;
  background: rgba(99, 102, 241, 0.1);
  color: #4f46e5;
  font-size: 12px;
  font-weight: 600;
}

.feed-event-tag svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.feed-event-head time {
  margin-left: auto;
  font-size: 11px;
  color: var(--muted, #64748b);
  font-variant-numeric: tabular-nums;
}

.feed-event-fields {
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(248, 250, 252, 0.75);
  padding: 10px 12px;
}

.feed-event-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.feed-event-field dt {
  font-size: 10px;
  font-weight: 600;
  color: var(--muted, #64748b);
}

.feed-event-field dd {
  margin: 2px 0 0;
  font-size: 12px;
  word-break: break-all;
}

.feed-event-field--wide {
  grid-column: 1 / -1;
}

.feed-event-field--emph {
  border-radius: 8px;
  padding: 6px 8px;
  background: rgba(148, 163, 184, 0.08);
}

.feed-event-field--add dd {
  color: #059669;
  font-weight: 600;
}

.feed-event-field--del dd {
  color: #dc2626;
  font-weight: 600;
}

.feed-event-seq {
  margin: 8px 0 0;
  font-size: 10px;
  color: var(--muted, #64748b);
}

.feed-older-header {
  text-align: center;
  font-size: 11px;
  color: var(--muted, #64748b);
  padding: 4px 0 8px;
  min-height: 20px;
}

.feed-top-sentinel {
  height: 1px;
  flex-shrink: 0;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.muted {
  color: var(--muted, #64748b);
}

.text-destructive {
  color: #ef4444;
}

.badge.ok {
  color: #059669;
}

.badge.bad {
  color: #dc2626;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* —— 企业配置（卡片 + 侧栏） —— */
.corp-page.page-card--enhanced {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  max-width: none;
  gap: 0;
}

.page-icon--corp {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
}

.corp-page-body {
  display: flex;
  align-items: stretch;
  gap: 16px;
  flex: 1;
  min-height: 0;
  padding: 0 4px 4px;
  min-width: 0;
}

.corp-page-foot {
  flex-shrink: 0;
  margin: 0;
  padding: 10px 8px 4px;
  font-size: 13px;
  color: var(--muted, #64748b);
  text-align: right;
}

.corp-page-foot strong {
  font-weight: 700;
  color: var(--text, #0f172a);
  font-variant-numeric: tabular-nums;
}

.corp-card-grid {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: min-content;
  align-content: start;
  gap: 16px;
}

.corp-card-grid:has(.corp-empty),
.corp-card-grid:has(.corp-loading) {
  grid-template-rows: 1fr;
  align-content: stretch;
}

.feed-help-card .corp-verify-legend {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
}

.feed-help-card .corp-verify-legend li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.feed-help-card .corp-verify-legend li + li {
  margin-top: 8px;
}

.corp-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  margin-top: 5px;
  flex-shrink: 0;
}

.corp-dot--ok {
  background: #10b981;
}

.corp-dot--warn {
  background: #f59e0b;
}

.corp-dot--bad {
  background: #ef4444;
}

.corp-dot--muted {
  background: #94a3b8;
}

@media (max-width: 1100px) {
  .corp-card-grid {
    grid-template-columns: 1fr;
  }
}

.corp-card {
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 6px 22px rgba(15, 23, 42, 0.06);
  overflow: hidden;
}

.corp-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.corp-card-brand {
  display: flex;
  gap: 12px;
  min-width: 0;
}

.corp-card-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(99, 102, 241, 0.12);
  color: #6366f1;
  flex-shrink: 0;
}

.corp-card-icon svg {
  width: 20px;
  height: 20px;
}

.corp-card-meta {
  min-width: 0;
}

.corp-card-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.corp-card-name {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
}

.corp-sync-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(148, 163, 184, 0.14);
  color: #64748b;
}

.corp-sync-badge--on {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
}

.corp-card-id {
  margin: 0;
  font-size: 12px;
  color: var(--muted, #64748b);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.corp-card-event-id {
  margin: 4px 0 0;
  font-size: 11px;
  color: var(--muted, #64748b);
}

.corp-card-proxy {
  margin: 4px 0 0;
  font-size: 11px;
  color: var(--muted, #64748b);
  word-break: break-all;
}

.corp-card-proxy--warn {
  color: #b45309;
}

.corp-card-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.corp-card-switch {
  position: relative;
  display: inline-flex;
  cursor: pointer;
}

.corp-card-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.corp-card-switch-track {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.45);
  transition: background 0.2s ease;
}

.corp-card-switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #fff;
  transition: transform 0.2s ease;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.18);
}

.corp-card-switch input:checked + .corp-card-switch-track {
  background: #6366f1;
}

.corp-card-switch input:checked + .corp-card-switch-track::after {
  transform: translateX(20px);
}

.corp-card-switch input:disabled + .corp-card-switch-track {
  opacity: 0.55;
}

.corp-edit-btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 10px;
  background: #fff;
  color: #64748b;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.corp-edit-btn svg {
  width: 16px;
  height: 16px;
}

.corp-edit-btn:hover {
  background: rgba(99, 102, 241, 0.08);
  border-color: rgba(99, 102, 241, 0.28);
  color: #6366f1;
}

.corp-card-channels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.corp-channel {
  padding: 14px 16px;
  min-width: 0;
}

.corp-channel + .corp-channel {
  border-left: 1px solid rgba(148, 163, 184, 0.14);
}

.corp-channel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.corp-channel-label {
  font-size: 12px;
  font-weight: 700;
  color: #334155;
}

.corp-vbadge {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.corp-vbadge--ok {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
}

.corp-vbadge--bad {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
}

.corp-vbadge--warn {
  background: rgba(245, 158, 11, 0.14);
  color: #d97706;
}

.corp-vbadge--muted {
  background: rgba(148, 163, 184, 0.16);
  color: #64748b;
}

.corp-channel-msg {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted, #64748b);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.corp-channel-msg--bad {
  color: #dc2626;
  display: block;
  -webkit-line-clamp: unset;
  -webkit-box-orient: unset;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: normal;
}

.corp-card-callback {
  padding: 10px 16px 0;
}

.corp-card-callback-url {
  margin: 4px 0 0;
  font-size: 11px;
  line-height: 1.45;
  word-break: break-all;
  color: #334155;
}

.corp-card-callback-url--warn {
  color: #ea580c;
}

.corp-callback-example {
  margin: 8px 0 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(248, 250, 252, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.22);
  font-size: 11px;
  line-height: 1.5;
  word-break: break-all;
  color: #334155;
}

.corp-callback-example em {
  font-style: normal;
  color: #6366f1;
  font-weight: 600;
}

.corp-card-foot {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 12px 16px 14px;
  background: rgba(248, 250, 252, 0.75);
}

@media (min-width: 720px) {
  .corp-card-foot {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

#btn-corp-refresh.is-spinning svg,
#btn-devices-refresh.is-spinning svg {
  animation: corp-refresh-spin 0.8s linear infinite;
}

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

.corp-foot-label {
  display: block;
  font-size: 10px;
  color: var(--muted, #64748b);
  margin-bottom: 2px;
}

.corp-card-foot strong {
  display: block;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  word-break: break-all;
}

.corp-empty {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 100%;
  padding: 72px 24px;
  border: 1px dashed rgba(148, 163, 184, 0.28);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.6);
}

.corp-empty-icon {
  display: grid;
  place-items: center;
  width: 80px;
  height: 80px;
  margin-bottom: 24px;
  border-radius: 18px;
  background: rgba(148, 163, 184, 0.12);
  color: #94a3b8;
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.2);
}

.corp-empty-icon svg {
  width: 40px;
  height: 40px;
}

.corp-empty-title {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 700;
}

.corp-empty-desc {
  margin: 0 0 24px;
  max-width: 24rem;
  font-size: 13px;
  color: var(--muted, #64748b);
  line-height: 1.5;
}

.corp-loading {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 100%;
  color: var(--muted, #64748b);
  font-size: 14px;
}

.corp-spinner {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 3px solid rgba(99, 102, 241, 0.15);
  border-top-color: #6366f1;
  animation: corp-spin 0.8s linear infinite;
}

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

.corp-msg--bad {
  color: #dc2626;
}

.page-icon--kbm {
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
}

.devices-runtime-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
  text-align: right;
  padding-top: 2px;
}

.devices-runtime-side strong {
  font-size: 15px;
  font-weight: 700;
  color: var(--text, #0f172a);
  font-variant-numeric: tabular-nums;
}

.devices-meta-heartbeat {
  margin-top: 2px;
  white-space: nowrap;
}

.devices-meta-sub {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--muted, #64748b);
  line-height: 1.4;
}

.devices-meta-sub--warn {
  color: #ea580c;
}

.devices-page-main {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  min-width: 0;
}

.devices-page-section {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.devices-section-head {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.devices-section-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
}

.devices-section-desc {
  margin: 0;
  font-size: 0.8125rem;
  color: #64748b;
}

.devices-section-foot {
  margin: 0;
  font-size: 0.8125rem;
  color: #64748b;
}

.devices-manage-link {
  color: #4f46e5;
  text-decoration: none;
}

.devices-manage-link:hover {
  text-decoration: underline;
}

.devices-info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.devices-info-grid--hosts {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  border-bottom: none;
}

.devices-info-grid--hosts-row {
  align-items: stretch;
}

.devices-info-grid--hosts-row .corp-channel {
  height: 100%;
  padding: 8px 16px;
}

.devices-info-grid--hosts-row .corp-channel-head {
  margin-bottom: 4px;
}

.devices-info-grid--hosts-row:not(.devices-info-grid--hosts-footer) .corp-channel {
  padding-bottom: 4px;
}

.devices-info-grid--hosts-footer .corp-channel {
  padding-top: 4px;
  padding-bottom: 10px;
}

.devices-info-grid--hosts-footer {
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

body[data-page="hosts"] .corp-card-grid {
  align-items: start;
}

@supports (grid-template-rows: subgrid) {
  body[data-page="hosts"] .corp-card-grid > .devices-card {
    display: grid;
    grid-template-rows: subgrid;
    grid-row: span 3;
    height: auto;
  }
}

.devices-card-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 16px;
}

.devices-card-brand--hosts {
  flex: 1;
  min-width: 0;
}

.devices-card-brand--hosts .corp-card-meta {
  flex: 1;
  min-width: 0;
}

.devices-card-brand--hosts .devices-meta-sub {
  word-break: break-word;
  overflow-wrap: anywhere;
}

.devices-info-grid--hosts .corp-channel-msg {
  display: block;
  overflow: visible;
  -webkit-line-clamp: unset;
  -webkit-box-orient: unset;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.corp-card-title-row--host {
  margin-bottom: 2px;
  width: 100%;
}

.devices-runtime-side--start {
  align-items: flex-start;
  align-self: start;
  text-align: left;
  flex-shrink: 0;
  min-width: 8.5em;
}

.devices-runtime-side--start .devices-status-stack {
  align-items: flex-start;
}

.devices-status-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.devices-status-line {
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
  white-space: nowrap;
}

.devices-status-label {
  color: #94a3b8;
  font-weight: 500;
}

.devices-status-text {
  font-weight: 600;
  color: var(--text, #0f172a);
}

.devices-status-text--on {
  color: #059669;
}

.devices-status-text--warn {
  color: #d97706;
}

.devices-card--clickable {
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition:
    background 0.22s ease,
    border-color 0.22s ease,
    box-shadow 0.22s ease;
}

.devices-card--clickable::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: transparent;
  transition: background 0.22s ease;
}

.devices-card--clickable:hover,
.devices-card--clickable:focus-within:not(.is-editing-name) {
  background: rgba(99, 102, 241, 0.035);
  border-color: rgba(99, 102, 241, 0.28);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.1);
}

.devices-card--clickable:hover::before,
.devices-card--clickable:focus-within:not(.is-editing-name)::before {
  background: #6366f1;
}

.devices-card--clickable.is-editing-name {
  cursor: default;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.devices-card--clickable:focus-visible {
  outline: 2px solid rgba(99, 102, 241, 0.55);
  outline-offset: 2px;
}

.devices-switch-labeled {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.devices-switch-label {
  font-size: 12px;
  color: var(--muted, #94a3b8);
  user-select: none;
  min-width: 28px;
  text-align: center;
}

.devices-switch-labeled:has(input:not(:checked)) .devices-switch-label[data-side="off"] {
  color: var(--text, #0f172a);
  font-weight: 600;
}

.devices-switch-labeled:has(input:checked) .devices-switch-label[data-side="on"] {
  color: #6366f1;
  font-weight: 600;
}

.devices-switch-labeled .archive-switch-ui input:disabled + .archive-switch-track {
  opacity: 0.55;
  cursor: not-allowed;
}

.host-name-field {
  flex: 1;
  min-width: 0;
  width: 100%;
}

.host-display-name {
  display: block;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 2px 6px;
  margin-left: -6px;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: text;
  word-break: break-word;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}

.host-display-name:hover {
  background: rgba(99, 102, 241, 0.08);
  border-color: rgba(99, 102, 241, 0.22);
  color: #4338ca;
}

.host-display-name:focus-visible {
  outline: none;
  background: rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.35);
}

.host-display-name.is-editing,
.host-display-name[contenteditable="true"] {
  cursor: text;
  background: #fff;
  border-color: rgba(99, 102, 241, 0.45);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
  outline: none;
}

.host-display-name.is-saving {
  opacity: 0.65;
  pointer-events: none;
}

.devices-info-grid .corp-channel + .corp-channel {
  border-left: 1px solid rgba(148, 163, 184, 0.14);
}

@media (max-width: 640px) {
  .devices-info-grid {
    grid-template-columns: 1fr;
  }

  .devices-info-grid .corp-channel + .corp-channel {
    border-left: none;
    border-top: 1px solid rgba(148, 163, 184, 0.14);
  }
}

.corp-card-foot--devices {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (min-width: 720px) {
  .corp-card-foot--devices {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

body.archive-modal-open {
  overflow: hidden;
}

.archive-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.archive-modal[hidden] {
  display: none !important;
}

.archive-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.55);
  backdrop-filter: blur(4px);
}

.archive-modal-panel {
  position: relative;
  width: min(100%, 560px);
  max-height: min(92vh, 820px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: #fff;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.28);
}

.archive-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.archive-modal-head h2 {
  margin: 0;
  font-size: 16px;
}

.archive-modal-close {
  border: none;
  background: transparent;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  color: #64748b;
  padding: 0 4px;
}

.archive-modal-body {
  overflow-y: auto;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.archive-form-section h3 {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
}

.archive-form-hint {
  margin: 0 0 10px;
  font-size: 11px;
  line-height: 1.45;
  color: var(--muted, #64748b);
}

.archive-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 600;
}

.archive-field .req {
  color: #dc2626;
  font-style: normal;
}

.archive-modal-body .archive-field input,
.archive-modal-body .archive-field textarea {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 400;
  background: #fff;
  color: inherit;
  font-family: inherit;
}

.archive-modal-body .archive-field textarea {
  resize: vertical;
  min-height: 72px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

.archive-modal-body .archive-field input:focus,
.archive-modal-body .archive-field textarea:focus {
  outline: none;
  border-color: rgba(99, 102, 241, 0.55);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.archive-form-block {
  padding: 14px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(248, 250, 252, 0.75);
}

.archive-form-block-title {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 700;
}

.archive-form-block-hint {
  margin: 0 0 10px;
  font-size: 11px;
  line-height: 1.45;
  color: var(--muted, #64748b);
}

.archive-enable-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(248, 250, 252, 0.75);
}

.archive-enable-box strong {
  display: block;
  font-size: 15px;
  margin-bottom: 2px;
}

.archive-enable-box p {
  margin: 0;
  font-size: 12px;
  color: var(--muted, #64748b);
}

.archive-switch-ui {
  position: relative;
  display: inline-flex;
  cursor: pointer;
}

.archive-switch-ui input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.archive-switch-track {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.45);
  transition: background 0.2s ease;
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.25);
}

.archive-switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #fff;
  transition: transform 0.2s ease;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.18);
}

.archive-switch-ui input:checked + .archive-switch-track {
  background: #6366f1;
}

.archive-switch-ui input:checked + .archive-switch-track::after {
  transform: translateX(20px);
}

.archive-modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 18px 16px;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
}

/* —— 消息媒体预览 —— */
.feed-participants {
  margin: 0 0 8px;
}

.feed-text {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.feed-caption {
  margin: 8px 0 0;
  padding-top: 8px;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
  font-size: 12px;
}

.feed-image {
  display: block;
  max-width: min(100%, 280px);
  max-height: 18rem;
  border-radius: 10px;
  object-fit: contain;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(148, 163, 184, 0.08);
}

.feed-emotion {
  display: block;
  width: 6rem;
  height: 6rem;
  border-radius: 10px;
  object-fit: contain;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(148, 163, 184, 0.06);
}

.feed-video {
  display: block;
  max-width: min(100%, 320px);
  max-height: 14rem;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(0, 0, 0, 0.75);
}

.feed-voice-player {
  max-width: min(100%, 320px);
}

.feed-voice-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 10px;
  background: rgba(148, 163, 184, 0.08);
  padding: 8px 12px;
  cursor: pointer;
  text-align: left;
  color: inherit;
  font: inherit;
}

.feed-voice-btn:hover:not(:disabled) {
  background: rgba(99, 102, 241, 0.08);
}

.feed-voice-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.feed-voice-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.12);
  color: #6366f1;
  font-size: 12px;
}

.feed-voice-label {
  font-size: 13px;
  font-weight: 600;
}

.feed-voice-hint {
  margin: 4px 0 0;
  font-size: 11px;
  color: #dc2626;
}

.feed-file-card {
  display: block;
  max-width: min(100%, 360px);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 10px;
  background: rgba(148, 163, 184, 0.06);
  text-decoration: none;
  color: inherit;
  overflow: hidden;
}

.feed-file-card:hover {
  border-color: rgba(99, 102, 241, 0.35);
  background: rgba(99, 102, 241, 0.06);
}

.feed-file-preview {
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  padding: 8px;
  background: rgba(148, 163, 184, 0.05);
}

.feed-file-preview img {
  display: block;
  margin: 0 auto;
  max-height: 10rem;
  max-width: 100%;
  border-radius: 8px;
  object-fit: contain;
}

.feed-file-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
}

.feed-file-icon {
  font-size: 22px;
  line-height: 1;
}

.feed-file-name {
  display: block;
  font-size: 13px;
  font-weight: 600;
  word-break: break-all;
}

.feed-file-badge {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: var(--muted, #64748b);
}

.home-copy--portals {
  width: min(100%, 720px) !important;
}

.home-portals {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 28px;
}

.home-portal-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px 18px;
  border-radius: 16px;
  border: 1px solid rgba(129, 140, 248, 0.28);
  background: rgba(7, 11, 20, 0.45);
  text-decoration: none;
  color: #e2e8f0;
  transition: transform 0.25s, border-color 0.25s, background 0.25s;
}

.home-portal-card--accent {
  border-color: rgba(56, 189, 248, 0.35);
}

.home-portal-card:hover {
  transform: translateY(-2px);
  border-color: rgba(165, 180, 252, 0.55);
  background: rgba(99, 102, 241, 0.12);
}

.home-portal-icon {
  font-size: 22px;
  line-height: 1;
}

.home-portal-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.home-portal-desc {
  font-size: 11px;
  color: rgba(226, 232, 240, 0.65);
  line-height: 1.45;
  flex: 1;
}

.home-portal-action {
  font-size: 11px;
  font-weight: 600;
  color: #a5b4fc;
  margin-top: 4px;
}

@media (min-width: 768px) {
  .home-copy--portals {
    margin-right: clamp(320px, 28vw, 520px) !important;
  }
}

@media (max-width: 767px) {
  .home-portals {
    margin-top: 20px;
  }
}
