/* ===== 大棚作物生长可视化看板 - styles.css ===== */
/* 农业办公风：主色调绿/土色系，简洁响应式 */

:root {
  --green-dark: #1b5e20;
  --green-main: #2E7D32;
  --green-mid: #43A047;
  --green-soft: #66BB6A;
  --earth: #8D6E63;
  --earth-dark: #795548;
  --bg: #f3f7f0;
  --card: #ffffff;
  --border: #d7e3d3;
  --danger: #c62828;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background: var(--bg);
  color: #333;
  min-height: 100vh;
}

/* ---------- 顶部导航 ---------- */
#app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 18px;
  background: var(--green-main);
  color: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}
.header-left .logo {
  font-size: 18px;
  font-weight: 600;
}
.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.clock {
  font-family: "Consolas", "Menlo", monospace;
  font-size: 13px;
  opacity: 0.95;
}
.user-status {
  font-size: 13px;
  background: rgba(255, 255, 255, 0.18);
  padding: 3px 8px;
  border-radius: 12px;
}

/* ---------- 按钮 ---------- */
.btn {
  padding: 7px 14px;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  background: #e0e0e0;
  color: #333;
  transition: filter .15s, background .15s;
}
.btn:hover { filter: brightness(0.95); }
.btn-primary { background: var(--green-main); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-light { background: rgba(255, 255, 255, 0.92); color: var(--green-main); font-weight: 600; }
.btn-enter { background: var(--green-soft); color: #fff; }

/* ---------- 主区域 ---------- */
#app-main {
  padding: 18px;
  max-width: 1280px;
  margin: 0 auto;
}
.page-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.page-head h2 {
  margin: 0;
  font-size: 20px;
  color: var(--green-dark);
}

/* ---------- 基地列表 ---------- */
.base-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.base-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
}
.base-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}
.base-name {
  font-size: 18px;
  font-weight: 600;
  color: var(--green-main);
}
.base-meta {
  color: #666;
  font-size: 13px;
  margin: 6px 0 12px;
}
.base-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
/* 基地档案摘要标签（区域/土壤/面积/编号） */
.base-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}
.base-chip {
  font-size: 12px;
  color: #546E7A;
  background: #ECEFF1;
  border-radius: 10px;
  padding: 2px 9px;
  white-space: nowrap;
}
.base-addr {
  font-size: 12px;
  color: #888;
  margin-bottom: 10px;
  line-height: 1.5;
}

/* ---------- 大棚看板网格 ---------- */
.legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.legend-group-label {
  font-size: 12px;
  color: #888;
  font-weight: 600;
  padding-right: 2px;
}
.legend-group-label:not(:first-child) {
  margin-left: 8px;
  padding-left: 10px;
  border-left: 1px solid #e0e0e0;
}
.legend-tag {
  font-size: 11px;
  color: #8D6E63;
  background: #EFEBE9;
  border-radius: 8px;
  padding: 0 6px;
  margin-left: 2px;
  font-weight: 700;
}
.legend-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #444;
  background: #fff;
  border: 1px solid #e0e0e0;
  padding: 4px 10px;
  border-radius: 16px;
}
.legend-color {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.gh-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}
.gh-card {
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 10px;
  padding: 14px;
  min-height: 210px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
}
.gh-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.gh-card-head {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.gh-shedno {
  font-weight: 700;
  font-size: 16px;
  color: #333;
}
.gh-del {
  background: var(--danger);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  line-height: 22px;
  cursor: pointer;
  font-size: 14px;
}
.gh-svg {
  width: 100%;
  height: 120px;
  margin: 6px 0;
}
.gh-cropname {
  font-weight: 600;
  font-size: 15px;
  color: var(--green-dark);
}
.gh-cropname.gh-idle {
  color: #888;
  font-weight: 500;
}

/* ---------- 休耕/整地地块：与「空闲」明确区分 ---------- */
/* 土黄底 + 虚线内框，卡片右上角带「整地中」标识 */
.gh-card.gh-fallow {
  border: 1.5px dashed #A1887F;
  box-shadow: inset 0 0 0 1px rgba(161, 136, 127, 0.18);
}
.gh-cropname.gh-fallow-name {
  color: #6D4C41;
  font-weight: 700;
}
.gh-fallow-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 0 7px;
  border-radius: 9px;
  background: #8D6E63;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  vertical-align: middle;
}
.gh-fallow-reason {
  font-size: 12px;
  color: #795548;
  margin-top: 2px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gh-fallow-eta {
  font-size: 12px;
  color: #8D6E63;
  margin-top: 2px;
  font-weight: 600;
}
.gh-fallow-eta.muted {
  color: #B0A9A4;
  font-weight: 400;
}
/* 超过预计恢复播种日仍未复种：标红提示（与预警角标呼应） */
.gh-fallow-eta.overdue {
  color: #C62828;
}
.gh-fallow-eta.overdue::before {
  content: "⚠ ";
}
/* 卡片底部工具条：改名 / 置为休耕 / 解除休耕 */
.gh-card-tools {
  display: flex;
  gap: 6px;
  margin-top: 6px;
  width: 100%;
  justify-content: center;
}
.gh-tool {
  flex: 1;
  max-width: 96px;
  padding: 3px 6px;
  font-size: 12px;
  border: 1px solid #CFD8DC;
  background: #fff;
  color: #546E7A;
  border-radius: 6px;
  cursor: pointer;
}
.gh-tool:hover {
  background: #ECEFF1;
  border-color: #B0BEC5;
}
.gh-tool-warn {
  border-color: #A1887F;
  color: #6D4C41;
}
.gh-tool-warn:hover {
  background: #EFEBE9;
}
/* 品种标签：富硒 */
.gh-se-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 0 7px;
  border-radius: 9px;
  background: #E1F5FE;
  color: #0277BD;
  font-size: 11px;
  font-weight: 700;
  vertical-align: middle;
}
/* 大棚卡片上的预警角标 */
.gh-alert-flag {
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 9px;
  background: #FFF3E0;
  color: #E65100;
  font-size: 11px;
  font-weight: 700;
  cursor: help;
}
.gh-alert-flag.danger {
  background: #FFEBEE;
  color: #C62828;
}
.gh-stage {
  margin-top: 4px;
  font-size: 13px;
  color: #444;
}
.gh-elapsed {
  font-size: 12px;
  color: #666;
  margin-top: 2px;
}
.gh-edit {
  margin-top: 10px;
  padding: 5px 14px;
  border: none;
  border-radius: 6px;
  background: var(--green-main);
  color: #fff;
  cursor: pointer;
  font-size: 13px;
}
.gh-card:hover .gh-edit { background: var(--green-dark); }

.empty-tip {
  grid-column: 1 / -1;
  color: #888;
  padding: 24px;
  text-align: center;
  background: #fff;
  border: 1px dashed #ccc;
  border-radius: 10px;
}

/* ---------- 编辑 / 查看面板（右侧抽屉） ---------- */
.edit-panel {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.25);
  display: flex;
  justify-content: flex-end;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s ease, visibility .25s ease;
}
.edit-panel.open {
  opacity: 1;
  visibility: visible;
}
.edit-panel-content {
  width: 340px;
  max-width: 92%;
  background: #fff;
  height: 100%;
  overflow-y: auto;
  padding: 18px;
  transform: translateX(100%);
  transition: transform .25s ease;
  box-shadow: -2px 0 14px rgba(0, 0, 0, 0.2);
}
.edit-panel.open .edit-panel-content {
  transform: translateX(0);
}
.edit-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #eee;
  padding-bottom: 10px;
  margin-bottom: 12px;
}
.edit-head h3 {
  margin: 0;
  color: var(--green-main);
}
.edit-close {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: #888;
  line-height: 1;
}
.readonly-tip {
  background: #FFF8E1;
  color: #8d6e00;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 13px;
  margin-bottom: 10px;
}
.field {
  margin-bottom: 12px;
}

/* ---------- 编辑面板：地块信息与状态 ---------- */
.plot-info {
  background: #f7f9fa;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 14px;
}
.plot-info.fallow {
  background: #FBF6EC;
  border-color: #D7CCC8;
}
.plot-status-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 6px 0;
}
.plot-status-chip {
  font-size: 12px;
  font-weight: 700;
  border-radius: 10px;
  padding: 2px 10px;
}
.plot-status-chip.growing {
  background: #E8F5E9;
  color: #2E7D32;
}
.plot-status-chip.idle {
  background: #ECEFF1;
  color: #607D8B;
}
.plot-status-chip.fallow {
  background: #8D6E63;
  color: #fff;
}
.plot-status-text {
  font-size: 12px;
  color: #666;
}
.plot-status-text.overdue {
  color: #C62828;
  font-weight: 600;
}
.plot-status-note {
  width: 100%;
  font-size: 12px;
  color: #795548;
  background: #fff;
  border-radius: 6px;
  padding: 6px 8px;
  margin-top: 4px;
  line-height: 1.5;
}
.btn-small {
  padding: 4px 10px;
  font-size: 12px;
}
.btn-fallow {
  background: #8D6E63;
  border-color: #8D6E63;
  color: #fff;
}
.btn-fallow:hover {
  background: #6D4C41;
  border-color: #6D4C41;
}
.field label {
  display: block;
  font-size: 13px;
  color: #555;
  margin-bottom: 4px;
}
.field input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
  box-sizing: border-box;
}
.field input[readonly] {
  background: #f5f5f5;
  color: #666;
}
.edit-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

/* ---------- 弹窗 ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}
.modal-overlay.hidden { display: none; }
.modal-box {
  background: #fff;
  border-radius: 10px;
  padding: 20px;
  width: 320px;
  max-width: 90%;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}
.modal-box h3 {
  margin: 0 0 14px;
  color: var(--green-main);
}
.modal-label {
  display: block;
  font-size: 13px;
  color: #555;
  margin: 8px 0 4px;
}
.modal-input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
  box-sizing: border-box;
}
.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 16px;
}

/* ---------- 通用多字段表单弹窗（新增基地 / 基地档案 / 休耕登记） ---------- */
.form-box {
  width: 560px;
  max-width: 94%;
  max-height: 88vh;
  overflow-y: auto;
}
.form-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 14px;
}
.form-row.full {
  grid-column: 1 / -1;
}
.form-label {
  display: block;
  font-size: 13px;
  color: #555;
  margin-bottom: 4px;
  font-weight: 600;
}
.req-star {
  color: #C62828;
  margin-left: 3px;
}
.form-hint {
  font-size: 12px;
  color: #888;
  margin-top: 4px;
  line-height: 1.5;
}
.form-error {
  margin-top: 12px;
  padding: 8px 10px;
  border-radius: 6px;
  background: #FFEBEE;
  border: 1px solid #FFCDD2;
  color: #C62828;
  font-size: 13px;
}
.form-error.hidden { display: none; }
textarea.modal-input {
  min-height: 56px;
  resize: vertical;
  font-family: inherit;
  line-height: 1.5;
}
@media (max-width: 560px) {
  .form-fields { grid-template-columns: 1fr; }
}

/* ---------- 农事日志（编辑面板内） ---------- */
.log-section {
  border-top: 1px dashed var(--border);
  margin-top: 14px;
  padding-top: 12px;
}
.log-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--green-main);
  margin-bottom: 8px;
}
.log-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.log-tab {
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  color: #555;
  font-size: 13px;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.log-tab:hover { border-color: var(--green-soft); color: var(--green-main); }
.log-tab.active {
  background: var(--green-main);
  color: #fff;
  border-color: var(--green-main);
}
.log-list {
  max-height: 200px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}
.log-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  background: #fafdf8;
  position: relative;
}
.log-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.log-cat {
  font-size: 12px;
  background: rgba(46, 125, 50, 0.12);
  color: var(--green-main);
  padding: 1px 8px;
  border-radius: 10px;
}
.log-date {
  font-size: 12px;
  color: #888;
  font-family: "Consolas", "Menlo", monospace;
}
.log-content {
  font-size: 13px;
  color: #333;
  line-height: 1.4;
  word-break: break-word;
}
.log-content-label {
  font-weight: 600;
  color: #555;
  margin-right: 4px;
}
.log-empty-field {
  color: #bbb;
  font-style: italic;
}
.log-del {
  position: static;
  flex: 0 0 auto;
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0 2px;
}
.log-empty {
  font-size: 13px;
  color: #999;
  text-align: center;
  padding: 14px 0;
}
.log-add {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px solid #eee;
  padding-top: 10px;
}
.log-add .field { margin-bottom: 0; }
.log-add-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}
.log-add-row .field { flex: 1; }
.log-add-btn {
  white-space: nowrap;
}
.clear-hint {
  font-size: 12px;
  color: var(--earth-dark);
  background: #f1ece7;
  border-left: 3px solid var(--earth);
  padding: 6px 10px;
  border-radius: 4px;
  margin-top: 8px;
  line-height: 1.4;
}

/* ---------- 农事日志管理面板（管理员弹窗） ---------- */
.logs-mgr-box {
  width: 1180px;
  max-width: 97%;
  max-height: 94vh;
  display: flex;
  flex-direction: column;
}
.logs-mgr-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #eee;
  padding-bottom: 10px;
  margin-bottom: 12px;
}
.logs-mgr-head h3 { margin: 0; color: var(--green-main); }
.logs-mgr-body {
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.period-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 4px;
}
.period-opt {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #444;
  cursor: pointer;
}
.period-opt input { margin: 0; }

/* ---------- 农事日志：筛选面板 ---------- */
.mgr-filter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px 14px;
}
.mgr-filter-cell { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.mgr-filter-cell label,
.mgr-filter-block > label {
  font-size: 13px;
  color: #555;
  font-weight: 600;
}
.mgr-filter-block {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
/* chips：可点选的筛选按钮 */
.mgr-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.mgr-chip {
  padding: 6px 14px;
  border: 1px solid #cfd8dc;
  border-radius: 999px;
  background: #fff;
  color: #455a64;
  font-size: 13px;
  cursor: pointer;
  transition: all .15s ease;
  white-space: nowrap;
}
.mgr-chip:hover { border-color: var(--green-main); color: var(--green-main); }
.mgr-chip.active {
  background: var(--green-main);
  border-color: var(--green-main);
  color: #fff;
  font-weight: 600;
}
/* 自定义日期区间 */
.mgr-custom-range {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 2px;
}
.mgr-custom-range.hidden { display: none; }
.mgr-custom-range .modal-input { width: 170px; }
.mgr-range-sep { color: #78909C; font-size: 13px; }
/* 关键词行 */
.mgr-kw-row { display: flex; gap: 10px; align-items: center; }
.mgr-kw-row .modal-input { flex: 1; min-width: 0; }
.mgr-reset-btn { flex: 0 0 auto; white-space: nowrap; }

/* 结果统计条 */
.logs-result-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 9px 14px;
  background: #f4f9f1;
  border: 1px solid #e3efe0;
  border-radius: 8px;
  font-size: 13px;
  color: #456;
}
.logs-result-bar .rb-count b { color: var(--green-main); font-size: 16px; }
.logs-result-bar .rb-total { color: #90a4ae; }
.logs-result-bar .rb-cond { color: #78909C; font-size: 12px; }

/* ---------- 农事日志实时表格 ---------- */
.logs-table-wrap {
  margin-top: 0;
  flex: 1 1 auto;
  min-height: 320px;
  max-height: none;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.logs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: #fff;
}
.logs-table th,
.logs-table td {
  border-bottom: 1px solid #eee;
  padding: 9px 10px;
  text-align: left;
  vertical-align: top;
  word-break: break-word;
}
.logs-table thead th {
  position: sticky;
  top: 0;
  background: var(--green-main);
  color: #fff;
  font-weight: 600;
  z-index: 1;
}
.logs-table tbody tr:nth-child(even) { background: #f7fbf5; }
.logs-table tbody tr:hover { background: #eef7ea; }
.logs-table .col-sel {
  width: 34px;
  text-align: center;
  padding-left: 4px;
  padding-right: 4px;
}
.logs-table .col-sel input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; }
/* 日期列不换行 */
.logs-table .col-date { white-space: nowrap; width: 96px; color: #607d8b; }
/* 内容列占满剩余宽度，完整展示不截断 */
.logs-table .col-content { width: 42%; min-width: 240px; line-height: 1.65; color: #37474f; }
/* 农事类型彩色标签 */
.cat-tag {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1.6;
  white-space: nowrap;
  background: #eceff1;
  color: #546e7a;
}
.cat-tag.cat-植保 { background: #ffebee; color: #c62828; }
.cat-tag.cat-灌溉 { background: #e3f2fd; color: #1565c0; }
.cat-tag.cat-施肥 { background: #fff8e1; color: #ef6c00; }
.cat-tag.cat-富硒 { background: #e8f5e9; color: #2e7d32; }
.cat-tag.cat-采收 { background: #f3e5f5; color: #6a1b9a; }
.log-empty-sub { font-size: 12px; color: #b0bec5; }

/* ---------- 后台管理：基地管理员账户 ---------- */
/* 窗口尺寸对齐「农事日志管理」，大屏下更宽敞 */
.acct-mgr-box {
  width: 920px;
  max-width: 96%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}
.acct-mgr-body { padding: 0 2px; }
/* 宽屏两栏：左列表 / 右表单，或左改密 / 右资料 */
.acct-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 24px;
  align-items: start;
}
.acct-col { min-width: 0; }
@media (max-width: 760px) {
  .acct-cols { grid-template-columns: 1fr; }
}
/* 在线会话：宽屏下双列卡片 */
.acct-list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 10px;
  align-items: start;
}
.acct-list-grid .acct-item-card { margin-bottom: 0; }
.acct-list-grid .empty-tip { grid-column: 1 / -1; }
.acct-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}
.acct-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  background: #fafdf8;
}
.acct-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--green-dark);
}
.acct-add {
  border-top: 1px solid #eee;
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.acct-add .modal-label { margin-top: 0; }

/* ---------- 响应式 ----------
 * PC 端（>640px）沿用原有网格：.base-grid minmax(240px) / .gh-grid minmax(200px)，
 * 本区块所有新规则均包在 max-width:640px 内，PC 视觉零变化。
 * 移动端核心改动：不再强制单列，改为 2 列紧凑网格 + 分组折叠 + 筛选。
 */
@media (max-width: 640px) {
  /* 触摸设备：去掉 hover 上浮（会粘滞），改用轻微按压反馈 */
  .base-card:hover,
  .gh-card:hover {
    transform: none;
  }
  .base-card:active,
  .gh-card:active {
    transform: scale(.97);
  }

  .edit-panel-content {
    width: 100%;
    max-width: 100%;
  }
  #app-header {
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
  }
  .header-right {
    flex-wrap: wrap;
  }
  #app-main {
    padding: 12px 10px 20px;
  }
  .page-head {
    gap: 8px;
    margin-bottom: 10px;
  }
  .page-head h2 {
    font-size: 17px;
  }

  /* --- 基地卡片：2 列 --- */
  .base-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .base-card {
    padding: 11px;
  }
  .base-name {
    font-size: 16px;
  }
  .base-meta {
    font-size: 12px;
    margin: 4px 0 8px;
  }
  .base-actions {
    gap: 6px;
  }
  .base-actions .btn {
    padding: 7px 4px;
    font-size: 13px;
  }

  /* --- 大棚看板工具条（仅移动端渲染，PC 不存在）--- */
  .gh-toolbar {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 10px;
  }
  /* 概览条：一行看懂分布，不用逐个点 */
  .gh-overview {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 12px;
  }
  .gh-ov-item {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 3px 9px;
    color: #555;
    white-space: nowrap;
  }
  .gh-ov-item b {
    color: var(--green-dark);
    font-weight: 600;
  }
  .gh-ov-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 3px;
    margin-right: 4px;
    vertical-align: -1px;
    border: 1px solid rgba(0, 0, 0, .1);
  }
  /* 状态筛选 chip：横向可滑动，一行放下全部状态 */
  .gh-filterrow {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
  }
  .gh-filterrow::-webkit-scrollbar { display: none; }
  .gh-fchip {
    flex: 0 0 auto;
    font-size: 13px;
    padding: 6px 12px;
    border-radius: 15px;
    border: 1px solid #CFD8DC;
    background: #fff;
    color: #546E7A;
    cursor: pointer;
    white-space: nowrap;
    /* 触摸目标不小于 32px 高 */
    min-height: 32px;
  }
  .gh-fchip.on {
    background: var(--green-main);
    border-color: var(--green-main);
    color: #fff;
    font-weight: 600;
  }
  .gh-searchrow {
    display: flex;
    gap: 6px;
    align-items: center;
  }
  .gh-searchrow input {
    flex: 1 1 auto;
    min-width: 0;
    padding: 8px 10px;
    font-size: 14px; /* <16px 会触发 iOS 自动放大页面，务必 >=16px，见下方修正 */
    border: 1px solid #CFD8DC;
    border-radius: 8px;
    min-height: 34px;
  }
  /* iOS Safari：输入框字号 <16px 会自动放大页面，必须 16px */
  .gh-searchrow input,
  .gh-searchrow input:focus {
    font-size: 16px;
  }
  .gh-clear {
    flex: 0 0 auto;
    border: 1px solid #CFD8DC;
    background: #fff;
    color: #78909C;
    border-radius: 8px;
    min-height: 34px;
    padding: 0 10px;
    font-size: 13px;
    cursor: pointer;
    display: none;
  }
  .gh-clear.show { display: block; }
  .gh-groupbar {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    align-items: center;
  }
  .gh-groupbar::-webkit-scrollbar { display: none; }
  .gh-gbtn {
    flex: 0 0 auto;
    font-size: 12px;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 8px;
    border: 1px solid #CFD8DC;
    background: #fff;
    color: #546E7A;
    cursor: pointer;
    white-space: nowrap;
  }
  .gh-gbtn.on {
    background: var(--green-soft);
    border-color: var(--green-main);
    color: #fff;
  }

  /* --- 分组：默认折叠，首屏只显示概览而不是 132 张卡 --- */
  .gh-group { margin-bottom: 8px; }
  .gh-group-head {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 9px 10px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 9px;
    font-size: 14px;
    font-weight: 600;
    color: var(--green-dark);
    cursor: pointer;
    text-align: left;
    min-height: 40px;
  }
  .gh-group-head .gh-caret {
    flex: 0 0 auto;
    display: inline-block;
    transition: transform .18s;
    color: #78909C;
    font-size: 12px;
  }
  .gh-group.open .gh-group-head .gh-caret {
    transform: rotate(90deg);
  }
  .gh-group-count {
    margin-left: auto;
    font-size: 12px;
    font-weight: 400;
    color: #78909C;
    white-space: nowrap;
  }
  .gh-group-body {
    display: none;           /* 默认收起 */
    padding-top: 8px;
  }
  .gh-group.open .gh-group-body { display: block; }
  .gh-group-empty {
    font-size: 12px;
    color: #90A4AE;
    padding: 8px 2px;
  }

  /* --- 大棚卡片：2 列紧凑化 --- */
  .gh-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }
  .gh-card {
    padding: 9px 7px;
    min-height: 132px;      /* PC 为 210px，压缩近 40% */
    border-radius: 9px;
  }
  .gh-shedno {
    font-size: 14px;
  }
  .gh-svg {
    height: 58px;            /* PC 为 120px */
    margin: 3px 0;
  }
  .gh-cropname {
    font-size: 13px;
    /* 长作物名在窄卡片里必须能收敛，否则会撑破列宽 */
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .gh-stage,
  .gh-elapsed {
    font-size: 11px;
  }
  .gh-fallow-reason,
  .gh-fallow-eta {
    font-size: 11px;
  }
  .gh-card-tools {
    gap: 4px;
    margin-top: 4px;
  }
  .gh-tool {
    max-width: none;
    font-size: 11px;
    padding: 5px 2px;
    min-height: 28px;       /* 触摸友好 */
  }
  .gh-del {
    width: 26px;             /* 触摸目标放大，原 22px 偏小 */
    height: 26px;
    line-height: 24px;
    font-size: 16px;
  }
  .gh-se-tag,
  .gh-fallow-tag {
    font-size: 10px;
  }

  /* --- 极窄屏（iPhone SE / 小屏安卓）：1 列，避免文字挤压 --- */
  @media (max-width: 359px) {
    .base-grid,
    .gh-grid {
      grid-template-columns: 1fr;
    }
  }

  /* --- 降低动效，尊重系统「减少动画」设置 --- */
  @media (prefers-reduced-motion: reduce) {
    .gh-group-head .gh-caret { transition: none; }
    .base-card, .gh-card { transition: none; }
  }
}


/* ===== 农事日志权限增强样式（Task 6） ===== */
.log-operator {
  flex: 1 1 auto;
  min-width: 0;
  margin-left: 0;
  font-size: 12px;
  color: #6D4C41;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.masked { color: #999; font-style: italic; }
.log-tip { font-size: 12px; color: #999; font-weight: normal; }
.logs-hint { font-size: 12px; color: #999; margin-bottom: 6px; }

/* ============ 封面页：访客 / 管理员双入口 ============ */
.cover-screen {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #F1F8E9 0%, #E8F5E9 45%, #FFF8E1 100%);
  padding: 20px;
  overflow-y: auto;
}
.cover-screen.hidden { display: none; }
.cover-inner {
  width: 100%;
  max-width: 560px;
  text-align: center;
}
.cover-logo { font-size: 60px; line-height: 1; margin-bottom: 8px; }
.cover-title {
  font-size: 30px;
  margin: 0 0 6px;
  color: #2E7D32;
  letter-spacing: 1px;
}
.cover-sub {
  font-size: 14px;
  color: #78909C;
  margin: 0 0 34px;
}
.cover-choices {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.cover-choice {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 26px 20px;
  border: 2px solid #C8E6C9;
  border-radius: 14px;
  background: #FFFFFF;
  cursor: pointer;
  font-family: inherit;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.cover-choice:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,0,0,.10);
}
.cover-choice-guest:hover { border-color: #90CAF9; }
.cover-choice-admin:hover { border-color: #66BB6A; }
.cover-choice-icon { font-size: 34px; }
.cover-choice-name { font-size: 19px; font-weight: 700; color: #33691E; }
.cover-choice-desc { font-size: 13px; color: #78909C; line-height: 1.5; }
.cover-msg {
  min-height: 20px;
  margin-top: 18px;
  font-size: 13px;
  color: #C62828;
}

/* ============ 强制改密提示 ============ */
.force-change-tip {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  background: #FFF3E0;
  color: #E65100;
  font-size: 12px;
  font-weight: 700;
}

/* ============ 账号安全面板 ============ */
.acct-section-title {
  font-size: 15px;
  font-weight: 700;
  color: #33691E;
  margin: 4px 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid #E0E0E0;
}
.acct-change-pwd {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}
.acct-change-pwd .modal-input { width: 100%; }
.acct-actions { display: flex; gap: 6px; }
.acct-reset-btn { font-size: 12px; padding: 4px 10px; }
.acct-badge {
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 8px;
  background: #FFF3E0;
  color: #E65100;
  font-size: 11px;
  font-weight: 700;
}
.pass-hint {
  font-size: 12px;
  color: #78909C;
  line-height: 1.5;
}

/* ============ 安全审计日志 ============ */
.audit-total { font-size: 12px; color: #78909C; margin-bottom: 8px; }
.audit-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.audit-table th, .audit-table td {
  border: 1px solid #E0E0E0;
  padding: 5px 6px;
  text-align: left;
  vertical-align: top;
}
.audit-table th { background: #F5F5F5; font-weight: 700; white-space: nowrap; }
.audit-detail { word-break: break-all; color: #616161; max-width: 260px; }

/* ============ 后台管理：页签 ============ */
.acct-tabs {
  display: flex;
  gap: 6px;
  padding: 0 16px 12px;
  border-bottom: 1px solid #E0E0E0;
  flex-wrap: wrap;
}
.acct-tab {
  padding: 7px 14px;
  border: 1px solid #C8E6C9;
  border-radius: 18px;
  background: #FFFFFF;
  color: #558B2F;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: all .15s ease;
}
.acct-tab:hover { background: #F1F8E9; }
.acct-tab.active {
  background: #66BB6A;
  border-color: #66BB6A;
  color: #FFFFFF;
  font-weight: 700;
}
.acct-pane { display: none; }
.acct-pane.active { display: block; }

/* ============ 后台管理：账号卡片 ============ */
.acct-item-card {
  display: block;
  padding: 10px 12px;
  margin-bottom: 8px;
  border: 1px solid #E8E8E8;
  border-radius: 8px;
  background: #FAFAFA;
}
.acct-item-main { margin-bottom: 6px; }
.acct-login {
  margin-left: 8px;
  font-size: 12px;
  font-weight: 400;
  color: #9E9E9E;
}
.acct-meta {
  font-size: 12px;
  color: #78909C;
  line-height: 1.6;
  word-break: break-all;
}
.acct-edit-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed #E0E0E0;
}
.acct-edit-row.hidden { display: none; }
.acct-edit-row .modal-input { width: 150px; }

.acct-badge.badge-senior { background: #E8F5E9; color: #2E7D32; }
.acct-badge.badge-off { background: #FFEBEE; color: #C62828; }
.acct-badge.badge-online { background: #E3F2FD; color: #1565C0; }
.acct-badge.badge-self { background: #FFF3E0; color: #E65100; }

.acct-profile-form { display: flex; flex-direction: column; gap: 6px; }
.acct-profile-form .modal-input { width: 100%; }

.acct-sessions-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.muted { color: #9E9E9E; font-size: 12px; }

.audit-body { max-height: 60vh; overflow-y: auto; }

/* ================================================================
   农事预警（植保安全间隔期 / 富硒干预不足 / 生长周期到顶）
   ================================================================ */
/* 顶栏入口与小红点 */
.alert-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  position: relative;
}
.alert-badge {
  display: inline-block;
  min-width: 17px;
  height: 17px;
  line-height: 17px;
  padding: 0 5px;
  border-radius: 9px;
  background: #9E9E9E;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}
.alert-badge.urgent { background: var(--danger); }

/* 面板尺寸对齐农事日志管理 */
.alert-box {
  width: 920px;
  max-width: 96%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}
.alert-rules-tip {
  background: #F1F8E9;
  border-left: 4px solid var(--green-main);
  border-radius: 4px;
  padding: 9px 12px;
  font-size: 12px;
  line-height: 1.7;
  color: #33691E;
  margin-bottom: 10px;
}
.alert-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.alert-toolbar .modal-input { width: auto; padding: 6px 8px; }

.alert-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 4px;
}
.alert-item {
  border: 1px solid #E0E0E0;
  border-left-width: 4px;
  border-radius: 6px;
  padding: 10px 12px;
  background: #FAFAFA;
}
.alert-lv-danger { border-left-color: var(--danger); background: #FFF8F8; }
.alert-lv-warn { border-left-color: #F9A825; background: #FFFCF5; }
.alert-lv-info { border-left-color: #42A5F5; background: #F8FBFF; }
.alert-item.alert-resolved { opacity: .62; border-left-color: #BDBDBD; background: #FAFAFA; }

.alert-item-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 5px;
}
.alert-badge-lv {
  padding: 1px 8px;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: #9E9E9E;
}
.alert-lv-danger .alert-badge-lv { background: var(--danger); }
.alert-lv-warn .alert-badge-lv { background: #F9A825; }
.alert-lv-info .alert-badge-lv { background: #42A5F5; }
.alert-rule-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--green-dark);
}
.alert-status-tag {
  padding: 1px 8px;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 700;
}
.alert-status-tag.st-open { background: #FFEBEE; color: #C62828; }
.alert-status-tag.st-done { background: #E8F5E9; color: #2E7D32; }
.alert-title-text {
  font-size: 13px;
  font-weight: 700;
  color: #333;
  flex: 1;
  min-width: 180px;
}
.alert-loc {
  font-size: 12px;
  color: #607D8B;
  margin-bottom: 4px;
}
.alert-detail {
  font-size: 12px;
  color: #444;
  line-height: 1.7;
  background: rgba(255, 255, 255, .7);
  border-radius: 4px;
  padding: 7px 9px;
}
.alert-foot {
  margin-top: 5px;
  font-size: 11px;
  color: #9E9E9E;
}
.alert-actions-row {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  margin-top: -6px;
  padding-bottom: 4px;
}
.alert-actions-row:empty { display: none; }

/* 登录后弹窗 */
.alert-popup-box { width: 680px; }
.alert-popup-body {
  max-height: 56vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-bottom: 12px;
}
.alert-popup-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--danger);
  margin-bottom: 2px;
}

/* 编辑作物：普通 / 富硒 选择 */
.crop-type-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.crop-type-opt {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  border: 1px solid #C8E6C9;
  border-radius: 18px;
  background: #fff;
  font-size: 13px;
  color: #558B2F;
  cursor: pointer;
  user-select: none;
}
.crop-type-opt input { margin: 0; }
.crop-type-opt.active {
  background: #66BB6A;
  border-color: #66BB6A;
  color: #fff;
  font-weight: 700;
}
.field-hint {
  margin-top: 5px;
  font-size: 12px;
  color: #78909C;
  line-height: 1.6;
}

/* ============ 登录：记住账号 / 免密登录 ============ */
.login-box {
  width: 360px;
}
.login-remembered {
  border: 1px solid #DCEDC8;
  background: #F7FBF2;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 14px;
}
.lr-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.lr-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--green-main);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 36px;
}
.lr-meta {
  min-width: 0;
}
.lr-name {
  font-size: 14px;
  font-weight: 600;
  color: #333;
}
.lr-sub {
  font-size: 12px;
  color: #78909C;
  word-break: break-all;
  line-height: 1.5;
}
.lr-btn {
  width: 100%;
  margin-top: 4px;
}
.lr-btn-ghost {
  background: transparent;
  border: 1px solid #C8D6B0;
  color: #558B2F;
  font-size: 12px;
  padding: 5px;
}
.lr-btn-ghost:hover {
  background: #EFF5E8;
}
.lr-sep {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0 2px;
  font-size: 12px;
  color: #B0BEC5;
}
.lr-sep::before,
.lr-sep::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #E0E0E0;
}
.login-options {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.login-opt {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: #555;
  cursor: pointer;
  user-select: none;
}
.login-opt input[type='checkbox'] {
  width: 14px;
  height: 14px;
  cursor: pointer;
  accent-color: var(--green-main);
}
.login-tip {
  margin-top: 10px;
  font-size: 11px;
  color: #90A4AE;
  line-height: 1.6;
  padding: 7px 9px;
  background: #FAFAFA;
  border-radius: 6px;
  border: 1px solid #EEEEEE;
}
.cover-remembered-tip {
  margin-top: 10px;
  font-size: 13px;
  color: #558B2F;
  background: #F1F8EC;
  border: 1px solid #DCEDC8;
  border-radius: 20px;
  padding: 6px 16px;
  display: inline-block;
}

/* ============ 后台管理：已记住设备 ============ */
.acct-devices-bar {
  margin-bottom: 10px;
}
/* 新增元素的显隐（.hidden 在本文件中按组件分别定义） */
.login-remembered.hidden,
.cover-remembered-tip.hidden {
  display: none;
}
