:root {
  --brand: #059669;
  --brand-deep: #047857;
  --brand-mid: #10b981;
  --brand-soft: #d1fae5;
  --accent: #0d9488;
  --success: #059669;
  --danger: #dc2626;
  --warn: #d97706;
  --bg: #f4faf6;
  --bg-soft: #e8f5ee;
  --panel: #ffffff;
  --text: #1a2e22;
  --muted: #5f7368;
  --line: #d7e8de;
  --sidebar-w: 236px;
  --radius: 16px;
  --radius-sm: 12px;
  --shadow: 0 10px 28px rgba(4, 120, 87, 0.08);
  --shadow-sm: 0 4px 14px rgba(4, 120, 87, 0.05);
  --font: "Manrope", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-display: "Noto Serif SC", "Songti SC", serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-tap-highlight-color: transparent; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; }
.hidden { display: none !important; }
.page { min-height: 100dvh; }

/* ========== 登录 ========== */
.login-page {
  display: grid; place-items: center; padding: 24px;
  position: relative; overflow: hidden;
  min-height: 100dvh;
}
.login-bg {
  position: absolute; inset: 0; z-index: 0;
  pointer-events: none;
  background: linear-gradient(165deg, #0b3d32 0%, #0f5c4c 38%, #147a63 72%, #0e4f42 100%);
}
.login-bg-wash {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 90% 55% at 18% 0%, rgba(255,255,255,.16), transparent 55%),
    radial-gradient(ellipse 70% 50% at 88% 100%, rgba(6,78,59,.55), transparent 60%),
    linear-gradient(180deg, transparent 0%, rgba(4,47,46,.2) 100%);
}
.login-bg-beam {
  position: absolute;
  width: 140%; height: 42%;
  left: -20%; top: -8%;
  background: linear-gradient(105deg, transparent 20%, rgba(255,255,255,.1) 48%, transparent 72%);
  transform: rotate(-8deg);
  animation: loginBeam 16s ease-in-out infinite;
}
.login-bg-mist {
  position: absolute; border-radius: 50%;
  filter: blur(48px);
  opacity: .55;
  animation: loginMist 18s ease-in-out infinite;
}
.login-bg-mist-a {
  width: 55vw; height: 40vw; min-width: 280px; min-height: 220px;
  left: -8%; top: 12%;
  background: rgba(167,243,208,.28);
}
.login-bg-mist-b {
  width: 48vw; height: 36vw; min-width: 240px; min-height: 180px;
  right: -6%; bottom: 8%;
  background: rgba(15,118,110,.45);
  animation-delay: -8s;
}
.login-particles {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  width: 100%; height: 52%;
  z-index: 1;
  display: block;
  pointer-events: none;
  opacity: .9;
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 22%, #000 100%);
  mask-image: linear-gradient(180deg, transparent 0%, #000 22%, #000 100%);
}
@keyframes loginBeam {
  0%, 100% { opacity: .55; transform: rotate(-8deg) translateX(0); }
  50% { opacity: .9; transform: rotate(-8deg) translateX(3%); }
}
@keyframes loginMist {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(2%, -3%) scale(1.06); }
}
.login-panel {
  position: relative; z-index: 2;
  width: min(400px, 100%);
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 24px 48px rgba(6, 40, 32, .28);
  animation: rise .4s ease;
}
.login-panel::before {
  content: "";
  display: block;
  height: 108px;
  background: linear-gradient(135deg, #047857 0%, #0d9488 100%);
}
.login-brand {
  text-align: center;
  margin: -90px 28px 8px;
  padding: 18px 12px 22px;
  position: relative;
}
.login-brand.no-logo {
  margin-top: -90px;
  padding-top: 28px;
  padding-bottom: 24px;
}
.login-logo {
  width: 28px; height: 28px; margin: 0 auto 8px;
  padding: 4px;
  background: rgba(255,255,255,.2);
  border-radius: 8px;
  display: block;
  box-sizing: content-box;
}
.login-brand h1 {
  font-family: var(--font-display);
  font-size: 1.32rem; color: #fff; font-weight: 700;
  letter-spacing: .01em;
  margin: 0 0 22px;
  text-shadow: 0 1px 2px rgba(0,40,30,.25);
}
.login-brand p {
  display: inline-block;
  margin: 0;
  padding: 6px 14px;
  font-size: .82rem;
  font-weight: 650;
  color: #065f46;
  background: #fff;
  border: 1px solid rgba(6,95,70,.12);
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(4,47,46,.1);
}
.login-form { padding: 14px 28px 28px; }
.field { display: block; margin-bottom: 14px; }
.field > span,
.field-label {
  display: flex; align-items: center; gap: 7px;
  font-size: .76rem; color: var(--muted);
  margin-bottom: 6px; font-weight: 650;
}
.field-ico {
  width: 18px; height: 18px; border-radius: 6px;
  display: grid; place-items: center; flex-shrink: 0;
  color: #fff;
}
.field-ico svg { width: 11px; height: 11px; display: block; }
.field-ico-user { background: linear-gradient(135deg, #34d399, #059669); }
.field-ico-lock { background: linear-gradient(135deg, #38bdf8, #2563eb); }
.field input {
  width: 100%; padding: 12px 14px;
  border: 1.5px solid var(--line); border-radius: 11px;
  background: #f8fcfa; color: var(--text); outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.field input:hover { border-color: #b7d4c4; background: #fff; }
.field input:focus {
  border-color: var(--brand);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(5,150,105,.14);
}
.remember { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .88rem; margin: 6px 0 18px; }
.error-tip { color: var(--danger); text-align: center; min-height: 1.2em; margin-top: 10px; font-size: .85rem; }

/* ========== 按钮 ========== */
.btn {
  border: none; border-radius: 11px; padding: 10px 16px;
  font-weight: 700; cursor: pointer;
  transition: transform .1s, filter .15s, box-shadow .15s;
}
.btn:active { transform: scale(.97); }
.btn-block { width: 100%; padding: 13px; font-size: 1rem; }
.btn-primary {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  box-shadow: 0 8px 18px rgba(5,150,105,.28);
}
.btn-primary:hover { filter: brightness(1.05); }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-outline {
  background: #fff; color: var(--brand-deep);
  border: 1px solid var(--line); box-shadow: var(--shadow-sm);
}
.btn-outline:hover { border-color: var(--brand); color: var(--brand); }
.btn-sm { padding: 7px 12px; font-size: .8rem; border-radius: 9px; }
.icon-btn {
  width: 40px; height: 40px; border: none; border-radius: 11px;
  background: var(--bg-soft); color: var(--brand-deep);
  cursor: pointer; font-size: 1.05rem;
}

/* ========== Shell ========== */
.shell {
  display: flex; min-height: 100dvh;
  background: var(--bg);
}
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  background: #eef8f2;
  color: var(--text);
  display: flex; flex-direction: column;
  padding: 18px 14px 16px;
  position: sticky; top: 0; height: 100dvh; z-index: 40;
  border-right: 1px solid var(--line);
  border-radius: 0 18px 18px 0;
  box-shadow: 4px 0 20px rgba(4,120,87,.04);
}
.sidebar-brand {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 10px 20px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
}
.sidebar-logo {
  width: 38px; height: 38px;
  flex-shrink: 0;
}
body:not(.show-logo) .sidebar-logo { display: none !important; }
body:not(.show-logo) .login-logo { display: none !important; }
.sidebar-title {
  font-family: var(--font-display);
  font-weight: 700; font-size: 1.05rem;
  color: var(--brand-deep);
}
.sidebar-sub { font-size: .7rem; color: var(--muted); margin-top: 2px; }

.sidebar-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border: none; border-radius: 12px;
  background: transparent; color: var(--muted);
  cursor: pointer; text-align: left; font-weight: 650; font-size: .92rem;
  transition: background .15s, color .15s;
}
.nav-item:hover { background: var(--bg-soft); color: var(--brand-deep); }
.nav-item.active {
  background: var(--brand-soft);
  color: var(--brand-deep);
  box-shadow: inset 3px 0 0 var(--brand);
}
.nav-ico {
  width: 30px; height: 30px; flex-shrink: 0;
  border-radius: 9px; display: grid; place-items: center;
}
.nav-ico svg { width: 16px; height: 16px; display: block; }
.nav-ico.ico-home { background: rgba(5,150,105,.14); color: #059669; }
.nav-ico.ico-fan { background: rgba(13,148,136,.14); color: #0d9488; }
.nav-ico.ico-chart { background: rgba(37,99,235,.14); color: #2563eb; }
.nav-ico.ico-vfd { background: rgba(99,102,241,.14); color: #6366f1; }
.nav-ico.ico-motor { background: rgba(8,145,178,.14); color: #0891b2; }
.nav-ico.ico-airflow { background: rgba(37,99,235,.14); color: #2563eb; }
.nav-ico.ico-energy { background: rgba(14,165,233,.14); color: #0ea5e9; }
.nav-ico.ico-topo { background: rgba(37,99,235,.14); color: #2563eb; }
.nav-ico.ico-scene { background: rgba(20,184,166,.14); color: #14b8a6; }
.nav-ico.ico-alarm { background: rgba(225,29,72,.14); color: #e11d48; }
.nav-ico.ico-oplog { background: rgba(217,119,6,.14); color: #d97706; }
.nav-ico.ico-setting { background: rgba(124,58,237,.14); color: #7c3aed; }
.nav-ico.ico-accounts { background: rgba(8,145,178,.14); color: #0891b2; }
.nav-item.active .nav-ico { filter: saturate(1.15); }

.accounts-panel { padding: 0; overflow: hidden; }
.accounts-table-wrap { overflow-x: auto; }
.accounts-table {
  width: 100%; border-collapse: collapse; font-size: .88rem;
}
.accounts-table th, .accounts-table td {
  padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.accounts-table th {
  background: #f4faf6; color: var(--muted); font-size: .75rem; font-weight: 750;
}
.accounts-table .acc-user,
.accounts-table .acc-name,
.accounts-table .acc-phone,
.accounts-table .acc-role {
  width: 100%; max-width: 150px; padding: 8px 10px;
  border: 1.5px solid var(--line); border-radius: 9px; background: #fff;
  color: var(--text); outline: none; font: inherit;
}
.accounts-table .acc-phone { max-width: 130px; }
.accounts-table .acc-user:focus,
.accounts-table .acc-name:focus,
.accounts-table .acc-phone:focus,
.accounts-table .acc-role:focus {
  border-color: var(--brand); box-shadow: 0 0 0 3px rgba(5,150,105,.12);
}
.acc-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-self {
  display: inline-block; font-size: .65rem; padding: 1px 6px; border-radius: 999px;
  background: var(--brand-soft); color: var(--brand-deep); font-weight: 750; margin-left: 4px;
}
.accounts-table .acc-row { cursor: pointer; }
.accounts-table .acc-row:hover { background: #f4faf6; }
.accounts-table .acc-row.active { background: var(--brand-soft); }
.accounts-table .acc-click { cursor: pointer; }
.account-oplog-panel { margin-top: 14px; }
.account-oplog-panel .list-panel { border: 1px solid var(--line); border-radius: 12px; }

.sidebar-foot {
  border-top: 1px solid var(--line);
  padding-top: 14px; display: flex; flex-direction: column; gap: 10px;
}
.user-chip { display: flex; align-items: center; gap: 10px; padding: 4px 6px; }
.avatar {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, #a7f3d0, #34d399);
  color: #065f46;
  display: grid; place-items: center; font-weight: 800; font-size: .9rem;
}
.user-name { font-size: .88rem; font-weight: 700; color: var(--text); }
.user-role { font-size: .72rem; color: var(--muted); }
.sidebar-foot .btn-ghost { color: var(--muted); text-align: left; padding-left: 8px; }
.sidebar-foot .btn-ghost:hover { color: var(--brand-deep); background: var(--bg-soft); }

.sidebar-mask {
  display: none; position: fixed; inset: 0;
  background: rgba(26,46,34,.28); z-index: 35; backdrop-filter: blur(2px);
}

.main {
  flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 100dvh;
}

.topbar {
  height: 56px; display: flex; align-items: center; gap: 12px;
  padding: 0 20px;
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
#btn-menu { display: none; }
.topbar-crumb {
  font-family: var(--font-display);
  font-weight: 700; color: var(--text); font-size: 1rem; flex: 1;
}
.topbar-actions { display: flex; gap: 8px; align-items: center; }

.content {
  flex: 1; padding: 20px 22px 36px;
  max-width: 1280px; width: 100%; margin: 0 auto;
}

.tab-panel { display: none; animation: rise .28s ease; }
.tab-panel.active { display: block; }
@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* ========== Hero / KPI ========== */
.hero-nav {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 2px 0;
  margin-bottom: 12px;
  padding: 8px 12px;
  background: #fff;
  border: 1px solid rgba(215,232,222,.95);
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
}
.hero-nav-item {
  appearance: none;
  border: 0; background: transparent;
  color: var(--brand-deep);
  font-size: .84rem; font-weight: 650;
  line-height: 1;
  padding: 6px 12px;
  cursor: pointer;
  white-space: nowrap;
}
.hero-nav-item + .hero-nav-item {
  border-left: 1px solid var(--line);
}
.hero-nav-item:hover {
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 999px;
  font-size: .8rem; font-weight: 700; border: none; cursor: pointer;
}
.pill.glass {
  background: rgba(255,255,255,.16); color: #fff;
  border: 1px solid rgba(255,255,255,.22); backdrop-filter: blur(8px);
}
.pill.glass:hover { background: rgba(255,255,255,.24); }
.pill.ghost {
  background: #fff; color: var(--muted);
  border: 1px solid var(--line); cursor: default;
}
.pill.ghost.power-off {
  background: #fef2f2 !important; color: var(--danger) !important;
  border-color: #fecaca !important;
}

.kpi-row {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 8px;
}
.kpi-card {
  background: var(--panel); border-radius: var(--radius);
  padding: 16px 18px; display: flex; align-items: center; gap: 14px;
  box-shadow: var(--shadow-sm); border: 1px solid rgba(215,232,222,.9);
}
.kpi-ico {
  width: 44px; height: 44px; border-radius: 12px;
  display: grid; place-items: center; font-size: 1.1rem; color: #fff;
}
.kpi-ico.sensor { background: linear-gradient(135deg, #34d399, #059669); }
.kpi-ico.fan { background: linear-gradient(135deg, #2dd4bf, #0d9488); }
.kpi-ico.alarm { background: linear-gradient(135deg, #f87171, #dc2626); }
.kpi-label { font-size: .75rem; color: var(--muted); }
.kpi-value {
  font-size: 1.4rem; font-weight: 700; color: var(--text); line-height: 1.2;
}
.kpi-value.accent { color: var(--accent); }
.kpi-value.danger { color: var(--danger); }

.section-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 12px; margin: 24px 0 12px; flex-wrap: wrap;
}
.section-head.compact { margin: 20px 0 10px; }
.section-head h2 {
  font-family: var(--font-display);
  font-size: 1.1rem; font-weight: 700; color: var(--text);
  display: flex; align-items: center; gap: 8px;
}
.section-head h2::before {
  content: ""; width: 4px; height: 1em; border-radius: 4px;
  background: var(--brand);
}
.section-head h3 {
  font-family: var(--font-display);
  font-size: .98rem; font-weight: 700; color: var(--text);
}
.section-head p { font-size: .8rem; color: var(--muted); margin-top: 4px; }

.panel {
  background: var(--panel); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow-sm);
  border: 1px solid rgba(215,232,222,.85);
}
.list-panel { padding: 0; overflow: hidden; }

.sensor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}
.sensor-card {
  background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px;
  display: flex; gap: 12px; align-items: flex-start;
  box-shadow: var(--shadow-sm);
  transition: transform .15s, box-shadow .15s;
}
.sensor-card.clickable { cursor: pointer; }
.sensor-card.clickable:hover {
  transform: translateY(-2px); box-shadow: var(--shadow);
  border-color: #a7d4c0;
}
.sensor-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.sensor-card.alarm { border-color: #fecaca; background: #fffbfb; }
.sensor-ico {
  width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0;
  display: grid; place-items: center;
}
.sensor-ico .ico-svg { width: 22px; height: 22px; display: block; }
.sensor-card.alarm .sensor-ico { box-shadow: inset 0 0 0 1px rgba(220,38,38,.25); }
.sensor-body { min-width: 0; flex: 1; }
.sensor-name { font-size: .78rem; color: var(--muted); font-weight: 650; }
.sensor-val {
  font-size: 1.3rem; font-weight: 700; margin: 2px 0 4px;
}
.sensor-val .unit { font-size: .75rem; font-weight: 600; color: var(--muted); margin-left: 2px; }
.sensor-range {
  font-size: .7rem; color: var(--muted);
  background: var(--bg-soft); display: inline-block;
  padding: 2px 8px; border-radius: 999px;
}
.sensor-card.alarm .sensor-val { color: var(--danger); }

.bus-support {
  margin-top: 16px;
  margin-bottom: 0;
  padding: 14px 16px 16px;
}
.bus-support-title {
  font-weight: 750; color: var(--text); font-size: .92rem; margin-bottom: 12px;
}
.bus-support-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}
.bus-card {
  display: flex; flex-direction: column; gap: 4px;
  padding: 12px 12px 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #f8fcfa;
  position: relative;
  overflow: hidden;
}
.bus-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
}
.bus-ico {
  width: 28px; height: 28px; border-radius: 8px;
  display: grid; place-items: center; margin-bottom: 4px;
}
.bus-ico svg { width: 16px; height: 16px; display: block; }
.bus-name { font-weight: 750; font-size: .88rem; color: var(--text); }
.bus-desc { font-size: .75rem; color: var(--muted); font-weight: 600; line-height: 1.35; }

.bus-rs485::before { background: #059669; }
.bus-rs485 .bus-ico { background: rgba(5,150,105,.14); color: #059669; }
.bus-can::before { background: #2563eb; }
.bus-can .bus-ico { background: rgba(37,99,235,.14); color: #2563eb; }
.bus-eth::before { background: #6366f1; }
.bus-eth .bus-ico { background: rgba(99,102,241,.14); color: #6366f1; }
.bus-wireless::before { background: #0ea5e9; }
.bus-wireless .bus-ico { background: rgba(14,165,233,.14); color: #0ea5e9; }

.bus-support-title-2 { margin-top: 16px; }
.proto-modbus::before { background: #0d9488; }
.proto-modbus .bus-ico { background: rgba(13,148,136,.14); color: #0d9488; }
.proto-canopen::before { background: #4f46e5; }
.proto-canopen .bus-ico { background: rgba(79,70,229,.14); color: #4f46e5; }
.proto-passthru::before { background: #0891b2; }
.proto-passthru .bus-ico { background: rgba(8,145,178,.14); color: #0891b2; }

.group-grid, .group-entry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}
.group-card, .group-entry {
  background: #fff; border-radius: var(--radius); padding: 16px;
  border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  cursor: pointer; transition: transform .15s, box-shadow .15s;
}
.group-card:hover, .group-entry:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.group-head, .group-entry .ge-top {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; gap: 10px;
}
.group-name, .group-entry .ge-name {
  font-family: var(--font-display); font-weight: 700; color: var(--text);
}
.group-entry .ge-name { font-size: 1.08rem; }
.group-meta, .group-entry .ge-meta { font-size: .8rem; color: var(--muted); margin-bottom: 10px; }
.group-entry .ge-mode {
  font-size: .72rem; padding: 3px 10px; border-radius: 999px; font-weight: 700;
  background: var(--bg-soft); color: var(--brand-deep);
}
.group-entry .ge-mode.on { background: var(--brand-soft); color: var(--brand-deep); }
.group-entry .ge-foot {
  display: flex; justify-content: space-between; align-items: center;
  font-size: .8rem; color: var(--brand); font-weight: 700;
}
.dots { display: flex; gap: 7px; flex-wrap: wrap; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: #c9d8cf; }
.dot.run { background: var(--success); box-shadow: 0 0 0 3px rgba(5,150,105,.18); }
.dot.fault { background: var(--danger); box-shadow: 0 0 0 3px rgba(220,38,38,.15); }

.list-item {
  padding: 14px 16px; border-bottom: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 4px;
}
.list-item:last-child { border-bottom: none; }
.list-item .row { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.list-item .msg { font-size: .92rem; font-weight: 700; }
.list-item .meta { font-size: .75rem; color: var(--muted); }
.badge {
  font-size: .7rem; padding: 3px 9px; border-radius: 999px; font-weight: 750; white-space: nowrap;
}
.badge.warn { background: #fef3c7; color: #92400e; }
.badge.error { background: #fee2e2; color: var(--danger); }
.badge.ok { background: var(--brand-soft); color: var(--brand-deep); }

.seg {
  display: inline-flex; background: var(--bg-soft); border-radius: 999px; padding: 3px;
}
.seg-btn {
  border: none; background: transparent; padding: 8px 16px; border-radius: 999px;
  color: var(--muted); font-weight: 700; font-size: .85rem; cursor: pointer;
}
.seg-btn.active { background: #fff; color: var(--brand-deep); box-shadow: var(--shadow-sm); }

.toolbar-row {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px;
}
.toolbar-row .select, .select {
  width: auto; min-width: 140px; padding: 10px 14px;
  border: 1.5px solid var(--line); border-radius: 11px; background: #fff; outline: none;
}
.toolbar-row .select:focus, .select:focus {
  border-color: var(--brand); box-shadow: 0 0 0 3px rgba(5,150,105,.12);
}

.device-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
.device-card {
  background: #fff; border-radius: var(--radius); padding: 16px;
  border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 12px;
}
.device-top { display: flex; gap: 12px; align-items: flex-start; }
.device-ico {
  width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, #34d399, #059669); font-size: 1.05rem;
}
.device-ico.run { background: linear-gradient(135deg, #34d399, #059669); }
.device-ico.fault { background: linear-gradient(135deg, #f87171, #dc2626); }
.device-info { flex: 1; min-width: 0; }
.device-name { font-family: var(--font-display); font-weight: 700; color: var(--text); }
.device-desc { font-size: .75rem; color: var(--muted); margin-top: 2px; }
.device-status-row { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.status-pill { font-size: .72rem; padding: 3px 10px; border-radius: 999px; font-weight: 750; }
.status-pill.run { background: var(--brand-soft); color: var(--brand-deep); }
.status-pill.stop { background: var(--bg-soft); color: var(--muted); }
.status-pill.fault { background: #fee2e2; color: var(--danger); }

.switch {
  width: 48px; height: 28px; border-radius: 999px; border: none;
  background: #c9d5ce; position: relative; cursor: pointer; flex-shrink: 0;
  transition: background .2s;
}
.switch.on { background: var(--brand); }
.switch::after {
  content: ""; position: absolute; width: 22px; height: 22px; border-radius: 50%;
  background: #fff; top: 3px; left: 3px; transition: left .2s;
  box-shadow: 0 2px 6px rgba(0,0,0,.15);
}
.switch.on::after { left: 23px; }
.switch:disabled { opacity: .45; cursor: not-allowed; }

.speed-row { display: flex; align-items: center; gap: 10px; }
.speed-row input[type=range] { flex: 1; accent-color: var(--brand); }
.speed-val { font-size: .8rem; font-weight: 750; color: var(--brand-deep); min-width: 40px; }
.device-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.device-actions .btn { width: 100%; }

.rule-item {
  padding: 14px 0; border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.rule-item:last-child { border-bottom: none; }
.rule-item .title { font-weight: 750; font-size: .92rem; }
.rule-item .desc { font-size: .75rem; color: var(--muted); margin-top: 3px; word-break: break-all; }

.form-panel { padding: 18px; }
.form-row {
  display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 4px; align-items: flex-end;
}
.form-actions {
  display: flex; justify-content: flex-end; gap: 10px;
  margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line);
}
.form-actions .btn-primary { min-width: 120px; padding: 11px 22px; }

.field-shell { display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 0; }
.field-shell > .flabel { font-size: .72rem; font-weight: 700; color: var(--muted); }
.input-box {
  position: relative; display: flex; align-items: center;
  border-radius: 11px; background: #f8fcfa; border: 1.5px solid var(--line);
  transition: border-color .15s, box-shadow .15s, background .15s; overflow: hidden;
}
.input-box:hover { border-color: #b7d4c4; background: #fff; }
.input-box:focus-within {
  border-color: var(--brand); background: #fff;
  box-shadow: 0 0 0 3px rgba(5,150,105,.12);
}
.input-box input, .input-box select {
  width: 100%; border: none; outline: none; background: transparent;
  padding: 12px 14px; color: var(--text); appearance: none; -webkit-appearance: none;
}
.input-box .prefix { padding-left: 14px; font-size: .75rem; font-weight: 700; color: var(--muted); }
.input-box .prefix + input { padding-left: 4px; }
.input-box .suffix {
  padding: 0 14px; font-size: .75rem; font-weight: 700; color: var(--brand-deep);
  border-left: 1px solid var(--line); align-self: stretch;
  display: grid; place-items: center; background: var(--bg-soft);
}
.input-box.select-box::after {
  content: ""; position: absolute; right: 14px; top: 50%;
  width: 7px; height: 7px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: translateY(-60%) rotate(45deg); pointer-events: none;
}
.input-box.select-box select { padding-right: 36px; cursor: pointer; }

.th-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px; margin-bottom: 4px;
}
.th-card {
  border-radius: 12px; padding: 12px;
  background: #f8fcfa; border: 1px solid var(--line);
}
.th-card .flabel {
  display: flex; justify-content: space-between; align-items: center;
  font-size: .72rem; color: var(--muted); font-weight: 700; margin-bottom: 8px;
  gap: 8px;
}
.th-card .th-title {
  display: inline-flex; align-items: center; gap: 8px; min-width: 0;
}
.th-card .th-ico {
  width: 26px; height: 26px; border-radius: 8px; flex-shrink: 0;
  display: inline-grid; place-items: center;
}
.th-card .th-ico .ico-svg { width: 15px; height: 15px; display: block; }
.th-card .flabel .tag {
  font-size: .65rem; padding: 2px 7px; border-radius: 999px;
  background: var(--brand-soft); color: var(--brand-deep); font-weight: 750;
  flex-shrink: 0;
}
.th-card .flabel .tag.lv1 { background: #fee2e2; color: var(--danger); }
.th-card .input-box { background: #fff; }

.channel-switches {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px; margin-bottom: 4px;
}
.channel-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 14px; border-radius: 12px;
  background: #f8fcfa; border: 1px solid var(--line);
}
.channel-item .lab { font-size: .85rem; font-weight: 700; color: var(--text); }
.api-output-hint {
  display: block; margin-top: 3px;
  font-size: .74rem; font-weight: 550; color: var(--muted);
}

.user-list { margin-top: 12px; }
.user-row {
  display: flex; justify-content: space-between; padding: 10px 0;
  border-bottom: 1px solid var(--line); font-size: .9rem;
}

.chart { width: 100%; height: 380px; }
.chart-panel { padding: 16px 18px 12px; }
.chart-sensor-tabs {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--line);
}
.chart-tab {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: #fff;
  color: var(--muted); font-size: .85rem; font-weight: 700; cursor: pointer;
}
.chart-tab-ico {
  width: 22px; height: 22px; border-radius: 7px;
  display: inline-grid; place-items: center; flex-shrink: 0;
}
.chart-tab-ico .ico-svg { width: 14px; height: 14px; display: block; }
.chart-tab.active .chart-tab-ico { color: #fff !important; background: rgba(255,255,255,.22) !important; }
.chart-tab:hover { filter: brightness(.97); }
.chart-tab.active { color: #fff; }
.chart-range-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 12px;
}
.chart-custom-range {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px;
  flex: 1; min-width: 260px;
}
.chart-custom-range .field-shell { flex: 0 1 160px; }
.range-sep { color: var(--muted); font-weight: 700; padding-bottom: 14px; }

.monitor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
.mon-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--shadow-sm);
}
.mon-card .mon-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 12px;
}
.mon-card .mon-name { font-weight: 750; color: var(--text); font-size: .95rem; }
.mon-card .mon-sub { font-size: .75rem; color: var(--muted); margin-top: 2px; }
.mon-card .mon-badge {
  font-size: .68rem; font-weight: 750; padding: 3px 8px; border-radius: 999px;
  background: var(--bg-soft); color: var(--brand-deep);
}
.mon-card .mon-badge.off { background: #eef2f7; color: #64748b; }
.mon-card .mon-badge.fault { background: #fee2e2; color: #dc2626; }
.mon-metrics {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
}
.mon-metric {
  background: #f8fcfa; border-radius: 10px; padding: 10px 8px; text-align: center;
}
.mon-metric .ml { font-size: .68rem; color: var(--muted); font-weight: 650; }
.mon-metric .mv { font-size: 1.05rem; font-weight: 750; color: var(--text); margin-top: 2px; }
.mon-metric .mu { font-size: .68rem; color: var(--muted); }
.mon-card .mon-actions { margin-top: 10px; display: flex; justify-content: flex-end; }

.vfd-metrics { gap: 10px; }
.vfd-metric {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 12px 8px 14px;
}
.vfd-metric .mi {
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center; margin-bottom: 2px;
}
.vfd-metric .mi svg { width: 18px; height: 18px; display: block; }
.vfd-metric .mi-volt { background: rgba(37,99,235,.12); color: #2563eb; }
.vfd-metric .mi-amp { background: rgba(5,150,105,.12); color: #059669; }
.vfd-metric .mi-freq { background: rgba(99,102,241,.12); color: #6366f1; }
.vfd-metric .ml { font-size: .74rem; }
.vfd-metric .mv {
  font-size: 1.35rem; font-weight: 800; line-height: 1.15; margin-top: 0;
  color: var(--text);
}
.vfd-metric .mv .mu {
  font-size: .78rem; font-weight: 700; color: var(--muted); margin-left: 2px;
}

.motor-metrics { gap: 10px; }
.motor-metric {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 12px 8px 14px;
}
.motor-metric .mi {
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center; margin-bottom: 2px;
}
.motor-metric .mi svg { width: 18px; height: 18px; display: block; }
.motor-metric .mi-power { background: rgba(14,165,233,.14); color: #0ea5e9; }
.motor-metric .mi-temp { background: rgba(99,102,241,.14); color: #6366f1; }
.motor-metric .mi-vib { background: rgba(13,148,136,.14); color: #0d9488; }
.motor-metric .ml { font-size: .74rem; }
.motor-metric .mv {
  font-size: 1.35rem; font-weight: 800; line-height: 1.15; margin-top: 0;
  color: var(--text);
}
.motor-metric .mv .mu {
  font-size: .78rem; font-weight: 700; color: var(--muted); margin-left: 2px;
}

.airflow-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.airflow-card.offline { opacity: .72; }
.airflow-val-row {
  display: flex; align-items: center; gap: 12px; margin-top: 4px;
}
.airflow-val-row .mi {
  width: 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center; flex-shrink: 0;
}
.airflow-val-row .mi svg { width: 22px; height: 22px; display: block; }
.airflow-label { font-size: .72rem; color: var(--muted); font-weight: 650; }
.airflow-value {
  font-size: 1.45rem; font-weight: 800; line-height: 1.15; margin-top: 2px;
}
.airflow-value .mu {
  font-size: .78rem; font-weight: 700; color: var(--muted); margin-left: 2px;
}

.energy-hint { font-size: .78rem; color: var(--muted); margin: 0 0 10px; }
.energy-kpi-phase {
  grid-template-columns: 1.4fr 1.4fr 1fr 1fr;
  align-items: stretch;
}
.energy-phase-card { align-items: flex-start; }
.energy-phase-body { flex: 1; min-width: 0; }
.phase-lines { display: grid; gap: 4px; margin-top: 6px; }
.phase-line {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  font-size: .84rem;
}
.phase-line span { color: var(--muted); font-weight: 650; }
.phase-line strong {
  font-size: 1.05rem; font-weight: 750; color: var(--text);
  font-variant-numeric: tabular-nums;
}
@media (max-width: 1100px) {
  .energy-kpi-phase { grid-template-columns: 1fr 1fr; }
}

.topo-panel { padding: 16px 18px 18px; overflow: hidden; }
.topo-legend {
  display: flex; flex-wrap: wrap; gap: 14px 20px;
  margin-bottom: 12px; font-size: .8rem; color: var(--muted); font-weight: 650;
}
.topo-legend .tl {
  display: inline-block; width: 28px; height: 3px; border-radius: 2px;
  margin-right: 8px; vertical-align: middle;
}
.tl-power { background: #059669; }
.tl-ctrl { background: #6366f1; }
.tl-sense { background: #0ea5e9; }
.topo-wrap {
  overflow: auto;
  background:
    radial-gradient(ellipse 60% 50% at 50% 0%, rgba(5,150,105,.06), transparent 60%),
    linear-gradient(180deg, #f7fcf9, #fff);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 8px;
}
.topo-svg { width: 100%; min-width: 720px; height: auto; display: block; }
.topo-lines { fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.topo-lines path { fill: none; }
.topo-lines.power { stroke: #059669; }
.topo-lines.ctrl { stroke: #6366f1; stroke-dasharray: 6 5; }
.topo-lines.sense { stroke: #0ea5e9; stroke-dasharray: 3 4; }
.topo-node rect {
  fill: #fff; stroke-width: 1.8; filter: drop-shadow(0 4px 10px rgba(4,120,87,.08));
}
.topo-node .nt {
  fill: #1a2e22; font-size: 13px; font-weight: 700; text-anchor: middle;
  font-family: Manrope, "Segoe UI", "Microsoft YaHei", sans-serif;
}
.topo-node .ns {
  fill: #5f7368; font-size: 11px; text-anchor: middle;
  font-family: Manrope, "Segoe UI", "Microsoft YaHei", sans-serif;
}
.topo-node.n-grid rect { stroke: #059669; }
.topo-node.n-breaker rect { stroke: #0d9488; }
.topo-node.n-meter rect { stroke: #0ea5e9; }
.topo-node.n-plc rect { stroke: #6366f1; }
.topo-node.n-vfd rect { stroke: #2563eb; fill: #f8fbff; }
.topo-node.n-motor rect { stroke: #14b8a6; fill: #f6fffd; }
.topo-node.n-sensor rect { stroke: #8b5cf6; }
.topo-node.n-protect rect { stroke: #64748b; fill: #f8fafc; }
.topo-node.n-protect .nt { font-size: 12px; }
.topo-note {
  margin-top: 12px; font-size: .78rem; color: var(--muted);
}

.scene-active-bar {
  margin-bottom: 14px; padding: 12px 16px; border-radius: 12px;
  background: var(--brand-soft); color: var(--brand-deep); font-weight: 700;
  border: 1px solid var(--line);
}
.scene-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.scene-card {
  position: relative; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 16px 16px; background: #fff; cursor: pointer;
  box-shadow: var(--shadow-sm); transition: transform .15s, box-shadow .15s, border-color .15s;
  overflow: hidden;
  display: block; text-decoration: none; color: inherit;
}
.scene-card:visited { color: inherit; }
.scene-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.scene-card.active {
  border-color: transparent;
  box-shadow: 0 10px 24px rgba(5,150,105,.16);
}
.scene-card .scene-bar {
  position: absolute; left: 0; top: 0; bottom: 0; width: 5px;
}
.scene-card .scene-name { font-weight: 750; font-size: 1.02rem; color: var(--text); margin-bottom: 6px; }
.scene-card .scene-desc { font-size: .8rem; color: var(--muted); line-height: 1.45; }
.scene-card .scene-check {
  margin-top: 12px; font-size: .75rem; font-weight: 750; color: var(--brand-deep);
  opacity: 1;
}

.flabel-hint {
  font-style: normal; font-weight: 550; color: #8aa094; margin-left: 6px; font-size: .68rem;
}
.combo { position: relative; }
.combo-input { padding-right: 0; }
.combo-input input { padding-right: 36px; }
.combo-toggle {
  position: absolute; right: 0; top: 0; bottom: 0; width: 36px;
  border: none; background: transparent; color: var(--muted);
  cursor: pointer; font-size: .85rem;
}
.combo-toggle:hover { color: var(--brand-deep); }
.combo-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30;
  max-height: 220px; overflow-y: auto;
  background: #fff; border: 1px solid var(--line); border-radius: 11px;
  box-shadow: 0 12px 28px rgba(4,120,87,.12);
}
.combo-item {
  display: block; width: 100%; text-align: left;
  padding: 10px 14px; border: none; background: transparent;
  color: var(--text); font-weight: 650; font-size: .88rem; cursor: pointer;
}
.combo-item:hover, .combo-item.active { background: var(--bg-soft); color: var(--brand-deep); }
.combo-empty { padding: 12px 14px; color: var(--muted); font-size: .82rem; }
.chip-row {
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px;
}
.chip {
  border: 1px solid var(--line); background: #fff; color: var(--muted);
  border-radius: 999px; padding: 4px 10px; font-size: .72rem; font-weight: 700; cursor: pointer;
}
.chip:hover, .chip.active {
  border-color: var(--brand); color: var(--brand-deep); background: var(--brand-soft);
}
.vfd-brand-field { flex: 1.2; min-width: 220px; }

.export-panel { margin-top: 14px; }
.export-bar {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px;
}
.export-bar .field-shell { flex: 0 1 160px; }
.export-bar .export-scope { flex: 0 1 180px; }
.export-bar .btn { margin-bottom: 1px; }

.pager {
  display: flex; justify-content: center; align-items: center; gap: 16px; margin-top: 14px;
}

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  background: rgba(6,78,59,.94); color: #fff;
  padding: 11px 18px; border-radius: 999px; font-size: .85rem;
  z-index: 100; max-width: 90%; box-shadow: 0 10px 28px rgba(0,0,0,.18);
  animation: rise .2s ease;
}

.local-alarm-bar {
  display: flex; align-items: center; gap: 14px;
  margin: 12px 20px 0; padding: 12px 16px; border-radius: 14px;
  background: linear-gradient(90deg, #b91c1c, #dc2626 55%, #ea580c);
  color: #fff; box-shadow: 0 10px 28px rgba(220,38,38,.28);
  animation: alarmFlash 1.2s ease-in-out infinite;
}
.local-alarm-bar.hidden { display: none !important; }
.local-alarm-pulse {
  width: 14px; height: 14px; border-radius: 50%; background: #fff;
  animation: pulseRing 1.2s infinite; flex-shrink: 0;
}
.local-alarm-body { flex: 1; min-width: 0; }
.local-alarm-body strong { display: block; font-size: .85rem; }
.local-alarm-body span { font-size: .9rem; opacity: .95; }
.btn-ack {
  background: #fff; color: #b91c1c; font-weight: 750; border: none;
  white-space: nowrap; border-radius: 10px; padding: 8px 14px; cursor: pointer;
}
@keyframes alarmFlash {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.08); }
}
@keyframes pulseRing {
  0% { box-shadow: 0 0 0 0 rgba(255,255,255,.55); }
  70% { box-shadow: 0 0 0 10px rgba(255,255,255,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,255,255,0); }
}

.notify-bell { position: relative; }
.badge-dot {
  position: absolute; top: 6px; right: 6px;
  width: 9px; height: 9px; border-radius: 50%;
  background: #f59e0b; border: 2px solid #fff;
}
.badge-dot.hidden { display: none; }

.app-notify-panel {
  position: absolute; right: 20px; top: 64px; z-index: 30;
  width: min(360px, calc(100% - 40px));
  background: #fff; border-radius: 16px;
  box-shadow: var(--shadow); border: 1px solid var(--line);
  max-height: 420px; display: flex; flex-direction: column;
}
.app-notify-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 14px; border-bottom: 1px solid var(--line);
}
.app-notify-head h3 { font-family: var(--font-display); font-size: .95rem; color: var(--text); }
.app-notify-list { overflow-y: auto; flex: 1; }
.app-notify-item {
  padding: 12px 14px; border-bottom: 1px solid var(--line); cursor: pointer;
}
.app-notify-item.unread { background: #f0fdf4; }
.app-notify-item .title { font-weight: 750; font-size: .88rem; }
.app-notify-item .content { font-size: .8rem; color: var(--muted); margin-top: 4px; }

.matrix-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.matrix-table th, .matrix-table td {
  padding: 12px 10px; text-align: center; border-bottom: 1px solid var(--line);
}
.matrix-table th { background: var(--bg-soft); color: var(--text); font-weight: 750; }
.matrix-table td:first-child, .matrix-table th:first-child,
.matrix-table td:nth-child(2), .matrix-table th:nth-child(2) { text-align: left; }
.matrix-check { color: var(--success); font-weight: 800; }
.matrix-empty { color: #c9d5ce; }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px; margin: 14px 0 8px;
}
.feature-card {
  background: #fff; border-radius: var(--radius-sm);
  padding: 14px; border: 1px solid var(--line); box-shadow: var(--shadow-sm);
}
.feature-card .ft {
  font-family: var(--font-display); font-weight: 700; color: var(--text); font-size: .9rem; margin-bottom: 4px;
}
.feature-card .fd { font-size: .75rem; color: var(--muted); }

.ch-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.ch-tag {
  font-size: .68rem; padding: 2px 7px; border-radius: 999px; font-weight: 750;
  background: var(--bg-soft); color: var(--muted);
}
.ch-tag.on { background: var(--brand-soft); color: var(--brand-deep); }
.ch-tag.local { background: #fee2e2; color: var(--danger); }
.grade-tag { font-size: .7rem; padding: 2px 8px; border-radius: 999px; font-weight: 750; }
.grade-tag.g1 { background: #fee2e2; color: var(--danger); }
.grade-tag.g2 { background: #fef3c7; color: #92400e; }

.group-view-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0 0 16px;
}
.group-view-tab {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  text-align: left;
  padding: 14px 16px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.group-view-tab .gvt-title {
  font-size: 1rem; font-weight: 750; color: var(--text);
  font-family: var(--font-display);
}
.group-view-tab .gvt-sub {
  font-size: .76rem; color: var(--muted); font-weight: 550;
}
.group-view-tab .gvt-note {
  font-size: .72rem; color: #9ca3af; font-weight: 500;
  line-height: 1.35; margin-top: 2px;
}
.group-view-tab.active .gvt-note { color: #9ca3af; }
.group-view-tab:hover {
  border-color: rgba(5,150,105,.45);
  background: #f6fbf8;
}
.group-view-tab.active {
  border-color: var(--brand);
  background: linear-gradient(180deg, #ecfdf5 0%, #fff 70%);
  box-shadow: 0 0 0 3px rgba(5,150,105,.12);
}
.group-view-tab.active .gvt-title { color: var(--brand-deep); }
.group-view-tab.active .gvt-sub { color: #047857; }
.group-view-tab[data-gview="strategy"]:not(.active) {
  border-color: rgba(13,148,136,.35);
  background: linear-gradient(135deg, #f0fdfa 0%, #fff 60%);
}
.group-view-tab[data-gview="strategy"]:not(.active) .gvt-title {
  color: #0f766e;
}
@media (max-width: 720px) {
  .group-view-tabs { grid-template-columns: 1fr; }
}

.strategy-panel { margin-top: 4px; }
.strategy-desc {
  font-size: .82rem; color: var(--muted);
  margin: 4px 0 16px; padding: 10px 12px;
  background: var(--bg-soft); border-radius: 10px;
}
.strategy-h {
  font-family: var(--font-display);
  font-size: .95rem; color: var(--text); font-weight: 700;
  margin: 8px 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line);
}
.strategy-block { margin-bottom: 8px; }
.fhint { font-size: .75rem; color: var(--muted); margin-top: 8px; }

.timer-cards, #st-timers {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
.timer-card {
  background: #f8fcfa; border-radius: var(--radius-sm);
  padding: 14px; border: 1px solid var(--line);
}
.timer-card .tc-head {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px;
}
.timer-card .tc-title { font-family: var(--font-display); font-weight: 700; color: var(--text); }
.cond-row {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr 1fr auto;
  gap: 10px; align-items: end; margin-bottom: 10px;
}

@media (max-width: 960px) {
  .sidebar {
    position: fixed; left: 0; top: 0;
    transform: translateX(-105%); transition: transform .28s ease;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-mask.open { display: block; }
  #btn-menu { display: grid; place-items: center; }
  .kpi-row { grid-template-columns: 1fr; }
  .content { padding: 16px 14px 28px; }
  .chart { height: 300px; }
  .local-alarm-bar { margin: 10px 14px 0; }
  .app-notify-panel { right: 14px; }
}
@media (max-width: 720px) {
  .cond-row { grid-template-columns: 1fr 1fr; }
  .hero-nav { padding: 6px 8px; }
  .hero-nav-item { padding: 6px 10px; font-size: .8rem; }
}
@media (orientation: landscape) and (max-height: 480px) {
  .chart { height: 240px; }
}
