/* ============================================================
   DOAS 健康家 · 焓湿图页面样式（与 3D 页面共用 style.css 基础变量）
   ============================================================ */
body { overflow: hidden; }

/* 顶部导航（复用 index 的 topbar，导航链接可点击） */
.topbar-nav {
  display: flex; align-items: center; gap: 8px;
  pointer-events: auto; margin: 0 10px;
}
.nav-link {
  padding: 6px 16px; border-radius: 999px; font-size: 12.5px;
  color: var(--muted); text-decoration: none;
  border: 1px solid var(--panel-border); background: rgba(255,255,255,0.05);
  transition: all .15s; white-space: nowrap;
}
.nav-link:hover { color: #fff; background: rgba(78,161,255,0.2); border-color: var(--accent); }
.nav-link.active { color: #fff; background: var(--accent); border-color: var(--accent); }

/* ------- 主体布局：左图右栏 ------- */
#main {
  position: fixed; inset: 60px 0 0 0; display: flex;
  gap: 12px; padding: 12px 14px 14px;
}
#chartWrap { position: relative; flex: 1; min-width: 0; }
#chart {
  width: 100%; height: 100%; display: block;
  background: radial-gradient(120% 120% at 20% 0%, #121a2a 0%, #0c1018 60%, #0a0d14 100%);
  border: 1px solid var(--panel-border); border-radius: 14px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.45);
}

/* 图例与提示 */
.legend {
  position: absolute; top: 12px; left: 14px; z-index: 5;
  display: flex; flex-wrap: wrap; gap: 6px; pointer-events: none;
}
.legend .lg {
  font-size: 11.5px; color: #cdd6e4; background: rgba(13,18,28,0.82);
  border: 1px solid rgba(255,255,255,0.1); border-radius: 999px;
  padding: 3px 10px; backdrop-filter: blur(4px);
}
.legend .lg::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.legend .lg1::before { background: #ff9f43; box-shadow: 0 0 8px #ff9f43; }
.legend .lg2::before { background: #4ea1ff; box-shadow: 0 0 8px #4ea1ff; }
.legend .lg3::before { background: #34d399; box-shadow: 0 0 8px #34d399; }
.legend .lg4::before { background: #a78bfa; box-shadow: 0 0 8px #a78bfa; }

#chartHint {
  position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%);
  font-size: 11.5px; color: #7c8799; background: rgba(13,18,28,0.78);
  border: 1px solid rgba(255,255,255,0.08); border-radius: 999px;
  padding: 4px 14px; white-space: nowrap; pointer-events: none;
}

/* 悬停探针 */
#probe {
  position: absolute; z-index: 20; pointer-events: none;
  background: rgba(15,21,32,0.96); border: 1px solid rgba(78,161,255,0.55);
  border-radius: 10px; padding: 9px 12px; font-size: 12px; color: #e8ecf4;
  box-shadow: 0 8px 24px rgba(0,0,0,0.55); min-width: 168px;
  transform: translate(16px, -50%);
}
#probe.hidden { display: none; }
#probe .pr-t { font-weight: 600; margin-bottom: 5px; color: #fff; }
#probe table { border-collapse: collapse; width: 100%; }
#probe td { padding: 1.5px 0; }
#probe td:first-child { color: var(--muted); padding-right: 10px; }
#probe td:last-child { text-align: right; font-variant-numeric: tabular-nums; }

/* ------- 右侧面板 ------- */
#panel {
  width: 352px; flex-shrink: 0; overflow-y: auto;
  background: var(--panel); border: 1px solid var(--panel-border);
  border-radius: 14px; padding: 14px; backdrop-filter: blur(10px);
  box-shadow: 0 10px 40px rgba(0,0,0,0.45);
  display: flex; flex-direction: column; gap: 14px;
}
#panel::-webkit-scrollbar { width: 6px; }
#panel::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 3px; }

.panel-sec { display: flex; flex-direction: column; gap: 8px; }
.sec-title {
  font-size: 12.5px; font-weight: 600; color: #cdd6e4;
  letter-spacing: 0.3px; padding-bottom: 6px; border-bottom: 1px solid rgba(255,255,255,0.07);
}
.sec-note { font-size: 11.5px; color: var(--muted); line-height: 1.6; }

/* 工况 chips */
.mode-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.mode-chip {
  font-size: 11.5px; padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--panel-border); color: var(--muted);
  background: rgba(255,255,255,0.05); cursor: default;
}
.mode-chip.active {
  color: #06203a; background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-color: transparent; font-weight: 600;
}

/* 动画控制 */
.anim-controls { display: flex; align-items: center; gap: 8px; }
.speed-wrap { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.speed-lbl { font-size: 11px; color: var(--muted); }
#speed { width: 86px; accent-color: var(--accent); cursor: pointer; }
.scrub-wrap { display: flex; align-items: center; gap: 8px; }
.scrub-lbl {
  font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px;
}
#scrub { flex: 1; accent-color: var(--accent); cursor: pointer; }

/* 参数滑杆 */
.param-row {
  display: grid; grid-template-columns: 108px 1fr 74px; align-items: center; gap: 8px;
}
.param-row label { font-size: 12px; color: #c3cddc; }
.param-row input { width: 100%; accent-color: var(--accent); cursor: pointer; }
.param-row .pval { font-size: 12px; color: #fff; text-align: right; font-variant-numeric: tabular-nums; }

/* 当前状态 */
.live-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.live-item {
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.07);
  border-radius: 9px; padding: 7px 10px; display: flex; flex-direction: column; gap: 2px;
}
.live-item:first-child { grid-column: 1 / -1; background: rgba(78,161,255,0.12); border-color: rgba(78,161,255,0.4); }
.live-item .lv-lbl { font-size: 10.5px; color: var(--muted); }
.live-item .lv-val { font-size: 14.5px; font-weight: 600; color: #fff; font-variant-numeric: tabular-nums; }

/* 处理流程 chips */
.flow-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.fchip {
  display: flex; flex-direction: column; gap: 1px; min-width: 92px;
  padding: 6px 9px; border-radius: 9px; font-size: 11px;
  background: rgba(255,255,255,0.045); border: 1px solid rgba(255,255,255,0.08);
  color: #c3cddc; transition: all .2s;
}
.fchip .fc-name { font-weight: 600; }
.fchip .fc-sub { font-size: 10px; color: var(--muted); }
.fchip.done { border-color: rgba(52,211,153,0.55); color: #d1fae5; background: rgba(52,211,153,0.12); }
.fchip.done .fc-sub { color: #8bd9bb; }
.fchip.active { border-color: var(--accent); background: rgba(78,161,255,0.2); color: #fff; box-shadow: 0 0 14px rgba(78,161,255,0.35); }
.fchip.active .fc-sub { color: #a9cdfa; }

/* 状态点卡片 */
.state-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.scard {
  background: rgba(255,255,255,0.045); border: 1px solid rgba(255,255,255,0.08);
  border-radius: 9px; padding: 7px 9px; font-size: 11px; color: #c3cddc; transition: all .2s;
}
.scard .sc-head { display: flex; align-items: center; gap: 6px; font-weight: 600; margin-bottom: 4px; }
.scard .sc-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.scard .sc-rows { display: flex; flex-direction: column; gap: 1.5px; }
.scard .sc-row { display: flex; justify-content: space-between; gap: 6px; }
.scard .sc-row span:first-child { color: var(--muted); }
.scard .sc-row span:last-child { font-variant-numeric: tabular-nums; color: #e8ecf4; }
.scard.current { border-color: var(--accent); box-shadow: 0 0 14px rgba(78,161,255,0.25); }

.panel-foot { font-size: 10.5px; color: #6b7689; line-height: 1.6; }

/* 窄屏适配 */
@media (max-width: 1080px) {
  #panel { width: 320px; }
}
@media (max-width: 900px) {
  #main { flex-direction: column; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; }
  #chartWrap { flex: 1; min-height: 46vh; }
  #panel { width: 100%; max-height: 46vh; }
  #chartHint { white-space: normal; max-width: calc(100% - 20px); line-height: 1.5; text-align: center; }
  #topbar { padding: 0 12px; }
  #topbar .stats { gap: 12px; }
  #topbar .stats .num { font-size: 14px; }
  #topbar .stats .lbl { font-size: 10px; }
}

/* 状态点参数编辑器（手动设置 t / d） */
.se-tip { font-size: 10.5px; color: #6b7689; line-height: 1.5; }
.state-editors { display: flex; flex-direction: column; gap: 6px; }
.se-row {
  display: grid; grid-template-columns: 12px 96px 1fr 1fr; align-items: center; gap: 6px;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.07);
  border-radius: 9px; padding: 6px 9px;
}
.se-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.se-name { font-size: 12px; color: #cdd6e4; white-space: nowrap; }
.se-in { display: flex; align-items: center; gap: 4px; font-size: 10.5px; color: var(--muted); }
.se-in input {
  width: 100%; min-width: 0; background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12); color: #fff; border-radius: 6px;
  padding: 3px 6px; font-size: 12px; outline: none; font-variant-numeric: tabular-nums;
}
.se-in input:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(78,161,255,0.25); }
.se-in input:hover { border-color: rgba(78,161,255,0.5); }

/* ============================================================
   空气状态点参数查询（主界面悬浮面板 · 科技感玻璃拟态）
   ============================================================ */
#qp {
  position: fixed; z-index: 95;
  width: min(360px, calc(100vw - 32px));
  max-height: min(80vh, 600px);
  display: flex; flex-direction: column;
  background: linear-gradient(165deg, rgba(17,24,38,0.96), rgba(9,13,22,0.97));
  border: 1px solid rgba(78,161,255,0.30); border-radius: 16px;
  backdrop-filter: blur(14px);
  box-shadow: 0 14px 44px rgba(0,0,0,0.60), 0 0 0 1px rgba(255,255,255,0.03) inset,
              inset 0 1px 0 rgba(255,255,255,0.07);
  overflow: hidden;
  transition: opacity .22s ease, transform .22s ease;
  animation: qpPop .18s ease;
}
@keyframes qpPop {
  from { opacity: 0; transform: translateY(8px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
#qp::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px; z-index: 2;
  background: linear-gradient(90deg, transparent, #4ea1ff 28%, #34d399 72%, transparent);
  background-size: 220% 100%;
  animation: qpShimmer 6s linear infinite;
  box-shadow: 0 0 10px rgba(78,161,255,0.55);
}
@keyframes qpShimmer {
  0%   { background-position: 120% 0; }
  100% { background-position: -120% 0; }
}
#qp::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(120% 90% at 85% -10%, rgba(52,211,153,0.10), transparent 45%),
    radial-gradient(120% 90% at -10% 110%, rgba(78,161,255,0.12), transparent 50%),
    repeating-linear-gradient(0deg, rgba(255,255,255,0.016) 0 1px, transparent 1px 3px);
}
#qp > * { position: relative; z-index: 1; }
#qp.hidden { display: none; }
#qp.collapsed .qp-body { display: none; }
#qp.collapsed { max-height: none; }

.qp-head {
  display: flex; align-items: center; gap: 10px; padding: 11px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.09);
  background: rgba(78,161,255,0.07);
  flex-shrink: 0; cursor: grab; user-select: none;
}
.qp-head:hover { background: rgba(78,161,255,0.12); }
.qp-head.dragging { cursor: grabbing; background: rgba(78,161,255,0.18); }
.qp-title { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 700; color: #fff; letter-spacing: 0.3px; pointer-events: none; }
.qp-icon {
  width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0;
  background: radial-gradient(circle at 35% 35%, #9fe8ff, #4ea1ff 60%, #2b6fd0);
  box-shadow: 0 0 10px rgba(78,161,255,0.9);
  animation: qpPulse 2.2s ease-in-out infinite;
}
@keyframes qpPulse { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.35); opacity: 0.75; } }
.qp-tag {
  font-size: 9.5px; letter-spacing: 1.2px; color: #34d399; font-weight: 600;
  border: 1px solid rgba(52,211,153,0.42); border-radius: 999px; padding: 2px 7px;
  background: rgba(52,211,153,0.08);
}
.qp-actions { margin-left: auto; display: flex; gap: 6px; }
.qp-btn {
  width: 28px; height: 28px; border-radius: 8px; cursor: pointer; font-size: 14px; line-height: 1;
  color: #cdd6e4; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.13);
  transition: all .15s; flex-shrink: 0;
}
.qp-btn:hover { color: #fff; background: rgba(78,161,255,0.28); border-color: #4ea1ff; box-shadow: 0 0 10px rgba(78,161,255,0.35); }

.qp-body { padding: 12px 14px 14px; overflow-y: auto; min-height: 0; }
.qp-body::-webkit-scrollbar { width: 6px; }
.qp-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.16); border-radius: 3px; }
.qp-body::-webkit-scrollbar-track { background: transparent; }
.qp-tip {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; color: #8b95a8; margin-bottom: 10px;
}
.qp-tip::before { content: "\26A1"; color: #4ea1ff; text-shadow: 0 0 8px rgba(78,161,255,0.8); }

.qp-inputs { display: flex; align-items: flex-end; gap: 8px; }
.qp-field { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.qp-field select {
  width: 100%; font-size: 12.5px; color: #e8ecf4; cursor: pointer; outline: none;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.14);
  border-radius: 9px; padding: 6px 26px 6px 9px; appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%234ea1ff' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center;
  transition: border-color .15s, box-shadow .15s;
}
.qp-field select:hover { border-color: rgba(78,161,255,0.55); }
.qp-field select:focus { border-color: #4ea1ff; box-shadow: 0 0 0 2px rgba(78,161,255,0.22); }
.qp-field select option { background: #101828; color: #e8ecf4; }
.qp-val {
  display: flex; align-items: center;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.13);
  border-radius: 9px; overflow: hidden; transition: border-color .15s, box-shadow .15s;
}
.qp-val:focus-within { border-color: #4ea1ff; box-shadow: 0 0 0 2px rgba(78,161,255,0.22); }
.qp-val input {
  flex: 1; min-width: 0; background: transparent; border: none; outline: none;
  color: #fff; font-size: 17px; font-weight: 600; padding: 7px 10px;
  font-variant-numeric: tabular-nums; width: 100%;
}
.qp-unit {
  font-size: 11px; font-weight: 700; color: #34d399; padding-right: 10px;
  white-space: nowrap; text-shadow: 0 0 8px rgba(52,211,153,0.4);
}
.qp-swap {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0; cursor: pointer;
  border: 1px solid rgba(78,161,255,0.5); background: rgba(78,161,255,0.12); color: #9fd0ff;
  font-size: 14px; line-height: 1; margin-bottom: 2px; transition: all .22s;
}
.qp-swap:hover { background: rgba(78,161,255,0.32); color: #fff; transform: rotate(180deg); box-shadow: 0 0 12px rgba(78,161,255,0.5); }

.qp-msg { display: none; margin-top: 9px; font-size: 11.5px; padding: 7px 10px; border-radius: 8px; line-height: 1.55; }
.qp-msg.error { display: block; color: #ffb4a8; background: rgba(255,85,60,0.13); border: 1px solid rgba(255,110,90,0.42); }
.qp-msg.hint { display: block; color: #9fb4d0; background: rgba(78,161,255,0.08); border: 1px solid rgba(78,161,255,0.30); }
.qp-msg.ok { display: block; color: #9fe8c8; background: rgba(52,211,153,0.11); border: 1px solid rgba(52,211,153,0.36); }

.qp-outputs { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 11px; }
.qp-out {
  position: relative; padding: 7px 10px; border-radius: 10px;
  background: rgba(255,255,255,0.045); border: 1px solid rgba(255,255,255,0.08);
  transition: all .18s;
}
.qp-out .qo-lbl { font-size: 10.5px; color: #8b95a8; display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.qp-out .qo-val { font-size: 15.5px; font-weight: 600; color: #fff; margin-top: 2px; font-variant-numeric: tabular-nums; }
.qp-out .qo-unit { font-size: 10.5px; color: #34d399; font-weight: 600; margin-left: 3px; }
.qp-out.in {
  border-color: rgba(78,161,255,0.62); background: rgba(78,161,255,0.11);
  box-shadow: 0 0 14px rgba(78,161,255,0.16) inset;
}
.qp-out.in .qo-lbl { color: #9fd0ff; }
.qp-out.in::after {
  content: "输入"; position: absolute; top: 6px; right: 8px;
  font-size: 8.5px; letter-spacing: 0.5px; color: #4ea1ff; font-weight: 600;
  border: 1px solid rgba(78,161,255,0.5); border-radius: 999px; padding: 1px 5px;
}
.qp-out:hover { border-color: rgba(78,161,255,0.45); transform: translateY(-1px); }

.qp-examples { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; }
.qp-ex-lbl { font-size: 10.5px; color: #6b7689; margin-right: 2px; }
.qp-chip {
  font-size: 11px; color: #b9c4d6; cursor: pointer; font-family: inherit;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.13);
  border-radius: 999px; padding: 3px 10px; transition: all .15s;
}
.qp-chip:hover { color: #fff; border-color: #4ea1ff; background: rgba(78,161,255,0.2); box-shadow: 0 0 10px rgba(78,161,255,0.25); }

.qp-foot { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.qp-reset {
  font-size: 11.5px; color: #cdd6e4; cursor: pointer; font-family: inherit;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.13);
  border-radius: 8px; padding: 5px 12px; transition: all .15s;
}
.qp-reset:hover { color: #fff; border-color: #34d399; background: rgba(52,211,153,0.15); box-shadow: 0 0 10px rgba(52,211,153,0.25); }
.qp-pres {
  margin-left: auto; display: flex; align-items: center; gap: 5px;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.14);
  border-radius: 8px; padding: 4px 8px; cursor: text;
  transition: border-color .15s, box-shadow .15s;
}
.qp-pres:hover { border-color: rgba(78,161,255,0.55); }
.qp-pres:focus-within { border-color: #4ea1ff; box-shadow: 0 0 0 2px rgba(78,161,255,0.22); }
.qp-pres-lbl { font-size: 10.5px; color: #8b95a8; white-space: nowrap; }
.qp-pres input {
  width: 62px; background: transparent; border: none; outline: none; padding: 0;
  color: #34d399; font-size: 12.5px; font-weight: 700; text-align: right;
  font-variant-numeric: tabular-nums;
}
.qp-pres-unit { font-size: 10.5px; color: #8b95a8; white-space: nowrap; }
.qp-pres-info { margin-top: 8px; font-size: 10px; color: #5f6a7d; text-align: right; letter-spacing: 0.3px; }
.qp-pres-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.qp-pres-chip {
  font-size: 10.5px; color: #9fb4d0; cursor: pointer; font-family: inherit;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.13);
  border-radius: 999px; padding: 2px 9px; transition: all .15s;
}
.qp-pres-chip:hover { color: #fff; border-color: #4ea1ff; background: rgba(78,161,255,0.2); }
.qp-pres-chip.active {
  color: #06203a; background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-color: transparent; font-weight: 600;
}

/* 悬浮开关按钮 */
.qp-fab {
  position: fixed; left: 40px; top: calc(100vh - 128px); z-index: 100;
  display: flex; align-items: center; gap: 9px; cursor: grab;
  touch-action: none; user-select: none; -webkit-user-select: none;
  background: linear-gradient(135deg, rgba(78,161,255,0.32), rgba(52,211,153,0.24));
  border: 1px solid rgba(78,161,255,0.65); color: #fff;
  border-radius: 999px; padding: 12px 20px; font-size: 13.5px; font-weight: 700; font-family: inherit;
  backdrop-filter: blur(10px); box-shadow: 0 8px 26px rgba(0,0,0,0.5), 0 0 20px rgba(78,161,255,0.4);
  transition: box-shadow .2s, transform .15s, background .2s; animation: qpFabGlow 2.4s ease-in-out infinite;
  will-change: left, top;
}
.qp-fab .qp-fab-handle { font-size: 14px; opacity: .8; margin-right: 2px; color: #a9d7ff; }
.qp-fab.dragging { cursor: grabbing; transform: scale(1.05); animation: none; box-shadow: 0 10px 30px rgba(0,0,0,0.55), 0 0 26px rgba(52,211,153,0.6); }
.qp-fab.dragging .qp-fab-handle { color: #34d399; }
@keyframes qpFabGlow {
  0%, 100% { box-shadow: 0 6px 22px rgba(0,0,0,0.45), 0 0 14px rgba(78,161,255,0.30); }
  50% { box-shadow: 0 6px 26px rgba(0,0,0,0.45), 0 0 26px rgba(52,211,153,0.55); }
}
.qp-fab.hidden { display: none; }
.qp-fab:hover { border-color: #4ea1ff; background: linear-gradient(135deg, rgba(78,161,255,0.4), rgba(52,211,153,0.3)); transform: translateY(-1px); animation: none; }

/* 窄屏适配 */
@media (max-width: 900px) {
  #qp { width: min(360px, calc(100vw - 16px)); }
}
