/* greenhouse.css - 大棚作物全生命周期监控样式文件 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Microsoft YaHei", sans-serif;
}

/* 基础布局 */
.greenhouse-bg {
  width: 100%;
  min-height: 100vh;
  position: relative;
  padding: 30px 20px 120px;
  overflow-x: hidden;
}

/* 视频背景 */
.bg-video {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -1;
  opacity: 0.85;
}

/* 顶部导航 */
.top-nav {
  width: 100%;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-bottom: 10px;
  padding-right: 20px;
  position: relative;
  z-index: 10;
  height: 60px;
}
.page-title {
  color: #2c3e50;
  font-size: 18px;
  font-weight: bold;
  background: rgba(255,255,255,0.85);
  padding: 8px 16px;
  border-radius: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  position: relative;
  z-index: 11;
  margin-right: 20px;
}

/* 左侧容器 */
.env-container {
  position: absolute;
  top: 50px;
  left: 20px;
  width: 200px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  z-index: 6;
}
.card-base {
  background: rgba(255,255,255,0.95);
  border-radius: 12px;
  padding: 15px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  border: 1px solid #f0f8f0;
}
.env-card-title {
  color: #27ae60;
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.env-item {
  display: flex;
  justify-content: space-between;
  margin: 8px 0;
  font-size: 14px;
  color: #34495e;
  white-space: nowrap;
}
.env-item span:last-child {
  font-weight: bold;
  color: #27ae60;
}

/* 作物选择器 */
.crop-selector-wrap {
  padding: 10px 15px;
}
.selector-label {
  font-size: 12px;
  color: #7f8c8d;
  margin-bottom: 8px;
  display: block;
}
.crop-list {
  width: 100%;
  border-radius: 6px;
  border: 1px solid #e4e7ed;
  overflow: hidden;
}
.crop-list-item {
  padding: 8px 12px;
  font-size: 14px;
  color: #34495e;
  cursor: pointer;
  transition: all 0.2s ease;
  border-bottom: 1px solid #f0f2f5;
}
.crop-list-item:last-child {
  border-bottom: none;
}
.crop-list-item:hover {
  background-color: #f8fcf8;
}
.crop-list-item.active {
  background-color: #e8f5e8;
  color: #27ae60;
  font-weight: bold;
}

/* 推荐农资 */
.product-title {
  color: #e67e22;
  font-size: 14px;
  font-weight: bold;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.product-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 10px;
}
.product-img {
  width: 100%;
  height: 60px;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 5px;
  background: #f8f8f8;
  position: relative;
  transition: transform 0.3s ease;
}
.pixel-product {
  width: 100%;
  height: 100%;
  position: relative;
}
.pixel-bottle {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 30px;
  height: 40px;
  background: #4CAF50;
  border-radius: 2px 2px 8px 8px;
}
.pixel-bottle::before {
  content: '';
  position: absolute;
  top: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 15px;
  height: 5px;
  background: #2E7D32;
  border-radius: 2px 2px 0 0;
}
.pixel-bottle::after {
  content: '';
  position: absolute;
  top: 10px;
  left: 5px;
  width: 20px;
  height: 15px;
  background: rgba(255,255,255,0.3);
  border-radius: 1px;
}
.product-item:hover .product-img {
  transform: scale(1.05);
}
.product-name {
  font-size: 11px;
  color: #34495e;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.product-price {
  font-size: 13px;
  color: #e74c3c;
  font-weight: bold;
  margin: 5px 0;
}
.product-btn {
  width: 100%;
  padding: 7px 0;
  background: #27ae60;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.2s ease;
}
.product-btn:hover {
  background: #219653;
}

/* 右侧警报面板 */
.alert-panel {
  position: absolute;
  top: 80px;
  right: 20px;
  width: 180px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  z-index: 5;
  margin-top: 10px;
}
.alert-card {
  background: rgba(255,255,255,0.95);
  border-radius: 10px;
  padding: 10px 8px;
  text-align: center;
  box-shadow: 0 3px 8px rgba(0,0,0,0.1);
  white-space: nowrap;
  transition: all 0.2s ease;
  border: 1px solid #f8f8f8;
}
.alert-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.15);
}
.alert-icon {
  width: 28px;
  height: 28px;
  margin: 0 auto 6px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 13px;
}
.alert-icon.green { background: #27ae60; }
.alert-icon.yellow { background: #f39c12; }
.alert-icon.blue { background: #3498db; }
.alert-text {
  font-size: 11px;
  color: #34495e;
  font-weight: 500;
}
.alert-subtext {
  font-size: 9px;
  color: #7f8c8d;
  margin-top: 3px;
}

/* 生命周期监控区域 */
.life-cycle-container {
  width: calc(100% - 420px);
  margin: 90px auto 60px;
  padding: 0 20px;
  position: relative;
  z-index: 1;
}
.life-cycle-title {
  color: #2c3e50;
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 20px;
  text-align: center;
  white-space: nowrap;
  padding: 12px 20px;
  background: rgba(255,255,255,0.9);
  border-radius: 15px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  border: 1px solid #e8f5e8;
}

/* 阶段卡片 */
.stage-list {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: nowrap;
  overflow-x: hidden;
  padding: 10px 0;
  margin-bottom: 40px;
}
.stage-card {
  flex: 1;
  min-width: 220px;
  max-width: 240px;
  background: rgba(255,255,255,0.98);
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
  text-align: left;
  transition: all 0.3s ease;
  cursor: pointer;
  border: 2px solid transparent;
}
.stage-card.is-current, .stage-card.active {
  border-color: #27ae60;
  box-shadow: 0 0 0 3px rgba(39, 174, 96, 0.15);
}
.stage-card.is-next {
  border-color: #f39c12;
  box-shadow: 0 0 0 3px rgba(243, 156, 18, 0.15);
}
.stage-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}
.stage-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #f0f2f5;
}
.stage-name {
  color: #27ae60;
  font-size: 16px;
  font-weight: bold;
}
.stage-days {
  font-size: 12px;
  color: #7f8c8d;
  background: #f8f9fa;
  padding: 2px 8px;
  border-radius: 12px;
}
.stage-img {
  width: 100%;
  height: 120px;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #f0f8f0 0%, #e8f5e8 100%);
  position: relative;
}

/* 作物阶段样式 */
.plant-zlt.seed, .plant-fq.seed {
  background: #f5f5dc;
  display: flex;
  align-items: center;
  justify-content: center;
}
.plant-zlt.seed::before, .plant-fq.seed::before {
  content: '';
  width: 18px;
  height: 18px;
  background: #8B4513;
  border-radius: 50%;
  position: relative;
  box-shadow: 0 0 0 3px #A0522D;
}
.plant-zlt.seed::after, .plant-fq.seed::after {
  content: '';
  width: 4px;
  height: 12px;
  background: #2E7D32;
  position: absolute;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
}

.plant-zlt.seedling, .plant-fq.seedling {
  background: #e8f5e8;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.plant-zlt.seedling::before {
  content: '';
  width: 5px;
  height: 40px;
  background: #2E7D32;
  border-radius: 3px;
}
.plant-fq.seedling::before {
  content: '';
  width: 4px;
  height: 35px;
  background: #2E7D32;
  border-radius: 3px;
}
.plant-zlt.seedling::after {
  content: '';
  width: 25px;
  height: 20px;
  background: #4CAF50;
  border-radius: 50% 50% 0 0;
  position: absolute;
  top: 50px;
  left: 50%;
  transform: translateX(-50%);
  box-shadow: -12px 8px 0 0 #66BB6A, 12px 8px 0 0 #66BB6A;
}
.plant-fq.seedling::after {
  content: '';
  width: 22px;
  height: 18px;
  background: #4CAF50;
  border-radius: 50% 50% 0 0;
  position: absolute;
  top: 55px;
  left: 50%;
  transform: translateX(-50%);
  box-shadow: -10px 7px 0 0 #66BB6A, 10px 7px 0 0 #66BB6A;
}

.plant-zlt.growing, .plant-fq.growing {
  background: #c8e6c9;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.plant-zlt.growing::before {
  content: '';
  width: 7px;
  height: 60px;
  background: #2E7D32;
  border-radius: 3px;
}
.plant-fq.growing::before {
  content: '';
  width: 6px;
  height: 55px;
  background: #2E7D32;
  border-radius: 3px;
  box-shadow: 8px 15px 0 -2px #66BB6A, -8px 15px 0 -2px #66BB6A;
}
.plant-zlt.growing::after {
  content: '';
  width: 35px;
  height: 30px;
  background: #4CAF50;
  border-radius: 50%;
  position: absolute;
  top: 30px;
  left: 50%;
  transform: translateX(-50%);
  box-shadow: -25px 15px 0 0 #66BB6A, 25px 15px 0 0 #66BB6A,
              -15px -10px 0 0 #81C784, 15px -10px 0 0 #81C784;
}
.plant-fq.growing::after {
  content: '';
  width: 30px;
  height: 25px;
  background: #4CAF50;
  border-radius: 50%;
  position: absolute;
  top: 35px;
  left: 50%;
  transform: translateX(-50%);
  box-shadow: -20px 12px 0 0 #66BB6A, 20px 12px 0 0 #66BB6A;
}

.plant-zlt.harvest, .plant-fq.harvest {
  background: #a5d6a7;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.plant-zlt.harvest::before {
  content: '';
  width: 9px;
  height: 70px;
  background: #2E7D32;
  border-radius: 3px;
}
.plant-fq.harvest::before {
  content: '';
  width: 8px;
  height: 65px;
  background: #2E7D32;
  border-radius: 3px;
  box-shadow: 10px 20px 0 -3px #66BB6A, -10px 20px 0 -3px #66BB6A;
}
.plant-zlt.harvest::after {
  content: '';
  width: 45px;
  height: 35px;
  background: #4CAF50;
  border-radius: 50%;
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  box-shadow: -30px 20px 0 0 #66BB6A, 30px 20px 0 0 #66BB6A,
              -20px -15px 0 0 #81C784, 20px -15px 0 0 #81C784,
              0 -25px 0 5px #A5D6A7, 0 -20px 0 8px #81C784;
}
.plant-fq.harvest::after {
  content: '';
  width: 40px;
  height: 30px;
  background: #4CAF50;
  border-radius: 50%;
  position: absolute;
  top: 25px;
  left: 50%;
  transform: translateX(-50%);
  box-shadow: -25px 18px 0 0 #66BB6A, 25px 18px 0 0 #66BB6A,
              0 -20px 0 8px #F44336, 15px -10px 0 5px #FF9800, 
              -15px -10px 0 5px #8BC34A;
}

.stage-status {
  font-size: 13px;
  color: #f39c12;
  margin-bottom: 8px;
  font-weight: 500;
}
.stage-brief {
  font-size: 11px;
  color: #34495e;
  line-height: 1.5;
  margin-bottom: 10px;
}
.stage-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid #f0f2f5;
  font-size: 12px;
}
.stage-suit {
  color: #27ae60;
  font-weight: bold;
}

/* 阶段详情区 */
.current-stage-detail {
  background: rgba(255,255,255,0.98);
  border-radius: 15px;
  padding: 20px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
  margin-top: 20px;
  margin-bottom: 60px;
  width: 100%;
  border: 1px solid #f0f8f0;
}
.detail-header {
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid #f0f2f5;
}
.detail-header-title {
  font-size: 16px;
  color: #2c3e50;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 8px;
}
.detail-header-desc {
  font-size: 11px;
  color: #7f8c8d;
  margin-top: 4px;
}
.detail-content {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  justify-content: space-between;
  width: 100%;
  padding-bottom: 8px;
}
.detail-module {
  flex: 1;
  min-width: 180px;
  max-width: 240px;
  background: #f8fcf8;
  border-radius: 10px;
  padding: 15px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: transform 0.2s ease;
}
.detail-module:hover {
  transform: translateY(-3px);
}
.module-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: #2c3e50;
  font-weight: bold;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px dashed #e4e7ed;
}
.module-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: white;
}
.icon-env { background: #3498db; }
.icon-pest { background: #e74c3c; }
.icon-work { background: #27ae60; }
.icon-service { background: #9b59b6; }
.module-content {
  font-size: 12px;
  color: #34495e;
  line-height: 1.7;
}
.content-item {
  margin-bottom: 6px;
  padding-left: 12px;
  position: relative;
}
.content-item::before {
  content: "•";
  position: absolute;
  left: 0;
  color: #27ae60;
}
.service-tag {
  display: inline-block;
  background: #e8f5e8;
  color: #27ae60;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  margin-right: 4px;
  margin-bottom: 4px;
}

/* 底部设备栏 */
.device-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(255,255,255,0.95);
  display: flex;
  justify-content: space-around;
  padding: 12px 0;
  box-shadow: 0 -3px 15px rgba(0,0,0,0.1);
  border-top: 1px solid #f0f8f0;
  z-index: 20;
}
.device-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 12px;
  color: #34495e;
}
.device-icon {
  font-size: 18px;
  margin-bottom: 3px;
  color: #27ae60;
}
.device-value {
  font-weight: bold;
  color: #2c3e50;
}

/* 智能体仙童名片样式 - 增强科技感 + 放大头像 */
#aiChatBtn {
  position: fixed;
  right: 30px;
  bottom: 90px;
  width: 120px;  /* 加宽按钮 */
  height: 140px; /* 加高按钮 */
  border-radius: 16px; /* 更大圆角 */
  background: linear-gradient(135deg, #e8f5e8 0%, #c8e6c9 100%);
  /* 科技感渐变边框 */
  border: 2px solid transparent;
  background-clip: padding-box, border-box;
  background-origin: padding-box, border-box;
  background-image: 
    linear-gradient(135deg, #e8f5e8 0%, #c8e6c9 100%),
    linear-gradient(135deg, #27ae60, #3498db);
  cursor: pointer;
  /* 科技感阴影 */
  box-shadow: 0 4px 20px rgba(0,0,0,0.15), 0 0 10px rgba(39, 174, 96, 0.1);
  z-index: 9998;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px;
  font-family: "Microsoft YaHei", sans-serif;
}
#aiChatBtn:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 25px rgba(0,0,0,0.2), 0 0 15px rgba(39, 174, 96, 0.2);
}
/* 放大头像 + 科技感样式 */
.xian-tong-avatar {
  width: 70px;    /* 头像放大到70px */
  height: 70px;   /* 头像放大到70px */
  border-radius: 50%;
  margin-bottom: 10px;
  display: block;
  object-fit: cover;
  /* 科技感发光边框 */
  border: 3px solid #27ae60;
  box-shadow: 0 0 10px rgba(39, 174, 96, 0.3), inset 0 0 5px rgba(255,255,255,0.5);
  /* 悬浮效果 */
  transition: all 0.3s ease;
}
#aiChatBtn:hover .xian-tong-avatar {
  transform: scale(1.05);
  box-shadow: 0 0 15px rgba(39, 174, 96, 0.5), inset 0 0 8px rgba(255,255,255,0.7);
}
.xian-tong-name {
  font-size: 16px;  /* 加大字体 */
  font-weight: bold;
  margin-bottom: 4px;
  text-align: center;
  /* 科技感文字效果 */
  text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}
.xian-tong-title {
  font-size: 11px;  /* 加大字体 */
  color: #219653;
  text-align: center;
  line-height: 1.2;
}

/* 智能体对话浮窗 - 改成90%高度，严格不超出屏幕 */
#aiChatWindow {
  position: fixed;
  right: 30px;
  bottom: 100px;         /* 离底部留足空间，不被按钮顶出去 */
  width: 550px;   
  height: 90vh;         /* 你要的 90% 高度 */
  max-height: 90vh; 
  /* 核心：确保永远不会顶出屏幕顶部 */
  max-height: calc(100vh - 120px); 
  border-radius: 16px;
  box-shadow: 0 0 25px rgba(0,0,0,0.2);
  z-index: 9999;
  display: none;
  overflow: hidden;
  border: 1px solid #eee;
  background: #fff;
  max-width: calc(100vw - 60px);
}
#closeChat {
  position: absolute;
  top: 15px;      
  right: 15px;    
  width: 35px;    
  height: 35px;   
  border-radius: 50%;
  background: #fff;
  color: #666;
  border: 1px solid #eee;
  cursor: pointer;
  z-index: 10000;
  font-size: 18px; 
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  /* 科技感关闭按钮 */
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
#closeChat:hover {
  background: #f8f8f8;
  color: #e74c3c;
  transform: scale(1.1);
  box-shadow: 0 3px 10px rgba(0,0,0,0.15);
}

/* 响应式适配 - 同步调整移动端样式 */
@media (max-width: 1200px) {
  .life-cycle-container { width: calc(100% - 380px); }
}
@media (max-width: 992px) {
  .life-cycle-container {
    width: 100%;
    margin-top: 360px;
    padding: 0 10px;
  }
  .alert-panel { width: 160px; }
  .stage-list {
    justify-content: flex-start;
    padding: 10px;
    gap: 15px;
  }
  .stage-card {
    flex: 0 0 calc(25% - 10px);
    min-width: 200px;
  }
}
@media (max-width: 768px) {
  .env-container, .alert-panel {
    position: static;
    margin: 15px auto;
    width: 90%;
    top: auto;
  }
  .life-cycle-container { margin-top: 20px; }
  .stage-card {
    flex: 0 0 calc(50% - 10px);
    margin-bottom: 15px;
  }
  .detail-module {
    width: 100%;
    margin-bottom: 10px;
  }
  .device-bar {
    flex-wrap: wrap;
    gap: 15px;
    padding: 10px;
  }
  .top-nav {
    height: auto;
    margin-bottom: 15px;
  }
  /* 移动端对话窗口适配 */
  @media (max-width: 768px) {
    #aiChatWindow {
      width: calc(100% - 40px); 
      height: 90vh;         /* 移动端也 90% 高度 */
      max-height: 90vh;         
      max-height: calc(100vh - 120px);
      right: 20px;
      bottom: 100px;
    }
  }
  /* 移动端智能体按钮适配 */
  #aiChatBtn {
    width: 100px;
    height: 120px;
    bottom: 80px;
  }
  .xian-tong-avatar { 
    width: 60px;  /* 移动端头像尺寸 */
    height: 60px; /* 移动端头像尺寸 */
  }
  .xian-tong-name { font-size: 14px; }
  .xian-tong-title { font-size: 10px; }
}

