/* 全局样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
  background: #0a1929;
  color: #fff;
  overflow-x: hidden;
}

/* 应用容器 */
.app-container {
  width: 100%;
  min-height: 100vh;
  background: #0a1929;
}

/* 头部导航 */
.header {
  background: #001529;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  height: 60px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.logo h2 {
  color: #1890ff;
  font-size: 20px;
  white-space: nowrap;
}

.nav-menu {
  display: flex;
  gap: 20px;
}

.nav-menu a {
  color: #fff;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 4px;
  transition: all 0.3s;
}

.nav-menu a:hover {
  background: rgba(24, 144, 255, 0.1);
  color: #1890ff;
}

.nav-menu a.active {
  background: rgba(24, 144, 255, 0.2);
  color: #1890ff;
  font-weight: bold;
}

.user-info select {
  background: transparent;
  color: #fff;
  border: 1px solid #1890ff;
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
}

/* 主内容区 */
.main-content {
  padding: 20px;
  background: #0a1929;
  min-height: calc(100vh - 60px);
}

/* 首页样式 */
.dashboard {
  padding: 0;
}

.header-title {
  text-align: center;
  padding: 20px;
  background: linear-gradient(135deg, #001529 0%, #003a8c 100%);
  border-radius: 8px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.header-title h1 {
  font-size: 28px;
  color: #1890ff;
  letter-spacing: 4px;
}

.time {
  font-size: 16px;
  color: #1890ff;
}

/* 池塘卡片 */
.pond-cards {
  margin-bottom: 20px;
}

.row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 20px;
}

.pond-card {
  background: linear-gradient(135deg, #1a365d 0%, #0d1b2a 100%);
  border: 1px solid rgba(24, 144, 255, 0.2);
  border-radius: 12px;
  padding: 20px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(24, 144, 255, 0.2);
  color: #1890ff;
  font-size: 18px;
  font-weight: bold;
}

.status {
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 14px;
}

.status.正常 {
  background: rgba(82, 196, 26, 0.2);
  color: #52c41a;
}

.status.异常 {
  background: rgba(245, 34, 45, 0.2);
  color: #f5222d;
}

.data-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  margin: 20px 0;
}

.data-item {
  text-align: center;
  padding: 15px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
}

.label {
  font-size: 14px;
  color: #a0aec0;
  margin-bottom: 8px;
  font-weight: 500;
}

.value {
  font-size: 32px;
  font-weight: bold;
  color: #ffffff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.do-value {
  text-shadow: 0 0 10px currentColor;
}

.temp-value {
  color: #00d4ff;
}

.ph-value {
  color: #00ff88;
}

.unit {
  font-size: 14px;
  color: #a0aec0;
  margin-left: 5px;
  font-weight: normal;
}

.device-status {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 15px;
}

.tag {
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 12px;
}

.tag.success {
  background: rgba(82, 196, 26, 0.2);
  color: #52c41a;
}

.tag.info {
  background: rgba(24, 144, 255, 0.2);
  color: #1890ff;
}

.tag.danger {
  background: rgba(245, 34, 45, 0.2);
  color: #f5222d;
}

.tag.warning {
  background: rgba(250, 173, 20, 0.2);
  color: #faad14;
}

.btn-primary {
  display: block;
  width: 100%;
  margin-top: 15px;
  padding: 10px;
  background: #1890ff;
  color: #fff;
  border: none;
  border-radius: 4px;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-primary:hover {
  background: #40a9ff;
}

/* 图表区域 */
.chart-section {
  margin-bottom: 20px;
}

.chart-card {
  background: linear-gradient(135deg, #1a365d 0%, #0d1b2a 100%);
  border: 1px solid rgba(24, 144, 255, 0.2);
  border-radius: 12px;
  padding: 20px;
}

.chart-card h3 {
  color: #1890ff;
  margin-bottom: 15px;
  font-size: 16px;
}

/* 告警区域 */
.alerts-section {
  margin-bottom: 20px;
}

.alert-card {
  background: linear-gradient(135deg, #1a365d 0%, #0d1b2a 100%);
  border: 1px solid rgba(24, 144, 255, 0.2);
  border-radius: 12px;
  padding: 20px;
}

.alert-card h3 {
  color: #1890ff;
  margin-bottom: 15px;
  font-size: 16px;
}

/* 表格样式 */
.alert-table {
  width: 100%;
  border-collapse: collapse;
  background: transparent;
}

.alert-table th {
  background: rgba(24, 144, 255, 0.15);
  color: #1890ff;
  font-weight: bold;
  font-size: 14px;
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid rgba(24, 144, 255, 0.2);
}

.alert-table td {
  color: #e2e8f0;
  font-size: 13px;
  padding: 12px;
  border-bottom: 1px solid rgba(24, 144, 255, 0.1);
}

.alert-table tr:hover td {
  background: rgba(24, 144, 255, 0.08);
}

/* 池塘详情页 */
.pond-detail {
  padding: 0;
}

.realtime-section {
  margin-bottom: 20px;
}

.data-card {
  background: linear-gradient(135deg, #1a365d 0%, #0d1b2a 100%);
  border: 1px solid rgba(24, 144, 255, 0.2);
  text-align: center;
  padding: 20px;
  border-radius: 8px;
}

.control-section, .rule-section {
  margin-bottom: 20px;
}

/* 告警中心 */
.alerts-page {
  padding: 0;
}

.stats-cards {
  margin-bottom: 20px;
}

.stat-card {
  background: linear-gradient(135deg, #1a365d 0%, #0d1b2a 100%);
  border: 1px solid rgba(24, 144, 255, 0.2);
  text-align: center;
  padding: 20px;
  border-radius: 8px;
}

.stat-card.warning {
  border-color: rgba(250, 173, 20, 0.3);
}

.stat-card.danger {
  border-color: rgba(245, 34, 45, 0.3);
}

.stat-number {
  font-size: 48px;
  font-weight: bold;
  color: #1890ff;
  text-shadow: 0 2px 8px rgba(24, 144, 255, 0.4);
}

.stat-card.warning .stat-number {
  color: #faad14;
  text-shadow: 0 2px 8px rgba(250, 173, 20, 0.4);
}

.stat-card.danger .stat-number {
  color: #f5222d;
  text-shadow: 0 2px 8px rgba(245, 34, 45, 0.4);
}

.stat-label {
  font-size: 16px;
  color: #a0aec0;
  margin-top: 10px;
  font-weight: 500;
}

.filter-card {
  margin-bottom: 20px;
  background: linear-gradient(135deg, #1a365d 0%, #0d1b2a 100%);
  border: 1px solid rgba(24, 144, 255, 0.2);
  border-radius: 12px;
  padding: 20px;
}

.filter-row {
  display: flex;
  gap: 20px;
  align-items: center;
}

.filter-row select, .filter-row button {
  padding: 8px 16px;
  border-radius: 4px;
  border: 1px solid #1890ff;
  background: transparent;
  color: #fff;
  cursor: pointer;
}

.filter-row button {
  background: #1890ff;
  border: none;
}

.filter-row button:hover {
  background: #40a9ff;
}

.filter-row button.danger {
  background: #f5222d;
}

.filter-row button.danger:hover {
  background: #ff4d4f;
}

/* 系统管理 */
.system-page {
  padding: 0;
}

.video-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  background: linear-gradient(135deg, #1a365d 0%, #0d1b2a 100%);
  border: 1px solid rgba(24, 144, 255, 0.2);
  border-radius: 12px;
  min-height: 400px;
}

.placeholder-icon {
  font-size: 80px;
  margin-bottom: 20px;
  opacity: 0.6;
}

.video-placeholder h3 {
  color: #1890ff;
  font-size: 24px;
  margin-bottom: 10px;
}

.video-placeholder p {
  color: #a0aec0;
  font-size: 16px;
  margin: 5px 0;
}

.placeholder-desc {
  color: #666;
  font-size: 14px;
  margin-top: 15px;
  text-align: center;
  max-width: 500px;
}

/* Tabs样式 */
.tabs {
  background: linear-gradient(135deg, #1a365d 0%, #0d1b2a 100%);
  border: 1px solid rgba(24, 144, 255, 0.2);
  border-radius: 12px;
  overflow: hidden;
}

.tab-header {
  display: flex;
  background: rgba(24, 144, 255, 0.1);
  border-bottom: 1px solid rgba(24, 144, 255, 0.2);
}

.tab-btn {
  padding: 12px 24px;
  background: transparent;
  border: none;
  color: #a0aec0;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 14px;
}

.tab-btn:hover {
  color: #1890ff;
  background: rgba(24, 144, 255, 0.05);
}

.tab-btn.active {
  color: #1890ff;
  background: rgba(24, 144, 255, 0.15);
  font-weight: bold;
}

.tab-content {
  padding: 20px;
}

/* 响应式 */
@media (max-width: 768px) {
  .row {
    grid-template-columns: 1fr;
  }

  .data-grid {
    grid-template-columns: 1fr;
  }

  .header {
    flex-direction: column;
    height: auto;
    padding: 10px;
  }

  .nav-menu {
    flex-wrap: wrap;
    justify-content: center;
  }
}
