:root {
  color-scheme: light;
  --sidebar-width: 300px;
  --ink: #202622;
  --muted: #737c76;
  --line: #d6ddd8;
  --line-strong: #bac6be;
  --paper: #f3f5f2;
  --panel: #fff;
  --green: #2f7148;
  --green-dark: #1f5134;
  --green-soft: #e8f2eb;
  --green-pale: #f4f8f5;
  --side: #edf0ed;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
}

* { box-sizing: border-box; }
html, body { min-width: 320px; min-height: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  overflow: hidden;
  color: var(--ink);
  background:
    linear-gradient(rgba(47, 113, 72, .025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(47, 113, 72, .025) 1px, transparent 1px),
    var(--paper);
  background-size: 28px 28px, 28px 28px, auto;
}
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

.library-topbar {
  position: relative;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 52px;
  padding: 0 12px;
  border-bottom: 1px solid #0d1216;
  background: #1c252d;
  background-image: linear-gradient(180deg, #232c34, #1c252d);
  box-shadow: inset 0 -1px 0 #c4853a55;
  color: #e8eef2;
}
.library-brand { display: flex; flex: 0 0 auto; align-items: center; gap: 8px; color: #e8eef2; }
.library-brand img { border-radius: 4px; }
.library-brand > span { display: flex; align-items: center; }
.library-brand strong { font-size: 13px; font-weight: 650; }
.library-brand strong b { font-weight: 400; color: #9eb0bb; }
.library-topnav { display: flex; align-self: stretch; height: 100%; margin-right: auto; }
.library-topnav a {
  display: grid;
  place-items: center;
  padding: 0 14px;
  border-bottom: 2px solid transparent;
  border-left: 1px solid #3a4650;
  color: #9eb0bb;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}
.library-topnav a:first-of-type { border-left: 0; }
.library-topnav a:hover { color: #e8eef2; background: #ffffff0d; }
.library-topnav a[aria-current="page"] { color: #c4853a; border-bottom-color: #c4853a; }
.library-data-status {
  margin-left: auto;
  padding: 7px 10px;
  border: 1px solid #3a4650;
  color: #c5d2da;
  background: #24303a;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .05em;
}

.database-app {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  height: calc(100vh - 52px);
}

.database-sidebar {
  position: relative;
  z-index: 30;
  display: flex;
  min-height: 0;
  flex-direction: column;
  border-right: 1px solid #ccd4ce;
  background: rgba(235, 239, 235, .95);
}
.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 54px;
  padding: 0 18px;
  border-bottom: 1px solid #cfd7d1;
}
.sidebar-head strong { font-family: "Songti SC", STSong, serif; font-size: 17px; }
.sidebar-head span { color: #89918c; font-size: 10px; }
.sidebar-scroll { min-height: 0; flex: 1; overflow-y: auto; padding: 0 0 24px; scrollbar-width: thin; }
.nav-section-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 45px;
  margin: 0;
  padding: 0 18px;
  color: #424b45;
  cursor: pointer;
  list-style: none;
  font-size: 12px;
  font-weight: 800;
}
.nav-section-label::-webkit-details-marker { display: none; }
.nav-section-label span:last-child { display: flex; align-items: center; gap: 9px; color: #89918c; font-size: 10px; }
.nav-section-label b { font-weight: 700; }
.nav-section-label i { color: #58645c; font-size: 20px; font-style: normal; transition: transform 180ms ease; }
details[open] > .nav-section-label i { transform: rotate(90deg); }
.nav-item {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 10px;
  width: calc(100% - 20px);
  min-height: 43px;
  margin: 0 10px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 4px;
  color: #536058;
  background: transparent;
  cursor: pointer;
  text-align: left;
}
.nav-item:hover { color: var(--green-dark); border-color: #c8d1cb; background: #f8faf8; }
.nav-item.is-active { color: var(--green-dark); border-color: #aac2b2; background: #fff; font-weight: 800; }
.nav-item[data-kind="overview"] {
  min-height: 43px;
  margin-top: 10px;
  margin-bottom: 10px;
  color: #fff;
  border-color: #28623f;
  background: var(--green);
}
.nav-item[data-kind="overview"]:hover { color: #fff; border-color: var(--green-dark); background: var(--green-dark); }
.nav-item[data-kind="overview"] small { color: #dcebe1; }
.nav-item span { overflow: hidden; font-size: 12px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.nav-item small { padding-left: 9px; color: #929ca9; font-size: 10px; }
.nav-icon { position: relative; display: block; width: 18px; height: 18px; overflow: hidden; color: #748179; }
.nav-icon::before {
  position: absolute;
  inset: 2px;
  border: 2px solid currentColor;
  border-radius: 3px;
  background:
    linear-gradient(currentColor, currentColor) 50% 0 / 2px 100% no-repeat,
    linear-gradient(currentColor, currentColor) 0 50% / 100% 2px no-repeat;
  content: "";
}
.nav-item.is-active .nav-icon { color: var(--green-dark); }
.nav-item-monitor {
  margin-top: 6px;
  margin-bottom: 10px;
  color: var(--green-dark);
  border-color: #aec7b5;
  background: linear-gradient(90deg, #f7fbf8, #fff);
}
.nav-item-monitor:hover { color: #fff; border-color: var(--green-dark); background: var(--green); }
.nav-item-monitor small { color: var(--green); font-weight: 800; }
.nav-item-monitor:hover small { color: #e1efe5; }
.nav-monitor-icon {
  position: relative;
  display: block;
  width: 18px;
  height: 18px;
  border: 2px solid currentColor;
  border-radius: 50%;
}
.nav-monitor-icon::before,
.nav-monitor-icon::after {
  position: absolute;
  border-radius: 50%;
  background: currentColor;
  content: "";
}
.nav-monitor-icon::before { top: 3px; left: 3px; width: 4px; height: 4px; }
.nav-monitor-icon::after { right: 3px; bottom: 3px; width: 3px; height: 3px; }
.nav-item[data-kind="type"] .nav-icon::after,
.nav-item[data-kind="brand"] .nav-icon::after {
  content: none;
}
.nav-subgroup { border-top: 1px solid #d1d8d3; }
.nav-subgroup:last-of-type { border-bottom: 1px solid #d1d8d3; }
.nav-subgroup nav { padding: 0 0 10px; }
.sidebar-foot { display: grid; gap: 3px; padding: 11px 0; border-top: 1px solid var(--line); background: rgba(255, 255, 255, .42); }
.sidebar-foot .nav-item { min-height: 46px; }

.database-workspace { display: grid; grid-template-rows: 94px minmax(0, 1fr); min-width: 0; min-height: 0; }
.scope-bar {
  display: grid;
  grid-template-columns: minmax(270px, .7fr) minmax(320px, 1.8fr) 160px;
  align-items: center;
  gap: 16px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .72);
}
.scope-copy { min-width: 0; }
.scope-copy strong, .scope-copy small { display: block; }
.scope-copy strong { overflow: hidden; font-size: 16px; text-overflow: ellipsis; white-space: nowrap; }
.scope-copy small { margin-top: 4px; color: var(--muted); font-size: 11px; }
.scope-search {
  display: flex;
  align-items: center;
  min-height: 50px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  background: #fff;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
.scope-search:focus-within { border-color: var(--green); box-shadow: 0 0 0 2px rgba(47, 113, 72, .08); }
.scope-search::before { margin-right: 11px; color: #596c82; font-size: 25px; content: "⌕"; }
.scope-search input { min-width: 0; flex: 1; height: 48px; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 14px; }
.status-select { height: 50px; padding: 0 14px; border: 1px solid var(--line-strong); outline: 0; color: var(--ink); background: #fff; font-size: 13px; font-weight: 650; }

.data-stage { min-height: 0; overflow: auto; padding: 18px 24px 30px; scrollbar-width: thin; }
.air-quality-shortcut {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  margin-bottom: 12px;
  padding: 18px 20px;
  border: 1px solid #a8c5b1;
  border-left: 5px solid var(--green);
  background:
    linear-gradient(90deg, rgba(229, 243, 233, .96), rgba(255, 255, 255, .94) 62%),
    #fff;
  box-shadow: 0 8px 24px rgba(35, 81, 49, .06);
}
.air-quality-shortcut[hidden] { display: none; }
.air-quality-shortcut-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border: 1px solid #8fb59a;
  border-radius: 50%;
  background: #fff;
  box-shadow: inset 0 0 0 7px rgba(47, 113, 72, .08);
}
.air-quality-shortcut-mark::before {
  width: 18px;
  height: 18px;
  border: 3px solid var(--green);
  border-radius: 50%;
  content: "";
}
.air-quality-shortcut-mark span {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--green);
}
.air-quality-shortcut-mark span:nth-child(1) { top: 9px; left: 29px; }
.air-quality-shortcut-mark span:nth-child(2) { right: 9px; bottom: 18px; }
.air-quality-shortcut-mark span:nth-child(3) { bottom: 18px; left: 9px; }
.air-quality-shortcut-copy { min-width: 0; }
.air-quality-shortcut-eyebrow {
  display: block;
  margin-bottom: 4px;
  color: var(--green);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .09em;
}
.air-quality-shortcut h2 { margin: 0; color: #1f3226; font-size: 18px; }
.air-quality-shortcut p { margin: 6px 0 0; color: #627168; font-size: 11px; line-height: 1.65; }
.air-quality-shortcut-metrics { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.air-quality-shortcut-metrics span {
  padding: 4px 8px;
  border: 1px solid #c7d7cc;
  border-radius: 999px;
  color: #52665a;
  background: rgba(255, 255, 255, .78);
  font-size: 9px;
  font-weight: 750;
}
.air-quality-shortcut-action { display: grid; justify-items: end; gap: 10px; min-width: 190px; }
.air-quality-shortcut-action small { display: flex; align-items: center; gap: 6px; color: #6d7c72; font-size: 10px; }
.air-quality-shortcut-action small i { width: 7px; height: 7px; border-radius: 50%; background: #21a45d; box-shadow: 0 0 0 4px rgba(33, 164, 93, .1); }
.air-quality-shortcut-action a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 17px;
  border: 1px solid var(--green-dark);
  border-radius: 3px;
  color: #fff;
  background: var(--green);
  font-size: 11px;
  font-weight: 850;
  transition: background 160ms ease, transform 160ms ease;
}
.air-quality-shortcut-action a:hover { background: var(--green-dark); transform: translateY(-1px); }
.brand-axis {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  align-items: start;
  gap: 14px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid #cfd8d1;
  background: rgba(255, 255, 255, .82);
}
.brand-axis-label { padding: 7px 0 0 2px; }
.brand-axis-label strong, .brand-axis-label small { display: block; }
.brand-axis-label strong { font-family: "Songti SC", STSong, serif; font-size: 16px; }
.brand-axis-label small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.brand-choices { display: flex; flex-wrap: wrap; gap: 7px; }
.brand-choice {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid #c5cec8;
  border-radius: 3px;
  color: #536058;
  background: #fff;
  cursor: pointer;
  font-size: 11px;
  font-weight: 750;
}
.brand-choice small { color: #89938c; font-size: 9px; }
.brand-choice:hover { color: var(--green-dark); border-color: #90ad99; background: var(--green-pale); }
.brand-choice.is-active { color: #fff; border-color: var(--green); background: var(--green); }
.brand-choice.is-active small { color: #dcebe1; }
.stage-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 54px;
  margin-bottom: 12px;
  padding: 8px 12px;
  border: 1px solid #cfd8d1;
  background: rgba(255, 255, 255, .72);
}
.stage-tools strong { font-size: 13px; }
.stage-tools span { color: var(--muted); font-size: 11px; }
.stage-tools a { padding: 8px 11px; border: 1px solid #bbc7bf; color: var(--green); background: #fff; font-size: 10px; font-weight: 800; }
.data-grid { display: grid; grid-template-columns: repeat(2, minmax(390px, 1fr)); gap: 13px; }
.stage-tools-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.grid-layout-switch {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  border: 1px solid #cbd5ce;
  border-radius: 4px;
  background: #fff;
}
.grid-layout-switch > span {
  margin: 0 5px 0 4px;
  color: var(--muted);
  font-size: 10px;
}
.grid-layout-switch button {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 3px;
  color: #6f7b73;
  background: transparent;
  cursor: pointer;
  font-size: 10px;
  font-weight: 800;
}
.grid-layout-switch button:hover {
  color: var(--green-dark);
  background: var(--green-pale);
}
.grid-layout-switch button.is-active {
  color: #fff;
  background: var(--green);
}
body[data-grid-columns="1"] .data-grid {
  grid-template-columns: minmax(0, 1fr);
}
body[data-grid-columns="2"] .data-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
body[data-grid-columns="3"] .data-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
body[data-grid-columns="4"] .data-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
body[data-grid-columns="1"] .curve-zone { height: 320px; }
body[data-grid-columns="2"] .curve-zone { height: 248px; }
body[data-grid-columns="3"] .curve-zone { height: 190px; }
body[data-grid-columns="4"] .curve-zone { height: 150px; }
body[data-grid-columns="4"] .panel-meta {
  grid-template-columns: repeat(2, 1fr);
}
body[data-grid-columns="4"] .panel-meta div:nth-child(3) {
  padding-left: 0;
  border-top: 1px solid #edf1f4;
  border-left: 0;
}
body[data-grid-columns="4"] .panel-meta div:nth-child(4) {
  border-top: 1px solid #edf1f4;
}
.data-panel {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  background: var(--panel);
  box-shadow: 0 8px 24px rgba(35, 56, 42, .045);
}
.data-panel::before { position: absolute; z-index: 2; top: 0; right: 0; left: 0; height: 3px; background: var(--green); content: ""; opacity: .88; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; min-height: 64px; padding: 13px 15px 10px; }
.panel-head > div { min-width: 0; }
.panel-head strong, .panel-head small { display: block; }
.panel-head strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.panel-head small { margin-top: 5px; color: #8490a0; font-size: 10px; }
.status { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 5px; min-height: 24px; padding: 0 8px; border-radius: 999px; color: #21894d; background: #e8f7ed; font-size: 9px; font-weight: 700; }
.status::before { width: 6px; height: 6px; border-radius: 50%; background: currentColor; content: ""; }
.data-panel[data-online="false"] .status { color: #77818e; background: #edf0f3; }
.curve-zone { position: relative; height: 248px; margin: 0 14px; overflow: hidden; border: 1px solid #e2e8e4; background: #fff; }
.curve-zone img { position: relative; z-index: 2; width: 100%; height: 100%; object-fit: fill; border: 0; background: #fff; opacity: 0; transition: opacity 140ms ease; }
.curve-loading { position: absolute; z-index: 1; inset: 0; overflow: hidden; color: #68766d; background: #fbfdfb; }
.curve-loading svg { width: 100%; height: 100%; }
.curve-loading span { position: absolute; right: 10px; bottom: 8px; padding: 4px 7px; border: 1px solid rgba(47, 113, 72, .14); border-radius: 999px; color: #6e7a72; background: rgba(255, 255, 255, .9); font-size: 9px; font-weight: 700; }
.curve-placeholder-grid { fill: none; stroke: rgba(79, 104, 88, .1); stroke-width: 1; }
.curve-placeholder-area { fill: rgba(47, 113, 72, .08); }
.curve-placeholder-line { fill: none; stroke: #6f9b7d; stroke-width: 4; vector-effect: non-scaling-stroke; }
.curve-zone.is-loaded img { opacity: 1; }
.curve-zone.is-loaded .curve-loading { display: none; }
.panel-action-muted { display: grid; place-items: center; min-height: 40px; color: #8b948e; font-size: 12px; font-weight: 700; }
.panel-meta { display: grid; grid-template-columns: repeat(4, 1fr); margin: 12px 14px 0; border-top: 1px solid #edf1f4; }
.panel-meta div { min-width: 0; padding: 9px 7px 10px 0; }
.panel-meta div + div { padding-left: 8px; border-left: 1px solid #edf1f4; }
.panel-meta small, .panel-meta strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.panel-meta small { color: #9aa3af; font-size: 9px; }
.panel-meta strong { margin-top: 4px; font-size: 11px; }
.panel-actions { display: grid; grid-template-columns: minmax(0, 1fr); padding: 0 14px 14px; }
.panel-actions a { display: flex; align-items: center; justify-content: center; min-height: 36px; border: 1px solid var(--line); border-radius: 4px; color: #4f5e71; font-size: 10px; font-weight: 700; line-height: 1.35; text-align: center; }
.panel-actions .panel-action-primary { color: #fff; border-color: var(--green-dark); background: var(--green); }
.panel-actions a[aria-disabled="true"] { cursor: progress; opacity: .72; pointer-events: none; }
.panel-actions a:hover { color: #fff; border-color: var(--green-dark); background: var(--green-dark); }
.empty { padding: 90px 20px; border: 1px dashed #cfd7df; color: #7c8796; background: #fff; text-align: center; }
.load-more-data {
  display: block;
  min-width: 220px;
  min-height: 42px;
  margin: 18px auto 0;
  padding: 0 20px;
  border: 1px solid var(--green);
  border-radius: 4px;
  color: var(--green-dark);
  background: #fff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}
.load-more-data:hover { color: #fff; background: var(--green); }
.data-note { margin: 16px 0 0; color: #89938c; font-size: 10px; text-align: center; }
.scrim { display: none; }
.library-mobile-menu { display: none; width: 38px; height: 38px; margin-right: 8px; border: 0; color: #e8eef2; background: transparent; cursor: pointer; font-size: 20px; }

@media (max-width: 1180px) {
  .scope-bar { grid-template-columns: 240px minmax(260px, 1fr) 140px; }
  .air-quality-shortcut { grid-template-columns: 60px minmax(0, 1fr); }
  .air-quality-shortcut-action { grid-column: 2; justify-items: start; }
  .data-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body[data-grid-columns="1"] .data-grid { grid-template-columns: 1fr; }
  body[data-grid-columns="3"] .data-grid,
  body[data-grid-columns="4"] .data-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stage-tools { flex-wrap: wrap; }
}

@media (max-width: 760px) {
  body { overflow: auto; }
  .library-topbar { height: 52px; padding: 0 12px; }
  .library-topnav a { padding: 0 8px; font-size: 12px; }
  .library-data-status { display: none; }
  .library-mobile-menu { display: grid; place-items: center; flex: 0 0 auto; }
  .database-app { display: block; height: auto; min-height: calc(100vh - 52px); }
  .database-sidebar { position: fixed; top: 52px; bottom: 0; left: 0; width: min(88vw, 350px); transform: translateX(-105%); transition: transform 180ms ease; }
  body.sidebar-open .database-sidebar { transform: translateX(0); }
  .scrim { position: fixed; z-index: 20; inset: 0; display: block; visibility: hidden; border: 0; background: rgba(20, 29, 42, .4); opacity: 0; transition: opacity 180ms ease, visibility 180ms ease; }
  body.sidebar-open .scrim { visibility: visible; opacity: 1; }
  .database-workspace { display: block; min-height: calc(100vh - 52px); }
  .scope-bar { grid-template-columns: 1fr; gap: 9px; padding: 12px; }
  .status-select { width: 100%; }
  .data-stage { overflow: visible; padding: 12px; }
  .air-quality-shortcut { grid-template-columns: 48px minmax(0, 1fr); gap: 12px; padding: 15px 14px; }
  .air-quality-shortcut-mark { width: 44px; height: 44px; box-shadow: inset 0 0 0 5px rgba(47, 113, 72, .08); }
  .air-quality-shortcut-mark::before { width: 13px; height: 13px; border-width: 2px; }
  .air-quality-shortcut-mark span:nth-child(1) { top: 6px; left: 20px; }
  .air-quality-shortcut-mark span:nth-child(2) { right: 6px; bottom: 12px; }
  .air-quality-shortcut-mark span:nth-child(3) { bottom: 12px; left: 6px; }
  .air-quality-shortcut h2 { font-size: 16px; }
  .air-quality-shortcut-action { grid-column: 1 / -1; width: 100%; min-width: 0; justify-items: stretch; }
  .air-quality-shortcut-action small { justify-content: center; }
  .air-quality-shortcut-action a { width: 100%; }
  .brand-axis { grid-template-columns: 1fr; gap: 9px; }
  .brand-axis-label { padding-top: 0; }
  .brand-choices { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .brand-choice { flex: 0 0 auto; }
  .stage-tools { align-items: flex-start; flex-direction: column; }
  .stage-tools-actions {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
  }
  .grid-layout-switch {
    align-self: flex-start;
  }
  .data-grid { grid-template-columns: 1fr; }
  body[data-grid-columns] .data-grid {
    grid-template-columns: 1fr;
  }
  .curve-zone { height: 218px; }
  body[data-grid-columns] .curve-zone {
    height: 218px;
  }
  .panel-meta { grid-template-columns: repeat(2, 1fr); }
  .panel-meta div:nth-child(3) { padding-left: 0; border-left: 0; border-top: 1px solid #edf1f4; }
  .panel-meta div:nth-child(4) { border-top: 1px solid #edf1f4; }
}
