/* ============================================================
   智慧农业物联网云平台 · 控制台样式
   配色与官网品牌一致：深海军蓝 / 科技蓝 / 金色点缀
   ============================================================ */
:root {
  --navy-900: #0a1f38;
  --navy-800: #0e2a4d;
  --navy-700: #12365f;
  --blue: #1668b5;
  --blue-soft: #eaf2fb;
  --green: #22a06b;
  --green-soft: #e6f6ef;
  --gold: #c9942e;
  --red: #d64545;
  --red-soft: #fdeeee;
  --amber-soft: #fdf4e0;
  --ink: #1c2b3a;
  --muted: #75879b;
  --line: #e3e9f0;
  --bg: #0b2340;
  --d-line: rgba(255, 255, 255, .10);
  --d-ink: #e8f1fa;
  --d-muted: #9db6cf;
  --shadow: 0 10px 26px rgba(4, 20, 40, .30);
  --shadow-lg: 0 16px 40px rgba(4, 20, 40, .48);
  --r: 12px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body { font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif; color: var(--ink); background: var(--bg); font-size: 14px; -webkit-font-smoothing: antialiased; }
a { color: var(--blue); text-decoration: none; }
[hidden] { display: none !important; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #c3cfdd; border-radius: 6px; }

/* ---------- 登录 ---------- */
#loginScreen { position: relative; display: flex; align-items: center; justify-content: center; min-height: 100vh;
  padding: 24px 16px; overflow: hidden;
  background: radial-gradient(1000px 520px at 88% -12%, rgba(233,180,76,.2), transparent 58%),
              radial-gradient(860px 560px at -12% 112%, rgba(61,139,212,.3), transparent 55%),
              linear-gradient(145deg, #0a2440 0%, var(--navy-800) 45%, #0a3558 100%); }
#loginScreen::before { content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 42%, #000 25%, transparent 74%);
  mask-image: radial-gradient(ellipse at 50% 42%, #000 25%, transparent 74%); }
#loginScreen::after { content: ""; position: absolute; left: 50%; top: 47%; width: 760px; height: 760px;
  transform: translate(-50%, -50%); pointer-events: none;
  background: radial-gradient(circle, rgba(38,118,204,.16), transparent 62%); }
.login-box { position: relative; z-index: 1; width: 100%; max-width: 402px; }
.login-card { position: relative; background: rgba(255,255,255,.99); border-radius: 18px; padding: 38px 38px 24px; overflow: hidden;
  box-shadow: 0 24px 60px rgba(3,20,40,.5), 0 2px 8px rgba(3,20,40,.25); }
.login-card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--blue) 0%, #3fae7e 55%, var(--gold) 100%); }
.login-head { text-align: center; margin-bottom: 26px; }
.login-head h1 { font-size: 23px; line-height: 1.45; letter-spacing: .02em; margin-bottom: 10px;
  background: linear-gradient(120deg, #123a63 10%, var(--blue) 60%, #2a8f66);
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.login-head p { font-size: 13.5px; color: var(--muted); }
.login-head p::after { content: ""; display: block; width: 44px; height: 2px; margin: 14px auto 0; border-radius: 2px;
  background: linear-gradient(90deg, var(--gold), transparent); }
.field { margin-bottom: 14px; text-align: left; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; font-weight: 500; }
.input-wrap { position: relative; }
.input-wrap .icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); display: flex; pointer-events: none; color: #93a5b8; }
.field input { box-sizing: border-box; width: 100%; height: 48px; border: 1.5px solid #dfe8f0; border-radius: 12px;
  padding: 0 14px 0 44px; font-size: 15px; color: var(--ink); background: #f6f9fc; outline: none;
  transition: border-color .2s, box-shadow .2s, background .2s; font-family: inherit; }
.field input::placeholder { color: #a9b7c5; }
.field input:focus { background: #fff; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(22,104,181,.13); }
.login-btn { width: 100%; height: 48px; margin-top: 8px; font-size: 16px; }
.login-tip { text-align: center; font-size: 12px; color: var(--muted); margin-top: 12px; }
.login-err { color: var(--red); background: rgba(214,69,69,.07); border: 1px solid rgba(214,69,69,.18);
  border-radius: 10px; padding: 9px 12px; font-size: 13.5px; text-align: center; margin-bottom: 6px; }
.login-copy { position: relative; z-index: 1; width: 100%; max-width: 402px; margin: 18px auto 0; text-align: center;
  font-size: 12px; color: rgba(255,255,255,.62); }

/* ---------- 主框架 ---------- */
.app-shell { display: none; min-height: 100vh; }
body.authed .app-shell { display: flex; }
body.authed #loginScreen { display: none; }
.sidebar { width: 226px; flex: 0 0 226px; display: flex; flex-direction: column; color: #cfe0f2;
  background: linear-gradient(180deg, var(--navy-900) 0%, var(--navy-800) 70%, #0b3b5f 100%); }
.brand { display: flex; align-items: center; padding: 16px 16px 14px; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand .brand-logo { height: 42px; width: auto; max-width: 100%; display: block;
  filter: brightness(0) invert(1); opacity: .97; }
.nav { flex: 1; padding: 12px 10px; overflow-y: auto; }
.nav .grp { font-size: 11px; color: #6f93ba; padding: 12px 12px 6px; letter-spacing: .12em; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 10.5px 12px; margin: 2px 0; border-radius: 10px;
  color: #c2d6ec; font-size: 14px; transition: all .18s; }
.nav a svg { flex: 0 0 auto; opacity: .85; }
.nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav a.on { background: linear-gradient(90deg, var(--blue), #1d7bc4); color: #fff; box-shadow: 0 6px 14px rgba(20,105,180,.35); }
.nav a.on svg { opacity: 1; }
/* 数据指挥中心（大屏）入口：外链新窗口，单独强调 */
.nav a.accent { background: linear-gradient(90deg, rgba(26,142,214,.22), rgba(26,142,214,.05));
  border: 1px solid rgba(63,216,245,.38); color: #cdeeff; }
.nav a.accent:hover { background: linear-gradient(90deg, rgba(26,142,214,.42), rgba(26,142,214,.14));
  color: #fff; box-shadow: 0 6px 16px rgba(20,105,180,.28); }
.nav a.accent svg { opacity: 1; color: #6fd8f5; }
.side-foot { border-top: 1px solid rgba(255,255,255,.08); padding: 12px 16px; font-size: 11px; color: #6f93ba; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 58px; flex: 0 0 58px; background: linear-gradient(90deg, #0c2544 0%, #0e2a4d 60%, #0d3355 100%);
  border-bottom: 1px solid var(--d-line);
  display: flex; align-items: center; gap: 14px; padding: 0 20px; }
.topbar .pg-title { font-size: 16.5px; font-weight: 600; color: var(--d-ink); }
.topbar .pg-sub { font-size: 12px; color: var(--d-muted); margin-top: 1px; }

/* ---------- 顶部品牌：临正智慧农业云平台 ---------- */
.tb-brand { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
/* 沿用官网 logo 里的小图标（从 images/logo.png 裁出），深色顶栏上按侧边栏同样规则反白显示 */
.tb-brand .tb-mark { width: 30px; height: 30px; flex: 0 0 30px; display: block; object-fit: contain;
  filter: brightness(0) invert(1) drop-shadow(0 2px 8px rgba(64, 160, 235, .3)); opacity: .97; }
.tb-brand .tb-name { font-size: 17px; font-weight: 700; letter-spacing: .8px; white-space: nowrap;
  color: #eaf3ff;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", "WenQuanYi Micro Hei", sans-serif;
  filter: drop-shadow(0 2px 10px rgba(64, 160, 235, .32)); }
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .tb-brand .tb-name { background: linear-gradient(96deg, #ffffff 0%, #d9ecff 48%, #8fe0bb 100%);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
}
.tb-split { width: 1px; height: 24px; flex: 0 0 1px; margin: 0 2px;
  background: linear-gradient(180deg, rgba(255,255,255,0) 0%, rgba(255,255,255,.28) 50%, rgba(255,255,255,0) 100%); }

/* ---------- 顶部：园区名称（点击可改，保存在本机浏览器） ---------- */
.tb-park { display: flex; align-items: center; gap: 6px; flex: 0 1 auto; min-width: 0;
  height: 30px; padding: 0 11px; border-radius: 999px;
  background: rgba(69, 214, 143, .1); border: 1px solid rgba(69, 214, 143, .3);
  transition: border-color .16s, background .16s; }
.tb-park:hover { background: rgba(69, 214, 143, .16); border-color: rgba(69, 214, 143, .48); }
.tb-park .tb-park-ico { flex: 0 0 auto; color: #45d68f; }
.tb-park .tb-park-btn { max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding: 0; border: 0; background: none; cursor: pointer; font-family: inherit;
  font-size: 13.5px; font-weight: 600; letter-spacing: .3px; color: #d9ecff; }
.tb-park .tb-park-btn:hover { color: #fff; }
.tb-park .tb-park-input { width: 168px; max-width: 40vw; height: 24px; box-sizing: border-box;
  padding: 0 8px; border-radius: 7px; outline: none; font-family: inherit;
  font-size: 13.5px; font-weight: 600; color: #08243d;
  background: #eaf4ff; border: 1px solid rgba(64, 214, 152, .6); }
@media (max-width: 1180px) { .tb-brand .tb-name { font-size: 15.5px; letter-spacing: .3px; } }
.topbar-right { position: relative; margin-left: auto; display: flex; align-items: center; gap: 12px; }
.icon-btn { position: relative; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--d-line);
  background: rgba(255, 255, 255, .07); color: #cfe0f2; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: .18s; }
.icon-btn:hover { border-color: rgba(255, 255, 255, .34); color: #fff; background: rgba(255, 255, 255, .13); }
.icon-btn .badge { position: absolute; top: -5px; right: -5px; min-width: 17px; height: 17px; padding: 0 4px;
  background: var(--red); color: #fff; font-size: 11px; border-radius: 9px; display: flex; align-items: center; justify-content: center; }
.bell-pop { position: absolute; top: 46px; right: -70px; width: 320px; background: #0f2a49; border: 1px solid var(--d-line);
  border-radius: 12px; box-shadow: var(--shadow-lg); z-index: 60; overflow: hidden; }
.bell-pop .pop-head { display: flex; justify-content: space-between; align-items: center; padding: 11px 14px;
  border-bottom: 1px solid var(--d-line); font-weight: 600; font-size: 13.5px; color: var(--d-ink); }
.bell-pop ul { list-style: none; max-height: 300px; overflow-y: auto; }
.bell-pop li { padding: 9px 14px; border-bottom: 1px solid rgba(255, 255, 255, .06); font-size: 12.5px; }
.bell-pop li b { display: block; font-weight: 600; color: var(--d-ink); }
.bell-pop li span { color: var(--d-muted); }
.bell-pop .text-btn { color: #6fb2ea; }
.bell-pop .pop-foot { padding: 9px; text-align: center; }
.user-chip { display: flex; align-items: center; gap: 9px; padding: 5px 6px 5px 5px; border: 1px solid var(--d-line);
  border-radius: 40px; background: rgba(255, 255, 255, .07); cursor: pointer; }
.user-chip:hover { border-color: rgba(255, 255, 255, .30); }
.user-chip .ava { width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(140deg, var(--blue), #1d7bc4);
  color: #fff; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; }
.user-chip .un { font-size: 13px; color: var(--d-ink); }
.content { flex: 1; padding: 18px 20px 34px; overflow-y: auto; position: relative;
  background:
    radial-gradient(1100px 620px at 86% -18%, rgba(41, 124, 212, .30), transparent 62%),
    radial-gradient(880px 520px at -8% 108%, rgba(34, 160, 107, .16), transparent 60%),
    linear-gradient(160deg, #0b2340 0%, #0e2a4d 46%, #0b3355 100%); }
.view { display: none; animation: fadeUp .28s ease; }
.view.active { display: block; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- 通用组件 ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-bottom: 16px; }
.page-head h2 { font-size: 19px; color: var(--ink); }
.page-head p { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.page-head .ph-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px 18px; }
.card + .card { margin-top: 16px; }
.card h3 { font-size: 14.5px; color: var(--ink); display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.card h3 .more { margin-left: auto; font-size: 12px; color: var(--muted); font-weight: 400; }
.card h3 .dot { width: 4px; height: 14px; border-radius: 3px; background: linear-gradient(180deg, var(--blue), #3fae7e); }
.grid { display: grid; gap: 16px; }
.g-kpi { grid-template-columns: repeat(5, 1fr); }
.g-2 { grid-template-columns: 1fr 1fr; }
.g-32 { grid-template-columns: 2fr 1fr; }
.g-23 { grid-template-columns: 1fr 2fr; }
.g-3 { grid-template-columns: repeat(3, 1fr); }
.g-4 { grid-template-columns: repeat(4, 1fr); }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow);
  padding: 14px 16px; display: flex; align-items: center; gap: 13px; }
.kpi .ki { width: 44px; height: 44px; flex: 0 0 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; }
.kpi .k-t { font-size: 12px; color: var(--muted); }
.kpi .k-v { font-size: 23px; font-weight: 700; color: var(--ink); line-height: 1.25; }
.kpi .k-v small { font-size: 12px; font-weight: 400; color: var(--muted); margin-left: 3px; }
.kpi .k-d { font-size: 11.5px; color: var(--green); }
.kpi .k-d.down { color: var(--red); }
.bg-blue { background: var(--blue-soft); color: var(--blue); }
.bg-green { background: var(--green-soft); color: var(--green); }
.bg-gold { background: #f9efdc; color: var(--gold); }
.bg-red { background: var(--red-soft); color: var(--red); }
.bg-gray { background: #eef2f6; color: #6d7f92; }
.chart { width: 100%; height: 300px; }
.chart-sm { height: 220px; }

/* 按钮 / 表单 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid transparent;
  height: 38px; padding: 0 18px; border-radius: 10px; font-size: 14px; cursor: pointer; font-family: inherit;
  transition: all .18s; white-space: nowrap; }
.btn-primary { background: linear-gradient(120deg, var(--blue), #1d7bc4); color: #fff; box-shadow: 0 8px 18px rgba(22,104,181,.26); }
.btn-primary:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn-ghost { background: #fff; border-color: var(--line); color: #42556a; }
.btn-ghost:hover { border-color: var(--blue); color: var(--blue); }
.btn-danger-soft { background: var(--red-soft); color: var(--red); }
.btn-danger-soft:hover { filter: brightness(.98); }
.btn-sm { height: 30px; padding: 0 12px; font-size: 12.5px; border-radius: 8px; }
.btn-xs { height: 24px; padding: 0 9px; font-size: 12px; border-radius: 7px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.text-btn { border: 0; background: none; color: var(--blue); cursor: pointer; font-size: 12.5px; padding: 2px; }
.text-btn:hover { text-decoration: underline; }
.text-btn.danger { color: var(--red); }
select.input, input.input { height: 38px; border: 1.5px solid var(--line); border-radius: 10px; padding: 0 12px; font-size: 13.5px;
  outline: none; background: #fff; color: var(--ink); font-family: inherit; }
select.input:focus, input.input:focus { border-color: var(--blue); }
.search-box { display: flex; align-items: center; gap: 8px; background: #fff; border: 1.5px solid var(--line);
  border-radius: 10px; padding: 0 12px; height: 38px; }
.search-box input { border: 0; outline: 0; font-size: 13.5px; width: 170px; color: var(--ink); background: none; font-family: inherit; }

/* 标签 / 状态 */
.pill { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 10px; border-radius: 20px; font-size: 12px; }
.pill .pd { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.green { background: var(--green-soft); color: var(--green); }
.pill.gray { background: #eef2f6; color: #7a8b9e; }
.pill.blue { background: var(--blue-soft); color: var(--blue); }
.pill.gold { background: #f9efdc; color: var(--gold); }
.pill.red { background: var(--red-soft); color: var(--red); }
.tag-type { background: #f0f4f8; color: #4f6378; border-radius: 6px; padding: 3px 8px; font-size: 12px; }

/* 设备卡片 */
.dev-card { background: #fff; border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow);
  padding: 14px 15px; transition: box-shadow .2s, transform .2s, border-color .2s; cursor: pointer; }
.dev-card:hover { box-shadow: var(--shadow-lg); border-color: #c6d9ea; }
.dev-top { display: flex; align-items: flex-start; gap: 11px; }
.dev-ic { width: 40px; height: 40px; flex: 0 0 40px; border-radius: 11px; display: flex; align-items: center; justify-content: center; }
.dev-top h4 { font-size: 14px; line-height: 1.3; color: var(--ink); }
.dev-top .code { font-size: 11px; color: var(--muted); margin-top: 2px; }
.dev-top .st { margin-left: auto; }
.dev-metrics { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 13px; padding-top: 11px; border-top: 1px dashed #e8eef4; }
.dev-metrics .m { min-width: 74px; }
.dev-metrics .m small { display: block; font-size: 11px; color: var(--muted); }
.dev-metrics .m b { font-size: 15px; color: var(--ink); font-weight: 600; }
.dev-metrics .m b i { font-style: normal; font-size: 10.5px; color: var(--muted); font-weight: 400; margin-left: 2px; }
.dev-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; }
.dev-foot .btns { display: flex; gap: 6px; }
.slider-row { display: flex; align-items: center; gap: 12px; margin-top: 13px; }
.slider-row label { font-size: 12.5px; color: var(--muted); min-width: 84px; }
input[type=range] { flex: 1; accent-color: var(--blue); height: 4px; }
.slider-val { font-weight: 600; min-width: 62px; text-align: right; color: var(--blue); font-size: 13.5px; }

/* 表格 */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 500; padding: 9px 10px;
  border-bottom: 1px solid var(--line); background: #f8fafc; white-space: nowrap; }
.tbl td { padding: 11px 10px; border-bottom: 1px solid #eef2f6; white-space: nowrap; }
.tbl tbody tr:hover { background: #fafcfe; }
.tbl .num { font-variant-numeric: tabular-nums; font-weight: 600; }
.mono { font-family: Consolas, Menlo, monospace; font-size: 12.5px; }

/* 告警列表 */
.alert-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 4px; border-bottom: 1px solid #eef2f6; }
.alert-row .lv { width: 34px; height: 34px; flex: 0 0 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.alert-row .tx { flex: 1; min-width: 0; }
.alert-row .tx b { font-size: 13.5px; color: var(--ink); display: block; }
.alert-row .tx span { font-size: 12px; color: var(--muted); }
.alert-row .op { display: flex; gap: 6px; align-items: center; }
.alert-row.done { opacity: .62; }

/* 命令条/日志 */
.cmd-row { display: flex; gap: 10px; align-items: center; padding: 10px 4px; border-bottom: 1px solid #eef2f6; font-size: 13px; }
.cmd-row .ck { flex: 0 0 22px; }

/* 模态框 */
.modal-mask { position: fixed; inset: 0; background: rgba(9, 25, 44, .55); z-index: 90; display: flex; align-items: center;
  justify-content: center; padding: 18px; backdrop-filter: blur(2px); }
.modal { background: #fff; border-radius: 16px; max-width: 560px; width: 100%; max-height: 88vh; overflow: hidden;
  display: flex; flex-direction: column; box-shadow: var(--shadow-lg); animation: pop .2s ease; }
@keyframes pop { from { transform: scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 16px; }
.modal-head .x { margin-left: auto; border: 0; background: none; font-size: 22px; color: var(--muted); cursor: pointer; line-height: 1; }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-foot { padding: 13px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 9px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; }
.detail-grid .it small { color: var(--muted); font-size: 12px; display: block; margin-bottom: 2px; }
.detail-grid .it b { font-size: 15px; }
.metric-line { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0 4px; }
.metric-line .mc { border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px; background: #fafcfd; }
.metric-line .mc small { display: block; color: var(--muted); font-size: 11.5px; }
.metric-line .mc b { font-size: 18px; color: var(--ink); }
.metric-line .mc b i { font-style: normal; font-size: 11px; color: var(--muted); }

/* 空态 / 提示条 */
.empty { text-align: center; color: var(--muted); padding: 34px 10px; font-size: 13px; }
.toast { position: fixed; top: 70px; left: 50%; transform: translateX(-50%); z-index: 120; background: #17293d; color: #fff;
  padding: 10px 20px; border-radius: 30px; font-size: 13.5px; box-shadow: var(--shadow-lg); animation: toastIn .25s ease; }
.toast.ok { background: #15855a; }
.toast.warn { background: #a9740f; }
.toast.err { background: #c23b3b; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, -10px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* 时间/文字 */
.text-muted { color: var(--muted); }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-blue { color: var(--blue); }
.text-gold { color: var(--gold); }
.flex { display: flex; align-items: center; gap: 10px; }
.flex-b { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; } .mb8 { margin-bottom: 8px; } .mb12 { margin-bottom: 12px; }
.ml-auto { margin-left: auto; }
.spin { width: 16px; height: 16px; border: 2px solid #cfe0f2; border-top-color: var(--blue); border-radius: 50%;
  display: inline-block; animation: rot .8s linear infinite; vertical-align: -3px; }
@keyframes rot { to { transform: rotate(360deg); } }

/* 响应式 */
@media (max-width: 1200px) {
  .g-kpi { grid-template-columns: repeat(3, 1fr); }
  .g-3, .g-4 { grid-template-columns: repeat(2, 1fr); }
  .g-32, .g-23 { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; z-index: 80; transform: translateX(-100%); transition: .25s; }
  body.menu-open .sidebar { transform: none; }
  .mask { display: none; position: fixed; inset: 0; background: rgba(9,25,44,.4); z-index: 70; }
  body.menu-open .mask { display: block; }
  .g-kpi, .g-2, .g-3, .g-4 { grid-template-columns: 1fr; }
  .content { padding: 14px; }
  .topbar { padding: 0 14px; }
  .tb-brand { gap: 8px; }
  .tb-brand .tb-name { display: none; }
  .tb-park { height: 27px; padding: 0 9px; gap: 5px; }
  .tb-park .tb-park-btn { max-width: 104px; font-size: 12.5px; }
  .tb-park .tb-park-input { width: 116px; font-size: 12.5px; }
  .tb-split { display: none; }
}

/* ---------- 补充：过滤激活 / 选择行 / 控件表单 / 迷你行 ---------- */
.btn-ghost.on { background: linear-gradient(120deg, var(--blue), #1d7bc4); color: #fff; border-color: transparent; box-shadow: 0 6px 14px rgba(22,104,181,.25); }
.btn-ghost.on:hover { color: #fff; }
.pick { display: flex; align-items: center; gap: 11px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 12px;
  background: #fff; margin-bottom: 9px; cursor: pointer; transition: all .18s; }
.pick:hover { border-color: #b9d2ea; box-shadow: var(--shadow); }
.pick.sel { border-color: var(--blue); background: var(--blue-soft); box-shadow: 0 0 0 3px rgba(22,104,181,.14); }
.pick .n b { display: block; font-size: 13.5px; color: var(--ink); }
.pick .n small { font-size: 11px; color: var(--muted); }
.pick .ml { margin-left: auto; }
.mini-dev { display: flex; align-items: center; gap: 10px; padding: 8px 2px; border-bottom: 1px dashed #edf2f7; cursor: pointer; }
.mini-dev:last-child { border-bottom: 0; }
.mini-dev .cd { font-family: Consolas, Menlo, monospace; font-size: 12px; color: var(--muted); width: 54px; }
.mini-dev .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--ink); }
.fg { margin: 13px 0 4px; }
.fg > small { display: block; font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: #fff; }
.seg button { border: 0; background: #fff; padding: 0 18px; height: 34px; cursor: pointer; font-size: 13px; color: #42556a; font-family: inherit; transition: .15s; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--blue); color: #fff; }
.seg button.on.green { background: var(--green); }
.seg button.on.red { background: var(--red); }
.srange { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.srange label { font-size: 12.5px; color: var(--muted); min-width: 88px; }
.srange output { font-weight: 700; color: var(--blue); min-width: 78px; text-align: right; font-size: 13.5px; font-variant-numeric: tabular-nums; }
input[type=range] { flex: 1; accent-color: var(--blue); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; }
.ctrl-note { font-size: 12px; color: var(--muted); line-height: 1.8; background: #f7fafc; border: 1px dashed var(--line); border-radius: 10px; padding: 10px 12px; }
.ctrl-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }
.dev-ic { display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px; }
.mini-flow { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
@media (max-width: 620px) {
  .form-row { grid-template-columns: 1fr; }
  .page-head .ph-actions { flex-wrap: wrap; }
  .search-box input { width: 110px; }
}

/* ============================================================
   水肥机总控（智能灌溉）
   ============================================================ */
.fm-head { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; background: linear-gradient(120deg, #0d2c50, #123f6e 62%, #15577f);
  border-radius: 14px; padding: 16px 20px; color: #eaf3fc; box-shadow: var(--shadow); }
.fm-head .fm-ic { width: 46px; height: 46px; flex: 0 0 46px; border-radius: 13px; background: rgba(255,255,255,.12);
  display: flex; align-items: center; justify-content: center; }
.fm-head b.fm-name { font-size: 16.5px; color: #fff; }
.fm-head .fm-sub { font-size: 11.5px; color: #9fc0e0; margin-top: 3px; }
.fm-head .fm-pills { margin-left: auto; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.fm-head .fm-prog { width: 100%; margin-top: 4px; font-size: 12.5px; color: #cfe4f5; background: rgba(255,255,255,.07);
  border: 1px dashed rgba(255,255,255,.22); border-radius: 9px; padding: 7px 12px; }
.pill.on-dark.green { background: rgba(34,160,107,.24); color: #6fe3ad; }
.pill.on-dark.gold { background: rgba(201,148,46,.25); color: #f4c96a; }
.pill.on-dark.blue { background: rgba(76,158,232,.24); color: #8fc6f2; }
.pill.on-dark.red { background: rgba(214,69,69,.25); color: #ff9b9b; }
.pill.on-dark.gray { background: rgba(255,255,255,.14); color: #c2d6ec; }
.fm-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0; }
.fm-tab { border: 1px solid var(--line); background: #fff; color: #42556a; border-radius: 9px; padding: 8px 16px;
  font-size: 13.5px; cursor: pointer; font-family: inherit; transition: .16s; }
.fm-tab:hover { border-color: var(--blue); color: var(--blue); }
.fm-tab.on { background: linear-gradient(120deg, var(--blue), #1d7bc4); color: #fff; border-color: transparent; box-shadow: 0 6px 14px rgba(22,104,181,.24); }
.fm-body { display: grid; gap: 16px; }
.fm-sec-title { font-size: 13.5px; font-weight: 600; color: var(--ink); display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.fm-sec-title .dot { width: 4px; height: 13px; border-radius: 3px; background: linear-gradient(180deg, var(--blue), #3fae7e); }
.fm-sec-title .more { margin-left: auto; font-weight: 400; font-size: 12px; color: var(--muted); }

/* 运行监控 读数卡 */
.fm-kpis { display: grid; grid-template-columns: repeat(8, 1fr); gap: 10px; }
.fm-read { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 11px 13px; box-shadow: var(--shadow); }
.fm-read .k { font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.fm-read .k .cdot { width: 7px; height: 7px; border-radius: 50%; }
.fm-read .v { font-size: 21px; font-weight: 700; color: var(--ink); margin-top: 5px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.fm-read .v small { font-size: 11px; color: var(--muted); font-weight: 400; margin-left: 2px; }
.fm-read .s { font-size: 10.5px; color: var(--muted); margin-top: 2px; }

/* 模拟管道示意 */
.fm-pipe { position: relative; background: linear-gradient(120deg, #123a63, #16639e); border-radius: 12px; padding: 18px 22px 16px;
  color: #dcebf8; overflow: hidden; min-height: 128px; }
.fm-pipe::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 34px 34px; }
.fm-pipe-row { position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
.fm-pipe-title { font-size: 11px; color: #9fc0e0; letter-spacing: .14em; text-align: center; margin-bottom: 10px; position: relative; z-index: 1; }
.pump-badge { display: inline-flex; flex-direction: column; align-items: center; gap: 4px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2);
  border-radius: 10px; padding: 8px 12px; font-size: 11px; }
.pump-badge b { font-size: 13px; color: #fff; }
.pump-badge.on { background: rgba(34,160,107,.28); border-color: rgba(111,227,173,.5); }
.pump-badge.off { background: rgba(255,255,255,.06); }
.pipe-seg { width: 74px; height: 10px; border-radius: 6px; background: rgba(255,255,255,.22); position: relative; overflow: hidden; }
.pipe-seg .ps-fill { position: absolute; inset: 0; transform-origin: left; background: linear-gradient(90deg, #3fae7e, #7fe0ae); transition: transform .5s; }
.ch-chip { display: inline-flex; align-items: center; gap: 6px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px; padding: 4px 10px; font-size: 11.5px; }
.ch-chip.on { background: rgba(34,160,107,.3); border-color: rgba(111,227,173,.55); color: #d9f7e8; }
.ch-chip .c-k { font-weight: 800; color: #fff; }
.ch-chip small { color: #aacbe6; }
.fm-valve-glow { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.25); }
.fm-valve-glow.on { background: #22a06b; border-color: #7fe0ae; box-shadow: 0 0 16px rgba(63,174,126,.8); }

/* 手动控制 */
.fm-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.fm-grid.c3 { grid-template-columns: repeat(3, 1fr); }
.switch { position: relative; width: 46px; height: 26px; flex: 0 0 46px; border-radius: 14px; background: #d7e0e9; cursor: pointer; transition: .18s; border: 0; }
.switch::after { content: ""; position: absolute; width: 20px; height: 20px; border-radius: 50%; background: #fff; top: 3px; left: 3px; transition: .18s; box-shadow: 0 1px 4px rgba(0,0,0,.18); }
.switch.on { background: var(--green); }
.switch.on::after { left: 23px; }
.switch.big { width: 58px; height: 32px; flex-basis: 58px; border-radius: 17px; }
.switch.big::after { width: 26px; height: 26px; top: 3px; left: 3px; }
.switch.big.on::after { left: 29px; }
.switch[disabled] { opacity: .55; cursor: not-allowed; }
.fm-ctl-row { display: flex; align-items: center; gap: 14px; padding: 11px 0; border-bottom: 1px dashed #edf2f7; }
.fm-ctl-row:last-child { border-bottom: 0; }
.fm-ctl-row .t b { font-size: 13.5px; color: var(--ink); display: block; }
.fm-ctl-row .t small { font-size: 11.5px; color: var(--muted); }
.fm-ctl-row .val { margin-left: auto; text-align: right; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.fm-ctl-row .val b { display: block; font-size: 16px; color: var(--ink); }
.ratio-row { display: flex; align-items: center; gap: 10px; margin-top: 5px; }
.ratio-row output { min-width: 46px; text-align: right; font-size: 12.5px; font-weight: 700; color: var(--blue); }
.bar { height: 6px; border-radius: 4px; background: #eef2f6; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #22a06b, #3fae7e); transition: width .4s; }
.level-mini { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--muted); }
.level-mini .bar { width: 70px; }

/* 分区/阀门 */
.zone-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 13px 15px; box-shadow: var(--shadow); }
.zone-top { display: flex; align-items: center; gap: 10px; }
.zone-top h4 { font-size: 14px; }
.zone-top .z-meta { font-size: 11px; color: var(--muted); margin-top: 2px; }
.zone-top .z-ops { margin-left: auto; display: flex; gap: 6px; }
.valve-chip { display: inline-flex; align-items: center; gap: 7px; border: 1.5px solid var(--line); border-radius: 9px; background: #fff;
  padding: 6px 10px; font-size: 12px; color: #42556a; cursor: pointer; margin: 7px 6px 0 0; transition: .15s; }
.valve-chip:hover { border-color: #b9d2ea; }
.valve-chip.on { background: var(--green); border-color: var(--green); color: #fff; }
.valve-chip .vc-addr { font-size: 10px; opacity: .75; }
.valve-chip .bat { display: inline-flex; align-items: center; gap: 3px; font-size: 10px; color: inherit; opacity: .85; }
.z-stats { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 9px; padding-top: 8px; border-top: 1px dashed #e8eef4; font-size: 11.5px; color: var(--muted); }

/* 程序卡片 */
.prog-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; box-shadow: var(--shadow); }
.prog-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.prog-top h4 { font-size: 14.5px; }
.prog-top .tag-type { font-size: 11px; }
.prog-ops { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.prog-meta { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 11px; }
.prog-meta .pm { background: #f7fafc; border: 1px dashed var(--line); border-radius: 8px; padding: 7px 10px; font-size: 11.5px; color: var(--muted); }
.prog-meta .pm b { display: block; font-size: 12.5px; color: var(--ink); margin-top: 2px; font-weight: 600; }
.prog-run { margin-top: 10px; }
.prog-run .pr-top { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); margin-bottom: 5px; }
.prog-run .pr-bar { height: 8px; border-radius: 5px; background: #eef2f6; overflow: hidden; }
.prog-run .pr-bar i { display: block; height: 100%; background: linear-gradient(90deg, #1668b5, #3fae7e); transition: width .6s; border-radius: 5px; }
.prog-desc { font-size: 12px; color: var(--muted); line-height: 1.7; margin-top: 9px; background: #fbfcfe; border-radius: 8px; padding: 7px 10px; }
.prog-desc .lk { color: var(--blue); font-weight: 600; }

/* 配方 */
.recipe-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; box-shadow: var(--shadow); }
.recipe-head { display: flex; align-items: center; gap: 10px; }
.recipe-head h4 { font-size: 14px; }
.recipe-head .ecph { font-size: 12px; color: var(--muted); }
.recipe-head .r-ops { margin-left: auto; display: flex; gap: 6px; }
.r-bar-row { display: flex; align-items: center; gap: 10px; margin-top: 8px; font-size: 11.5px; color: var(--muted); }
.r-bar-row .rk { width: 24px; height: 24px; flex: 0 0 24px; border-radius: 7px; background: #eaf2fb; color: var(--blue); font-weight: 800;
  display: flex; align-items: center; justify-content: center; font-size: 12px; }
.r-bar-row .bar { flex: 1; }
.r-bar-row .rv { width: 44px; text-align: right; font-variant-numeric: tabular-nums; }
.r-note { font-size: 11.5px; color: var(--muted); margin-top: 9px; line-height: 1.7; background: #fbfcfe; border-radius: 8px; padding: 7px 10px; }

/* 日志 */
.log-row { display: flex; gap: 12px; padding: 10px 4px; border-bottom: 1px solid #eef2f6; font-size: 13px; align-items: flex-start; }
.log-row .lt { flex: 0 0 60px; }
.log-row .lg-tx { flex: 1; color: var(--ink); }
.log-row .lg-time { color: var(--muted); font-size: 12px; white-space: nowrap; }

/* 空运行提示 & 底部操作条 */
.fm-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.fm-note { font-size: 12px; color: var(--muted); background: #f2f7fb; border: 1px solid #dae8f3; border-radius: 10px; padding: 9px 13px; line-height: 1.7; }
.fm-note b { color: var(--blue); }

@media (max-width: 1200px) {
  .fm-kpis { grid-template-columns: repeat(4, 1fr); }
  .fm-grid.c3 { grid-template-columns: repeat(2, 1fr); }
  .prog-meta { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .fm-kpis { grid-template-columns: repeat(2, 1fr); }
  .fm-grid, .fm-grid.c3 { grid-template-columns: 1fr; }
  .fm-head .fm-pills { margin-left: 0; }
}

/* ===== 水肥机界面补充样式 ===== */
.fm-pane { min-width: 0; }
.fm-hide { display: none !important; }
.fm-chart { width: 100%; height: 238px; }
.fm-head-prog { width: 100%; margin-top: 2px; }
.fp-l { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.fp-l .fp-name b { color: #fff; }
.fp-l .fp-zones { color: #9fc0e0; font-size: 11.5px; }
.fp-rem { margin-left: auto; color: #cfe4f5; font-size: 12px; white-space: nowrap; }
.fp-rem b { color: #fff; font-size: 14px; font-variant-numeric: tabular-nums; }
.fp-track { height: 5px; background: rgba(255,255,255,.16); border-radius: 4px; margin-top: 7px; overflow: hidden; }
.fp-fill { height: 100%; width: 0; background: linear-gradient(90deg, #6fe3ad, #3fae7e); border-radius: 4px; transition: width .6s; }
.fp-fill.pump { background: linear-gradient(90deg, #8fc6f2, #1668b5); }

/* 吸肥通道卡片 */
.ch-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.ch-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; box-shadow: var(--shadow); }
.ch-head { display: flex; align-items: center; gap: 10px; }
.ch-k { width: 32px; height: 32px; border-radius: 9px; flex: 0 0 32px; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 13.5px; color: #fff; }
.ch-head .ch-nm { min-width: 0; }
.ch-head .ch-nm b { display: block; font-size: 13px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-head .ch-nm small { font-size: 11px; color: var(--muted); }
.ch-head .switch { margin-left: auto; }
.ch-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; margin: 10px 0 6px; font-size: 11.5px; color: var(--muted); }
.ch-meta b { color: var(--ink); font-variant-numeric: tabular-nums; font-weight: 600; }
.ch-lvl { margin-top: 4px; }
.ch-lvl .bar { height: 5px; margin-top: 5px; }
.ch-dosed { margin-top: 8px; font-size: 11px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }

/* 田间分区 */
.fm-zone-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.z-num { font-size: 11px; color: var(--muted); }

/* 灌溉程序 / 配方 编辑面板 */
.fm-panel { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px 16px; box-shadow: var(--shadow); }
.fm-panel > h4 { font-size: 14.5px; color: var(--ink); margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.fm-panel > h4 .more { margin-left: auto; font-weight: 400; font-size: 12px; color: var(--muted); }
.fm-ed { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px 20px; }
.fm-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.fm-field.full { grid-column: 1 / -1; }
.fm-field > label { font-size: 12.5px; font-weight: 600; color: var(--ink); }
.fm-field > label small { color: var(--muted); font-weight: 400; margin-left: 6px; }
.fm-field input[type=text], .fm-field input[type=number], .fm-field input[type=time], .fm-field select, .fm-field textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; font-size: 13px;
  font-family: inherit; color: var(--ink); background: #fff; box-sizing: border-box; }
.fm-field textarea { resize: vertical; min-height: 58px; line-height: 1.6; }
.fm-field input:focus, .fm-field select:focus, .fm-field textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 2px rgba(22,104,181,.12); }
.fm-field .fm-help { font-size: 11px; color: var(--muted); line-height: 1.6; }
.fm-ed-foot { grid-column: 1 / -1; display: flex; gap: 8px; justify-content: flex-end; align-items: center; padding-top: 6px; border-top: 1px dashed #eef2f7; }
.fm-chip-set { display: flex; flex-wrap: wrap; gap: 6px; }
.fm-chip { border: 1.5px solid var(--line); background: #fff; color: #42556a; border-radius: 8px; padding: 5px 10px; font-size: 12px;
  cursor: pointer; font-family: inherit; transition: .14s; line-height: 1.4; }
.fm-chip:hover { border-color: #b9d2ea; }
.fm-chip.sel { background: var(--green); border-color: var(--green); color: #fff; }
.fm-zone-grp { font-size: 11.5px; color: var(--muted); width: 100%; margin-top: 4px; font-weight: 600; }
.fm-zone-grp + .fm-zone-grp { margin-top: 10px; }
.fm-hint { font-size: 12px; color: var(--muted); }
.fm-empty { text-align: center; color: var(--muted); font-size: 13px; padding: 26px 0; line-height: 1.8; }
.fm-empty .big { font-size: 15px; color: #42556a; }

/* 程序卡内联 */
.prog-sub { font-size: 11px; color: var(--muted); margin-left: 2px; font-weight: 400; }
.btn-plain { background: none; border: 0; color: var(--blue); font-size: 12.5px; cursor: pointer; padding: 2px 4px; font-family: inherit; }
.btn-plain:hover { text-decoration: underline; }
.log-tag { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 12px; font-size: 11px; }
.lg-kind { flex: 0 0 56px; }
.fm-zone-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 1250px) { .ch-grid { grid-template-columns: repeat(2, 1fr); } .fm-zone-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 900px) { .fm-ed { grid-template-columns: 1fr; } .fm-zone-grid2 { grid-template-columns: 1fr; } }
@media (max-width: 700px) { .ch-grid { grid-template-columns: 1fr; } .fm-zone-grid { grid-template-columns: 1fr; } }

/* ===== 水肥机界面补充样式（fm.js 用） ===== */
.hd-btn { background: rgba(255,255,255,.13); border: 1px solid rgba(255,255,255,.28); color: #eaf3fc; border-radius: 8px;
  padding: 5px 12px; font-size: 12.5px; cursor: pointer; font-family: inherit; transition: .15s; line-height: 1.5; }
.hd-btn:hover { background: rgba(255,255,255,.24); }
.hd-btn.danger { background: rgba(214,69,69,.2); border-color: rgba(255,155,155,.5); }
.hd-btn.danger:hover { background: rgba(214,69,69,.35); }
.fm-read .v b { font-weight: 700; }
.fm-stack { display: grid; gap: 16px; align-content: start; min-width: 0; }
.ch-row { padding: 10px 2px; }
.ch-row + .ch-row { border-top: 1px dashed #e6edf4; margin-top: 4px; }
.ch-row .ch-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; margin: 10px 0 6px; font-size: 11.5px; color: var(--muted); }
.ch-meta b { color: var(--ink); font-variant-numeric: tabular-nums; font-weight: 600; }
.ch-row .ratio-row { display: flex; align-items: center; gap: 10px; font-size: 11.5px; color: var(--muted); }
.ch-row .ratio-row input[type=range] { flex: 1; accent-color: var(--blue); }
.ch-row .ratio-row output { min-width: 52px; text-align: right; font-size: 12.5px; font-weight: 700; color: var(--blue); font-variant-numeric: tabular-nums; }
.ch-row .ch-lvl { margin-top: 8px; font-size: 11px; color: var(--muted); }
.ch-row .ch-lvl .bar { height: 5px; margin-top: 4px; }
.prog-card.run { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(22,104,181,.09); }
.fm-pipe-row .fm-flow-tag { font-size: 11.5px; color: #9fc0e0; text-align: center; margin-top: 12px; line-height: 1.8; }
.fm-pipe-row .fm-flow-tag b { color: #fff; font-variant-numeric: tabular-nums; }
.chips-row { display: flex; flex-wrap: wrap; gap: 7px; justify-content: center; margin-top: 13px; }
.ctrl-hint { font-size: 12px; line-height: 1.7; border-radius: 10px; padding: 9px 12px; background: #e6f6ef;
  border: 1px solid #bfe6d2; color: #17724e; margin-bottom: 13px; }
.ctrl-hint.warn { background: #fdf4e0; border-color: #eed9a8; color: #8a6410; }
.trend-legend { display: flex; flex-wrap: wrap; gap: 3px 12px; font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.trend-legend i { width: 11px; height: 3px; border-radius: 2px; display: inline-block; vertical-align: middle; margin-right: 4px; }
.fm-today { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fm-today .td { background: #f7fafc; border: 1px dashed var(--line); border-radius: 10px; padding: 10px 12px; }
.fm-today .td small { display: block; font-size: 11px; color: var(--muted); }
.fm-today .td b { display: block; font-size: 17px; margin-top: 4px; color: var(--ink); font-variant-numeric: tabular-nums; }
.fm-today .td b i { font-style: normal; font-size: 11px; color: var(--muted); font-weight: 400; margin-left: 2px; }
.pane-notes { font-size: 12px; color: var(--muted); line-height: 1.8; background: #f2f7fb; border: 1px solid #dae8f3;
  border-radius: 10px; padding: 9px 13px; }
.pane-notes b { color: var(--blue); }
.z-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 13px; }
.z-toolbar .z-hint { color: var(--muted); font-size: 12px; }
.prog-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px;
  font-size: 11.5px; color: var(--muted); }
.zone-card .empty-chip { font-size: 11.5px; color: var(--muted); margin-top: 8px; }
.fm-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: #fff; }
.fm-seg button { border: 0; background: #fff; padding: 0 14px; height: 32px; cursor: pointer; font-size: 12.5px;
  color: #42556a; font-family: inherit; transition: .15s; }
.fm-seg button + button { border-left: 1px solid var(--line); }
.fm-seg button.on { background: var(--blue); color: #fff; }
.fm-seg button.on.green { background: var(--green); }

/* ===== 水肥机总控 · 补充（fm.js 视图接线用） ===== */
.hd-btn:disabled { opacity: .42; cursor: not-allowed; }
.fm-head .fm-pills .divider { width: 1px; height: 22px; background: rgba(255,255,255,.22); margin: 0 2px; }
.tb-right { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tb-right .tb-tip { font-size: 12px; color: var(--muted); margin-right: 2px; }
.fm-note.warn { background: #fdf4e0; border-color: #eed9a8; color: #8a6410; }
.recipe-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.logs-panel { background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; }
.logs-panel .logs-scroll { max-height: 440px; overflow: auto; padding: 2px 16px; }
.logs-empty { text-align: center; color: var(--muted); font-size: 13px; padding: 30px 0; line-height: 1.9; }
.kpi-fill { color: var(--blue); font-variant-numeric: tabular-nums; }
.mini-pipe-lab { font-size: 10px; color: #9fc0e0; text-align: center; margin-bottom: 4px; }
.fm-modebox { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.fm-modebox .mo-lab { font-size: 12.5px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.fm-modebox .mo-lab b { color: var(--ink); font-size: 14px; }
.fm-ed .fm-chip[data-v].sel { background: var(--blue); border-color: var(--blue); }
.fm-seg-note { font-size: 11.5px; color: var(--muted); line-height: 1.6; margin-top: 6px; }
@media (max-width: 1100px) { .recipe-grid { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .tb-right { margin-left: 0; } }

/* ---------- 补充：数据总览 · 传感数据 ---------- */
.sen-avg { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 16px; border-top: 1px dashed #e3e9f0; margin-top: 12px; padding-top: 10px; }
.sen-avg .lbl { font-size: 11.5px; color: var(--muted); margin-right: 2px; }
.sen-avg .chip { font-size: 12px; color: var(--ink); display: inline-flex; align-items: center; gap: 5px; font-variant-numeric: tabular-nums; }
.sen-avg .chip i { width: 7px; height: 7px; border-radius: 50%; display: inline-block; font-style: normal; }
.sen-station { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px 12px; margin-bottom: 10px; background: #fff; cursor: pointer; transition: border-color .18s, box-shadow .18s; }
.sen-station:hover { border-color: #b9d2ea; box-shadow: var(--shadow); }
.sen-head { display: flex; align-items: center; gap: 10px; }
.sen-head .grow { flex: 1; min-width: 0; }
.sen-head b { font-size: 13.5px; color: var(--ink); display: block; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sen-head small { font-size: 11px; color: var(--muted); }
.sen-head .dev-ic { width: 34px; height: 34px; flex: 0 0 34px; border-radius: 9px; font-size: 13px; }
.sen-head .pill { margin-left: auto; flex: 0 0 auto; }
.sen-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 10px; }
.sen-metric { background: #f7fafc; border: 1px solid #edf2f7; border-radius: 8px; padding: 6px 2px 7px; text-align: center; }
.sen-metric small { display: block; color: var(--muted); font-size: 10.5px; line-height: 1.2; }
.sen-metric b { font-size: 15px; color: var(--ink); font-variant-numeric: tabular-nums; }
.sen-metric b i { font-style: normal; font-size: 10px; color: var(--muted); margin-left: 1px; }
.sen-sub { border-top: 1px dashed #e3e9f0; margin-top: 4px; padding-top: 10px; }
.sen-sub-h { font-size: 11.5px; color: var(--muted); margin-bottom: 8px; display: flex; justify-content: space-between; }
.sen-sub-h b { color: var(--ink); font-weight: 600; }
.chip-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.sen-chip { background: #f7fafc; border: 1px solid #edf2f7; border-radius: 8px; padding: 6px 4px 7px; text-align: center; }
.sen-chip small { display: block; color: var(--muted); font-size: 10px; line-height: 1.2; }
.sen-chip b { font-size: 14px; color: var(--ink); font-variant-numeric: tabular-nums; }
.sen-chip b i { font-style: normal; font-size: 10px; color: var(--muted); margin-left: 1px; }
@media (max-width: 420px) { .sen-metrics, .chip-row { grid-template-columns: repeat(2, 1fr); } }

/* ============================================================
   深色外壳补充：滚动条 / 卡片描边
   ============================================================ */
.content::-webkit-scrollbar-thumb,
.nav::-webkit-scrollbar-thumb,
.bell-pop ul::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .22); }
.content::-webkit-scrollbar-thumb:hover,
.nav::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, .36); }
.card, .kpi { border-color: rgba(255, 255, 255, .07); }

/* ============================================================
   数据总览 · 园区位置地图
   ============================================================ */
.map-box { position: relative; height: 340px; border-radius: 14px; overflow: hidden;
  background: #091d34; border: 1px solid rgba(255, 255, 255, .11);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), inset 0 0 60px rgba(4, 18, 36, .55);
  cursor: grab; user-select: none; -webkit-user-select: none; touch-action: none; }
.map-box.dragging { cursor: grabbing; }
.map-box:fullscreen { height: 100%; border-radius: 0; }
/* 浏览器不支持全屏时的退化：卡片内放大 */
.map-box.map-box--big { height: 74vh; }
.map-stage { position: absolute; inset: 0; }

/* 瓦片 + 两种底图色调（默认影像·标准） */
.map-tile { position: absolute; width: 256px; height: 256px; z-index: 1; pointer-events: none;
  user-select: none; -webkit-user-drag: none; background: rgba(255, 255, 255, .022);
  backface-visibility: hidden; }
.map-box[data-base="road"] .map-tile { filter: brightness(.97) saturate(.9) contrast(1.02); }
.map-box[data-base="sat"] .map-tile { filter: saturate(.94) brightness(1.04) contrast(1.02); }

/* 四周暗角，让地图自然融进深色卡片 */
.map-glow { position: absolute; inset: 0; z-index: 5; pointer-events: none;
  background:
    radial-gradient(125% 95% at 50% 46%, rgba(9, 29, 52, 0) 42%, rgba(9, 29, 52, .40) 100%),
    linear-gradient(to top, rgba(9, 29, 52, .46) 0%, rgba(9, 29, 52, 0) 34%); }

/* 园区位置示意光晕 */
.map-fence { position: absolute; z-index: 2; border-radius: 50%; transform: translate(-50%, -50%);
  border: 1.5px dashed rgba(64, 214, 152, .8); pointer-events: none;
  background: radial-gradient(circle, rgba(34, 160, 107, .24) 0%, rgba(34, 160, 107, .10) 58%, rgba(34, 160, 107, 0) 76%);
  box-shadow: 0 0 30px rgba(34, 160, 107, .22), inset 0 0 26px rgba(34, 160, 107, .18); }
.map-fence-wave { position: absolute; inset: 0; border-radius: 50%; border: 1px solid rgba(64, 214, 152, .55);
  animation: fenceWave 3.6s ease-out infinite; }
@keyframes fenceWave { 0% { transform: scale(.55); opacity: .85; } 100% { transform: scale(1.28); opacity: 0; } }

.map-pin { position: absolute; z-index: 6; width: 0; height: 0; pointer-events: none; }
.map-pin .map-pin-dot { position: absolute; left: -7.5px; top: -7.5px;
  width: 15px; height: 15px; box-sizing: border-box; border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #6ff0b6, var(--green) 62%, #178052 100%);
  border: 2.5px solid #fff;
  box-shadow: 0 0 0 3px rgba(34, 160, 107, .3), 0 0 16px rgba(64, 214, 152, .85), 0 4px 10px rgba(0, 0, 0, .5); }
.map-pin .map-pin-ring { position: absolute; left: -7.5px; top: -7.5px;
  width: 15px; height: 15px; border-radius: 50%; background: rgba(64, 214, 152, .5);
  animation: pinPulse 2.6s ease-out infinite; }
.map-pin .map-pin-label { position: absolute; left: 0; top: 13px; transform: translateX(-50%);
  padding: 4px 11px; border-radius: 999px; font-size: 12px; white-space: nowrap;
  letter-spacing: .2px; color: #eaf6ff; background: rgba(8, 26, 46, .78); border: 1px solid rgba(64, 214, 152, .38);
  box-shadow: 0 6px 18px rgba(4, 18, 36, .55);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.map-pin.ping .map-pin-dot { animation: pinBounce .6s ease; }
@keyframes pinPulse { 0% { transform: scale(1); opacity: .7; } 100% { transform: scale(4.6); opacity: 0; } }
@keyframes pinBounce { 0% { transform: scale(1); } 45% { transform: scale(1.5); } 100% { transform: scale(1); } }

/* 右上角工具条 */
.map-tools { position: absolute; top: 12px; right: 12px; z-index: 8;
  display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.map-tool-row { display: flex; gap: 6px; }
.map-tool { width: 32px; height: 32px; box-sizing: border-box; padding: 0; border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, .18); background: rgba(8, 26, 46, .74); color: #d6e6f7;
  line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(4, 18, 36, .4);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  transition: background .18s, color .18s, border-color .18s, transform .18s; }
.map-tool:hover { background: rgba(22, 104, 181, .92); color: #fff; border-color: rgba(255, 255, 255, .4); transform: translateY(-1px); }
.map-tool:active { transform: translateY(0); }
.map-tool.on { background: linear-gradient(120deg, var(--blue), #1d7bc4); color: #fff; border-color: transparent; }

/* 底图分段切换 */
.map-seg { display: flex; gap: 2px; padding: 3px; border-radius: 10px;
  background: rgba(8, 26, 46, .76); border: 1px solid rgba(255, 255, 255, .15);
  box-shadow: 0 4px 14px rgba(4, 18, 36, .45);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.map-seg-btn { padding: 4px 10px; border: 0; border-radius: 7px; background: transparent; color: #9db6cf;
  font-family: inherit; font-size: 11.5px; line-height: 1.35; cursor: pointer; transition: background .16s, color .16s; }
.map-seg-btn:hover { color: #fff; }
.map-seg-btn.on { background: linear-gradient(120deg, var(--blue), #1d7bc4); color: #fff; font-weight: 600; }

/* 左上角信息卡 */
.map-card-info { position: absolute; left: 12px; top: 12px; z-index: 8; max-width: 56%;
  display: flex; flex-direction: column; gap: 3px; padding: 10px 13px; border-radius: 11px;
  background: linear-gradient(150deg, rgba(9, 30, 54, .9), rgba(9, 30, 54, .74));
  border: 1px solid rgba(255, 255, 255, .13); box-shadow: 0 8px 24px rgba(4, 18, 36, .48);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.map-card-info b { color: #fff; font-size: 13.5px; font-weight: 600; letter-spacing: .2px; }
.map-card-info .map-addr { color: #b9cfe6; font-size: 12px; }
.map-card-info .map-readout { color: #7fd3ab; font-size: 11.5px; font-variant-numeric: tabular-nums;
  letter-spacing: .3px; }
.map-card-info .map-readout--cursor { color: #7fb6e8; }

/* 左下角比例尺 */
.map-scale { position: absolute; left: 12px; bottom: 11px; z-index: 8; display: flex;
  flex-direction: column; gap: 3px; pointer-events: none; }
.map-scale-txt { font-size: 10.5px; color: rgba(255, 255, 255, .82); text-shadow: 0 1px 3px rgba(0, 0, 0, .7); }
.map-scale-bar { display: block; height: 7px; border-left: 1px solid rgba(255, 255, 255, .9);
  border-right: 1px solid rgba(255, 255, 255, .9); border-bottom: 2px solid rgba(255, 255, 255, .9);
  box-sizing: border-box; box-shadow: 0 1px 3px rgba(0, 0, 0, .55); }

.map-attr { position: absolute; right: 9px; bottom: 6px; z-index: 8; font-size: 10.5px;
  color: rgba(255, 255, 255, .62); text-shadow: 0 1px 3px rgba(0, 0, 0, .7); }
.map-fail { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 9;
  padding: 6px 13px; border-radius: 999px; font-size: 12px; color: #fff; background: rgba(214, 69, 69, .92); }
.map-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 12px; margin-top: 12px; }
.map-foot .text-muted { font-size: 12px; }

/* ---------- 园区位置：未添加的空状态 / 取点模式 / 取点表单 ---------- */
/* 未添加位置时，地图上不显示绿点与光圈 */
.map-box.no-loc .map-pin, .map-box.no-loc .map-fence { display: none; }
.map-box.picking { cursor: crosshair; }
.map-box.picking .map-scale, .map-box.picking .map-attr { opacity: 0; }

/* 取点模式：地图底部提示条 */
.map-pickbar { position: absolute; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; align-items: center; gap: 9px; padding: 9px 12px;
  background: linear-gradient(to top, rgba(6, 22, 40, .96), rgba(6, 22, 40, .84));
  border-top: 1px solid rgba(64, 214, 152, .32);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.map-pick-tip { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: #d9ecff; }
.map-pick-tip::before { content: ""; width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%;
  background: #45d68f; box-shadow: 0 0 9px rgba(69, 214, 143, .95); animation: pickBlink 1.2s ease-in-out infinite; }
@keyframes pickBlink { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
.map-pick-btn { height: 27px; padding: 0 11px; border-radius: 8px; cursor: pointer; white-space: nowrap;
  font-family: inherit; font-size: 12px; letter-spacing: .2px; color: #fff; border: 1px solid transparent;
  background: linear-gradient(120deg, var(--green), #1f8d78);
  box-shadow: 0 5px 14px rgba(34, 160, 107, .3); transition: filter .16s, transform .16s, background .16s; }
.map-pick-btn:hover { filter: brightness(1.07); transform: translateY(-1px); }
.map-pick-btn:active { transform: translateY(0); }
.map-pick-btn--ghost { background: rgba(255, 255, 255, .07); border-color: rgba(255, 255, 255, .24); color: #d6e6f7; box-shadow: none; }
.map-pick-btn--ghost:hover { background: rgba(255, 255, 255, .14); }

/* 取点表单（位于地图下方） */
.map-picker { margin-top: 12px; padding: 13px 14px; border-radius: 12px;
  background: linear-gradient(150deg, #f3f9ff 0%, #edf5fd 100%);
  border: 1px solid #d6e7f6; box-shadow: inset 0 1px 0 #fff; }
.map-picker-hd { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; margin-bottom: 11px; }
.map-picker-hd b { font-size: 13.5px; color: #16334c; letter-spacing: .2px; }
.map-pick-coord { font-size: 11.5px; color: #4a7cae; font-variant-numeric: tabular-nums; }
.map-picker-bd { display: grid; grid-template-columns: repeat(auto-fit, minmax(206px, 1fr)); gap: 10px 12px; }
.map-field { display: flex; flex-direction: column; gap: 5px; }
.map-field > span { font-size: 12px; color: #4b6b88; }
.map-field input { height: 32px; box-sizing: border-box; width: 100%; padding: 0 10px; border-radius: 8px;
  font-family: inherit; font-size: 13px; color: #16334c; background: #fff;
  border: 1px solid #cfe1f2; outline: none; transition: border-color .16s, box-shadow .16s; }
.map-field input::placeholder { color: #9db3c8; }
.map-field input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(22, 104, 181, .12); }
.map-picker-ft { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.map-picker-ft .text-muted { font-size: 11.5px; }
.map-picker-err { margin-top: 9px; padding: 6px 11px; border-radius: 8px; font-size: 12px;
  color: #9d2f2f; background: #fdeaea; border: 1px solid #f6cccc; }
.map-picker-tip { margin-top: 10px; padding-top: 10px; border-top: 1px dashed #cfe1f2;
  font-size: 11.5px; line-height: 1.7; color: #587795; }

/* 取点预览态：绿点半透明、不显示气泡文字，表示「尚未保存」 */
.map-pin.preview .map-pin-dot { opacity: .78; }
.map-pin.preview .map-pin-ring, .map-pin.preview .map-pin-label { display: none; }

@media (max-width: 1100px) { .map-card-info { max-width: 64%; } }
@media (max-width: 860px) {
  .map-box { height: 272px; }
  .map-card-info { max-width: 70%; left: 10px; top: 10px; padding: 8px 11px; }
  .map-card-info b { font-size: 12.5px; }
  .map-card-info .map-addr { font-size: 11px; }
  .map-card-info .map-readout { font-size: 10.5px; }
  .map-tools { top: 10px; right: 10px; gap: 6px; }
  .map-tool { width: 29px; height: 29px; border-radius: 8px; }
  .map-seg-btn { padding: 3px 8px; font-size: 11px; }
  .map-scale { left: 10px; bottom: 9px; }
  .map-pickbar { padding: 8px 10px; gap: 6px; flex-wrap: wrap; }
  .map-pick-tip { font-size: 11.5px; flex-basis: 100%; }
  .map-pick-btn { height: 25px; padding: 0 9px; font-size: 11.5px; }
  .map-picker { padding: 11px 12px; }
  .map-picker-bd { grid-template-columns: 1fr; }
}
