:root {
  --bg: #f5f7f2;
  --panel: #ffffff;
  --ink: #17324d;
  --muted: #5f6d7f;
  --line: #d4dde7;
  --line-soft: #e7edf4;
  --accent: #0f766e;
  --accent-strong: #0b5f59;
  --accent-soft: #d8f3ee;
  --shadow-soft: 0 8px 24px rgba(16, 42, 67, 0.07);
  --shadow-float: 0 10px 24px rgba(15, 118, 110, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Avenir Next", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 0% 0%, #dff5f2 0%, transparent 40%),
    radial-gradient(circle at 100% 18%, #fdf0d5 0%, transparent 35%),
    var(--bg);
  max-width: 1680px;
  margin-inline: auto;
}

.hero {
  padding: 20px 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
  margin: 12px 14px 10px;
  background: linear-gradient(120deg, #ffffff, #eef9f8 55%, #fff6e7);
  box-shadow: var(--shadow-soft);
}

.hero h1 {
  margin: 0 0 8px;
  font-size: 26px;
}

.hero p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

.filters {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
  padding: 6px 14px 14px;
  align-items: stretch;
}

.filters > * {
  min-width: 0;
}

.filters label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
}

select,
input[type="date"],
button {
  border: 1px solid #cdd7e3;
  border-radius: 10px;
  padding: 9px 10px;
  font-size: 14px;
  background: #fff;
  transition: all 0.2s ease;
  min-width: 0;
  width: 100%;
}

select:focus,
input[type="date"]:focus,
button:focus {
  outline: none;
  border-color: #8fd8cf;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
}

button {
  cursor: pointer;
  background: linear-gradient(145deg, var(--accent), var(--accent-strong));
  color: #fff;
  border-color: transparent;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(15, 118, 110, 0.25);
}

button:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-float);
}

.cards {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  padding: 0 14px 14px;
}

.data-health {
  margin: 2px 14px 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #f7d7a7;
  background: #fff8ec;
  color: #9a5a00;
  font-size: 13px;
  line-height: 1.4;
}

.data-health.hidden {
  display: none;
}

.cards > * {
  min-width: 0;
}

.card {
  background: linear-gradient(170deg, #fff, #f9fcff);
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  padding: 8px 10px;
  min-height: 67px;
  box-shadow: var(--shadow-soft);
}

.card .label {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.2px;
}

.card .value {
  margin-top: 4px;
  font-size: clamp(13px, 1.2vw, 15px);
  font-weight: 600;
  line-height: 1.2;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.card .value-id {
  font-size: clamp(10px, 1.25vw, 14px);
  letter-spacing: 0.2px;
}

.panel {
  margin: 12px 14px;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  padding: 14px;
  box-shadow: var(--shadow-soft);
}

h2 {
  margin: 2px 0 12px;
  font-size: 16px;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
}

th,
td {
  border-bottom: 1px solid var(--line-soft);
  padding: 9px;
  font-size: 13px;
  text-align: left;
}

th {
  background: linear-gradient(180deg, var(--accent-soft), #eaf8f5);
  color: #1d4f4b;
  font-weight: 700;
}

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

tr:hover td {
  background: #f2faf8;
}

tr.total-row td {
  background: #eef7f5 !important;
  border-top: 2px solid #c7e5df;
}

.model-color-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 12px;
}

.model-color-sv {
  background: #f1f3f6;
  color: #5a6271;
  border-color: #d9dee7;
}

.model-color-og {
  background: #fff1e6;
  color: #a54a00;
  border-color: #ffd2ae;
}

.model-color-bl {
  background: #e9f2ff;
  color: #1f4f95;
  border-color: #bfd6fa;
}

.model-color-unknown {
  background: #f3f4f6;
  color: #6b7280;
  border-color: #d9dde3;
}

#colorTable th.capacity-st-head {
  background: linear-gradient(180deg, #d6f4ee, #c7eee5);
  color: #0d5f57;
}

#colorTable td.capacity-st-cell {
  background: linear-gradient(180deg, #f2fcf9, #e7f8f3);
  color: #0d5f57;
  font-weight: 700;
  font-size: 15.6px;
  text-align: center;
  border-left: 1px solid #cfe9e2;
}

#colorTable tr:hover td.capacity-st-cell {
  background: linear-gradient(180deg, #e7f8f3, #dcf4ec);
}

#pnlCapacityTable th,
#pnlCapacityTable td {
  white-space: nowrap;
}

.abbr-help {
  display: inline-block;
  border-bottom: 1px dotted rgba(23, 50, 77, 0.55);
  cursor: default;
  text-decoration: none;
  outline: none;
}

.abbr-help:focus-visible {
  box-shadow: 0 0 0 2px rgba(24, 121, 115, 0.25);
  border-radius: 3px;
}

.heox-tooltip {
  position: fixed;
  z-index: 9999;
  max-width: 260px;
  background: #17324d;
  color: #fff;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.35;
  box-shadow: 0 8px 24px rgba(11, 27, 42, 0.25);
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.14s ease, transform 0.14s ease;
}

.heox-tooltip.visible {
  opacity: 1;
  transform: translateY(0);
}

#pnlCapacityTable th {
  font-size: 11px;
  padding: 8px 9px;
  letter-spacing: 0.15px;
}

#pnlCapacityTable td {
  padding: 8px 9px;
}

#pnlCapacityTable th:first-child,
#pnlCapacityTable td:first-child {
  min-width: 170px;
}

.trend {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.trendControls {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 10px;
}

.trendControls label {
  display: grid;
  gap: 6px;
  font-size: 11px;
  color: var(--muted);
}

.bar {
  background: linear-gradient(180deg, #f3f7fc, #eef4fb);
  border-radius: 10px;
  padding: 10px;
  border: 1px solid var(--line-soft);
}

@media (min-width: 1100px) {
  .filters button#refreshBtn {
    min-height: 100%;
  }
}

.bar .meta {
  font-size: 12px;
  color: var(--muted);
}

.bar .fillWrap {
  margin-top: 8px;
  height: 10px;
  background: #e3e8ef;
  border-radius: 999px;
  overflow: hidden;
}

.bar .fill {
  height: 100%;
  background: var(--accent);
}

.note {
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 900px) {
  .filters {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .cards {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .panel {
    margin: 10px 10px;
  }

  .hero,
  .filters,
  .cards {
    padding-left: 10px;
    padding-right: 10px;
  }

  .trend {
    grid-template-columns: 1fr;
  }

  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}

@media (max-width: 560px) {
  .filters {
    grid-template-columns: 1fr;
  }

  .cards {
    grid-template-columns: 1fr;
  }

  .hero {
    margin: 10px 10px 8px;
    border-radius: 14px;
    padding: 18px 14px;
  }
}
