/* ============================================================
   layout.css — 顶栏、导航、主内容区、首页 Hero、仪表盘面板
   ============================================================ */

/* ---------- 深蓝顶栏（政务标准配色）---------- */
.topbar {
  height: 68px;
  background: linear-gradient(135deg, var(--gov-blue-dark) 0%, var(--gov-blue) 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  transition: height 0.5s cubic-bezier(0.4, 0, 0.2, 1), background 0.5s ease;
}

/* 首页 hero 模式 — Banner 铺满 + 政务蓝滤镜 */
html.is-dashboard .topbar {
  height: 60vh;
  transition: height 0.5s cubic-bezier(0.4, 0, 0.2, 1), background 0.5s ease;
  background:
    linear-gradient(180deg, rgba(20,100,200,0.35) 0%, rgba(10,70,160,0.55) 100%),
    linear-gradient(0deg, rgba(30,130,220,0.35) 0%, rgba(15,90,180,0.22) 100%),
    url('/image/banner.jpg') center / cover no-repeat;
  background-blend-mode: normal, overlay, normal;
}

html.is-dashboard .topbar-title-row { display: flex; animation: fadeSlideIn 0.4s ease both; }
html.is-dashboard .topbar-row1 { height: auto; align-items: center; padding: 18px 40px 0; }
html.is-dashboard .hero-kpi-row { display: flex; animation: fadeSlideIn 0.4s 0.1s ease both; }
html.is-dashboard .main-content { height: 40vh; transition: height 0.5s cubic-bezier(0.4, 0, 0.2, 1); }

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- 顶栏第一行 ---------- */
.topbar-row1 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 40px 0;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-user {
  font-size: 14px;
  color: rgba(255,255,255,0.85);
  letter-spacing: 1px;
}

/* ---------- 导航按钮 ---------- */
.topbar-nav {
  display: flex;
  align-items: center;
  gap: 16px;
}

.oval-btn {
  display: inline-block;
  padding: 9px 26px;
  font-size: 15px;
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.92);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.25s;
  font-weight: 400;
  letter-spacing: 2px;
  text-decoration: none;
  white-space: nowrap;
}

.oval-btn:hover {
  background: rgba(255,255,255,0.22);
  color: #fff;
  border-color: rgba(255,255,255,0.5);
}

.oval-btn.active {
  background: rgba(255,255,255,0.28);
  color: #fff;
  border-color: rgba(255,255,255,0.55);
  font-weight: 600;
}

.oval-btn.oval-home {
  font-weight: 600;
  padding: 9px 24px;
}

/* ---------- ghost 按钮 ---------- */
.ghost-btn {
  background: transparent;
  border-color: #92b4d6;
  color: #eaf2fa;
}

.ghost-btn-sm {
  padding: 4px 14px;
  font-size: 13px;
  border-radius: 50px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.3);
  color: rgba(255,255,255,0.85);
  cursor: pointer;
  transition: all 0.2s;
}

.ghost-btn-sm:hover {
  background: rgba(255,255,255,0.2);
  color: #fff;
}

/* ---------- 标题行 ---------- */
.topbar-title-row {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.topbar-title-row h1 {
  margin: 0;
  font-family: "Noto Serif SC", "STZhongsong", "SimSun", serif;
  font-size: 72px;
  font-weight: 900;
  letter-spacing: 20px;
  color: #fff;
  text-shadow:
    0 3px 10px rgba(0,0,0,0.95),
    0 0 60px rgba(0,0,0,0.5);
}

/* ---------- Hero 底部 KPI 指标 ---------- */
.hero-kpi-row { display: none; }

html.is-dashboard .hero-kpi-row {
  display: flex;
  gap: 14px;
  justify-content: center;
  padding: 0 40px 20px;
}

.hero-kpi-row .kpi-item {
  flex: 1;
  max-width: 150px;
  text-align: center;
  color: #fff;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 10px;
  padding: 12px 8px;
  backdrop-filter: blur(2px);
}

.hero-kpi-row .kpi-item .kpi-val {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
  text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.hero-kpi-row .kpi-item .kpi-label {
  font-size: 12px;
  opacity: 0.85;
  margin-top: 2px;
}

.hero-kpi-row .kpi-item.kpi-warn .kpi-val { color: #ffcccc; }

/* ---------- 主内容区 ---------- */
.main-content { overflow-y: auto; }
.content { padding: 20px 24px; }

.tab { display: none; }
.tab.active { display: block !important; }

/* ---------- 首页下半部分 ---------- */
.home-panels { height: calc(40vh - 40px); }
.home-panels-grid { display: flex; gap: 16px; height: 100%; }

/* -------- 行业方形卡片 -------- */
.home-panel-card {
  flex: 1;
  height: 100%;
  background: #fff;
  border: none;
  border-left: 5px solid transparent;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 0;
  cursor: pointer;
  transition: all 0.2s;
  padding: 18px 20px;
  text-align: left;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  overflow: hidden;
}

.home-panel-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

.home-panel-card .hp-icon-wrap {
  width: 52px; height: 52px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  margin-bottom: 14px;
  background: #f3f6fb;
}

.home-panel-card .hp-body { width: 100%; }

.home-panel-card strong {
  font-size: 17px; color: #1d2a38;
  display: block; margin-bottom: 4px;
}

.home-panel-card small {
  font-size: 12px; color: #95a5b8;
  display: block; margin-bottom: 10px;
}

.home-panel-card .hp-stats {
  display: flex; align-items: center; gap: 0;
  font-size: 12px; color: #607286;
}

.home-panel-card .hp-stats em {
  font-style: normal; font-weight: 700; font-size: 15px;
  color: #0b5cab; margin: 0 3px;
}

.home-panel-card .hp-divider { color: #d7e0ea; margin: 0 8px; }

/* 行业颜色 */
.hp-coal       { border-left-color: #4a5568; }
.hp-construct  { border-left-color: #e67e22; }
.hp-manufacture { border-left-color: #2e86de; }
.hp-service    { border-left-color: #10ac84; }
.hp-other      { border-left-color: #a55eea; }

/* -------- 预警竖矩形卡 -------- */
.home-panel-warn {
  width: 240px; flex-shrink: 0; height: 100%;
  background: linear-gradient(180deg, #f9fafc 0%, #fff 100%);
  border: none;
  border-left: 5px solid #e74c3c;
  border-radius: 10px;
  cursor: pointer;
  display: flex; flex-direction: column;
  padding: 20px 22px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  transition: all 0.2s;
  overflow: hidden;
}

.home-panel-warn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

.home-panel-warn .warn-header { margin-bottom: 16px; }

.home-panel-warn .warn-header strong {
  font-size: 17px; color: #1d2a38;
  display: flex; align-items: center; gap: 10px;
}

.home-panel-warn .warn-header .warn-badge {
  background: #e74c3c; color: #fff;
  padding: 3px 14px; border-radius: 99px;
  font-size: 13px; font-weight: 600;
}

.home-panel-warn .warn-items {
  flex: 1;
  display: flex; flex-direction: column; gap: 4px;
}

.home-panel-warn .warn-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 9px 0; border-bottom: 1px solid #f0f2f5; font-size: 13px;
}

.home-panel-warn .warn-item span:first-child { color: #607286; }
.home-panel-warn .warn-item span:last-child { font-weight: 700; color: #1d2a38; font-size: 16px; }
.home-panel-warn .warn-item.danger span:last-child { color: #e74c3c; }

.home-panel-warn .warn-footer {
  margin-top: 10px; text-align: right;
  font-size: 13px; color: #0b5cab; font-weight: 500;
}
