/* 安装统计：跟壳的 Ant Design + data-theme 走，只补仪表盘排版 */

#xy-installs-root {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 64px);
}

.xy-installs-page {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  min-height: 0;
  width: 100%;
}

.xy-installs-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.xy-installs-title {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary, #303133);
}

.xy-installs-sub {
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary, #909399);
}

.xy-installs-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  flex: 0 0 auto;
}

@media (max-width: 1200px) {
  .xy-installs-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.xy-stat {
  position: relative;
  overflow: hidden;
  background: var(--bg-card, #fff);
  border: 1px solid var(--border-primary, #f0f0f0);
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  padding: 14px 16px 12px 18px;
  min-height: 92px;
}

.xy-stat::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--color-primary, #3a71a8);
}

.xy-stat[data-tone="blue"]::before { background: var(--color-primary, #3a71a8); }
.xy-stat[data-tone="red"]::before { background: var(--color-error, #c03639); }
.xy-stat[data-tone="green"]::before { background: var(--color-success, #30b08f); }
.xy-stat[data-tone="ok"]::before { background: #52c41a; }
.xy-stat[data-tone="slate"]::before { background: #8c8c8c; }
.xy-stat[data-tone="gold"]::before { background: var(--color-warning, #fec171); }

.xy-stat .ant-statistic-title {
  margin-bottom: 8px;
  font-size: 13px;
}

.xy-stat .ant-statistic-content-value {
  font-size: 26px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  color: var(--text-primary, #303133);
}

.xy-stat[data-tone="blue"] .ant-statistic-content-value { color: var(--color-primary, #3a71a8); }
.xy-stat[data-tone="red"] .ant-statistic-content-value { color: var(--color-error, #c03639); }
.xy-stat[data-tone="green"] .ant-statistic-content-value { color: var(--color-success, #30b08f); }
.xy-stat[data-tone="ok"] .ant-statistic-content-value { color: #52c41a; }
.xy-stat[data-tone="gold"] .ant-statistic-content-value { color: #d48806; }

.xy-installs-toolbar.ant-card .ant-card-body {
  padding: 12px 16px;
}

.xy-installs-toolbar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
}

.xy-installs-label {
  font-size: 13px;
  color: var(--text-secondary, #909399);
}

.xy-installs-date {
  width: 136px;
}

.xy-installs-table-card {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 360px;
}

.xy-installs-table-card .ant-card-head {
  flex: 0 0 auto;
}

.xy-installs-table-card .ant-card-body {
  flex: 1;
  padding: 0 !important;
  overflow: auto;
}

.xy-installs-loading,
.xy-installs-empty {
  padding: 48px 16px;
  text-align: center;
  color: var(--text-secondary, #909399);
}

.xy-grid {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 13px;
  background: var(--bg-card, #fff);
  color: var(--text-primary, #303133);
}

.xy-grid th,
.xy-grid td {
  border: 1px solid #e2e8f0 !important;
  padding: 11px 12px;
  line-height: 1.4;
}

.xy-grid th {
  background: #f8fafc;
  color: #64748b;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
}

.xy-grid td.name {
  text-align: left;
  font-weight: 500;
}

.xy-grid td.num,
.xy-grid th + th {
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.xy-grid td.strong {
  font-weight: 600;
}

.xy-grid td.muted {
  color: #94a3b8;
}

.xy-grid td.tone-off {
  color: var(--color-error, #c03639);
}

.xy-grid td.tone-on {
  color: var(--color-success, #30b08f);
}

.xy-grid tbody tr:nth-child(even) td {
  background: #f8fafc;
}

.xy-grid tbody tr:hover td {
  background: #eef6ff;
}

.xy-grid tfoot td {
  background: #f1f5f9;
  font-weight: 600;
}

.xy-cell-bar {
  height: 8px;
  border-radius: 99px;
  background: #e2e8f0;
  overflow: hidden;
}

.xy-cell-bar i {
  display: block;
  height: 100%;
  background: var(--color-primary, #3a71a8);
  border-radius: 99px;
}

[data-theme="dark"] .xy-grid th,
[data-theme="dark"] .xy-grid td {
  border-color: var(--border-primary, #30363d) !important;
}

[data-theme="dark"] .xy-grid th {
  background: var(--bg-tertiary, #21262d);
  color: var(--text-secondary, #8b949e);
}

[data-theme="dark"] .xy-grid tbody tr:nth-child(even) td,
[data-theme="dark"] .xy-grid tfoot td {
  background: var(--bg-tertiary, #21262d);
  color: var(--text-primary, #e6edf3);
}

/* 安装统计「设备分配情况」：bundle 里是裸 table + th 内联 #fafafa，暗色下字色继承成浅色 */
html[data-theme="dark"] .ant-layout-content .ant-card-body > .ant-spin-nested-loading table thead th,
html[data-theme="dark"] .ant-layout-content .ant-card-body table thead th {
  background: #21262d !important;
  color: #c9d1d9 !important;
  border-bottom: 1px solid #30363d !important;
}

html[data-theme="dark"] .ant-layout-content .ant-card-body table tbody td {
  color: #e6edf3 !important;
  border-bottom-color: #30363d !important;
}

html[data-theme="dark"] .ant-layout-content .ant-card-body table tbody tr:hover td {
  background: #1c2128 !important;
}

/* Ant Design Table（若其它页仍用） */
html[data-theme="dark"] .ant-layout-content .ant-table-thead > tr > th {
  background: #21262d !important;
  color: #c9d1d9 !important;
  border-bottom: 1px solid #30363d !important;
}

html[data-theme="dark"] .ant-layout-content .ant-table-tbody > tr > td {
  color: #e6edf3;
  border-bottom-color: #30363d !important;
}

html[data-theme="dark"] .ant-layout-content .ant-table-tbody > tr.ant-table-row:hover > td {
  background: #1c2128 !important;
}

html[data-theme="dark"] .ant-layout-content .ant-table-summary > tr > td,
html[data-theme="dark"] .ant-layout-content .ant-table-footer {
  background: #161b22 !important;
  color: #e6edf3 !important;
}

[data-theme="dark"] .xy-grid tbody tr:hover td {
  background: var(--bg-hover, #1f2937);
}

[data-theme="dark"] .xy-cell-bar {
  background: var(--bg-secondary, #161b22);
}
