/* ============================================================
   临港供暖接续保障 · 共享亮色主题
   适用页面：index.html（全域总览）/ projects.html（能源站列表）/ project.html（项目数字孪生）
   ============================================================ */
:root {
  --bg: #edf1f7;
  --panel: #ffffff;
  --panel2: #f4f7fb;
  --line: #d8e0ea;
  --txt: #22303f;
  --dim: #64748b;
  --faint: #7c8fa5;
  --cyan: #0e7490;
  --orange: #f59e0b;
  --gold: #b45309;
  --green: #0fb981;
  --blue: #0891b2;
  --red: #0891b2;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  background-image:
    radial-gradient(1100px 520px at 85% -80px, rgba(14, 116, 144, .08), transparent 62%),
    radial-gradient(900px 480px at -10% 32%, rgba(8,145,178, .05), transparent 62%);
  background-attachment: fixed;
  color: var(--txt);
  min-height: 100vh;
  overflow-x: hidden;
}
.wrap { position: relative; max-width: 1280px; margin: 0 auto; padding: 0 24px 80px; }

/* ===== 顶部 ===== */
header { padding: 40px 0 6px; }
header.center { text-align: center; }
.brand-badge {
  display: inline-flex; align-items: center; gap: 10px; padding: 7px 18px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--panel); box-shadow: 0 1px 3px rgba(27, 40, 55, .06);
  font-size: 12px; letter-spacing: 5px; color: var(--dim); text-transform: uppercase;
}
.brand-badge b {
  min-width: 26px; height: 26px; padding: 0 6px; border-radius: 8px; display: grid; place-items: center;
  background: linear-gradient(135deg, #f59e0b, #b45309); color: #fff; font-size: 10.5px; font-weight: 800; letter-spacing: 0;
}
h1 {
  margin-top: 20px; font-size: clamp(28px, 4.6vw, 46px); font-weight: 800; letter-spacing: 2px; line-height: 1.2;
  background: linear-gradient(92deg, #0b2b45 15%, #0891b2 48%, #00c2d1 85%);
  background-size: 220% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: sheen 7s linear infinite;
}
@keyframes sheen { to { background-position: 220% 0; } }
h1 small { font-size: 14px; color: var(--dim); font-weight: 400; margin-left: 12px; letter-spacing: 0; }
.sub { margin-top: 12px; font-size: 15px; color: var(--dim); letter-spacing: 1px; }
.sub em { color: var(--cyan); font-style: normal; font-weight: 600; }
.crumb { font-size: 13px; color: var(--faint); margin-bottom: 14px; }
.crumb a { color: var(--cyan); text-decoration: none; }
.crumb a:hover { text-decoration: underline; }

/* ===== 统计卡 ===== */
.stats { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin: 30px 0 0; }
.stats.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.stat {
  min-width: 130px; padding: 14px 20px; border-radius: 14px; text-align: center;
  border: 1px solid var(--line); background: var(--panel); box-shadow: 0 1px 3px rgba(27, 40, 55, .05);
  position: relative; overflow: hidden; transition: transform .2s ease, box-shadow .2s ease;
}
.stat::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, rgba(14, 116, 144, .55), rgba(180, 83, 9, .55));
  opacity: 0; transition: opacity .2s ease;
}
.stat:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(27, 40, 55, .1); }
.stat:hover::before { opacity: 1; }
.stat b { display: block; font-size: 24px; font-weight: 800; color: var(--gold); }
.stat b i { font-style: normal; font-size: 13px; color: var(--dim); margin-left: 2px; }
.stat span { display: block; font-size: 12px; color: var(--faint); letter-spacing: 1px; margin-top: 2px; }
.stat.cy b { color: var(--cyan); } .stat.gr b { color: var(--green); } .stat.or b { color: var(--orange); }

/* ===== 导航 ===== */
.nav {
  position: sticky; top: 12px; z-index: 20; margin: 30px auto; width: fit-content; max-width: 100%;
  display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; padding: 8px; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, .92); backdrop-filter: blur(14px);
  box-shadow: 0 4px 16px rgba(27, 40, 55, .08);
}
.nav a { padding: 8px 18px; border-radius: 999px; font-size: 13px; color: var(--dim); text-decoration: none; letter-spacing: 1px; transition: .2s; white-space: nowrap; flex: none; }
.nav a:hover { color: var(--txt); background: rgba(14, 116, 144, .1); }
.nav a.on { background: var(--cyan); color: #fff; font-weight: 600; }
.nav a.page-link { color: var(--cyan); font-weight: 600; }

/* ===== 区块 ===== */
section { margin: 52px 0; }
.sec-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 22px; flex-wrap: wrap; }
.sec-head h2 { font-size: 26px; font-weight: 800; letter-spacing: 2px; position: relative; padding-bottom: 9px; }
.sec-head h2::before { content: "◆ "; color: var(--cyan); font-size: 18px; }
.sec-head h2::after { content: ""; position: absolute; left: 2px; bottom: 0; width: 46px; height: 3px;
  border-radius: 2px; background: linear-gradient(90deg, var(--cyan), rgba(14, 116, 144, 0)); }
.sec-head p { color: var(--faint); font-size: 13px; letter-spacing: 1px; }
.panel {
  border: 1px solid var(--line); border-radius: 18px; background: var(--panel);
  box-shadow: 0 1px 4px rgba(27, 40, 55, .05); padding: 22px;
}

/* ===== 表格 ===== */
table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
th, td { padding: 7px 8px; text-align: right; border-bottom: 1px solid #e6edf4; }
th:first-child, td:first-child { text-align: left; }
th { color: var(--faint); font-weight: 600; font-size: 11.5px; white-space: nowrap; }
td { color: var(--dim); }
td b { color: var(--txt); font-weight: 600; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11px; border: 1px solid; background: #fff; white-space: nowrap; }
.tbl-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
tbody tr { transition: background .15s ease; }
tbody tr:hover { background: rgba(14, 116, 144, .045); }

/* ===== 图表与条形 ===== */
.chart { width: 100%; height: auto; }
.bar-row { display: grid; grid-template-columns: 110px 1fr 150px; gap: 10px; align-items: center; margin: 7px 0; font-size: 13px; }
.bar-row .lbl { color: var(--dim); white-space: nowrap; }
.bar-track { height: 20px; border-radius: 6px; background: #e9eff6; overflow: hidden; display: flex; }
.bar-fill { height: 100%; border-radius: 0; transition: width 1s cubic-bezier(.22,.8,.32,1); }
.bar-val { font-size: 12px; color: var(--faint); white-space: nowrap; }
.bar-val b { color: var(--txt); font-size: 13px; }

/* ===== 指标卡 ===== */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 20px; }
.card2 {
  border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; background: var(--panel);
  box-shadow: 0 1px 3px rgba(27, 40, 55, .05); transition: transform .2s ease, box-shadow .2s ease;
}
.card2:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(27, 40, 55, .1); }
.card2 b { display: block; font-size: 24px; font-weight: 800; }
.card2 span { font-size: 12px; color: var(--faint); letter-spacing: 1px; }
.c-cyan b { color: var(--cyan); } .c-gold b { color: var(--gold); } .c-green b { color: var(--green); } .c-orange b { color: var(--orange); }

.kpi { border: 1px solid var(--line); border-radius: 14px; padding: 14px 18px; background: var(--panel2);
  transition: transform .2s ease, box-shadow .2s ease; }
.kpi:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(27, 40, 55, .09); }
.kpi b { font-size: 26px; font-weight: 800; color: var(--green); }
.kpi span { display: block; font-size: 12px; color: var(--faint); margin-top: 2px; word-break: break-all; overflow-wrap: break-word; }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 18px; }

/* ===== 控件 ===== */
.ctrl { margin: 14px 0; }
.ctrl label { display: flex; justify-content: space-between; font-size: 13px; color: var(--dim); margin-bottom: 6px; }
.ctrl label output { color: var(--cyan); font-weight: 700; }
.ctrl input[type=range] { width: 100%; accent-color: var(--cyan); }
.ctrl-hint { font-size: 12px; color: var(--faint); padding: 4px 0; }
.formula { font-size: 12.5px; color: var(--faint); line-height: 1.9; margin-top: 14px; }
.formula code { color: var(--dim); background: rgba(14, 116, 144, .08); padding: 1px 6px; border-radius: 5px; }

/* ===== 按钮 ===== */
.btn {
  display: inline-block; padding: 10px 26px; border-radius: 999px; font-size: 14px; font-weight: 600;
  color: #fff; background: var(--cyan); text-decoration: none; letter-spacing: 1px; white-space: nowrap;
  box-shadow: 0 3px 10px rgba(14, 116, 144, .3); transition: .2s;
}
.btn:hover { background: #155e75; box-shadow: 0 4px 14px rgba(14, 116, 144, .4); }
.seg { display: flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--panel); max-width: 100%; }
.seg button { padding: 6px 14px; font-size: 12.5px; background: none; border: none; color: var(--dim); cursor: pointer; white-space: nowrap; flex: none; }
.seg button.on { background: rgba(14, 116, 144, .14); color: var(--cyan); font-weight: 600; }
.seg button:hover:not(.on) { background: rgba(14, 116, 144, .06); }

/* ===== 流程步骤 ===== */
.flow { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; counter-reset: step; }
.flow .step {
  position: relative; border: 1px solid var(--line); border-radius: 14px; padding: 16px 14px 14px;
  background: var(--panel2);
}
.flow .step::before {
  counter-increment: step; content: counter(step); position: absolute; top: -11px; left: 14px;
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800;
  background: linear-gradient(135deg, #0e7490, #00c2d1); color: #fff;
}
.flow .step b { display: block; font-size: 14px; margin-bottom: 6px; color: var(--cyan); }
.flow .step p { font-size: 12px; color: var(--dim); line-height: 1.7; }

.note-list { font-size: 13px; color: var(--dim); line-height: 2; padding-left: 18px; }
.note-list li::marker { color: var(--cyan); }
.note-list b { color: var(--txt); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 960px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* ===== 页脚 ===== */
.foot { margin-top: 70px; text-align: center; font-size: 12px; color: var(--faint); line-height: 2; }
.foot b { color: var(--dim); }
.err { padding: 60px 0; text-align: center; color: var(--faint); }

/* ===== 手机端适配（≤768px） ===== */
@media (max-width: 768px) {
  .wrap { padding: 0 12px 48px; }
  header { padding: 26px 0 4px; }
  .sub { font-size: 13px; }
  .stats { gap: 8px; margin-top: 20px; }
  .stat { min-width: 0; flex: 1 1 calc(50% - 8px); padding: 10px 12px; }
  .stat b { font-size: 19px; }
  .nav { width: 100%; flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto;
    -webkit-overflow-scrolling: touch; border-radius: 14px; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { flex-shrink: 0; padding: 8px 14px; font-size: 12px; }
  section { margin: 36px 0; }
  .sec-head h2 { font-size: 20px; }
  .panel { padding: 14px; border-radius: 14px; }
  .cards { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
  .card2 { padding: 12px 14px; }
  .card2 b { font-size: 19px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .kpi { padding: 10px 12px; }
  .kpi b { font-size: 19px; }
  .bar-row { grid-template-columns: 76px 1fr 110px; gap: 8px; font-size: 12px; }
  .bar-val b { font-size: 12px; }
  table { font-size: 12px; }
  th { font-size: 12px; }
  .tbl-scroll table { min-width: 600px; }
  .foot { margin-top: 44px; }
}
