* { box-sizing: border-box; }
:root { --brand-green: #0E8F73; }
body { font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Microsoft YaHei", sans-serif; margin: 0; padding: 0; background: #f7f7f9; min-height: 100vh; }
.container { width: min(92vw, 1600px); max-width: 1600px; margin: 0 auto; padding: 40px 32px 40px; position: relative; }
.header-bar { display: grid; grid-template-columns: auto 1fr auto; align-items: center; column-gap: 16px; margin-bottom: 32px; position: relative; }
.page-title { margin: 0; font-size: 44px; line-height: 60px; color: var(--brand-green); position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); white-space: nowrap; }
.logo { height: 60px; }
.refresh-btn { position: absolute; right: 24px; top: 40px; padding: 10px 18px; background: #2563eb; color: #fff; border: none; border-radius: 8px; cursor: pointer; font-size: 14px; }
.refresh-btn:hover { background: #1d4ed8; }

/* 数据展示区域 */
.data-display { display: flex; flex-direction: column; gap: 34px; margin-bottom: 46px; }

/* 模块标题 */
.module-section { background: #fff; border: 1px solid #e5e7eb; border-radius: 16px; padding: 28px; box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08); }
.module-title { margin: 0 0 22px 0; font-size: 26px; font-weight: 700; color: var(--brand-green); text-align: center; border-bottom: 2px solid #dbeafe; padding-bottom: 12px; }

/* 模块网格 */
.module-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }

/* 参数模块 */
.param-module { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; padding: 18px; text-align: center; transition: all 0.2s ease; }
.param-module:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); }
.param-label { font-size: 18px; font-weight: 600; color: #475569; margin-bottom: 10px; }
.param-value { font-size: 40px; font-weight: 700; color: #1e293b; margin-bottom: 6px; }
.param-unit { font-size: 16px; color: #64748b; font-weight: 500; }

/* 时间信息 */
.time-info { text-align: center; margin-top: 34px; padding: 24px; background: #fff; border: 1px solid #e5e7eb; border-radius: 16px; line-height: 1.4; }
.data-time { font-size: 18px; color: #475569; margin-bottom: 12px; white-space: nowrap; }
.beijing-time { font-size: 20px; font-weight: 700; color: var(--brand-green); white-space: nowrap; }

/* 固定时间信息（底部） */
.time-info-fixed {
  text-align: center;
  margin-top: 20px;
  margin-bottom: 48px;
  color: inherit;
}

/* Admin button & modal */
.admin-btn { position: fixed; right: 12px; bottom: 12px; opacity: 0.25; background: #374151; border-color: #374151; z-index: 1001; }
.admin-btn:hover { opacity: 0.6; }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.2); display: grid; place-items: center; z-index: 1000; }
.modal[hidden] { display: none; }
.modal-content { width: 520px; max-width: calc(100% - 24px); background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; padding: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.form-row label { display: flex; flex-direction: column; gap: 6px; }
.form-row textarea { width: 100%; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; border: 1px solid #ddd; border-radius: 6px; padding: 8px; }
.form-row input { border: 1px solid #ddd; border-radius: 6px; padding: 6px; }
.actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }
.status { margin-left: auto; font-size: 12px; color: #6b7280; }
.status.err { color: #b00020; }
.status.ok { color: #137333; }

/* 参数配置编辑器 */
.p-row {
  display: grid;
  grid-template-columns: 220px 200px 180px 120px 100px;
  gap: 25px;
  align-items: center;
  margin-bottom: 12px;
  padding: 12px;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
}

.p-row input, .p-row select {
  width: 100%;
  padding: 8px;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  font-size: 14px;
}

.p-del {
  padding: 8px 12px;
  background: #ef4444;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
}

/* 园区控制样式 */
.park-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
  margin-bottom: 20px;
  padding: 10px;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.park-btn {
  padding: 6px 12px;
  background: #3b82f6;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
}

.park-btn:hover {
  background: #2563eb;
}

#park-info {
  font-weight: 600;
  color: #475569;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .container { padding: 16px 12px 24px; width: 100%; }
  .module-grid { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
  .param-value { font-size: 26px; }
  .param-label { font-size: 15px; }
  .module-section { padding: 16px; }
  .page-title { font-size: 22px; margin-top: 10px; }
  .park-controls { flex-direction: column; gap: 10px; }
}

/* 轮询状态指示器 */
.polling-indicator {
  text-align: center;
  font-size: 14px;
  color: #64748b;
  margin-top: 10px;
}

/* 园区配置样式 */
.park-config-section {
  margin-top: 15px;
  padding: 15px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.park-config-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.park-config-header h3 {
  margin: 0;
  font-size: 16px;
  color: var(--brand-green);
}

#add-park-btn {
  padding: 6px 12px;
  background: #3b82f6;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
}

#add-park-btn:hover {
  background: #2563eb;
}

.park-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 15px;
}

.park-item {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 15px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  align-items: center;
}

.park-item input {
  padding: 6px;
  border: 1px solid #ddd;
  border-radius: 4px;
  width: 100%;
}

.park-item-header {
  grid-column: 1 / span 4;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid #f1f5f9;
}

.park-item-title {
  font-weight: 600;
  color: #334155;
}

.remove-park-btn {
  padding: 4px 8px;
  background: #ef4444;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
}

.remove-park-btn:hover {
  background: #dc2626;
}

.park-config-help {
  font-size: 12px;
  color: #64748b;
  background: #f1f5f9;
  padding: 10px;
  border-radius: 4px;
}

.park-config-help p {
  margin: 0;
}

@media (max-width: 768px) {
  .park-item {
    grid-template-columns: 1fr 1fr;
  }
  .park-item-header {
    grid-column: 1 / span 2;
  }
}

/* 大屏优化（1920x1080 及以上） */
@media (min-width: 1400px) {
  .container { width: min(90vw, 1600px); }
  .module-grid { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; }
  .param-value { font-size: 42px; }
  .param-label { font-size: 19px; }
}

@media (min-height: 900px) and (max-height: 1080px) {
  .container { width: min(99.5vw, 1920px); padding-top: 28px; padding-bottom: 40px; }
  .header-bar { margin-bottom: 18px; }
  .page-title { font-size: 38px; line-height: 56px; }
  .data-display { gap: 18px; margin-bottom: 0; }
  .module-section { padding: 24px; }
  .module-title { margin-bottom: 10px; font-size: 23px; }
  .module-grid { grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 18px; }
  .param-module { padding: 18px; }
  .param-value { font-size: 42px; }
  .param-label { font-size: 18px; }
  .param-unit { font-size: 16px; }
  .module-section .time-info { padding: 8px 6px 4px; }
  .module-section .data-time { font-size: 16px; margin-bottom: 8px; }
  .module-section .beijing-time { font-size: 18px; }
  .module-section:last-of-type { padding-bottom: 0; }
  .module-section:last-of-type .time-info { padding-bottom: 0; }
}

/* 时间信息合并到模块样式 */
.module-section .time-info {
  background: transparent;
  border: 0;
  border-top: 1px solid #e5e7eb;
  border-radius: 0;
  margin-top: 18px;
  padding: 14px 8px 6px;
}
