/* ============ 农牧交错带牧户智能决策系统 ============ */
/* 视觉规范：主色 #2E8B62 · 预警 #D9534F · 告警 #E0A53B · 背景 #F4F6F8 */
:root {
  --brand: #2E8B62;
  --brand-dark: #24714F;
  --brand-light: #E4F1EB;
  --warn: #E0A53B;
  --danger: #D9534F;
  --bg: #F4F6F8;
  --sidebar-w: 232px;

  --el-color-primary: #2E8B62;
  --el-color-primary-light-3: #5aa884;
  --el-color-primary-light-5: #86c0a4;
  --el-color-primary-light-7: #b1d6c5;
  --el-color-primary-light-8: #c7e2d5;
  --el-color-primary-light-9: #e4f1eb;
  --el-color-primary-dark-2: #24714f;
  --el-color-warning: #E0A53B;
  --el-color-danger: #D9534F;
  --el-border-radius-base: 8px;
  --el-font-family: 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: var(--el-font-family);
  background: var(--bg);
  color: #263238;
  -webkit-font-smoothing: antialiased;
}
#app { height: 100%; }

/* ---------- 布局 ---------- */
.layout { height: 100vh; display: flex; overflow: hidden; }
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: linear-gradient(180deg, #1E4D3B 0%, #143528 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 16px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.brand img { width: 38px; height: 38px; border-radius: 9px; }
.brand .name { font-size: 19px; font-weight: 700; letter-spacing: 2px; }
.brand .sub { font-size: 10.5px; color: rgba(255,255,255,.55); margin-top: 2px; letter-spacing: 1px; }
.main-wrap { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 58px; background: #fff;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px;
  box-shadow: 0 1px 4px rgba(31, 61, 47, .08);
  position: relative; z-index: 5;
}
.content { flex: 1; overflow-y: auto; padding: 18px 20px 26px; }

/* ---------- 侧栏菜单 ---------- */
.sidebar .el-menu { border-right: none; background: transparent; flex: 1; overflow-y: auto; padding-top: 6px; }
.sidebar .el-menu-item, .sidebar .el-menu-item:hover { background: transparent; }
.sidebar .el-menu-item {
  color: rgba(255,255,255,.72); height: 44px; margin: 3px 10px; border-radius: 8px;
}
.sidebar .el-menu-item:hover { color: #fff; background: rgba(255,255,255,.07); }
.sidebar .el-menu-item.is-active {
  color: #fff; background: linear-gradient(90deg, #2E8B62, #3BAA78);
  box-shadow: 0 2px 8px rgba(46,139,98,.45);
}
.sidebar .el-menu-item .el-icon { margin-right: 8px; }
.menu-group-title {
  font-size: 11px; color: rgba(255,255,255,.38);
  padding: 14px 22px 6px; letter-spacing: 2px;
}
.sidebar-footer {
  padding: 12px 16px; font-size: 11px; color: rgba(255,255,255,.35);
  border-top: 1px solid rgba(255,255,255,.08); line-height: 1.7;
}

/* ---------- 通用卡片 ---------- */
.panel {
  background: #fff; border-radius: 12px;
  padding: 18px 20px;
  box-shadow: 0 1px 3px rgba(31, 61, 47, .06);
}
.panel + .panel, .grid + .panel, .panel + .grid { margin-top: 16px; }
.panel-title {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 15px; font-weight: 600; margin: 0 0 14px; color: #1F3D2F;
}
.panel-title .bar { display: flex; align-items: center; gap: 8px; }
.panel-title .bar::before {
  content: ''; width: 4px; height: 16px; border-radius: 2px;
  background: linear-gradient(180deg, #3BAA78, #2E8B62);
}
.sub-tip { color: #8A97A0; font-size: 12px; font-weight: 400; }

/* 指标卡 */
.stat-card {
  background: #fff; border-radius: 12px; padding: 18px;
  box-shadow: 0 1px 3px rgba(31,61,47,.06);
  display: flex; gap: 14px; align-items: center;
  transition: transform .18s, box-shadow .18s;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: 0 6px 18px rgba(31,61,47,.12); }
.stat-icon {
  width: 48px; height: 48px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 24px; color: #fff;
}
.stat-card .label { font-size: 12.5px; color: #8A97A0; }
.stat-card .value { font-size: 23px; font-weight: 700; color: #1F3D2F; margin-top: 3px; line-height: 1.1; }
.stat-card .unit { font-size: 12px; color: #8A97A0; font-weight: 400; margin-left: 2px; }
.stat-card .trend { font-size: 11.5px; margin-top: 4px; }
.up { color: #2E8B62; } .down { color: #D9534F; } .flat { color: #8A97A0; }

/* 决策入口卡 */
.entry-card {
  position: relative; overflow: hidden;
  border-radius: 12px; padding: 18px; color: #fff; cursor: pointer;
  transition: transform .18s, box-shadow .18s;
}
.entry-card:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0,0,0,.18); }
.entry-card .cnt { font-size: 30px; font-weight: 800; line-height: 1; }
.entry-card .ttl { font-size: 15px; font-weight: 600; margin-top: 8px; }
.entry-card .rule { font-size: 11.5px; opacity: .85; margin-top: 8px; line-height: 1.7; }
.entry-card .go { position: absolute; right: 16px; top: 16px; font-size: 12px; opacity: .85; }

/* 预警等级色点 */
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.dot-ok { background: #2E8B62; } .dot-watch { background: #E0A53B; }
.dot-warn { background: #E07B39; } .dot-danger { background: #D9534F; }
.dot-none { background: #C3CCD3; }

/* 进度条 */
.mini-bar { height: 6px; border-radius: 3px; background: #EDF1F4; overflow: hidden; width: 100%; }
.mini-bar > i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg,#3BAA78,#2E8B62); }

/* 等距沙盘 */
.iso-scene {
  display: flex; align-items: flex-end; justify-content: center; gap: 26px;
  padding: 30px 10px 18px; height: 320px; perspective: 800px;
}
.iso-block {
  width: 108px; height: 118px; position: relative; cursor: pointer;
  transform: rotateX(56deg) rotateZ(45deg);
  border-radius: 8px;
  transition: box-shadow .2s, outline-color .2s; outline: 2px solid transparent;
}
.iso-block:hover { outline-color: rgba(255,255,255,.9); }
.iso-block .face-top { position: absolute; inset: 0; border-radius: 8px; }
.iso-block .label {
  position: absolute; transform: rotateZ(-45deg) rotateX(-56deg);
  left: 50%; top: 50%; translate: -50% -50%;
  color: #fff; font-weight: 700; font-size: 15px; text-shadow: 0 1px 3px rgba(0,0,0,.4);
  white-space: nowrap; text-align: center; line-height: 1.5;
}
.iso-shadow {
  position: absolute; inset: 0; border-radius: 8px;
  box-shadow: 0 26px 22px rgba(20,53,40,.35);
}

/* 轮牧甘特 */
.gantt { width: 100%; border-collapse: collapse; }
.gantt th, .gantt td { border: 1px solid #EBF0F3; font-size: 12px; padding: 7px 8px; text-align: center; }
.gantt th { background: #F7FAF9; color: #5A6A75; font-weight: 600; }
.gantt .seg { position: relative; height: 16px; border-radius: 8px; margin: 0 3px; }
.gantt .conflict { outline: 2px dashed #D9534F; outline-offset: 2px; }
.legend { display: flex; gap: 18px; font-size: 12px; color: #5A6A75; margin-top: 10px; flex-wrap: wrap; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

/* 表格微调 */
.el-table .cell { font-size: 12.5px; }
.el-table th.el-table__cell { background: #F7FAF9 !important; color: #44535E; font-weight: 600; }

/* 登录页 */
.login-page {
  height: 100vh; display: flex;
  background: linear-gradient(135deg, #1E4D3B 0%, #143528 60%, #0E2A1F 100%);
  overflow: hidden; position: relative;
}
.login-left {
  flex: 1.15; color: #fff; display: flex; flex-direction: column; justify-content: center;
  padding: 60px 8vw; position: relative; z-index: 2;
}
.login-left h1 { font-size: 40px; letter-spacing: 6px; margin: 26px 0 12px; }
.login-left .slogan { font-size: 16px; color: rgba(255,255,255,.75); letter-spacing: 2px; }
.login-left .desc { margin-top: 34px; color: rgba(255,255,255,.6); line-height: 2; font-size: 13.5px; max-width: 460px; }
.login-left .desc b { color: #fff; }
.login-stats { display: flex; gap: 44px; margin-top: 48px; }
.login-stats .n { font-size: 26px; font-weight: 800; }
.login-stats .t { font-size: 12px; color: rgba(255,255,255,.55); margin-top: 4px; }
.login-right {
  flex: .85; background: rgba(255,255,255,.04); backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center;
  border-left: 1px solid rgba(255,255,255,.08); z-index: 2;
}
.login-box {
  width: 380px; background: #fff; border-radius: 16px; padding: 38px 36px 30px;
  box-shadow: 0 24px 60px rgba(0,0,0,.35);
}
.login-box .lb-title { font-size: 20px; font-weight: 700; color: #1F3D2F; }
.login-box .lb-sub { font-size: 12.5px; color: #8A97A0; margin: 6px 0 24px; }
.login-tip { font-size: 12px; color: #8A97A0; margin-top: 14px; line-height: 1.8; }
.pasture-bg {
  position: absolute; inset: 0; opacity: .5; z-index: 1; pointer-events: none;
  background:
    radial-gradient(60vw 40vh at 80% 110%, rgba(59,170,120,.35), transparent 60%),
    radial-gradient(50vw 36vh at 12% -10%, rgba(59,170,120,.22), transparent 60%);
}
.hill {
  position: absolute; bottom: -18vh; left: -10vw; width: 70vw; height: 34vh;
  background: radial-gradient(50% 100% at 50% 100%, rgba(46,139,98,.5), transparent 70%);
  border-radius: 50%; z-index: 1;
}
.hill.h2 { left: 30vw; bottom: -24vh; height: 40vh; opacity: .6; }

/* 其他 */
.page-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 16px; }
.page-head h2 { margin: 0; font-size: 19px; color: #1F3D2F; }
.page-head .sub { font-size: 12.5px; color: #8A97A0; }
.grid { display: grid; gap: 14px; }
.g6 { grid-template-columns: repeat(6, 1fr); }
.g5 { grid-template-columns: repeat(5, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g-2-1 { grid-template-columns: 2fr 1fr; }
.g-1-2 { grid-template-columns: 1fr 2fr; }
@media (max-width: 1100px) { .g5 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 1280px) { .g6, .g5 { grid-template-columns: repeat(3, 1fr); } .g4, .g-2-1, .g-1-2 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 860px) {
  .sidebar { display: none; }
  .g6, .g5, .g4, .g3, .g2, .g-2-1, .g-1-2 { grid-template-columns: 1fr; }
  .login-left { display: none; }
  .login-page { justify-content: center; }
  .login-right { border: none; flex: 1; }
}

/* ---------- 紧凑指标小卡片（驾驶舱 / 设施建设） ---------- */
.stat-card.sm {
  padding: 14px 16px; gap: 12px; align-items: flex-start; border-radius: 12px;
  min-height: 96px;
}
.stat-card.sm .stat-icon { width: 42px; height: 42px; border-radius: 11px; font-size: 21px; margin-top: 2px; }
.stat-card.sm .label { font-size: 12px; line-height: 1.4; }
.stat-card.sm .value { font-size: 21px; margin-top: 3px; }
.stat-card.sm .trend { font-size: 11px; margin-top: 5px; line-height: 1.5; }
.stat-card.clickable { cursor: pointer; }
.stat-card.is-active { box-shadow: 0 0 0 2px rgba(46,139,98,.45), 0 6px 18px rgba(31,61,47,.12); }
.card-link { color: #57AEE2; font-size: 11.5px; margin-left: 5px; white-space: nowrap; }

/* 省份可点击链接 */
.province-link {
  color: #2E8B62; cursor: pointer; text-decoration: none;
  border-bottom: 1px dashed #A9D3C1; padding-bottom: 1px;
}
.province-link:hover { color: #1E6B4A; border-bottom-style: solid; }

/* ---------- 顶栏通知中心 ---------- */
.bell-wrap { display: flex; align-items: center; cursor: pointer; padding: 4px; }
.notify-pop { padding: 0 !important; }
.notify-head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px 10px; border-bottom: 1px solid #EBF0F3;
}
.notify-list { max-height: 380px; overflow-y: auto; }
.notify-empty { padding: 34px 12px; text-align: center; color: #8A97A0; font-size: 12.5px; line-height: 1.9; }
.notify-item {
  display: flex; gap: 10px; padding: 11px 14px; cursor: pointer;
  border-bottom: 1px solid #F1F5F7; transition: background .15s;
}
.notify-item:hover { background: #F6FAF8; }
.notify-item.unread { background: #F7FBF9; }
.notify-item .nt { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #1F3D2F; }
.notify-item .nt em {
  font-style: normal; font-size: 11px; font-weight: 700; color: #fff;
  background: #D9534F; border-radius: 9px; padding: 0 6px; line-height: 16px;
}
.notify-item .nd { font-size: 12px; color: #5A6A75; margin-top: 3px; line-height: 1.6; }
.notify-item .ntime { font-size: 11px; color: #A6B1B9; margin-top: 4px; }

.muted { color: #8A97A0; }
.mono { font-variant-numeric: tabular-nums; }
.tag-mini { font-size: 11px; padding: 0 6px; height: 20px; line-height: 19px; border-radius: 4px; }

/* 繁殖提醒：已过预产期行淡红底，便于一眼定位 */
.el-table .row-overdue td.el-table__cell { background: #FDF3F2; }

/* 顶栏用户信息：去掉点击下拉后出现的黑色焦点描边框 */
.topbar .el-dropdown .el-tooltip__trigger:focus,
.topbar .el-dropdown .el-tooltip__trigger:focus-visible,
.topbar .el-dropdown-selfdefine:focus,
.topbar .el-dropdown-selfdefine:focus-visible { outline: none !important; }

/* 滚动条 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #C6D2CB; border-radius: 4px; }
::-webkit-scrollbar-track { background: transparent; }
