:root {
  --bg: #f8fafc;
  --card: #fff;
  --muted: #6b7280;
  --text: #111827;
  --brand: #4f46e5;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 60%);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  line-height: 1.4;
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 20px;
  position: relative;
}

.softbg {
  position: absolute;
  inset: 0;
  top: -80px;
  height: 180px;
  pointer-events: none;
  opacity: .7;
  z-index: 0;
}

.softbg > div {
  max-width: 1080px;
  margin: 0 auto;
  height: 100%;
  filter: blur(24px);
  border-radius: 24px;
  background: linear-gradient(
    90deg,
    #eff6ff 0%,
    #eef2ff 50%,
    #ecfdf5 100%
  );
}

h1 {
  font-size: 22px;
  margin: 0 0 4px 0;
  font-weight: 600;
  position: relative;
  z-index: 1;
}

.brand {
  color: var(--brand);
}

.muted {
  color: var(--muted);
  font-size: 14px;
  position: relative;
  z-index: 1;
}

.row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  position: relative;
  z-index: 1;
}

.smallrightinfo {
  font-size:12px;
  color:var(--muted);
  max-width:220px;
  line-height:1.4;
  text-align:right;
}

.grow {
  flex: 1;
}

.card {
  background: var(--card);
  border: 1px solid #eee;
  border-radius: 14px;
  box-shadow: 0 4px 10px rgba(0,0,0,.04);
  padding: 14px;
}

.card h3 {
  margin: 0 0 8px 0;
  font-size: 15px;
  display: flex;
  gap: 8px;
  align-items: center;
  font-weight: 600;
}

.badge {
  border-radius: 999px;
  padding: 2px 8px;
  border: 1px solid #e5e7eb;
  font-size: 12px;
  line-height: 1.2;
  font-weight: 500;
  display: inline-block;
}

.badge.warn {
  background: #fff7ed;
  border-color: #fdba74;
  color: #9a3412;
}

.badge.danger {
  background: #fee2e2;
  border-color: #fecaca;
  color: #7f1d1d;
}

.tabbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.tab {
  background: #fff;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 13px;
  line-height: 1.2;
  font-weight: 500;
  color: var(--text);
}

.tab.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.avatars {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.avatar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 14px;
  border: 1px solid transparent;
  background: #fff;
  font-size: 13px;
  line-height: 1.2;
  font-weight: 500;
  color: var(--text);
}

.avatar.active {
  border-color: #c7d2fe;
  box-shadow: 0 4px 10px rgba(99,102,241,.2);
  background: radial-gradient(circle at 0% 0%, #f0f9ff 0%, #eef2ff 50%, #ffffff 100%);
}

.kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 12px;
  margin-top: 8px;
  font-size: 13px;
}

.progress {
  height: 10px;
  background: #eef2ff;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress > div {
  height: 100%;
  background: #6366f1;
}

.grid {
  display: grid;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.grid.cols-3 {
  grid-template-columns: 1fr;
}

@media(min-width:900px){
  .grid.cols-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

.alert {
  position: fixed;
  right: 16px;
  top: 16px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 12px;
  padding: 10px 12px;
  display: none;
  font-size: 13px;
  line-height: 1.4;
  color: #78350f;
  box-shadow: 0 10px 20px rgba(0,0,0,.08);
  max-width: 240px;
  z-index: 10;
}

.big {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
}

.kv {
  display: flex;
  justify-content: space-between;
  margin: 4px 0;
  font-size: 14px;
  line-height: 1.4;
}

.kv .k {
  color: var(--muted);
  font-weight: 400;
}

.kv .v {
  font-weight: 600;
  color: var(--text);
}

.foot {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

/* 顶部导航栏 */
.navbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  position: relative;
  z-index: 2;
}
.navitem {
  font-size: 13px;
  line-height:1.2;
  background:#fff;
  border-radius: 10px;
  border:1px solid #e5e7eb;
  padding:6px 10px;
  text-decoration:none;
  color:var(--text);
  font-weight:500;
  box-shadow:0 2px 6px rgba(0,0,0,.03);
}
.navitem.active {
  background: var(--brand);
  border-color: var(--brand);
  color:#fff;
  box-shadow:0 4px 10px rgba(99,102,241,.3);
}

/* 历史表格 */
.datatable {
  border-collapse: collapse;
  width: 100%;
  min-width: 600px;
  font-size: 13px;
}
.datatable th {
  text-align: left;
  background:#f9fafb;
  color: var(--muted);
  font-weight:500;
  border-bottom:1px solid #e5e7eb;
  padding:8px;
  white-space:nowrap;
}
.datatable td {
  border-bottom:1px solid #f1f5f9;
  padding:8px;
  white-space:nowrap;
  color: var(--text);
}
.datatable.compact th,
.datatable.compact td{
  padding:6px 8px;
  font-size:12px;
}

/* 小滚动容器，用于1小时样本列表 */
.scrollbox {
  max-height: 220px;
  overflow-y: auto;
  border:1px solid #f1f5f9;
  border-radius:10px;
}

/* 节点卡片 */
.nodesgrid {
  display:flex;
  flex-wrap:wrap;
  gap:12px;
}
.nodecard {
  flex:1 1 240px;
  min-width:240px;
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:12px;
  box-shadow:0 4px 10px rgba(0,0,0,.04);
  padding:12px;
  font-size:13px;
  line-height:1.4;
}
.nodecard .title {
  font-weight:600;
  font-size:14px;
  margin-bottom:4px;
}
.nodecard .status {
  font-size:12px;
  font-weight:500;
  display:inline-block;
  border-radius:999px;
  border:1px solid #e5e7eb;
  padding:2px 8px;
}
.nodecard .status.online {
  background:#ecfdf5;
  border-color:#6ee7b7;
  color:#065f46;
}
.list {
  margin:0;
  padding-left:20px;
  font-size:13px;
  line-height:1.5;
  color:var(--text);
}
.list li {
  margin-bottom:4px;
  color:var(--text);
}

/* 链接去下划线（导航条更干净） */
a.navitem {
  text-decoration: none;
  color: inherit;
}

/* 双列布局，用于 降水 + 地图 这一排 */
.grid.cols-2-map {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  position: relative;
  z-index: 1;
  margin-bottom: 24px;
}

@media(min-width:900px){
  .grid.cols-2-map {
    grid-template-columns: 1fr 1fr;
  }
}

/* 降水卡片内折线图容器，固定高度方便 Chart.js 自适应 */
.precipchartwrap {
  width: 100%;
  height: 160px;
  border: 1px solid #eef2ff;
  border-radius: 10px;
  padding: 8px;
  background: radial-gradient(circle at 0% 0%, #f8f9ff 0%, #ffffff 60%);
  box-shadow: 0 4px 10px rgba(99,102,241,.08);
  margin: 12px 0;
}

/* 3D 地图卡片里的容器 */
.map3d-card {
  width: 100%;
  height: 260px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: radial-gradient(circle at 0% 0%, #f0f9ff 0%, #eef2ff 50%, #ffffff 100%);
  box-shadow: 0 10px 20px rgba(99,102,241,.15);
  margin-bottom: 12px;
  position: relative;
  overflow: hidden;
}
