/* 主机网格与卡片样式 */
.host-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin: 0 16px 24px;
  padding: 8px 0;
  overflow-x: hidden;
  overflow-y: auto;
  max-height: 60vh;
  align-content: flex-start;
  justify-content: flex-start;
  align-items: flex-start;
  width: 100%;
  /* 覆盖父级可能的居中对齐 */
  justify-self: stretch;
  align-self: start;
}

.main-content {
  position: relative;
  z-index: 10;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 80px);
  padding: 50px;
}

.host-card {
  position: relative;
  border-radius: 16px;
  padding: 16px;
  color: #e9edf1;
  border: 1px solid rgba(120, 140, 160, 0.25);
  box-shadow: none;
  transition: border-color 0.2s ease;
  background-image: linear-gradient(135deg, rgba(30, 42, 59, 0.45), rgba(22, 28, 40, 0.45)), url('../images/win_host.jpg');
  background-size: cover, cover;
  background-position: center, center;
  background-repeat: no-repeat, no-repeat;
  box-sizing: border-box;
  width: 480px;
  height: 270px;
  flex: 0 0 480px;
}
.host-card:hover { border-color: #4da3ff; }
.host-card.selected { border-color: #4da3ff; }

.host-card-header { display: flex; justify-content: space-between; align-items: center; }
.host-name { font-size: 20px; font-weight: 600; letter-spacing: 0.2px; color: #f5f7fa; }
.host-actions-top { display: flex; align-items: center; gap: 8px; }

.settings-btn {
  width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(120,140,160,0.25);
  cursor: pointer; transition: background 0.2s ease, transform 0.2s ease;
}
.settings-btn:hover { background: rgba(255,255,255,0.12); }
.settings-btn svg { width: 18px; height: 18px; color: #cbd5e1; }

.connect-area { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); margin: 0; }
.connect-btn {
  width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(ellipse at center, #2f7be2 0%, #1c4da0 100%);
  border: 1px solid rgba(77,163,255,0.55);
  box-shadow: 0 8px 18px rgba(35, 115, 220, 0.35);
  cursor: pointer; transition: background 0.2s ease, box-shadow 0.2s ease;
}
.connect-btn:hover { background: radial-gradient(ellipse at center, #3a8cff 0%, #2361d1 100%); box-shadow: 0 12px 24px rgba(35,115,220,0.42); }
.connect-btn:active { background: radial-gradient(ellipse at center, #55a6ff 0%, #2f7be2 100%); }
.connect-btn.clicked { animation: pulseGlow 600ms ease-out; }
@keyframes pulseGlow { 0% { box-shadow: 0 0 0 0 rgba(35,115,220,0.6); } 100% { box-shadow: 0 0 0 14px rgba(35,115,220,0); } }
.connect-btn svg { width: 26px; height: 26px; color: #e9f2ff; }

.host-net { position: absolute; left: 16px; right: 16px; bottom: 16px; font-size: 13px; line-height: 1.6; color: #d5dde6; }
.net-label { opacity: 0.85; }
.net-value { color: #f0f5ff; }
.icon { width: 16px; height: 16px; margin-right: 6px; color: #cbd5e1; vertical-align: -2px; }

/* 响应式优化：小屏移除内部滚动并收紧间距 */
@media (max-width: 1024px) {
  .host-grid {
    max-height: none;
    overflow-y: visible;
    gap: 16px;
    margin: 0 12px 20px;
  }
  /* 两列布局：卡片宽度按容器计算，避免右侧裁切 */
  .host-card {
    max-width: 480px;
    width: calc((100% - 16px) / 2);
    flex: 1 1 calc((100% - 16px) / 2);
    aspect-ratio: 16 / 9;
    height: auto;
  }
}

@media (max-width: 600px) {
  .host-grid { gap: 12px; margin: 0 8px 16px; }
  /* 单列：占满容器宽度 */
  .host-card { max-width: 100%; width: 100%; flex: 1 1 100%; aspect-ratio: 16 / 9; height: auto; }
}

/* 移动端内容区顶部对齐，避免居中造成空间浪费 */
@media (max-width: 768px) {
  .main-content { align-items: flex-start; justify-content: flex-start; padding: 16px 20px; }
}

/* Host card additions */
.host-card .status.online { color: #4caf50; }
.host-card .status.offline { color: #f44336; }
.host-card .host-mini-stats { font-size: 12px; opacity: 0.8; margin-top: 6px; }
.host-card .host-actions { margin-top: 10px; display: flex; gap: 8px; }

/* stats-section 已移除 */
