:root {
  --green: #2e7d32;
  --green-d: #1b5e20;
  --bg: #f4f7f4;
  --card: #ffffff;
  --line: #e2e8e2;
  --text: #1f2d22;
  --muted: #6b7c70;
  --danger: #c62828;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 4px 12px rgba(0,0,0,.04);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: -apple-system, "PingFang SC", "Microsoft YaHei", Segoe UI, sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.6; font-size: 16px; -webkit-tap-highlight-color: transparent; }
a { color: var(--green); text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
.btn { background: var(--green); color: #fff; border: 0; border-radius: 10px; padding: 12px 18px; font-size: 16px; min-height: 44px; transition: background .2s, transform .08s; }
.btn:hover { background: var(--green-d); }
.btn:active { transform: scale(.98); }
.btn.ghost { background: #fff; color: var(--green); border: 1px solid var(--green); }
.btn.danger { background: var(--danger); }
.btn.sm { padding: 8px 14px; font-size: 14px; min-height: 38px; border-radius: 9px; }
input, select, textarea { width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 16px; font-family: inherit; background: #fff; }
label { display: block; font-size: 14px; color: var(--muted); margin: 12px 0 5px; }
.nav { background: var(--green-d); color: #fff; padding: 0 18px; display: flex; align-items: center; height: 54px; position: sticky; top: 0; z-index: 40; }
.nav .brand { font-weight: 700; font-size: 17px; margin-right: 22px; white-space: nowrap; }
.nav-links { display: flex; align-items: center; flex: 1; }
.nav a { color: #e8f5e9; padding: 0 12px; line-height: 54px; display: inline-block; }
.nav a.active, .nav a:hover { color: #fff; border-bottom: 3px solid #a5d6a7; }
.nav .who { font-size: 13px; color: #c8e6c9; margin-right: 12px; }
.nav-foot { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.nav-toggle { display: none; }
.container { max-width: 1040px; margin: 22px auto; padding: 0 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 18px; box-shadow: var(--shadow); margin-bottom: 16px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; box-shadow: var(--shadow); }
.stat .n { font-size: 26px; font-weight: 700; color: var(--green); }
.stat .l { color: var(--muted); font-size: 13px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 160px; }
.bar { background: #e8f5e9; border-radius: 6px; height: 22px; position: relative; overflow: hidden; margin: 6px 0; }
.bar > span { position: absolute; left: 0; top: 0; bottom: 0; background: var(--green); }
.bar .t { position: relative; z-index: 1; font-size: 12px; padding: 0 8px; line-height: 22px; color: #1b5e20; }
.tag { display: inline-block; background: #e8f5e9; color: #2e7d32; border-radius: 999px; padding: 2px 10px; font-size: 12px; margin: 2px; }
.meta { font-size: 14px; color: var(--muted); }
.meta b { color: var(--text); font-weight: 600; }
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.4); display: none; align-items: flex-start; justify-content: center; padding: 40px 12px; overflow: auto; z-index: 2000; }
.modal-bg.show { display: flex; }
.modal { background: #fff; border-radius: 12px; width: 100%; max-width: 520px; padding: 20px; box-shadow: var(--shadow); }
.modal h3 { margin: 0 0 10px; }
.field-err { color: var(--danger); font-size: 12px; margin-top: 2px; }
.toast { position: fixed; top: 14px; right: 14px; background: #323; color: #fff; padding: 10px 14px; border-radius: 8px; display: none; z-index: 3000; max-width: 320px; }
.toast.show { display: block; }
.toast.err { background: #5c1a1a; }
.empty { color: var(--muted); text-align: center; padding: 30px; }
.auth-wrap { max-width: 380px; margin: 8vh auto; }
.pill { font-size: 12px; padding: 2px 8px; border-radius: 6px; background: #eee; color: #555; }
.pill.on { background: #e8f5e9; color: #2e7d32; }
.pill.off { background: #fdecea; color: #c62828; }
hr { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }
.muted { color: var(--muted); font-size: 14px; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.filters > div { flex: 1; min-width: 130px; }

/* ---------- 仪表盘 ---------- */
.dashboard { max-width: 1100px; }
.dash-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 22px; flex-wrap: wrap; }
.dash-header h2 { font-size: 22px; color: var(--green-d); }
.dash-date { margin: 0; font-size: 14px; color: var(--muted); }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card { display: flex; align-items: center; gap: 14px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px; box-shadow: var(--shadow); border-left: 5px solid var(--green); transition: transform .15s, box-shadow .15s; }
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,.1); }
.stat-card.accent-amber { border-left-color: #f9a825; }
.stat-card.accent-blue { border-left-color: #0288d1; }
.stat-icon { width: 50px; height: 50px; display: flex; align-items: center; justify-content: center; background: #e8f5e9; border-radius: 14px; font-size: 26px; }
.stat-card.accent-amber .stat-icon { background: #fff8e1; }
.stat-card.accent-blue .stat-icon { background: #e1f5fe; }
.stat-value { font-size: 28px; font-weight: 700; color: var(--green-d); line-height: 1; }
.stat-label { font-size: 13px; color: var(--muted); margin-top: 6px; }
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.dash-col { display: flex; flex-direction: column; gap: 16px; }
.dash-card { margin-bottom: 0; }
.dash-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.dash-card-head h3 { margin: 0; font-size: 16px; color: var(--green-d); font-weight: 700; }
.dash-sub { font-size: 12px; color: var(--muted); }
.dash-card-head a { font-size: 13px; color: var(--green); }
.dash-bar-list { display: flex; flex-direction: column; gap: 12px; }
.dash-bar2 { display: flex; align-items: center; gap: 10px; font-size: 13px; line-height: 1; }
.dash-bar2-label { width: 4.5em; color: var(--muted); flex-shrink: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-bar2-track { flex: 1; height: 10px; background: #e8f5e9; border-radius: 5px; overflow: hidden; min-width: 40px; }
.dash-bar2-fill { height: 100%; border-radius: 5px; transition: width .45s ease; min-width: 2px; }
.dash-bar2-val { width: 2.2em; text-align: right; font-weight: 600; color: var(--text); flex-shrink: 0; }
.dash-trend-chart { display: flex; align-items: flex-end; gap: 6px; height: 130px; padding-top: 10px; }
.dash-trend-bar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; min-width: 22px; max-width: 40px; }
.dash-trend-col { width: 100%; min-width: 14px; background: linear-gradient(180deg, #4caf50, #2e7d32); border-radius: 6px 6px 0 0; opacity: .9; transition: height .45s ease; }
.dash-trend-month { font-size: 10px; color: var(--muted); margin-top: 6px; }
.dash-trend-val { font-size: 10px; font-weight: 600; color: var(--green-d); margin-bottom: 4px; }
.dash-recent-list { display: flex; flex-direction: column; gap: 8px; }
.dash-recent-item { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 10px; background: #fafbfa; transition: background .15s; }
.dash-recent-item:hover { background: #f0f5f0; }
.dash-recent-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); flex-shrink: 0; }
.dash-recent-main { flex: 1; min-width: 0; }
.dash-recent-title { font-size: 14px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-recent-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.dash-recent-date { font-size: 12px; color: var(--muted); white-space: nowrap; }

/* 时间轴 */
.tl-date { font-weight: 700; color: var(--green-d); margin: 20px 0 8px; border-left: 4px solid var(--green); padding-left: 10px; }
.tl-item { border-left: 3px solid var(--line); margin-left: 6px; }
.tl-item:hover { border-left-color: var(--green); }

/* 媒体 */
.media-grid { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.media-thumb { width: 110px; height: 110px; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); background: #eef2ee; }
.media-media { width: 100%; max-width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--line); margin-top: 8px; background: #eef2ee; }
.media-doc { display: inline-block; background: #eef; color: #243; border: 1px solid #cdd; border-radius: 8px; padding: 6px 10px; font-size: 13px; margin-top: 6px; }

/* 作物档案 */
.crop-card { display: flex; flex-direction: column; }
.crop-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.crop-head h3 { margin: 0; flex: 1; min-width: 0; }
.crop-status { font-size: 12px; padding: 2px 10px; border-radius: 999px; white-space: nowrap; }
.crop-status.growing { background: #e8f5e9; color: #2e7d32; }
.crop-status.harvested { background: #fff3e0; color: #ef6c00; }
.crop-status.cleared { background: #efebe9; color: #6d4c41; }
/* 旧类名兼容 */
.crop-status.on { background: #e8f5e9; color: #2e7d32; }
.crop-status.off { background: #f5f5f5; color: #888; }

/* 已清除档案夹 */
.crop-archive { margin-top: 24px; }
.crop-archive-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: #f5f5f5; border-radius: 10px; cursor: pointer; user-select: none; }
.crop-archive-head:hover { background: #eeeeee; }
.crop-archive-head .arrow { transition: transform .2s; }
.crop-archive-head.open .arrow { transform: rotate(90deg); }
.crop-archive-count { font-size: 12px; color: var(--muted); background: #fff; padding: 1px 8px; border-radius: 999px; }
.crop-archive-body { display: none; padding-top: 14px; }
.crop-archive-body.open { display: block; }
.crop-archive .crop-card { opacity: .92; }
.crop-archive .crop-actions .btn.danger { display: none; }
.crop-info { display: flex; flex-direction: column; gap: 8px; flex: 1; }
.ci-row { display: flex; align-items: baseline; gap: 4px; font-size: 13px; line-height: 1.5; min-width: 0; }
.ci-label { color: var(--muted); font-weight: 600; width: 4em; flex-shrink: 0; text-align: right; white-space: nowrap; }
.ci-label::after { content: '：'; }
.ci-val { color: var(--text); flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crop-actions { display: flex; gap: 10px; margin-top: 10px; }
.crop-actions .btn {
  flex: 1; min-width: 0; text-align: center;
  border-radius: 10px; padding: 8px 0;
  font-weight: 600; letter-spacing: .5px;
  transition: all .2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.crop-actions .btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(0,0,0,.12);
}
.crop-actions .btn.ghost {
  border: 1px solid #c8e6c9; background: linear-gradient(180deg,#faffff,#f1f8f1);
  color: var(--green-d);
}
.crop-actions .btn.ghost:hover {
  border-color: var(--green);
  background: linear-gradient(180deg,#e8f5e9,#dceddc);
}
.crop-actions .btn.danger {
  border: 1px solid #ef9a9a; background: linear-gradient(180deg,#fff5f5,#ffebee);
  color: var(--danger);
}
.crop-actions .btn.danger:hover {
  background: linear-gradient(180deg,#ffebee,#ffcdd2);
}

/* 作物表单 */
.crop-form-grid { display: flex; flex-direction: column; gap: 18px; margin-top: 6px; }
.form-section { background: #fafbfa; border: 1px solid #eef0ee; border-radius: 10px; padding: 14px; }
.fs-title { font-weight: 700; font-size: 14px; color: var(--green-d); margin-bottom: 12px; }
.form-row { display: flex; gap: 14px; margin-bottom: 12px; }
.form-row:last-child { margin-bottom: 0; }
.form-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.form-col label { font-size: 13px; color: var(--muted); margin-bottom: 5px; }
.required { color: var(--danger); }
.crop-form-actions { display: flex; gap: 10px; margin-top: 16px; }
.crop-form-actions .btn { min-width: 88px; }
.crop-form-actions .btn.danger { margin-left: auto; }

/* 地块选择器 */
.plot-picker { position: relative; }
.plot-picker-trigger {
  width: 100%; min-height: 44px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 10px;
  background: #fff; color: var(--text); font-size: 15px;
  display: flex; align-items: center; justify-content: space-between;
  cursor: pointer; transition: border-color .2s, box-shadow .2s;
}
.plot-picker-trigger:hover { border-color: var(--green); }
.plot-picker-trigger:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(34,164,90,.12); }
.plot-picker-arrow { color: var(--muted); font-size: 12px; }
.plot-picker-panel {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px);
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 6px 20px rgba(0,0,0,.12); z-index: 100;
  padding: 10px; max-height: 280px; display: flex; flex-direction: column;
}
.plot-picker-panel.hidden { display: none; }
.plot-picker-search {
  width: 100%; box-sizing: border-box; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 8px; margin-bottom: 8px;
  font-size: 14px;
}
.plot-picker-list { overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.plot-picker-item {
  display: flex; flex-direction: column; align-items: flex-start;
  padding: 8px 10px; border-radius: 8px; border: 0; background: transparent;
  cursor: pointer; text-align: left; transition: background .15s;
}
.plot-picker-item:hover { background: #f1f8f1; }
.plot-picker-item.sel { background: #e8f5e9; }
.ppi-name { font-size: 14px; color: var(--text); font-weight: 600; }
.ppi-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.plot-picker-state { padding: 20px 6px; text-align: center; color: var(--muted); font-size: 13px; }
.plot-picker-state.err { color: var(--danger); }

/* 农事类型标签 */
.act-type { background: #fff3e0; color: #e65100; border: 1px solid #ffe0b2; }

/* 时间轴（弹窗内） */
.cl-desc { font-size: 14px; color: var(--text); margin-top: 6px; line-height: 1.7; white-space: pre-wrap; }
.cl-meta { margin-top: 6px; }
.cl-actions { margin-top: 8px; }
.cl-actions .btn { font-size: 12px; padding: 4px 10px; }

/* 弹窗内时间轴：加大宽度 */
#modal .tl-item { margin-bottom: 10px; }
#modal .tl-date { font-size: 15px; }

/* 加载态（阶段4：按钮处理中 + 列表占位） */
.btn[disabled] { opacity: .6; cursor: not-allowed; }
.loading { text-align: center; color: var(--muted); padding: 24px; font-size: 14px; }
.loading::after {
  content: ''; display: inline-block; width: 14px; height: 14px; margin-left: 8px;
  border: 2px solid var(--line); border-top-color: var(--green); border-radius: 50%;
  animation: spin .7s linear infinite; vertical-align: -2px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 模态框无障碍（阶段4：打开后聚焦轮廓，Esc 关闭） */
.modal[role="dialog"]:focus { outline: none; }
.modal input:focus, .modal select:focus, .modal textarea:focus {
  outline: 2px solid var(--green); outline-offset: 1px;
}

/* 移动端适配（平板/手机） */
.fab { display: none; }

/* 平板及以下：导航汉堡化 + 右下 FAB + 双列卡片 */
@media (max-width: 768px) {
  .container { padding: 0 14px; margin: 14px auto 0; padding-bottom: 88px; }
  .nav { padding: 0 14px; }
  .nav .brand { font-size: 16px; margin-right: auto; }
  .nav-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; margin-left: 6px; padding: 0;
    background: transparent; border: 0; color: #fff; font-size: 24px; line-height: 1;
  }
  .nav-links {
    position: absolute; top: 54px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; flex: none;
    background: var(--green-d);
    max-height: 0; overflow: hidden; transition: max-height .25s ease;
    box-shadow: 0 8px 20px rgba(0,0,0,.18);
  }
  body.nav-open .nav-links { max-height: calc(100vh - 54px); overflow-y: auto; }
  .nav-links a {
    line-height: normal; min-height: 50px; padding: 0 18px;
    display: flex; align-items: center;
    border-bottom: 1px solid rgba(255,255,255,.08);
  }
  .nav-links a.active {
    color: #fff; border-bottom: 1px solid rgba(255,255,255,.08);
    background: rgba(255,255,255,.1);
  }
  .nav-foot { margin-left: 0; flex-direction: column; align-items: stretch; gap: 0; padding: 6px 0 10px; }
  .nav-foot .who { padding: 10px 18px 4px; margin: 0; }
  .nav-foot .btn { margin: 4px 18px 0; justify-content: center; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .fab {
    display: flex; align-items: center; justify-content: center;
    position: fixed; right: 18px; bottom: calc(18px + env(safe-area-inset-bottom, 0px));
    z-index: 60; width: 56px; height: 56px; border-radius: 50%;
    background: var(--green); color: #fff; font-size: 30px; font-weight: 700;
    text-decoration: none; box-shadow: 0 6px 18px rgba(0,0,0,.3);
  }
  .fab:active { transform: scale(.92); }
}

/* 手机：单列、加大触控与间距、字体与行高优化 */
@media (max-width: 600px) {
  body { line-height: 1.7; }
  .container { margin: 12px auto 0; }
  .card { padding: 14px; margin-bottom: 12px; border-radius: 14px; }
  .card .row { flex-direction: column; }
  .card .row > * { width: 100%; min-width: auto; }
  .grid { grid-template-columns: 1fr; }
  .carbon-grid { grid-template-columns: 1fr; }
  .crop-actions { flex-direction: column; }
  .crop-actions .btn { width: 100%; box-sizing: border-box; min-height: 46px; }
  .cl-actions { flex-direction: column; }
  .cl-actions .btn { width: 100%; box-sizing: border-box; text-align: center; min-height: 44px; }
  .filters { flex-direction: column; }
  .filters > div { min-width: 100%; }
  .media-thumb { width: 84px; height: 84px; }
  .plot-card { min-height: 84px; padding: 14px 16px; }
  .plot-ctrl input[type=range] { min-height: 40px; }
  #modal { max-width: 100%; border-radius: 0; padding: 16px; }
  .ci-label { width: 68px; }
  .stat .n { font-size: 24px; }
  .cl-desc { font-size: 15px; }
}

/* 地块全景：图例 / 筛选 / 地图 / 卡片 */
.plot-page-head h2 { margin: 0 0 4px; }
.plot-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; padding: 10px 14px; margin-bottom: 12px; font-size: 13px; }
.lg-item { display: inline-flex; align-items: center; gap: 6px; color: var(--text); }
.lg-dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; box-shadow: 0 0 0 2px rgba(255,255,255,.7); }
.plot-filters { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; padding: 12px 14px; margin-bottom: 12px; }
.plot-filters > div { flex: 1; min-width: 140px; }
.plot-filters label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.plot-map-wrap { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin-bottom: 16px; background: #e8efe9; box-shadow: var(--shadow); }
.plot-map { height: 460px; width: 100%; }

.plot-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 14px 14px 18px; box-shadow: var(--shadow); cursor: pointer; transition: all .2s ease; position: relative; overflow: hidden; }
.plot-card:hover { transform: translateY(-3px); box-shadow: 0 6px 16px rgba(0,0,0,.12); }
.plot-card.sel { outline: 2px solid var(--green); outline-offset: 2px; }
.plot-dot { position: absolute; left: 0; top: 0; bottom: 0; width: 5px; display: block; }
.plot-name { font-weight: 700; font-size: 15px; color: var(--green-d); }
.plot-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.plot-crops { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.plot-crop-chip { font-size: 12px; padding: 3px 10px; border-radius: 20px; background: #e8f5e9; color: #1b5e20; border: 1px solid #c8e6c9; }
.plot-crop-chip.harvested { background: #fff3e0; color: #e65100; border-color: #ffe0b2; }
.plot-crop-chip.cleared { background: #efebe9; color: #5d4037; border-color: #d7ccc8; }
.plot-status { font-size: 12px; font-weight: 600; margin-top: 8px; }
.plot-detail-crops { margin: 14px 0; }
.plot-detail-crops h4 { margin: 0 0 10px; font-size: 14px; color: var(--green-d); }
.plot-detail-crops.empty { color: var(--muted); font-size: 13px; padding: 8px 0; }
.plot-detail-crop { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.plot-detail-crop:last-child { border-bottom: none; }
.plot-detail-crop-name { font-weight: 600; color: var(--text); }
.plot-detail-crop-stage, .plot-detail-crop-variety { font-size: 12px; color: var(--muted); background: var(--bg); padding: 2px 8px; border-radius: 12px; }

@media (max-width: 600px) {
  .plot-map { height: 320px; }
  .plot-filters > div { min-width: 100px; }
}

/* 碳足迹 */
.carbon-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.carbon-grid > .card:first-child { grid-column: 1 / -1; }
.carbon-total .stat { box-shadow: none; }
.donut-wrap { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.donut-legend { font-size: 13px; line-height: 1.9; }
.donut-legend .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.bar-list { display: flex; flex-direction: column; gap: 10px; }
.bar-row .bar-label { font-size: 13px; color: var(--text); margin-bottom: 2px; }
.bar-row .bar { background: #e8f5e9; border-radius: 6px; height: 26px; position: relative; overflow: hidden; }
.bar-row .bar > span { position: absolute; left: 0; top: 0; bottom: 0; background: var(--green); }
.bar-row .bar .t { position: relative; z-index: 1; font-size: 12px; padding: 0 8px; line-height: 26px; color: #1b5e20; white-space: nowrap; }
.bars { display: flex; align-items: flex-end; gap: 8px; height: 160px; padding-top: 8px; overflow-x: auto; }
.bar-col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; min-width: 34px; height: 100%; }
.bar-col-v { width: 22px; background: var(--green); border-radius: 6px 6px 0 0; min-height: 4px; text-align: center; }
.bar-col-l { font-size: 10px; color: var(--muted); margin-top: 4px; }
/* AI 智能录入栏 */
.ai-bar {
  border: 1px dashed rgba(52, 199, 89, 0.5);
  background: rgba(52, 199, 89, 0.06);
  border-radius: 14px;
  padding: 10px 12px;
  margin-bottom: 14px;
  backdrop-filter: blur(6px);
}
.ai-bar-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.ai-badge {
  font-weight: 600; font-size: 13px;
  background: linear-gradient(135deg, #34c759, #30b0c7);
  color: #fff; padding: 2px 9px; border-radius: 999px; white-space: nowrap;
}
.ai-tip { font-size: 12px; color: var(--muted); }
.ai-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ai-row input { flex: 1 1 180px; min-width: 0; }
.ai-mic { white-space: nowrap; }
.ai-hits { margin-top: 8px; font-size: 12.5px; color: #1f7a3d; min-height: 16px; line-height: 1.5; }
.ai-hits:empty { display: none; }

/* ================= 农场地图标注 ================= */
.map-page { display: flex; flex-direction: column; gap: 12px; }
.map-head h2 { margin: 0 0 4px; }
.map-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.map-filters { display: flex; gap: 8px; flex-wrap: wrap; flex: 1; }
.map-filters .chip {
  border: 1px solid var(--line); background: #fff; color: var(--text);
  border-radius: 999px; padding: 8px 16px; font-size: 14px; min-height: 38px;
  transition: all .15s;
}
.map-filters .chip.on { background: var(--green); border-color: var(--green); color: #fff; }
.map-wrap { display: flex; gap: 12px; align-items: stretch; }
.map-box {
  flex: 1; min-width: 0; height: 520px; border-radius: 12px;
  border: 1px solid var(--line); box-shadow: var(--shadow); background: #e8efe9;
  position: relative; overflow: hidden;
}
.map-box.picking { cursor: crosshair; outline: 2px dashed var(--green); outline-offset: -2px; }
.map-box .leaflet-container { height: 100%; width: 100%; z-index: 1; }
.marker-list {
  width: 320px; flex-shrink: 0; background: var(--card);
  border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow);
  overflow-y: auto; max-height: 520px; padding: 8px;
}
.marker-item {
  display: flex; gap: 10px; padding: 10px 8px; border-radius: 10px;
  cursor: pointer; transition: background .15s; border-bottom: 1px solid var(--line);
}
.marker-item:hover { background: #f2f8f2; }
.marker-item.active { background: #e3f2e3; }
.marker-item .dot { width: 12px; height: 12px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; }
.mi-main { flex: 1; min-width: 0; }
.mi-name { font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.mi-desc { font-size: 13px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.mk-btns { display: inline-flex; gap: 8px; margin-top: 6px; }
.mk-btns .btn { min-height: 34px; padding: 4px 12px; font-size: 13px; }
.mk-pop { min-width: 180px; max-width: 260px; }
.mk-pop p { word-break: break-word; white-space: pre-wrap; }
.popup-actions { display: flex; gap: 8px; }
.popup-actions .btn { min-height: 34px; padding: 4px 12px; font-size: 13px; }

@media (max-width: 768px) {
  .map-wrap { flex-direction: column; }
  .map-box { height: 55vh; min-height: 320px; }
  .marker-list { width: 100%; max-height: 40vh; }
}
@media (max-width: 600px) {
  .map-toolbar { flex-direction: column; align-items: stretch; }
  .map-toolbar .btn { width: 100%; }
  .map-filters { justify-content: flex-start; }
}

/* ================= 地图工具栏（分层/缩放/搜索/重置/全屏） ================= */
.mk-toolbar { display: flex; flex-direction: column; border-radius: 6px; overflow: hidden; box-shadow: 0 1px 5px rgba(0,0,0,.2); }
.mk-toolbar .mk-btn {
  width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
  background: #fff; border: 0; border-bottom: 1px solid rgba(0,0,0,.1);
  font-size: 16px; cursor: pointer; padding: 0; color: #333; line-height: 1;
  font-family: inherit;
}
.mk-toolbar .mk-btn:last-child { border-bottom: 0; }
.mk-toolbar .mk-btn:hover { background: #f4f4f4; }
.mk-toolbar .mk-btn.active { background: var(--green); color: #fff; }

/* 搜索框（地图右上角） */
.mk-search-wrap { position: absolute; top: 10px; right: 10px; z-index: 500; }
.mk-search {
  width: 220px; padding: 8px 12px; border: 1px solid #ccc; border-radius: 8px;
  font-size: 14px; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.15);
  outline: none;
}
.mk-search:focus { border-color: var(--green); }

/* 分层面板（底图 + 分类） */
.mk-layer-panel {
  position: absolute; top: 10px; left: 50px; z-index: 500;
  background: #fff; border: 1px solid rgba(0,0,0,.2); border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,.25); padding: 10px 32px 10px 12px;
  min-width: 180px; display: none;
}
.mk-layer-panel.show { display: block; }
.mk-lp-section { margin-bottom: 10px; }
.mk-lp-section:last-child { margin-bottom: 0; }
.mk-lp-title { font-weight: 600; font-size: 13px; color: #333; margin-bottom: 6px; border-bottom: 1px solid #eee; padding-bottom: 4px; }
.mk-lp-item { display: flex; align-items: center; gap: 6px; padding: 4px 0; font-size: 14px; cursor: pointer; }
.mk-lp-item input { width: auto !important; min-width: 0 !important; margin: 0; padding: 0; }
.mk-lp-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.mk-lp-close {
  position: absolute; top: 6px; right: 6px; width: 24px; height: 24px;
  border: 0; background: transparent; font-size: 20px; color: #999;
  cursor: pointer; padding: 0; line-height: 1; font-family: inherit;
}
.mk-lp-close:hover { color: #333; }

/* 全屏 */
.map-wrap:fullscreen, .map-wrap:-webkit-full-screen {
  width: 100vw; height: 100vh; background: #fff; display: flex;
}
.map-wrap:fullscreen .map-box, .map-wrap:-webkit-full-screen .map-box { height: 100%; flex: 1; }
.map-wrap:fullscreen .marker-list, .map-wrap:-webkit-full-screen .marker-list { max-height: 100vh; }

@media (max-width: 600px) {
  .mk-search { width: 160px; font-size: 13px; }
  .mk-layer-panel { left: 44px; min-width: 160px; }
}

/* ================= 农场资产 ================= */
.asset-list { display: flex; flex-direction: column; gap: 12px; }
.asset-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; box-shadow: var(--shadow); }
.asset-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.asset-name { font-weight: 700; font-size: 17px; color: var(--green-d); }
.asset-price { font-weight: 700; font-size: 18px; color: var(--green); white-space: nowrap; }
.asset-desc { color: var(--text); font-size: 14px; margin: 10px 0 0; line-height: 1.7; }
.asset-meta-line { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 10px; font-size: 13px; color: var(--muted); }
.asset-flags { margin-top: 10px; font-size: 12px; color: #e65100; }
.asset-files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.asset-file { font-size: 12px; color: var(--muted); background: #f4f7f4; border: 1px solid var(--line); border-radius: 6px; padding: 3px 8px; }

@media (max-width: 600px) {
  .asset-head { flex-direction: column; }
  .asset-price { font-size: 16px; }
  .asset-meta-line { gap: 6px 12px; }
}

/* 仪表盘响应式 */
@media (max-width: 900px) {
  .dash-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-header { margin-bottom: 16px; }
  .dash-header h2 { font-size: 20px; }
}
@media (max-width: 600px) {
  .stat-grid { grid-template-columns: 1fr; }
  .stat-card { padding: 14px; }
  .stat-icon { width: 44px; height: 44px; font-size: 22px; }
  .stat-value { font-size: 24px; }
  .dash-trend-chart { height: 110px; }
  .dash-trend-month { font-size: 9px; }
}
