/* ═══════════════════════════════════════════
   Hyper-V Monitor — 样式表
   ═══════════════════════════════════════════ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font: 14px 'Microsoft YaHei UI', 'Microsoft YaHei', -apple-system, sans-serif;
  background: #f0f2f5;
  color: #222;
}

/* ── 登录页 ── */
#loginBox {
  max-width: 380px;
  margin: 120px auto;
  background: #fff;
  padding: 36px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  text-align: center;
}

#loginBox h2 {
  margin-bottom: 20px;
  font-size: 20px;
  color: #333;
}

#loginBox input {
  width: 100%;
  padding: 12px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  margin-bottom: 14px;
  font-size: 15px;
  outline: none;
  transition: border 0.2s;
}

#loginBox input:focus {
  border-color: #4a90d9;
}

#loginBox button {
  width: 100%;
  padding: 12px;
  background: #4a90d9;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  cursor: pointer;
  font-weight: 600;
}

#loginBox button:hover {
  background: #3a7bc8;
}

#loginBox .err {
  color: #e53e3e;
  font-size: 13px;
  margin-top: 8px;
  min-height: 20px;
}

#loginBox .hint {
  color: #999;
  font-size: 12px;
  margin-top: 12px;
}

/* ── 主应用 ── */
#app {
  display: none;
}

/* ── 顶栏 ── */
.header {
  background: #1a1d2e;
  color: #fff;
  padding: 14px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header h1 {
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.header h1 b {
  color: #4da3ff;
}

.header .meta {
  font-size: 12px;
  color: #889;
}

/* ── 主内容区 ── */
.main {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 44px);
  overflow: hidden;
}

/* ── 冻结面板（工具栏 + 图表）── */
.sticky-panel {
  flex-shrink: 0;
  background: #f0f2f5;
  padding-top: 14px;
  padding-bottom: 8px;
}

/* ── 内容区可滚动 ── */
#content {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 20px;
}

/* ── 主机卡片表头冻结 ── */
.hostcard .card-head {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #f8f9fb;
}

/* ── 工具栏 ── */
.toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  align-items: center;
  flex-wrap: wrap;
}

.toolbar input,
.toolbar select {
  padding: 7px 12px;
  border: 1px solid #d0d0d0;
  border-radius: 6px;
  font-size: 13px;
  outline: none;
  background: #fff;
}

.toolbar button {
  padding: 7px 14px;
  border: 1px solid #d0d0d0;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
}

.toolbar button:hover {
  background: #eef3ff;
}

.toolbar button.red {
  background: #fff0f0;
  border-color: #fcc;
  color: #c33;
}

.toolbar button.red:hover {
  background: #ffe0e0;
}

.toolbar .tick {
  font-size: 12px;
  color: #888;
  margin-left: auto;
}

/* ── 卡片 ── */
.card {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  margin-bottom: 14px;
  overflow: hidden;
}

.card-head {
  padding: 10px 20px;
  background: #f8f9fb;
  border-bottom: 1px solid #e8eaed;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 13px;
  color: #555;
  cursor: pointer;
}

.card-head:hover {
  background: #f0f3f8;
}

.card-head .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  flex-shrink: 0;
}

.card-head .dot.dot-offline {
  background: #e53e3e;
  animation: dot-blink 1.5s infinite;
}

@keyframes dot-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.card-head span {
  color: #999;
  font-weight: 400;
  font-size: 11px;
}

/* ── 表格 ── */
table {
  width: 100%;
  border-collapse: collapse;
}

th {
  background: #f1f3f5;
  padding: 9px 14px;
  text-align: left;
  font-size: 12px;
  color: #666;
  font-weight: 700;
  border-bottom: 2px solid #dee2e6;
  cursor: pointer;
  white-space: nowrap;
  letter-spacing: 0.3px;
}

th:hover {
  color: #4a90d9;
}

td {
  padding: 8px 14px;
  border-bottom: 1px solid #f0f1f2;
  font-size: 13px;
  white-space: nowrap;
}

tr:nth-child(even) td {
  background: #fafbfc;
}

tr:hover td {
  background: #eef3ff !important;
}

tr.sum td {
  background: #e8f4fd !important;
  font-weight: 700;
  border-top: 2px solid #4a90d9;
  font-size: 13px;
}

td.nm {
  font-family: 'Microsoft YaHei UI', Consolas, monospace;
  font-size: 13px;
  color: #333;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
}

td.nu {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-family: Consolas, monospace;
  font-size: 13px;
}

td.nu.r1 { font-weight: 700; color: #34d399; }
td.nu.r2 { font-weight: 700; color: #fcd34d; }

td.nu.ip {
  font-size: 12px;
  color: #333;
  font-family: Consolas, monospace;
}

tr.vr {
  transition: background 0.15s;
}

.disk-detail-hidden { display: none !important; }

/* ── 折叠状态 ── */
.collapsed table {
  display: none;
}

.collapsed .card-head {
  border-bottom: none;
}

/* ── 空状态 ── */
.empty {
  text-align: center;
  padding: 50px;
  color: #999;
  font-size: 14px;
}

/* ── 页脚 ── */
.footer {
  text-align: center;
  padding: 12px;
  color: #bbb;
  font-size: 11px;
}

/* ── 图表卡片 ── */
#chartCard canvas {
  display: block;
  width: 100%;
  background: #f3f4f6;
}

/* ── 改密弹窗 ── */
#chPwdBox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 999;
  align-items: center;
  justify-content: center;
}

#chPwdBox > div {
  background: #fff;
  padding: 24px;
  border-radius: 10px;
  width: 300px;
}

#chPwdBox h3 {
  margin-bottom: 12px;
  font-size: 15px;
}

#chPwdBox input {
  width: 100%;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 6px;
  margin-bottom: 8px;
  font-size: 13px;
  outline: none;
}

#chPwdBox .row {
  display: flex;
  gap: 8px;
}

#chPwdBox .row button {
  flex: 1;
  padding: 8px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: 12px;
}

#chPwdBox .row .btn1 {
  background: #4a90d9;
  color: #fff;
}

#chPwdBox .row .btn2 {
  background: #eee;
  color: #666;
}

#chPwdBox .msg {
  font-size: 12px;
  margin-top: 8px;
  color: #e53e3e;
}

/* ── 分组管理弹窗 ── */
#groupMgrBox {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.3);
  z-index: 999;
  align-items: center;
  justify-content: center;
}
#groupMgrBox > div {
  background: #fff;
  padding: 24px;
  border-radius: 10px;
  width: 420px;
  max-height: 80vh;
  overflow-y: auto;
}
#groupMgrBox h3 { margin-bottom: 12px; font-size: 15px; }
#groupMgrBox input { width: 100%; padding: 8px; border: 1px solid #ddd; border-radius: 6px; font-size: 12px; outline: none; }
#groupMgrBox select { padding: 4px 8px; border: 1px solid #ddd; border-radius: 4px; font-size: 11px; }
#groupMgrBox button { padding: 6px 12px; border: 1px solid #d0d0d0; border-radius: 4px; background: #fff; cursor: pointer; font-size: 11px; }
#groupMgrBox button:hover { background: #eef3ff; }
#groupMgrBox .msg { font-size: 11px; margin-top: 6px; color: #16a34a; }
