/* UI 约定：daisyUI 默认 light / dark。
   组件用官方类名（btn / input / card / table / badge / stats / alert / menu）。
   这里只留布局，颜色一律 var(--color-*)。 */

:root {
  --pp-container-w: min(1440px, calc(100% - 48px));
  --pp-radius: 14px;
  --pp-radius-sm: 8px;
  --pp-radius-lg: 18px;
  --pp-gap-page: 24px;
  --pp-gap-card: 20px;
  --pp-pad-card: 20px;
  --pp-pad-card-sm: 14px;
}
@media (max-width: 768px) {
  :root {
    --pp-container-w: calc(100% - 24px);
    --pp-gap-page: 16px;
    --pp-gap-card: 14px;
    --pp-pad-card: 14px;
    --pp-pad-card-sm: 10px;
  }
}

html, body, #root { min-height: 100%; }
body { background: var(--color-base-100); color: oklch(var(--bc)); }

.shell { min-height: 100dvh; display: flex; flex-direction: column; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  width: 100%;
  box-sizing: border-box;
  background: color-mix(in oklab, oklch(var(--b1)) 92%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid oklch(var(--bc) / 0.08);
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.04);
}
.topbar-inner {
  width: var(--pp-container-w);
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.6rem 0;
  box-sizing: border-box;
}
.page, #page {
  width: var(--pp-container-w);
  max-width: 1440px;
  margin: 0 auto;
  padding: var(--pp-gap-page) 0 3rem 0;
  box-sizing: border-box;
}
.grow { flex: 1; min-width: 0; }

.row { display: grid; gap: .75rem; }
@media (min-width: 720px) {
  .row.cols-2 { grid-template-columns: 1fr 1fr; }
  .row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
  .row.cols-4 { grid-template-columns: repeat(4, 1fr); }
}

.form-control, .fieldset { width: 100%; }
.input, .select, .textarea { width: 100%; }
.textarea { min-height: 4.5rem; }

.stats { width: 100%; }
.muted { color: color-mix(in oklab, oklch(var(--bc)) 58%, transparent); }

.auth { min-height: 100dvh; display: grid; place-items: center; padding: 1rem; position: relative; }
.auth .card { width: min(420px, 100%); margin: 0; }
.auth-tools { position: absolute; top: 1rem; right: 1rem; }

.sw {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: .7rem 0;
  border-bottom: 1px solid color-mix(in oklab, oklch(var(--bc)) 8%, transparent);
}
.bindbar { display: flex; flex-wrap: wrap; gap: .3rem; }
.bind-summary { margin: .6rem 0 1rem; }

#ezviz, .pp-video-stage {
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 380px;
  min-height: 220px;
  background: radial-gradient(circle at 50% 40%, #172033 0%, #0c101a 100%);
  border-radius: var(--pp-radius);
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
#ezviz iframe, #ezviz video {
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: cover;
}

.pp-toast-host {
  position: fixed;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 80;
  display: grid;
  gap: .5rem;
  width: min(24rem, calc(100vw - 2rem));
  pointer-events: none;
}
@media (max-width: 720px) {
  .pp-toast-host {
    top: max(.75rem, env(safe-area-inset-top));
    bottom: auto;
    right: max(.75rem, env(safe-area-inset-right));
    left: max(.75rem, env(safe-area-inset-left));
    width: auto;
  }
}
.pp-toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .5rem;
  animation: pp-toast-in .18s ease-out;
}
.pp-toast > span { flex: 1; line-height: 1.4; }
@keyframes pp-toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .pp-toast { animation: none; }
}

.settings-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: .75rem;
  flex-wrap: wrap;
  margin-bottom: .85rem;
}
.settings-head .card-title { margin-bottom: .2rem; }
.settings-grid {
  display: grid;
  gap: .75rem;
  align-items: start;
}
.settings-grid > div > .card { margin-bottom: 0; }
@media (min-width: 800px) {
  .settings-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr);
    grid-template-areas:
      "login ew"
      "bambu ew"
      "ez ew"
      "air ew";
  }
  .settings-login { grid-area: login; }
  .settings-bambu { grid-area: bambu; }
  .settings-ew { grid-area: ew; }
  .settings-ez { grid-area: ez; }
  .settings-air { grid-area: air; }
}
.overflow-x-auto { overflow-x: auto; }
.w-full { width: 100%; }
.w-16 { width: 4rem; }
.input-xs, .select-xs { height: 1.8rem; min-height: 1.8rem; padding: 0 .4rem; font-size: .75rem; }
.mb-4 { margin-bottom: 1rem; }
.menu.menu-horizontal { flex-wrap: wrap; }
.steps { margin: .4rem 0 1rem; width: 100%; }
.card { margin-bottom: 1rem; }
.cursor-pointer { cursor: pointer; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.gap-1 { gap: .25rem; }
.gap-2 { gap: .5rem; }
.py-1 { padding-block: .25rem; }
.min-h-screen { min-height: 100dvh; }
.text-xs { font-size: .75rem; }
.text-lg { font-size: 1.125rem; }
.text-base { font-size: 1rem; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .6rem; margin-top: .75rem; }
.thumbs figure { margin: 0; border: 1px solid color-mix(in oklab, oklch(var(--bc)) 10%, transparent); border-radius: .6rem; overflow: hidden; background: oklch(var(--b2)); }
.thumbs img { width: 100%; height: 110px; object-fit: cover; display: block; background: var(--color-base-300); }
.thumbs figcaption { padding: .35rem .45rem .5rem; font-size: .75rem; display: flex; justify-content: space-between; align-items: center; gap: .3rem; }

.page-wide { max-width: 1280px; }
.inv-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.inv-toolbar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: .75rem; }
.inv-search { flex: 1; min-width: 12rem; }
.inv-new { position: relative; }
.inv-new > summary { list-style: none; cursor: pointer; }
.inv-new > summary::-webkit-details-marker { display: none; }
.inv-new-body { margin-top: .75rem; min-width: min(28rem, 80vw); }
.inv-sum { margin: .25rem 0 .75rem; }
.inv-list { display: grid; gap: .75rem; }
.inv-card .inv-card-body { gap: .55rem; padding: 1rem 1.1rem; }
.inv-card-top { display: flex; justify-content: space-between; align-items: center; gap: .75rem; }
.inv-title { font-size: 1.05rem; font-weight: 700; margin: 0; }
.inv-line { font-weight: 500; opacity: .75; }
.inv-stats { display: flex; flex-wrap: wrap; gap: .75rem 1.1rem; font-size: .9rem; }
.inv-stats b { font-variant-numeric: tabular-nums; }
.inv-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.inv-specs {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem .55rem;
  font-size: .8rem;
  margin: .1rem 0 .2rem;
}
.card-title + .inv-specs {
  margin: .15rem 0 .7rem;
}
.inv-specs span {
  display: inline-flex;
  align-items: baseline;
  gap: .3rem;
  padding: .15rem .45rem;
  border-radius: .4rem;
  background: color-mix(in oklab, oklch(var(--p)) 8%, oklch(var(--b2)));
}
.inv-specs em {
  font-style: normal;
  font-size: .7rem;
  opacity: .62;
}
.stock-chip {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .2rem .5rem .2rem .6rem;
  border-radius: 999px;
  background: oklch(var(--b2));
  border: 1px solid color-mix(in oklab, oklch(var(--bc)) 10%, transparent);
  font-size: .85rem;
}
.stock-chip.is-open { border-color: color-mix(in oklab, oklch(var(--wa)) 55%, transparent); }
.stock-qty {
  min-width: 1.15rem; text-align: center;
  font-weight: 700; font-variant-numeric: tabular-nums;
  background: var(--color-base-100);
  border-radius: 999px;
  padding: 0 .35rem;
}
.hidden { display: none !important; }
.opacity-50 { opacity: .55; }
.mb-1 { margin-bottom: .25rem; }
.text-sm { font-size: .875rem; }
.text-3xl { font-size: 1.65rem; }

.stk-insights { margin: .75rem 0; }
.stk-list { margin: .2rem 0 0; padding-left: 1.1rem; display: grid; gap: .25rem; }
.stk-link {
  background: none; border: 0; padding: 0; color: inherit;
  cursor: pointer; text-align: left; font: inherit;
  text-decoration: underline dotted;
}
.stk-link b { font-variant-numeric: tabular-nums; margin-left: .25rem; }
.stk-jump { margin: .4rem 0 .2rem; }
.stk-wrap { overflow-x: auto; margin-top: .4rem; }
.stk-table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
.stk-table tbody tr {
  border-bottom: 1px solid oklch(var(--b3) / 0.3);
}
.stk-table tbody tr:hover td, .stk-table tbody tr:hover th {
  filter: brightness(0.95);
}
[data-theme="dark"] .stk-table tbody tr:hover td, [data-theme="dark"] .stk-table tbody tr:hover th {
  filter: brightness(1.2);
}
.stk-table th {
  font-size: .75rem;
  font-weight: 600;
  text-align: center;
  padding: .35rem .3rem;
  white-space: nowrap;
  vertical-align: bottom;
}
.stk-colsum { font-weight: 700; font-size: .8rem; opacity: .7; margin-top: .1rem; }
.stk-rowhead {
  text-align: left !important;
  font-size: .8rem;
  white-space: nowrap;
  padding-right: .5rem !important;
}
.stk-dot {
  width: .7rem; height: .7rem; border-radius: 999px;
  display: inline-block; margin-right: .4rem; vertical-align: -1px;
  border: 1px solid color-mix(in oklab, oklch(var(--bc)) 18%, transparent);
}
.stk-cell {
  position: relative;
  text-align: center;
  min-width: 5.1rem;
  min-height: 3.4rem;
  padding: 0;
  border: 1px solid oklch(var(--b1));
  cursor: pointer;
  vertical-align: middle;
  overflow: hidden;
}
.stk-sum {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 3.4rem;
  padding: .28rem .2rem .22rem;
}
.stk-cell b { display: block; font-size: 1.05rem; line-height: 1.15; }
.stk-cell small { display: block; font-size: .65rem; opacity: .72; }
.stk-has-split .stk-split {
  display: none;
  position: absolute;
  inset: 0;
}
.stk-has-split:hover .stk-sum,
.stk-has-split:focus-within .stk-sum,
.stk-has-split.is-split .stk-sum {
  visibility: hidden;
}
.stk-has-split:hover .stk-split,
.stk-has-split:focus-within .stk-split,
.stk-has-split.is-split .stk-split {
  display: flex;
}
.stk-split {
  display: flex;
  width: 100%;
  height: 100%;
  font-variant-numeric: tabular-nums;
}
.stk-slice {
  flex: 1 1 0;
  min-width: 0;
  border: 0;
  margin: 0;
  padding: .2rem .15rem;
  font: inherit;
  color: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.15;
  background: color-mix(in oklab, var(--color-base-100) 18%, transparent);
}
.stk-slice + .stk-slice {
  box-shadow: inset 1px 0 0 color-mix(in oklab, oklch(var(--bc)) 18%, transparent);
}
.stk-slice:nth-child(2) {
  background: color-mix(in oklab, oklch(var(--bc)) 10%, transparent);
}
.stk-slice:nth-child(3) {
  background: color-mix(in oklab, oklch(var(--bc)) 16%, transparent);
}
.stk-slice:hover {
  background: color-mix(in oklab, var(--color-base-100) 28%, transparent);
}
.stk-slice strong { font-size: .82rem; font-weight: 700; }
.stk-slice em {
  font-style: normal;
  font-size: .58rem;
  opacity: .72;
  margin-top: .05rem;
}
.stk-zero { opacity: .35; }
.stk-lv0 { background: color-mix(in oklab, oklch(var(--bc)) 6%, transparent); }
.stk-lv1 { background: color-mix(in oklab, oklch(var(--p)) 18%, oklch(var(--b2))); }
.stk-lv2 { background: color-mix(in oklab, oklch(var(--p)) 34%, oklch(var(--b2))); }
.stk-lv3 { background: color-mix(in oklab, oklch(var(--p)) 52%, oklch(var(--b2))); color: oklch(var(--pc)); }
.stk-lv4 { background: color-mix(in oklab, oklch(var(--wa)) 72%, oklch(var(--p))); color: oklch(var(--wac)); }
.stk-total, .stk-foot td, .stk-foot th { text-align: center; font-size: .85rem; }
.stk-bar {
  display: grid;
  grid-template-columns: 6.6rem 1fr 2rem;
  align-items: center;
  gap: .5rem;
  margin: .35rem 0;
  font-size: .85rem;
}
button.stk-bar-btn {
  width: 100%;
  background: none;
  border: 0;
  color: inherit;
  cursor: pointer;
  font: inherit;
  padding: .15rem .1rem;
  border-radius: .4rem;
  text-align: inherit;
}
button.stk-bar-btn:hover {
  background: color-mix(in oklab, oklch(var(--bc)) 6%, transparent);
}
.stk-bar-lab { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stk-bar b { text-align: right; font-variant-numeric: tabular-nums; }
.stk-track {
  height: .55rem;
  background: color-mix(in oklab, oklch(var(--bc)) 8%, transparent);
  border-radius: 999px;
  overflow: hidden;
}
.stk-fill { display: block; height: 100%; border-radius: 999px; }
.stk-fill.is-light,
.stk-seg.is-light {
  box-shadow: inset 0 0 0 1px color-mix(in oklab, oklch(var(--bc)) 28%, transparent);
}
.stk-stack {
  display: flex;
  height: 100%;
  border-radius: 999px;
  overflow: hidden;
}
.stk-seg {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-width: 3px;
  position: relative;
}
.stk-seg em {
  font-style: normal;
  font-size: .62rem;
  font-weight: 700;
  color: oklch(var(--bc));
  text-shadow: 0 0 2px var(--color-base-100);
}
.stk-bar-block { margin: .45rem 0 .7rem; }
.stk-legend {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem .55rem;
  margin: .25rem 0 0 6.6rem;
  font-size: .72rem;
}
.stk-leg { display: inline-flex; align-items: center; gap: .25rem; }
.stk-bottom { margin-top: .5rem; }
.mt-2 { margin-top: .5rem; }


/* Mobile specific utility classes */
@media (min-width: 800px) {
  .nav-mobile { display: none !important; }
  .nav-desktop { display: flex !important; }
}
@media (max-width: 799px) {
  .nav-desktop { display: none !important; }
  .hide-on-mobile { display: none !important; }
  .topbar-inner { padding: 0.35rem 0.5rem; }
  .masonry-grid { column-count: 1 !important; }
}
.masonry-grid {
  column-count: 2;
  column-gap: 1rem;
}
@media (min-width: 1200px) {
  .masonry-grid { column-count: 3; }
}
.masonry-item {
  break-inside: avoid;
  margin-bottom: 1rem;
}

/* Visual Design Overhaul Overrides */

/* 1. Global Page Width & Alignment */
.page { max-width: 1100px; margin: 0 auto; width: 100%; padding: 1.5rem 1rem max(2rem, calc(1.5rem + env(safe-area-inset-bottom))); }
.page-wide { max-width: 1400px; }

/* 2. Materials Grid Layout */
.inv-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}
.inv-card { margin-bottom: 0; display: flex; flex-direction: column; }

/* 3. Settings Grid & Form Breathing Room (masonry: 每列独立堆叠，短卡下方不留洞) */
.pp-settings-grid, .settings-grid, .masonry-grid {
  display: block;
  columns: 2;
  column-gap: var(--pp-gap-card);
}
@media (max-width: 900px) {
  .pp-settings-grid, .settings-grid, .masonry-grid {
    columns: 1;
  }
}
.pp-settings-grid > .card, .settings-grid > .card, .masonry-grid > .card {
  height: auto;
  min-height: 0;
  margin-bottom: var(--pp-gap-card);
  break-inside: avoid;
}
.pp-settings-grid .card-wide, .settings-grid .card-wide, .masonry-grid .card-wide {
  column-span: all;
  margin-top: var(--pp-gap-card);
}
.form-control { margin-bottom: 0.8rem; }
.form-control:last-child { margin-bottom: 0; }
.settings-head { display: flex; justify-content: flex-start; align-items: center; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.settings-head > div { flex: 0 1 auto; margin-right: auto; }
.settings-head .btn-primary { margin-top: 0; }

/* 4. Stock Matrix Polish */
.stk-table thead th, .stk-foot td, .stk-foot th {
  background: oklch(var(--b2));
  color: oklch(var(--bc));
}
.stk-table thead th { border-bottom: 2px solid oklch(var(--b3) / 0.5); }
.stk-foot th, .stk-foot td { border-top: 2px solid oklch(var(--b3) / 0.5); font-weight: bold; }
.stk-zero { opacity: 0.25; font-size: 0.9rem; }
.stk-sum b { font-weight: 800; color: oklch(var(--bc)); }
[data-theme="dark"] .stk-sum b { color: #fff; }

/* ===== Utility Layer (v33) =====
   vendor/daisyui.css 是纯组件构建，不含 Tailwind 工具类；
   这里补齐 live_app.js 模板实际用到的子集（Tailwind 默认值）。 */

/* 关闭态 <dialog class="modal"> 不得暴露给辅助技术（本 vendor 构建缺隐藏规则） */
dialog.modal:not([open]) { display: none !important; }

.row.cols-5 { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 800px) { .row.cols-5 { grid-template-columns: 1fr 1fr; } }

/* 耗材过滤条：品牌下拉不被拉满整行 */
.inv-toolbar .select { width: auto; flex: 0 1 auto; min-width: 8.5rem; }

.inline-block { display: inline-block; }
.inline-flex { display: inline-flex; }
.flex { display: flex; }
.grid { display: grid; }
.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-start { justify-content: flex-start; }
.justify-end { justify-content: flex-end; }
.flex-1 { flex: 1 1 0%; }
.grow { flex-grow: 1; }
.shrink-0 { flex-shrink: 0; }
.w-full { width: 100%; }
.w-auto { width: auto; }
.h-full { height: 100%; }
.max-w-7xl { max-width: 80rem; }
.min-h-screen { min-height: 100vh; }

.gap-1 { gap: 0.25rem; }
.gap-1\.5 { gap: 0.375rem; }
.gap-2 { gap: 0.5rem; }
.gap-2\.5 { gap: 0.625rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-5 { gap: 1.25rem; }
.gap-6 { gap: 1.5rem; }

.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.grid-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.grid-cols-12 { grid-template-columns: repeat(12, minmax(0, 1fr)); }

.col-span-1 { grid-column: span 1 / span 1; }
.col-span-2 { grid-column: span 2 / span 2; }
.col-span-3 { grid-column: span 3 / span 3; }
.col-span-4 { grid-column: span 4 / span 4; }
.col-span-5 { grid-column: span 5 / span 5; }
.col-span-6 { grid-column: span 6 / span 6; }
.col-span-7 { grid-column: span 7 / span 7; }
.col-span-8 { grid-column: span 8 / span 8; }
.col-span-9 { grid-column: span 9 / span 9; }
.col-span-10 { grid-column: span 10 / span 10; }
.col-span-11 { grid-column: span 11 / span 11; }
.col-span-12 { grid-column: span 12 / span 12; }

@media (min-width: 640px) {
  .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sm\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sm\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .sm\:col-span-1 { grid-column: span 1 / span 1; }
  .sm\:col-span-2 { grid-column: span 2 / span 2; }
}

@media (min-width: 768px) {
  .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .md\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .md\:col-span-1 { grid-column: span 1 / span 1; }
  .md\:col-span-2 { grid-column: span 2 / span 2; }
  .md\:col-span-3 { grid-column: span 3 / span 3; }
  .md\:col-span-4 { grid-column: span 4 / span 4; }
}

@media (min-width: 1024px) {
  .lg\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .lg\:grid-cols-12 { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .lg\:col-span-3 { grid-column: span 3 / span 3; }
  .lg\:col-span-4 { grid-column: span 4 / span 4; }
  .lg\:col-span-5 { grid-column: span 5 / span 5; }
  .lg\:col-span-6 { grid-column: span 6 / span 6; }
  .lg\:col-span-7 { grid-column: span 7 / span 7; }
  .lg\:col-span-8 { grid-column: span 8 / span 8; }
  .lg\:col-span-9 { grid-column: span 9 / span 9; }
  .lg\:col-span-12 { grid-column: span 12 / span 12; }
  .lg\:px-4 { padding-left: 1rem; padding-right: 1rem; }
}

@media (min-width: 1280px) {
  .xl\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .xl\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.h-2\.5 { height: 0.625rem; }
.h-3 { height: 0.75rem; }
.h-4 { height: 1rem; }
.h-5 { height: 1.25rem; }
.w-2\.5 { width: 0.625rem; }
.w-3 { width: 0.75rem; }
.w-4 { width: 1rem; }
.w-5 { width: 1.25rem; }
.w-52 { width: 13rem; }
.p-0 { padding: 0; }
.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-4 { padding: 1rem; }
@media (min-width: 640px) { .sm\:p-6 { padding: 1.5rem; } }
.pb-1 { padding-bottom: 0.25rem; }
.px-1 { padding-left: 0.25rem; padding-right: 0.25rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mx-2 { margin-left: 0.5rem; margin-right: 0.5rem; }
.mx-auto { margin-left: auto; margin-right: auto; }
.my-2 { margin-top: 0.5rem; margin-bottom: 0.5rem; }
.mr-1 { margin-right: 0.25rem; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-normal { font-weight: 400; }
.font-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-center { text-align: center; }
.align-middle { vertical-align: middle; }
.opacity-70 { opacity: 0.7; }
.border-0 { border-width: 0; }
.rounded-full { border-radius: 9999px; }
.shadow { box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06); }
.shadow-sm { box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); }
.max-w-7xl { max-width: 80rem; }
.overflow-visible { overflow: visible; }
.z-\[1\] { z-index: 1; }
.hover\:badge-primary:hover {
  background-color: oklch(var(--p));
  color: oklch(var(--pc));
}

/* 窄屏溢出修复：.shell 是 grid，main 作为条目默认 min-width:auto，
   表格/栅格的 min-content 会把整页撑宽；置 0 后由内部 overflow-x-auto 容器接管滚动 */
.shell > main { min-width: 0; }
.inv-list { grid-template-columns: repeat(auto-fill, minmax(min(380px, 100%), 1fr)); }

/* 顶栏实底 + 吸顶：避免滚动时内容透出导致文字不可读 */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: oklch(var(--b1));
  border-bottom: 1px solid oklch(var(--b3) / 0.5);
}

/* ===== Polish Layer (v41) — 优雅实用 ===== */

/* 0. 颜色别名：原文件按 --color-* 约定书写但变量从未定义，7 处静默失效（含顶栏透明根因），映射到主题变量 */
:root {
  --color-base-100: oklch(var(--b1));
  --color-base-200: oklch(var(--b2));
  --color-base-300: oklch(var(--b3));
  --color-base-content: oklch(var(--bc));
  --color-primary: oklch(var(--p));
  --color-primary-content: oklch(var(--pc));
}

/* 1. 顶栏：轻投影替代生硬边线，导航圆角胶囊化 */
.topbar { box-shadow: 0 1px 2px rgb(0 0 0 / 0.05); border-bottom: 1px solid oklch(var(--b3) / 0.5); }
#brand { font-weight: 800; letter-spacing: 0.01em; }
.nav-desktop a { font-size: 0.92rem; border-radius: 0.55rem; }
.nav-desktop a:hover { background: oklch(var(--b2)); }

/* 2. 卡片：统一圆角与节奏 */
.card { border-radius: var(--rounded-box, 1rem); }
.card-body { line-height: 1.62; }
.card-title { font-size: 1.05rem; font-weight: 700; }

/* 3. 数字与表格：等宽数字、舒适的密度、悬浮反馈 */
.stat-value, .table td, .inv-stats, .badge { font-variant-numeric: tabular-nums; }
.table :where(th, td) { padding: 0.55rem 0.75rem; }
.table thead th { font-size: 0.8rem; opacity: 0.75; }
.table tbody tr:hover { background: oklch(var(--b2) / 0.55); }

/* 4. 滚动条：细而随主题 */
* { scrollbar-width: thin; scrollbar-color: oklch(var(--bc) / 0.28) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: oklch(var(--bc) / 0.28); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: oklch(var(--bc) / 0.42); }

/* 5. 焦点可见性 */
:focus-visible { outline: 2px solid oklch(var(--p) / 0.65); outline-offset: 2px; }

/* 6. 克制的动效 */
body, .card, .topbar, .btn, .badge { transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* 7. 内联代码：轻底色 */
:not(pre) > code { font-size: 0.85em; background: oklch(var(--b2)); padding: 0.12em 0.45em; border-radius: 0.4em; }

/* 8. 登录卡：一点浮起 */
.auth .card { box-shadow: 0 10px 34px rgb(0 0 0 / 0.07); }
.auth-brand { width: 3.25rem; height: 3.25rem; margin: 0 auto 0.6rem; display: grid; place-items: center;
  border-radius: 999px; background: oklch(var(--p) / 0.12); color: oklch(var(--p));
  font-size: 1.5rem; font-weight: 900; letter-spacing: -0.03em; }
.-mt-1 { margin-top: -0.25rem; }

/* 宽卡：跨两列（通知/表单密集卡），窄屏自动回落单列 */
.masonry-grid .card-wide { grid-column: 1 / -1; }
@media (max-width: 900px) { .masonry-grid .card-wide { grid-column: span 1; } }

/* 移动端表格操作按钮触控尺寸强化 */
@media (max-width: 799px) {
  .table .btn-xs {
    min-height: 2rem;
    height: 2rem;
    padding: 0 0.6rem;
    font-size: 0.85rem;
  }
  .table .join {
    gap: 0.25rem;
  }
  .table select.select-xs {
    min-height: 2rem;
    height: 2rem;
    font-size: 0.85rem;
  }
}

/* 暗黑模式无数据对比度与悬浮强化 */
[data-theme="dark"] .stk-zero { opacity: 0.45; }
[data-theme="dark"] .stk-table tbody tr:hover td { background-color: oklch(var(--b2) / 0.8) !important; }

/* ===== Visual Elevation (v60) — 极简高质硬件感 ===== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in oklab, oklch(var(--b1)) 84%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid oklch(var(--bc) / 0.08);
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.04);
}

.nav-desktop a.menu-active, .nav-desktop a.active, .nav-pill.active {
  background: rgba(99, 102, 241, 0.14) !important;
  color: #4f46e5 !important;
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.25);
}
[data-theme="dark"] .nav-desktop a.menu-active, [data-theme="dark"] .nav-desktop a.active, [data-theme="dark"] .nav-pill.active {
  background: rgba(99, 102, 241, 0.25) !important;
  color: #a5b4fc !important;
  border-color: rgba(99, 102, 241, 0.4);
}

.nav-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
  color: oklch(var(--bc) / 0.75);
  transition: all 0.18s ease;
  white-space: nowrap;
}
.nav-pill:hover {
  background: oklch(var(--bc) / 0.06);
  color: oklch(var(--bc));
}

.card {
  border-radius: 1.25rem;
  border: 1px solid oklch(var(--bc) / 0.08);
  background: oklch(var(--b1));
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.03), 0 1px 2px -1px rgb(0 0 0 / 0.03);
}

.gauge-tile, .stat-card {
  background: oklch(var(--b1));
  border: 1px solid oklch(var(--bc) / 0.08);
  border-radius: 1.15rem;
  padding: 1rem 1.15rem;
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.02);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}
.gauge-tile:hover, .stat-card:hover {
  border-color: oklch(var(--p) / 0.35);
  box-shadow: 0 4px 12px -2px rgb(0 0 0 / 0.05);
}

.stat-icon {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
}

.metric-tile {
  background: color-mix(in oklab, oklch(var(--b2)) 40%, transparent);
  border: 1px solid oklch(var(--bc) / 0.06);
  border-radius: 0.95rem;
  padding: 0.75rem 1rem;
  transition: all 0.15s ease;
}
.metric-tile:hover {
  background: color-mix(in oklab, oklch(var(--b2)) 65%, transparent);
  border-color: oklch(var(--bc) / 0.12);
}
.metric-tile .metric-val-big {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.metric-tile .metric-val-unit {
  font-size: 0.8125rem;
  font-weight: 500;
  opacity: 0.6;
}

.radar-wave-box {
  position: relative;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(16, 185, 129, 0.12);
}
.radar-wave-box::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 999px;
  border: 2px solid #10b981;
  opacity: 0.6;
  animation: radar-pulse 2s infinite ease-out;
}
@keyframes radar-pulse {
  0% { transform: scale(0.6); opacity: 0.8; }
  100% { transform: scale(1.8); opacity: 0; }
}

.pulse-dot {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  animation: pulse-glow 2s infinite ease-in-out;
}
@keyframes pulse-glow {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(1.18); }
}

.progress-hardware {
  position: relative;
  height: 0.65rem;
  border-radius: 999px;
  background: oklch(var(--b3) / 0.35);
  overflow: hidden;
}
.progress-hardware-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #6366f1, #8b5cf6, #10b981);
  transition: width 0.4s ease;
}

/* ===== Unified Design Baseline Component Classes (pp-*) ===== */
.card {
  border-radius: var(--pp-radius);
  border: 1px solid oklch(var(--bc) / 0.08);
  background: oklch(var(--b1));
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.03), 0 1px 2px -1px rgb(0 0 0 / 0.03);
}

/* KPI 4-Card Grid */
.pp-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--pp-gap-card);
  margin-bottom: var(--pp-gap-page);
}
@media (max-width: 1024px) {
  .pp-kpi-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .pp-kpi-grid { grid-template-columns: 1fr; }
}

/* KPI Card Equal-Height Spec & Status Scale */
.pp-kpi-card {
  background: oklch(var(--b1));
  border: 1px solid oklch(var(--bc) / 0.08);
  border-radius: var(--pp-radius);
  padding: 1.1rem 1.25rem;
  min-height: 144px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.02);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}
.pp-kpi-card:hover {
  border-color: oklch(var(--p) / 0.35);
  box-shadow: 0 4px 12px -2px rgb(0 0 0 / 0.05);
}
.pp-kpi-card.is-active {
  border-color: oklch(var(--p));
  box-shadow: 0 0 0 2px oklch(var(--p)), 0 4px 16px -2px oklch(var(--p) / 0.15);
}
.pp-kpi-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.pp-kpi-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: oklch(var(--bc) / 0.7);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.pp-kpi-status {
  font-size: 1.0625rem; /* 16-18px */
  font-weight: 700;
  line-height: 1.25;
  margin-top: 4px;
}
.pp-kpi-body {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  margin: 0.2rem 0;
}
.pp-kpi-value {
  font-size: 2.25rem; /* 36px */
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.025em;
}
.pp-kpi-unit {
  font-size: 0.8125rem;
  font-weight: 500;
  color: oklch(var(--bc) / 0.55);
}
.pp-kpi-aux {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 0.8125rem; /* 12-13px */
  color: oklch(var(--bc) / 0.75);
  margin-top: 4px;
}
.pp-kpi-aux-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.pp-kpi-footer {
  font-size: 0.75rem;
  color: oklch(var(--bc) / 0.5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px dashed oklch(var(--bc) / 0.08);
  padding-top: 6px;
  margin-top: 4px;
  white-space: nowrap;
}

/* Home 8:4 Two-Column Layout */
.pp-home-grid {
  display: grid;
  grid-template-columns: 8fr 4fr;
  gap: var(--pp-gap-page);
  align-items: start;
}
@media (max-width: 1024px) {
  .pp-home-grid {
    grid-template-columns: 1fr;
  }
}

/* Stock Page Compact 5-Item Stat Bar */
.pp-stat-bar {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  background: oklch(var(--b1));
  border: 1px solid oklch(var(--bc) / 0.08);
  border-radius: var(--pp-radius);
  padding: 14px 20px;
  margin-bottom: var(--pp-gap-page);
  align-items: center;
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.02);
}
@media (max-width: 1024px) {
  .pp-stat-bar { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 640px) {
  .pp-stat-bar { grid-template-columns: 1fr 1fr; }
}
.pp-stat-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 0 8px;
  border-right: 1px solid oklch(var(--bc) / 0.08);
}
.pp-stat-item:last-child {
  border-right: none;
}
.pp-stat-item-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: oklch(var(--bc) / 0.65);
  display: flex;
  align-items: center;
  gap: 4px;
}
.pp-stat-item-val {
  font-size: 1.875rem; /* ~30px */
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1.1;
  display: flex;
  align-items: baseline;
  gap: 4px;
}
.pp-stat-item-sub {
  font-size: 0.75rem; /* ~12px */
  color: oklch(var(--bc) / 0.5);
}

/* Stock Matrix Horizontal Scroll & Sticky Row Headers */
.stk-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}
.stk-table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
}
.stk-table th:first-child,
.stk-table td:first-child,
.stk-table .stk-rowhead {
  position: sticky;
  left: 0;
  z-index: 5;
  background: oklch(var(--b1));
  box-shadow: 2px 0 4px -2px rgb(0 0 0 / 0.08);
}
[data-theme="dark"] .stk-table th:first-child,
[data-theme="dark"] .stk-table td:first-child,
[data-theme="dark"] .stk-table .stk-rowhead {
  background: oklch(var(--b1));
  box-shadow: 2px 0 4px -2px rgb(0 0 0 / 0.4);
}

/* Tabs & Controls */
.pp-tab-group {
  display: inline-flex;
  background: oklch(var(--b2) / 0.6);
  padding: 3px;
  border-radius: var(--pp-radius-sm);
  gap: 2px;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.pp-tab-btn {
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: oklch(var(--bc) / 0.7);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  flex-shrink: 0;
}
.pp-tab-btn:hover {
  color: oklch(var(--bc));
}
.pp-tab-btn.active {
  background: oklch(var(--b1));
  color: oklch(var(--bc));
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.08);
  font-weight: 600;
}

/* Unified Icon Constraints */
.pp-icon {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
}
.pp-icon-xs { width: 14px; height: 14px; max-width: 14px; max-height: 14px; }
.pp-icon-sm { width: 16px; height: 16px; max-width: 16px; max-height: 16px; }
.pp-icon-base { width: 18px; height: 18px; max-width: 18px; max-height: 18px; }
.pp-icon-card { width: 20px; height: 20px; max-width: 20px; max-height: 20px; }
.pp-icon-title { width: 24px; height: 24px; max-width: 24px; max-height: 24px; }

/* ===== Air Quality Dashboard (.pp-air Scoped) ===== */
.pp-air {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.pp-air-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid oklch(var(--bc) / 0.08);
  padding-bottom: 12px;
}
.pp-air-title {
  font-size: 1.625rem; /* ~26px */
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.pp-air-subtitle {
  font-size: 0.8125rem;
  color: oklch(var(--bc) / 0.6);
  margin-top: 2px;
}
.pp-air-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
@media (max-width: 900px) {
  .pp-air-cards {
    grid-template-columns: 1fr;
  }
}
.pp-air-card {
  background: oklch(var(--b1));
  border: 1.5px solid oklch(var(--bc) / 0.1);
  border-radius: var(--pp-radius);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.02);
  min-height: 220px;
  position: relative;
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.pp-air-card:hover {
  border-color: oklch(var(--bc) / 0.28);
}
.pp-air-card.is-active {
  border-color: oklch(var(--p));
  box-shadow: 0 0 0 2px oklch(var(--p)), 0 6px 16px oklch(var(--p) / 0.12);
}
.pp-air-focus-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 1.5px 6px;
  border-radius: 4px;
  background: oklch(var(--p) / 0.14);
  color: oklch(var(--p));
}
.pp-air-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.8125rem;
  color: oklch(var(--bc) / 0.65);
  margin-bottom: 4px;
}
.pp-air-point-name {
  font-size: 0.9375rem;
  font-weight: 700;
  color: oklch(var(--bc));
  display: flex;
  align-items: center;
  gap: 6px;
}
.pp-air-card-status {
  font-size: 1.0625rem; /* 16-18px */
  font-weight: 700;
  line-height: 1.3;
  margin: 4px 0 2px;
}
.pp-air-primary-block {
  margin: 4px 0 8px;
}
.pp-air-primary-metric {
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.pp-air-primary-val {
  font-size: 2.375rem; /* 36-40px */
  font-weight: 700;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.pp-air-primary-unit {
  font-size: 0.875rem;
  font-weight: 500;
  color: oklch(var(--bc) / 0.6);
}
.pp-air-card-aux {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.8125rem; /* 12-13px */
  color: oklch(var(--bc) / 0.8);
  margin-top: 6px;
}
.pp-air-card-aux-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.pp-air-card-meta {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed oklch(var(--bc) / 0.08);
  font-size: 0.75rem;
  color: oklch(var(--bc) / 0.5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}
.pp-air-card-details {
  margin-top: 6px;
  border-top: 1px dotted oklch(var(--bc) / 0.08);
  padding-top: 4px;
  font-size: 0.75rem;
}
.pp-air-card-details summary {
  cursor: pointer;
  color: oklch(var(--p));
  user-select: none;
  font-size: 0.75rem;
  list-style: none;
}
.pp-air-card-details summary::-webkit-details-marker {
  display: none;
}

/* Trend Panel */
.pp-air-chart-card {
  background: oklch(var(--b1));
  border: 1px solid oklch(var(--bc) / 0.08);
  border-radius: var(--pp-radius);
  padding: 20px;
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.02);
}
.pp-air-chart-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid oklch(var(--bc) / 0.06);
  margin-bottom: 12px;
}
.pp-air-chart-title {
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}
.pp-air-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

/* Direct Focus Highlights Box */
.pp-air-highlights-box {
  background: color-mix(in oklab, oklch(var(--b2)) 40%, transparent);
  border: 1px solid oklch(var(--bc) / 0.06);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 12px;
}
.pp-air-highlights-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
}
.pp-air-hl-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 140px;
}
.pp-air-hl-label {
  font-size: 0.75rem;
  color: oklch(var(--bc) / 0.6);
}
.pp-air-hl-val {
  font-size: 1.1875rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: oklch(var(--bc));
}
.pp-air-hl-sub {
  font-size: 0.6875rem;
  color: oklch(var(--bc) / 0.5);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}
.pp-air-stats-drawer {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed oklch(var(--bc) / 0.08);
  font-size: 0.8125rem;
  color: oklch(var(--bc) / 0.75);
}

.pp-air-chart-box {
  height: 350px;
  width: 100%;
}
.pp-air-strip-container {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  padding: 6px 10px;
  background: color-mix(in oklab, oklch(var(--b2)) 30%, transparent);
  border-radius: 6px;
  font-size: 0.75rem;
}
.pp-air-strip-label {
  font-weight: 600;
  color: oklch(var(--bc) / 0.65);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 4px;
}
.pp-air-strip-track {
  position: relative;
  height: 18px;
  flex: 1;
  background: oklch(var(--bc) / 0.05);
  border-radius: 4px;
  overflow: hidden;
}
.pp-air-strip-block {
  position: absolute;
  top: 0;
  height: 100%;
  background: #10b981;
  opacity: 0.85;
  border-radius: 2px;
  cursor: pointer;
  transition: opacity 0.15s;
}
.pp-air-strip-block:hover {
  opacity: 1;
}
.pp-air-strip-block.is-incomplete {
  background: repeating-linear-gradient(
    45deg,
    #10b981,
    #10b981 6px,
    #059669 6px,
    #059669 12px
  );
}

/* 3-Column Summary Strip (3 Objects x 3 Metrics) */
.pp-air-summary-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--pp-gap-card);
  margin-top: 1rem;
  margin-bottom: var(--pp-gap-page);
}
@media (max-width: 900px) {
  .pp-air-summary-strip {
    grid-template-columns: 1fr;
  }
}
.pp-air-summary-col {
  background: oklch(var(--b1));
  border: 1px solid oklch(var(--bc) / 0.08);
  border-radius: var(--pp-radius);
  padding: 14px 16px;
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.02);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pp-air-summary-col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 8px;
  border-bottom: 1px solid oklch(var(--bc) / 0.06);
}
.pp-air-summary-col-title {
  font-size: 0.8125rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}
.pp-air-summary-cells {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}
@media (max-width: 480px) {
  .pp-air-summary-cells {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}
.pp-air-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.pp-air-cell-label {
  font-size: 0.6875rem;
  color: oklch(var(--bc) / 0.55);
  font-weight: 500;
}
.pp-air-cell-val {
  font-size: 1.0625rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.pp-air-cell-sub {
  font-size: 0.6875rem;
  color: oklch(var(--bc) / 0.5);
  font-family: ui-monospace, SFMono-Regular, monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Sequential Downward Modules (PM, TVOC, Env) */
.pp-air-module-card {
  background: oklch(var(--b1));
  border: 1px solid oklch(var(--bc) / 0.08);
  border-radius: var(--pp-radius);
  padding: 16px 20px 20px;
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.02);
  margin-bottom: var(--pp-gap-page);
}
.pp-air-module-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid oklch(var(--bc) / 0.06);
}
.pp-air-module-title {
  font-size: 0.9375rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}
.pp-air-module-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: color-mix(in oklab, oklch(var(--b2)) 35%, transparent);
  border: 1px solid oklch(var(--bc) / 0.06);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 0.75rem;
  margin-bottom: 12px;
}

/* Spacing utilities (auto-completed: 模板用到但此前缺失，修复内容贴边) */
.p-0\.5 { padding: 0.125rem; }
.p-1\.5 { padding: 0.375rem; }
.p-2\.5 { padding: 0.625rem; }
.px-2\.5 { padding-left: 0.625rem; padding-right: 0.625rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.py-0 { padding-top: 0px; padding-bottom: 0px; }
.py-0\.5 { padding-top: 0.125rem; padding-bottom: 0.125rem; }
.py-1\.5 { padding-top: 0.375rem; padding-bottom: 0.375rem; }
.py-2\.5 { padding-top: 0.625rem; padding-bottom: 0.625rem; }
.py-3\.5 { padding-top: 0.875rem; padding-bottom: 0.875rem; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }
.pt-1 { padding-top: 0.25rem; }
.pt-2 { padding-top: 0.5rem; }
.pt-3 { padding-top: 0.75rem; }
.pb-2 { padding-bottom: 0.5rem; }
.pb-3 { padding-bottom: 0.75rem; }
.pl-4 { padding-left: 1rem; }
.pr-4 { padding-right: 1rem; }
.mx-1 { margin-left: 0.25rem; margin-right: 0.25rem; }
.my-1 { margin-top: 0.25rem; margin-bottom: 0.25rem; }
.my-3 { margin-top: 0.75rem; margin-bottom: 0.75rem; }
.mt-0 { margin-top: 0px; }
.mt-0\.5 { margin-top: 0.125rem; }
.mt-1\.5 { margin-top: 0.375rem; }
.mt-2\.5 { margin-top: 0.625rem; }
.mb-0 { margin-bottom: 0px; }
.mb-0\.5 { margin-bottom: 0.125rem; }
.mb-1\.5 { margin-bottom: 0.375rem; }
.mb-5 { margin-bottom: 1.25rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.ml-1 { margin-left: 0.25rem; }
.ml-2 { margin-left: 0.5rem; }
.mr-2 { margin-right: 0.5rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }

/* Spacing utilities (auto-completed: 模板用到但此前缺失，修复内容贴边) */
.p-3 { padding: 0.75rem; }
.p-5 { padding: 1.25rem; }

/* 机台页：视频监控右栏（DOM 在前=手机端置顶，桌面端 order 靠右整栏） */
.mach-flex { display: flex; flex-direction: column; gap: 1.25rem; align-items: stretch; }
#mach .mach-video-col { width: 100%; display: flex; flex-direction: column; gap: 1.25rem; }
@media (min-width: 1024px) {
  .mach-flex { flex-direction: row; }
  /* 右侧监控栏设为黄金比例宽度 (440px)，左侧机台信息自然拉伸占满 */
  #mach .mach-video-col { order: 2; width: var(--mach-video-w, 440px); flex-shrink: 0; }
  #mach .mach-main-col { order: 1; flex: 1 1 0%; min-width: 0; }
}

