/* pages/device/fence/fence-new.wxss */

.fence-container {
  width: 100%;
  height: 100vh;
  background-color: #f5f5f5;
  position: relative;
  overflow: hidden;
}

/* 顶部标题栏 */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 88rpx;
  background: linear-gradient(135deg, #7CB342, #8BC34A);
  color: white;
  padding: 0 32rpx;
  position: relative;
  z-index: 100;
}

.header-left {
  display: flex;
  align-items: center;
}

.back-icon {
  font-size: 48rpx;
  font-weight: bold;
}

.header-title {
  font-size: 36rpx;
  font-weight: bold;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 24rpx;
}

.menu-icon, .settings-icon, .location-icon {
  font-size: 32rpx;
}

/* 地图容器 */
.map-container {
  width: 100%;
  height: calc(100vh - 88rpx);
  position: relative;
}

.show-farm-btn {
  position: absolute;
  top: 20rpx;
  left: 20rpx;
  background: #7CB342;
  color: white;
  padding: 16rpx 32rpx;
  border-radius: 24rpx;
  font-size: 28rpx;
  z-index: 10;
  box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.15);
}

.fence-map {
  width: 100%;
  height: 100%;
}

/* 地图控件 */
.map-controls {
  position: absolute;
  top: 20rpx;
  left: 20rpx;
  right: 20rpx;
  z-index: 5;
}

.device-stats {
  position: absolute;
  top: 80rpx;
  left: 0;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 16rpx 24rpx;
  border-radius: 12rpx;
  font-size: 24rpx;
}

.stat-item {
  display: flex;
  margin-bottom: 8rpx;
}

.stat-item:last-child {
  margin-bottom: 0;
}

.stat-label {
  margin-right: 16rpx;
}

.stat-value {
  font-weight: bold;
}

.switch-map-btn {
  position: absolute;
  top: 0;
  right: 0;
  background: #7CB342;
  color: white;
  padding: 16rpx 32rpx;
  border-radius: 24rpx;
  font-size: 28rpx;
  box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.15);
}

/* 位置标记 */
.location-markers {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.location-marker {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.marker-icon {
  font-size: 32rpx;
  color: #f5222d;
}

.marker-label {
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 4rpx 12rpx;
  border-radius: 8rpx;
  font-size: 20rpx;
  margin-top: 4rpx;
}

/* 底部信息栏 */
.bottom-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.95);
  padding: 24rpx 32rpx;
  border-top: 1rpx solid #e8e8e8;
}

.location-info {
  margin-bottom: 12rpx;
}

.location-name {
  font-size: 32rpx;
  font-weight: bold;
  color: #333;
}

.coordinates-info {
  display: flex;
  align-items: center;
}

.coordinates {
  font-size: 24rpx;
  color: #1890ff;
}

/* 操作面板 */
.operation-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  border-radius: 24rpx 24rpx 0 0;
  box-shadow: 0 -4rpx 20rpx rgba(0, 0, 0, 0.1);
  z-index: 200;
  max-height: 80vh;
  overflow-y: auto;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 32rpx;
  border-bottom: 1rpx solid #f0f0f0;
}

.panel-title {
  font-size: 36rpx;
  font-weight: bold;
  color: #333;
}

.panel-close {
  font-size: 48rpx;
  color: #999;
}

.panel-content {
  padding: 32rpx;
}

/* 创建围栏表单 */
.create-fence-form {
  display: flex;
  flex-direction: column;
  gap: 32rpx;
}

.form-item {
  display: flex;
  flex-direction: column;
  gap: 16rpx;
}

.form-label {
  font-size: 28rpx;
  color: #333;
  font-weight: bold;
}

.form-input, .form-textarea {
  padding: 24rpx;
  border: 1rpx solid #d9d9d9;
  border-radius: 12rpx;
  font-size: 28rpx;
  background: #fafafa;
}

.form-textarea {
  min-height: 120rpx;
  resize: none;
}

.form-picker {
  padding: 24rpx;
  border: 1rpx solid #d9d9d9;
  border-radius: 12rpx;
  background: #fafafa;
}

.picker-text {
  font-size: 28rpx;
  color: #333;
}

.coordinates-list {
  display: flex;
  flex-direction: column;
  gap: 16rpx;
  max-height: 200rpx;
  overflow-y: auto;
}

.coordinate-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16rpx;
  background: #f5f5f5;
  border-radius: 8rpx;
  font-size: 24rpx;
}

.remove-point {
  color: #f5222d;
  font-size: 24rpx;
}

.form-actions {
  display: flex;
  gap: 24rpx;
  margin-top: 32rpx;
}

.btn-cancel, .btn-save {
  flex: 1;
  padding: 24rpx;
  border-radius: 12rpx;
  font-size: 28rpx;
  border: none;
}

.btn-cancel {
  background: #f5f5f5;
  color: #666;
}

.btn-save {
  background: #7CB342;
  color: white;
}

.btn-save:disabled {
  background: #d9d9d9;
  color: #999;
}

/* 围栏详情 */
.fence-detail {
  display: flex;
  flex-direction: column;
  gap: 24rpx;
}

.detail-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24rpx 0;
  border-bottom: 1rpx solid #f0f0f0;
}

.detail-item:last-child {
  border-bottom: none;
}

.detail-label {
  font-size: 28rpx;
  color: #666;
}

.detail-value {
  font-size: 28rpx;
  color: #333;
  font-weight: bold;
}

.detail-actions {
  display: flex;
  gap: 24rpx;
  margin-top: 32rpx;
}

.btn-edit, .btn-delete {
  flex: 1;
  padding: 24rpx;
  border-radius: 12rpx;
  font-size: 28rpx;
  border: none;
}

.btn-edit {
  background: #1890ff;
  color: white;
}

.btn-delete {
  background: #f5222d;
  color: white;
}

/* 浮动操作按钮 */
.fab-container {
  position: fixed;
  bottom: 120rpx;
  right: 32rpx;
  z-index: 150;
}

.fab-main {
  width: 112rpx;
  height: 112rpx;
  background: #7CB342;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8rpx 24rpx rgba(124, 179, 66, 0.4);
}

.fab-icon {
  font-size: 48rpx;
  color: white;
  font-weight: bold;
}

.fab-menu {
  position: absolute;
  bottom: 140rpx;
  right: 0;
  display: flex;
  flex-direction: column;
  gap: 16rpx;
}

.fab-item {
  display: flex;
  align-items: center;
  gap: 16rpx;
  background: white;
  padding: 16rpx 24rpx;
  border-radius: 24rpx;
  box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.1);
  white-space: nowrap;
}

.fab-item-icon {
  font-size: 32rpx;
}

.fab-item-text {
  font-size: 24rpx;
  color: #333;
}

/* 加载提示 */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
}

.loading-content {
  background: white;
  padding: 48rpx;
  border-radius: 16rpx;
  display: flex;
  align-items: center;
  gap: 24rpx;
}

.loading-text {
  font-size: 28rpx;
  color: #333;
}

/* 响应式调整 */
@media (max-width: 750rpx) {
  .header {
    height: 80rpx;
    padding: 0 24rpx;
  }
  
  .header-title {
    font-size: 32rpx;
  }
  
  .map-container {
    height: calc(100vh - 80rpx);
  }
  
  .fab-container {
    bottom: 100rpx;
    right: 24rpx;
  }
}