/* ============================================================
   联农宝 · 千人千面高保真原型 — 共享样式
   index.html(静态总览) / demo.html(动态交互) 共用
   ============================================================ */
:root {
  --bg: #F2F7F5;
  --card: #FFFFFF;
  --border: #E5EBE8;
  --primary: #00A870;
  --primary-light: #E9F5F0;
  --text: #1A2B24;
  --text-2: #6B7A75;
  --blue: #2563EB;
  --blue-light: #E3F2FD;
  --orange: #D97706;
  --orange-light: #FFF3E0;
  --red: #FF6B7A;
  --red-light: #FCE4EC;
  --purple: #9B8EF5;
  --green: #5FD4A0;
  --shadow: 0 2px 12px rgba(0,0,0,0.06);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  color: var(--text);
}
button { font-family: inherit; }

/* ═══════════════ App 屏内组件（390×844 坐标系） ═══════════════ */
.app-screen {
  width: 390px; height: 844px;
  background: var(--bg);
  display: flex; flex-direction: column;
  position: relative; overflow: hidden;
}
.status-bar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0 24px; height: 44px; flex: none;
  font-size: 15px; font-weight: 600; color: var(--text);
  background: var(--card);
}
.status-bar .ic { font-size: 12px; letter-spacing: 2px; }
.header-row {
  display: flex; align-items: center; padding: 0 16px;
  height: 52px; gap: 10px; background: var(--primary-light); flex: none;
}
.header-row-2 {
  display: flex; align-items: center; padding: 0 16px;
  height: 44px; gap: 10px; background: var(--primary-light); flex: none;
}
.menu-btn {
  width: 32px; height: 32px; border: none; background: none;
  font-size: 22px; color: var(--text); cursor: pointer; line-height: 1;
}
.farm-name { flex: 1; font-size: 16px; font-weight: 600; color: var(--text); }
.weather { display: flex; align-items: baseline; gap: 4px; }
.temp { font-size: 16px; font-weight: 700; color: var(--text); }
.desc { font-size: 12px; color: var(--text-2); }
.warn { flex: 1; font-size: 12px; font-weight: 500; color: var(--orange); }
.bcast-btn {
  padding: 4px 10px; border: 1px solid var(--primary); border-radius: 14px;
  background: var(--card); color: var(--primary); font-size: 12px; font-weight: 500; cursor: pointer;
}
.content {
  flex: 1; overflow-y: auto; padding: 16px;
  display: flex; flex-direction: column; gap: 12px;
  scrollbar-width: none;
}
.content::-webkit-scrollbar { display: none; }

/* 2×4 顶部专题 */
.card-2x4 {
  border-radius: 14px; padding: 14px 16px; color: #fff;
  background: linear-gradient(135deg, #008F61, #00B880);
  cursor: pointer; transition: transform 0.2s; flex: none;
  position: relative; overflow: hidden;
}
.card-2x4.blue { background: linear-gradient(135deg, #1E6FEB, #4A9EF5); }
.card-2x4.img {
  background-size: cover; background-position: center;
  text-shadow: 0 1px 4px rgba(0,0,0,0.35);
}
.card-2x4.img::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,40,25,0.05), rgba(0,40,25,0.35));
}
.card-2x4 .t { font-size: 18px; font-weight: 700; margin-bottom: 4px; position: relative; }
.card-2x4 .s { font-size: 12px; opacity: 0.92; margin-bottom: 2px; position: relative; }
.card-2x4 .hint { font-size: 10px; opacity: 0.7; position: relative; }
.card-2x4.banner { display:flex; flex-direction:column; justify-content:center; }
.card-2x4.banner.fert { background: linear-gradient(120deg, #0B7A4E, #00A870 55%, #7BE8B8); }
.card-2x4.banner.irr { background: linear-gradient(120deg, #0B4F8A, #2563EB 55%, #60A5FA); }
.card-2x4.banner .cta {
  position: absolute; right: 12px; bottom: 10px;
  background: rgba(255,255,255,.22); border: 1px solid rgba(255,255,255,.45);
  font-size: 12px; font-weight: 600; padding: 5px 14px; border-radius: 99px;
}

/* 2×4 服务专题 Banner（与矩阵 wgServiceBanner 风格一致：左 icon+标题，右 CTA） */
.card-2x4.banner.svc-banner {
  display: flex; flex-direction: row; align-items: center; gap: 12px;
  padding: 14px 16px;
}
.card-2x4.banner.svc-banner .svc-hd {
  display: flex; align-items: center; gap: 12px; flex: 1; position: relative;
}
.card-2x4.banner.svc-banner .svc-hd .svc-ic {
  width: 42px; height: 42px; border-radius: 12px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.2);
}
.card-2x4.banner.svc-banner .svc-hd .svc-ic svg { width: 24px; height: 24px; }
.card-2x4.banner.svc-banner .svc-hd .t { font-size: 17px; font-weight: 700; }
.card-2x4.banner.svc-banner .svc-hd .s { font-size: 12px; opacity: .92; margin-top: 2px; }
.card-2x4.banner.svc-banner .cta {
  position: static;
  border: 1px solid rgba(255,255,255,.45);
  background: rgba(255,255,255,.22);
  font-size: 12px; font-weight: 600; padding: 7px 14px; border-radius: 99px;
  flex: none;
}

/* 金刚区 */
.kingkong { display: flex; justify-content: space-between; padding: 4px 0; flex: none; }
.kk-item { display: flex; flex-direction: column; align-items: center; gap: 5px; width: 60px; cursor: pointer; }
.kk-box {
  width: 46px; height: 46px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700;
}
.kk-label { font-size: 11px; color: #374151; }

/* 1×2 横向指标条 */
.card-1x2 {
  display: flex; align-items: center; gap: 10px; flex: none;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 0 12px; height: 60px; cursor: pointer;
}
.card-1x2 .ic {
  width: 36px; height: 36px; border-radius: 10px; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700;
}
.card-1x2 .mid { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.card-1x2 .t { font-size: 11px; color: var(--text-2); }
.card-1x2 .v { font-size: 14px; font-weight: 700; color: var(--text); }

/* 1×2 · 实况天气（与矩阵 wgWeatherLive 1×2 风格一致） */
.card-1x2.weather { gap: 10px; }
.card-1x2.weather .ic-w {
  width: 36px; height: 36px; border-radius: 10px; flex: none;
  display: flex; align-items: center; justify-content: center;
}
.card-1x2.weather .hi { color: var(--text); font-size: 14px; font-weight: 800; margin-left: 6px; }
.card-1x2.weather .ext {
  text-align: right; flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 1px;
}
.card-1x2.weather .ext b { font-size: 14px; color: var(--orange); font-weight: 800; line-height: 1; }
.card-1x2.weather .ext span { font-size: 10px; color: var(--text-2); }
.card-1x2.weather .ext .warn-tag {
  display: inline-block; margin-top: 3px; font-size: 9px; color: #fff; background: var(--orange);
  padding: 2px 6px; border-radius: 99px; font-weight: 600;
}

/* 1×2 · 田间设备（单设备状态条，1×2 设备规格） */
.card-1x2.device .ic-d {
  width: 36px; height: 36px; border-radius: 10px; flex: none;
  display: flex; align-items: center; justify-content: center;
}

/* 2×2 子类型 */
.card-2x2.svc-promo {
  background: linear-gradient(135deg, #FDF3E0 0%, #FCE9D0 100%);
  border-color: #F5C97E;
}
.card-2x2.map-card {
  background: linear-gradient(135deg, #E9F5F0 0%, #D8EBE0 100%);
  border-color: #7BC96F;
}

/* 2×2 中部数据卡 */
.row-2x2 { display: flex; gap: 8px; flex: none; }
.card-2x2 {
  flex: 1; background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px; height: 120px;
  display: flex; flex-direction: column; gap: 6px; cursor: pointer;
}
.card-2x2 .t { font-size: 12px; font-weight: 600; color: var(--text); }
.card-2x2 .v { font-size: 18px; font-weight: 700; }
.card-2x2 .s { font-size: 10px; color: var(--text-2); }

/* 列表卡 */
.list-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px 14px; flex: none;
}
.list-card .hd { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 10px; }
.list-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.list-row .date { font-size: 11px; color: var(--text-2); width: 50px; }
.list-row .t { flex: 1; font-size: 12px; color: var(--text); }
.list-row .tag { font-size: 10px; font-weight: 500; }

/* TabBar */
.tabbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px 21px; background: var(--card);
  border-top: 1px solid var(--border); flex: none;
}
.tab { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 60px; cursor: pointer; }
.tab .label { font-size: 10px; font-weight: 500; color: #6B7A75; }
.tab.active .label { color: var(--primary); font-weight: 600; }
.tab.ai { margin-top: -14px; }
.tab.ai .label { color: var(--primary); font-weight: 600; }

/* 左抽屉 */
.drawer-overlay {
  position: absolute; inset: 0; background: rgba(0,0,0,0.45);
  z-index: 50; opacity: 0; pointer-events: none; transition: opacity 0.3s;
}
.drawer-overlay.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: absolute; left: 0; top: 0; bottom: 0; width: 290px;
  background: #EDF9F2; z-index: 51;
  transform: translateX(-102%); transition: transform 0.32s cubic-bezier(.32,.72,.28,1);
  display: flex; flex-direction: column; overflow-y: auto;
  scrollbar-width: none;
}
.drawer::-webkit-scrollbar { display: none; }
.drawer.open { transform: translateX(0); }
.drawer-header { padding: 40px 20px 20px; background: linear-gradient(180deg, #C8EED9, #F2F9F4); }
.drawer-user { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.drawer-avatar {
  width: 56px; height: 56px; border-radius: 28px; background: #fff; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700; color: var(--primary);
  box-shadow: 0 2px 8px rgba(0,80,50,0.12);
}
.drawer-name { font-size: 18px; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 6px; }
.drawer-sub { font-size: 11px; color: var(--text-2); margin-top: 3px; }
.drawer-farm {
  background: #fff; border-radius: 12px; padding: 14px 16px;
  display: flex; justify-content: space-between; align-items: center;
}
.drawer-farm .n { font-size: 15px; font-weight: 600; color: var(--text); }
.drawer-farm .s { font-size: 12px; color: var(--primary); font-weight: 500; flex: none; }
.drawer-farm .a { font-size: 11px; color: var(--text-2); margin-top: 4px; }
.drawer-group { padding: 14px 20px 4px; font-size: 14px; font-weight: 700; color: var(--text); }
.drawer-item { display: flex; align-items: center; gap: 14px; padding: 0 20px; height: 52px; cursor: pointer; }
.drawer-item:active { background: rgba(0,168,112,0.06); }
.drawer-item .icon {
  width: 32px; height: 32px; border-radius: 9px; flex: none;
  display: flex; align-items: center; justify-content: center;
}
.drawer-item .l { flex: 1; font-size: 15px; color: var(--text); }
.drawer-item .arrow { font-size: 22px; color: #9CA3AF; font-weight: 300; }
.drawer-item.special .l { color: var(--primary); font-weight: 600; }
.drawer-item.special .arrow { color: var(--primary); }
.drawer-item .badge {
  background: #F5A040; color: #fff; font-size: 9px; padding: 2px 6px;
  border-radius: 8px; font-weight: 700;
}
.drawer-ver { margin-top: auto; padding: 20px; text-align: center; font-size: 10px; color: #94A3B8; }

/* 编辑模式 / 组件库 页头 */
.edit-header {
  display: flex; align-items: center; gap: 8px; padding: 0 16px;
  height: 56px; background: var(--card); border-bottom: 1px solid var(--border); flex: none;
}
.edit-header .back { font-size: 24px; color: var(--text); cursor: pointer; width: 28px; }
.edit-header .title { font-size: 16px; font-weight: 600; color: var(--text); }
.edit-header .chip {
  padding: 2px 8px; border-radius: 4px; font-size: 10px;
  background: var(--primary-light); color: var(--primary); font-weight: 500;
}
.edit-header .spacer { flex: 1; }
.edit-header .btn { padding: 6px 12px; border-radius: 6px; font-size: 12px; cursor: pointer; }
.edit-header .btn.outline { border: 1px solid var(--border); color: var(--text); background: #fff; }
.edit-header .btn.solid { background: var(--primary); color: #fff; border: none; }

/* 角色模板卡 */
.template-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; padding: 16px; flex: none;
}
.template-card .hd { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 12px; }
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  padding: 6px 14px; border-radius: 20px; font-size: 12px;
  border: 1px solid var(--border); color: var(--text-2); cursor: pointer; background: #fff;
}
.chip.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* 卡片管理（支持长按拖拽） */
.manage-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; padding: 16px; flex: none;
}
.manage-card .hd { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.manage-card .tip { font-size: 11px; color: var(--text-2); margin-bottom: 8px; }
.manage-list { position: relative; }
.manage-row {
  display: flex; align-items: center; gap: 10px; padding: 10px 0;
  border-bottom: 1px solid var(--border);
  background: var(--card);
  user-select: none; -webkit-user-select: none;
  touch-action: pan-y;
}
.manage-row:last-child { border-bottom: none; }
.manage-row .handle { font-size: 18px; color: #9CA3AF; cursor: grab; width: 22px; text-align: center; }
.manage-row .name { flex: 1; font-size: 13px; color: var(--text); }
.manage-row .spec { padding: 2px 6px; border-radius: 4px; font-size: 10px; font-weight: 500; }
.spec-1x1 { background: var(--primary-light); color: var(--primary); }
.spec-1x2 { background: var(--blue-light); color: var(--blue); }
.spec-2x2 { background: var(--orange-light); color: var(--orange); }
.spec-2x4 { background: var(--red-light); color: var(--red); }
.spec-4x4 { background: #F3F0FF; color: #7C6AE8; }
.spec-1x4 { background: #E0F2FE; color: #0284C7; }
.spec-4xn, .spec-4xN { background: #FDF2E9; color: #C05621; }
.manage-row .toggle {
  width: 36px; height: 20px; border-radius: 10px; flex: none;
  background: #E5EBE8; position: relative; cursor: pointer;
}
.manage-row .toggle.on { background: var(--primary); }
.manage-row .toggle::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px; border-radius: 50%; background: #fff;
  transition: left 0.2s; box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.manage-row .toggle.on::after { left: 18px; }
.manage-row .toggle.locked { cursor: not-allowed; opacity: .85; }
.manage-row.armed { background: var(--primary-light); border-radius: 8px; }
.manage-row.dragging {
  position: relative; z-index: 10;
  box-shadow: 0 8px 24px rgba(0,60,40,0.18);
  border-radius: 10px; border-bottom: none;
  cursor: grabbing;
}
.manage-row.dragging .handle { cursor: grabbing; color: var(--primary); }
.manage-list.sorting .manage-row:not(.dragging) { transition: transform 0.18s ease; }

/* 添加卡片入口 */
.add-card-btn {
  background: var(--card); border: 1px dashed var(--primary);
  border-radius: 14px; padding: 14px 16px; text-align: center;
  color: var(--primary); font-size: 14px; font-weight: 500; cursor: pointer; flex: none;
}
.add-card-btn:active { background: var(--primary-light); }

/* 组件库页 */
.search-bar {
  display: flex; align-items: center; gap: 8px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 14px; flex: none;
  color: var(--text-2); font-size: 13px;
}
.lib-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px 14px; flex: none;
}
.lib-item .ic {
  width: 44px; height: 44px; border-radius: 12px; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700;
}
.lib-item .mid { flex: 1; }
.lib-item .n { font-size: 14px; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 6px; }
.lib-item .d { font-size: 11px; color: var(--text-2); margin-top: 3px; }
.lib-item .add-btn {
  padding: 6px 14px; border-radius: 16px; font-size: 12px; font-weight: 500;
  border: 1px solid var(--primary); color: var(--primary); background: #fff; cursor: pointer; flex: none;
}
.lib-item .add-btn.added { background: var(--primary-light); border-color: transparent; color: var(--primary); }
.lib-done-btn {
  position: sticky; bottom: 64px; z-index: 20;
  margin: 12px 0 4px; padding: 14px 0; border-radius: 12px; border: none;
  background: var(--primary); color: #fff; font-size: 15px; font-weight: 600;
  cursor: pointer; flex: none;
  box-shadow: 0 -4px 12px rgba(0,0,0,0.06);
}

/* 屏内 Toast */
.phone-toast {
  position: absolute; left: 50%; bottom: 96px; transform: translateX(-50%) translateY(8px);
  background: rgba(26,43,36,0.88); color: #fff; font-size: 12px;
  padding: 8px 16px; border-radius: 18px; z-index: 80;
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s;
  white-space: nowrap;
}
.phone-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ═══════════════ 静态总览页 ═══════════════ */
.ov-body { background: #EDF1F4; min-height: 100vh; }
.ov-topbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,0.92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
  padding: 14px 32px;
}
.ov-logo {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, #008F61, #00C870);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 16px; font-weight: 700;
}
.ov-title { font-size: 17px; font-weight: 700; }
.ov-sub { font-size: 12px; color: var(--text-2); margin-top: 1px; }
.ov-topbar .spacer { flex: 1; }
.ov-demo-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 20px; border-radius: 22px; text-decoration: none;
  background: var(--primary); color: #fff; font-size: 14px; font-weight: 600;
  box-shadow: 0 4px 14px rgba(0,168,112,0.35);
}
.ov-demo-btn:hover { background: #009260; }
.ov-main { max-width: 1320px; margin: 0 auto; padding: 32px 32px 80px; }
.ov-section { margin-bottom: 56px; }
.ov-sec-hd { display: flex; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.ov-sec-no {
  font-size: 13px; font-weight: 700; color: #fff;
  background: var(--text); border-radius: 6px; padding: 3px 9px;
}
.ov-sec-no.c1 { background: var(--primary); }
.ov-sec-no.c2 { background: var(--blue); }
.ov-sec-no.c3 { background: var(--orange); }
.ov-sec-no.c4 { background: var(--purple); }
.ov-sec-title { font-size: 22px; font-weight: 700; }
.ov-sec-desc { font-size: 13px; color: var(--text-2); margin-bottom: 24px; }
.ov-phones { display: flex; gap: 36px; flex-wrap: wrap; justify-content: center; }

/* 手机模型（静态） */
.mock { width: 286px; flex: none; }
.mock-clip {
  width: 286px; height: 602px; overflow: hidden;
  border-radius: 40px; border: 9px solid #17211C;
  background: var(--bg);
  box-shadow: 0 16px 40px rgba(20,40,30,0.16);
  position: relative;
}
.mock-notch {
  position: absolute; top: 9px; left: 50%; transform: translateX(-50%);
  width: 96px; height: 20px; background: #17211C; border-radius: 12px; z-index: 20;
}
.mock-inner { width: 390px; height: 844px; transform: scale(0.6897); transform-origin: top left; }
.mock-cap { text-align: center; margin-top: 14px; }
.mock-cap .n { font-size: 15px; font-weight: 700; }
.mock-cap .d { font-size: 12px; color: var(--text-2); margin-top: 3px; }

/* 宽图展示 */
.ov-wides { display: flex; flex-direction: column; gap: 28px; }
.ov-wide {
  background: #fff; border: 1px solid var(--border); border-radius: 16px;
  padding: 20px; box-shadow: var(--shadow);
}
.ov-wide img { width: 100%; border-radius: 10px; display: block; background: #F5F7F6; }
.ov-wide .cap { margin-top: 12px; }
.ov-wide .cap .n { font-size: 15px; font-weight: 700; }
.ov-wide .cap .d { font-size: 12px; color: var(--text-2); margin-top: 3px; }

/* ═══════════════ 动态演示页 ═══════════════ */
.dm-body {
  background: radial-gradient(1200px 700px at 70% 20%, #E4F0EA, #DDE5E9);
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  gap: 56px; padding: 32px; flex-wrap: wrap;
}
.dm-panel { width: 264px; flex: none; }
.dm-panel h1 { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.dm-panel .sub { font-size: 12px; color: var(--text-2); margin-bottom: 22px; }
.dm-role-lb { font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 10px; }
.dm-role-btn {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 13px 16px; margin-bottom: 10px; border-radius: 14px;
  border: 1.5px solid var(--border); background: #fff; cursor: pointer;
  font-size: 14px; font-weight: 600; color: var(--text); text-align: left;
  transition: all .18s;
}
.dm-role-btn .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.dm-role-btn small { display: block; font-size: 11px; font-weight: 400; color: var(--text-2); margin-top: 2px; }
.dm-role-btn:hover { border-color: var(--primary); }
.dm-role-btn.active { border-color: var(--primary); background: var(--primary-light); box-shadow: 0 4px 14px rgba(0,168,112,0.15); }
.dm-flow {
  margin-top: 22px; background: #fff; border: 1px solid var(--border);
  border-radius: 14px; padding: 14px 16px;
}
.dm-flow .t { font-size: 12px; font-weight: 700; margin-bottom: 8px; }
.dm-flow .step { font-size: 12px; color: var(--text-2); line-height: 1.9; display: flex; gap: 8px; }
.dm-flow .step b { color: var(--primary); font-weight: 600; }
.dm-back {
  display: inline-block; margin-top: 20px; font-size: 13px; color: var(--text-2);
  text-decoration: none;
}
.dm-back:hover { color: var(--primary); }

/* 手机外框 */
.dm-phone {
  width: 414px; height: 876px; padding: 12px;
  background: #17211C; border-radius: 56px;
  box-shadow: 0 30px 80px rgba(15,35,25,0.35), inset 0 0 0 2px #2A3830;
  position: relative; flex: none;
}
.dm-phone .notch {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
  width: 120px; height: 26px; background: #17211C; border-radius: 16px; z-index: 30;
}
.dm-viewport {
  width: 390px; height: 852px; border-radius: 44px; overflow: hidden;
  position: relative; background: var(--bg);
}
.dm-viewport .app-screen { position: absolute; inset: 0; height: 852px; }
.dm-screen { display: none; }
.dm-screen.active { display: flex; }

/* ════════════════════════════════════════════════════════════════
   样式 A · 卫星图沉浸式首页（农技中心 / 现场管理员）
   ════════════════════════════════════════════════════════════════ */
.app-screen.panel-up { background: #2d4a2e; }

/* 卫星图底 */
.a-map-wrap {
  position: relative; height: 460px; flex: none;
  background: #2d4a2e; overflow: hidden;
}
.app-screen.panel-up .a-map-wrap { height: 200px; transition: height .3s ease; }
.a-map { position: absolute; inset: 0; width: 100%; height: 100%; }
.a-topbar {
  position: absolute; top: 50px; left: 0; right: 0;
  display: flex; align-items: center; gap: 10px;
  padding: 0 14px; z-index: 5;
}
.a-menu {
  width: 32px; height: 32px; border: none; background: rgba(0,0,0,.45);
  color: #fff; font-size: 20px; border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.a-addr {
  flex: 1; display: flex; align-items: center; gap: 6px;
  background: rgba(0,0,0,.45); color: #fff; font-size: 13px;
  padding: 6px 12px; border-radius: 16px; cursor: pointer;
  max-width: 60%;
}
.a-addr .a-swap {
  width: 22px; height: 22px; background: rgba(255,255,255,.18);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 12px;
}
.a-topright {
  position: absolute; top: 50px; right: 14px; z-index: 5;
  display: flex; flex-direction: column; align-items: flex-end; gap: 10px;
}
.a-weather {
  display: flex; align-items: center; gap: 4px;
  background: rgba(0,0,0,.45); color: #fff; padding: 4px 10px;
  border-radius: 14px; font-size: 12px;
}
.a-temp { font-size: 16px; font-weight: 700; }
.a-desc { font-size: 12px; }
.a-bcast {
  display: flex; align-items: center; gap: 4px;
  background: rgba(255,255,255,.92); color: #1F2937;
  border: none; padding: 6px 14px; border-radius: 99px;
  font-size: 13px; font-weight: 600; cursor: pointer;
}
.a-bcast .a-play {
  width: 16px; height: 16px; background: #00A870; color: #fff;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 9px;
}
.a-alert {
  position: absolute; top: 110px; left: 16px; z-index: 5;
  color: #FFB800; font-size: 12.5px; font-weight: 600;
  text-shadow: 0 1px 2px rgba(0,0,0,.4);
}
.a-handle {
  position: absolute; bottom: 6px; left: 50%; transform: translateX(-50%);
  width: 36px; height: 4px; background: rgba(255,255,255,.5);
  border-radius: 99px; z-index: 6;
}

/* 面板 */
.a-panel {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: #fff; border-radius: 18px 18px 0 0;
  box-shadow: 0 -6px 20px rgba(0,0,0,.1);
  overflow: hidden;
}
.a-panel-inner {
  height: 100%; overflow: hidden; padding: 12px 16px 16px;
}
.a-section { margin-bottom: 12px; }
.a-hd {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}
.a-title { font-size: 16px; font-weight: 700; color: #1F2937; }
.a-more { font-size: 12px; color: #00A870; cursor: pointer; }

/* 农事任务 3 卡 */
.a-task3 { display: flex; gap: 0; justify-content: space-between; }
.a-task-item {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  gap: 4px; cursor: pointer; padding: 4px 0;
}
.a-task-ic {
  width: 44px; height: 44px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
}
.a-task-num { font-size: 14px; font-weight: 700; color: #1F2937; }
.a-task-lb  { font-size: 11px; color: #6B7280; }

/* 待办卡 */
.a-todo-card {
  background: #F8FAFB; border-radius: 12px;
  padding: 12px 14px; cursor: pointer;
}
.a-todo-row1 {
  display: flex; align-items: center; gap: 8px; margin-bottom: 8px;
}
.a-tag {
  display: inline-flex; align-items: center; padding: 3px 8px;
  border-radius: 4px; font-size: 11.5px; font-weight: 600;
}
.a-tag.type { background: #DCFCE7; color: #16A34A; }
.a-tag.status.blue  { background: #DBEAFE; color: #2563EB; margin-left: auto; }
.a-tag.status.green { background: #DCFCE7; color: #16A34A; margin-left: auto; }
.a-tag.status.red   { background: #FEE2E2; color: #DC2626; margin-left: auto; }
.a-tag.status.orange{ background: #FFF7ED; color: #EA580C; margin-left: auto; }
.a-todo-name { font-size: 14px; font-weight: 700; color: #1F2937; flex: 1; }
.a-todo-meta {
  font-size: 12px; color: #6B7280; line-height: 1.8;
}
.a-todo-meta span { color: #9CA3AF; }

/* 异常信息提示条 */
.a-warn-bar {
  display: flex; align-items: center; gap: 8px;
  background: #FFFBEB; border: 1px solid #FDE68A;
  border-radius: 12px; padding: 10px 14px;
}
.a-warn-l { display: flex; align-items: center; gap: 6px; flex: 1; font-size: 13px; color: #92400E; }
.a-warn-l b { color: #B91C1C; font-weight: 700; }
.a-warn-ic { color: #F59E0B; font-size: 16px; }
.a-warn-btn {
  background: #EA580C; color: #fff; border: none;
  padding: 5px 12px; border-radius: 6px; font-size: 12px;
  cursor: pointer; flex: none;
}
.a-warn-x {
  color: #9CA3AF; cursor: pointer; font-size: 14px; padding: 0 4px;
  flex: none;
}

/* 4 项 TabBar */
.a-tabbar {
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 56px; background: #fff;
  display: flex; align-items: center;
  border-top: 1px solid #F3F4F6;
}
.a-tab {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 2px;
  height: 100%; cursor: pointer; font-size: 11px;
}
.a-tab.on { color: #00A870; font-weight: 600; }

/* ════════════════════════════════════════════════════════════════
   样式 B · 浅绿清爽首页（老板 / 飞防中心 / 供销中心 / 农机中心）
   ════════════════════════════════════════════════════════════════ */
.app-screen.b-style { background: #F0FDF4; }

.b-top {
  background: linear-gradient(180deg, #DCFCE7 0%, #F0FDF4 100%);
  padding: 12px 16px 18px; flex: none;
}
.b-top-row { display: flex; align-items: center; justify-content: space-between; }
.b-farm-sel {
  background: rgba(255,255,255,.85); padding: 8px 14px;
  border-radius: 99px; font-size: 13px; color: #1F2937;
  display: flex; align-items: center; gap: 6px; cursor: pointer;
  font-weight: 500;
}
.b-arrow { font-size: 10px; color: #6B7280; }
.b-bell {
  position: relative; width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.b-bell-dot {
  position: absolute; top: 4px; right: 4px;
  width: 8px; height: 8px; background: #EF4444;
  border-radius: 50%;
}
.b-hello {
  font-size: 20px; font-weight: 700; color: #1F2937;
  margin-top: 12px;
}

.b-content {
  flex: 1; overflow-y: auto; padding: 0 16px 80px;
  background: #F0FDF4;
}

/* 天气卡 */
.b-weather {
  background: #fff; border-radius: 14px;
  padding: 12px 14px; display: flex; align-items: center;
  justify-content: space-between; margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.b-weather-l {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: #1F2937;
}
.b-arrow-r { color: #9CA3AF; font-size: 16px; }

/* 双卡适宜度 */
.b-suit-row { display: flex; gap: 8px; margin-bottom: 14px; }
.b-suit {
  flex: 1; border-radius: 14px; padding: 14px 12px;
  position: relative; overflow: hidden;
  min-height: 100px;
  display: flex; flex-direction: column; justify-content: flex-start;
}
.b-suit.bad  { background: linear-gradient(135deg, #FED7AA 0%, #FFEDD5 100%); }
.b-suit.good { background: linear-gradient(135deg, #BBF7D0 0%, #DCFCE7 100%); }
.b-suit-bg {
  position: absolute; right: 0; bottom: 0;
  width: 100%; height: 100%; opacity: .9;
  pointer-events: none;
}
.b-suit-bg svg { width: 100%; height: 100%; }
.b-suit-label {
  font-size: 18px; font-weight: 700;
  position: relative; z-index: 2;
}
.b-suit.bad  .b-suit-label { color: #EA580C; }
.b-suit.good .b-suit-label { color: #16A34A; }
.b-suit-name {
  font-size: 13px; color: #1F2937; font-weight: 500;
  position: relative; z-index: 2;
}
.b-suit-label {
  font-size: 18px; font-weight: 700;
}
.b-suit.bad  .b-suit-label { color: #EA580C; }
.b-suit.good .b-suit-label { color: #16A34A; }
.b-suit-name {
  font-size: 13px; color: #1F2937; font-weight: 500;
}

/* Tab 切换 */
.b-tab-row {
  display: flex; gap: 24px; padding: 0 4px;
  border-bottom: 1px solid #E5E7EB; margin-bottom: 12px;
}
.b-tab {
  position: relative; padding: 6px 0;
  font-size: 14px; color: #9CA3AF; cursor: pointer;
  font-weight: 500;
}
.b-tab.on { color: #1F2937; font-weight: 700; }
.b-tab.on i {
  position: absolute; bottom: -1px; left: 0; right: 0;
  height: 2px; background: #00A870; border-radius: 1px;
  display: block;
}

/* 搜索框 */
.b-search {
  display: flex; align-items: center; gap: 6px;
  background: #F1F5F9; border-radius: 99px;
  padding: 8px 14px; margin-bottom: 12px;
  font-size: 13px; color: #9CA3AF;
}

/* 任务列表 */
.b-list { display: flex; flex-direction: column; gap: 10px; }
.b-todo-card {
  background: #fff; border-radius: 12px;
  padding: 12px 14px; cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.b-row1 {
  display: flex; align-items: center; gap: 8px; margin-bottom: 8px;
}
.b-type {
  background: #DCFCE7; color: #16A34A;
  padding: 3px 8px; border-radius: 4px;
  font-size: 11.5px; font-weight: 600;
}
.b-name { font-size: 14px; font-weight: 700; color: #1F2937; flex: 1; }
.b-status {
  padding: 3px 8px; border-radius: 4px;
  font-size: 11.5px; font-weight: 600;
}
.b-row2 {
  font-size: 12px; color: #6B7280; line-height: 1.7;
}
.b-row2 span { color: #9CA3AF; }

/* 2 项 TabBar */
.b-tabbar {
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 56px; background: #fff;
  display: flex; align-items: center;
  border-top: 1px solid #F3F4F6;
}
.b-tab-item {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 2px;
  height: 100%; cursor: pointer; font-size: 11px;
}
.b-tab-item.on { color: #00A870; font-weight: 600; }

/* ════════════════════════════════════════════════════════════════
   静态总览 · 样式对比卡
   ════════════════════════════════════════════════════════════════ */
.ov-style-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 8px; }
.ov-style-card {
  background: #fff; border: 1px solid #E5E7EB; border-radius: 12px;
  padding: 18px 20px; position: relative;
}
.ov-style-card.a { border-color: #10B981; background: linear-gradient(135deg, #ECFDF5 0%, #fff 100%); }
.ov-style-card.b { border-color: #BBF7D0; background: linear-gradient(135deg, #F0FDF4 0%, #fff 100%); }
.ov-style-tag {
  display: inline-block; padding: 4px 12px; border-radius: 99px;
  background: #10B981; color: #fff; font-size: 12px; font-weight: 700;
  margin-bottom: 10px;
}
.ov-style-name {
  font-size: 18px; font-weight: 700; color: #1F2937;
  margin-bottom: 8px;
}
.ov-style-roles {
  font-size: 13px; color: #16A34A; font-weight: 600;
  margin-bottom: 8px;
}
.ov-style-feat {
  font-size: 13px; color: #4B5563; line-height: 1.7;
}

/* 样式 B 顶部改造：左侧菜单按钮 + 农场名（不再下拉） */
.b-menu-btn {
  display: flex; align-items: center; gap: 8px;
  font-size: 17px; font-weight: 700; color: #1F2937;
  cursor: pointer;
}
.b-menu-btn .b-farm-name { font-size: 17px; font-weight: 700; }
.b-rain-cloud { font-size: 18px; }
.b-empty {
  display: flex; flex-direction: column; align-items: center;
  padding: 60px 0 40px;
}
.b-empty-art { opacity: 0.9; }
.b-empty-text { font-size: 13px; color: #9CA3AF; margin-top: 8px; }

/* 隐藏侧滑条 & 滚动条（webkit） */
.a-panel-inner::-webkit-scrollbar { display: none; }
.a-panel-inner { scrollbar-width: none; }
/* 组件库已添加状态 */
.lib-item.used { background: #ECFDF5; border-color: #A7F3D0; }
.lib-item.used .ic { opacity: 0.7; }

/* ═══ S08 预览模式悬浮条 ═══ */
.pv-pill {
  position: absolute; top: 56px; left: 50%; transform: translateX(-50%);
  z-index: 60; display: flex; align-items: center; gap: 8px;
  background: rgba(17, 24, 39, .88); color: #fff;
  padding: 7px 8px 7px 12px; border-radius: 999px;
  font-size: 11.5px; white-space: nowrap;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .3);
  backdrop-filter: blur(4px);
}
.pv-pill .pv-badge { color: #FBBF24; font-weight: 700; }
.pv-pill .pv-ver { color: rgba(255, 255, 255, .75); }
.pv-pill .pv-exit {
  background: #fff; color: #111827; border-radius: 999px;
  padding: 4px 11px; font-weight: 700; cursor: pointer;
}
.pv-pill .pv-exit:active { opacity: .8; }
