/* ============================================
   国家级零碳园区跟踪 · styles.css
   清新 / 简洁 / 绿色低碳。克制的现代感，信息密度优先。
   类名严格对齐 app.js 实际输出的 markup。
   ============================================ */

:root {
  /* 配色 token */
  --bg: #faf4ec;          /* 浅杏色正文底，与白色卡片区分层次 */
  --surface: #ffffff;
  --surface-soft: #f9fafb;
  --border: #e6eaef;
  --border-strong: #d7dde5;
  --text: #1f2a37;
  --text-body: #384250;
  --text-muted: #6b7480;
  --text-faint: #9aa3af;
  --primary: #2c4a75;          /* 藏蓝 */
  --primary-strong: #223a5d;
  --primary-weak: #edf2f8;
  --primary-line: #b9c9e0;
  --warning: #c2790a;
  --warning-weak: #fdf4e3;

  /* 尺寸 / 阴影 */
  --radius: 10px;
  --radius-sm: 6px;
  --radius-xs: 4px;
  --shadow-sm: 0 1px 2px rgba(17, 24, 39, .04);
  --shadow: 0 1px 3px rgba(17, 24, 39, .06);
  --gutter: max(24px, calc((100% - 1200px) / 2));
  --mono: ui-monospace, "SF Mono", "SFMono-Regular", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: system-ui, -apple-system, "PingFang SC", "Segoe UI", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text-body);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-strong); text-decoration: underline; }

::selection { background: var(--primary-weak); }

h1, h2, h3, h4 { color: var(--text); font-weight: 600; }

/* 全站横向留白节奏：背景铺满、内容居中限宽 1200 */
.header,
#stats-bar,
#view-overview,
#view-park,
#view-module,
.footer {
  padding-inline: var(--gutter);
}

/* ---------- Header ---------- */
.header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding-block: 18px 14px;
}

.header h1 {
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 4px;
  letter-spacing: -.01em;
}

.header .subtitle {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--text-muted);
}

.topnav {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 3px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 15px;
}

.topnav a {
  display: inline-block;
  padding: 6px 15px;
  border-radius: 12px;
  font-size: 13px;
  color: var(--text-body);
  background: transparent;
  transition: background .15s ease, color .15s ease, box-shadow .15s ease;
  white-space: nowrap;
}

.topnav a:hover {
  background: var(--surface);
  color: var(--primary);
  text-decoration: none;
}

.topnav a.active {
  background: var(--primary);
  color: #fff;
  font-weight: 500;
  box-shadow: var(--shadow-sm);
}

/* ---------- 统计条 ---------- */
#stats-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding-block: 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.stat-card {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: border-color .12s ease;
}

.stat-card:hover { border-color: var(--border-strong); }

.stat-card .stat-value {
  font-size: 26px;
  font-weight: 650;
  line-height: 1.15;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
}

.stat-card .stat-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
}

/* ---------- View 区块 ---------- */
#view-overview,
#view-park,
#view-module {
  padding-block: 22px 8px;
}

/* ---------- 总览布局 ---------- */
/* 资讯主栏（左）+ 地图（右）；地图 sticky 随资讯滚动保持可见 */
.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, 1fr);
  gap: 20px;
  margin-bottom: 18px;
  align-items: start;
}

.map-panel,
.table-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.feed-panel { min-width: 0; }               /* readhub 式主栏：flat，无卡片边框 */
.map-panel { position: sticky; top: 72px; }

.table-panel { margin-bottom: 22px; }

.map-panel h3,
.feed-panel h3,
.table-panel h3 {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

/* 面板小标题：左侧绿色标记 */
.feed-panel h3,
.table-panel h3 {
  padding-left: 10px;
  border-left: 3px solid var(--primary);
  line-height: 1.2;
}

/* ---------- 地图 ---------- */
#map {
  height: 500px;
  width: 100%;
}

#map-legend { margin-top: 12px; }

.map-legend-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-muted);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .9);
}

/* 筛选行 */
.filter-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.filter-row label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.filter-row select {
  padding: 5px 26px 5px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 13px;
  background: var(--surface);
  color: var(--text-body);
  font-family: inherit;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%236b7480' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

.filter-row select:hover { border-color: var(--primary-line); }
.filter-row select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-weak);
}

/* ---------- 进展流（readhub 式，随页滚动，不做内部滚动框） ---------- */
#updates-feed { }

.update-item {
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  background: var(--surface-soft);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 13px;
  transition: background .12s ease;
}

.update-item:hover { background: var(--primary-weak); }

.update-item .ud-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 3px;
}

.update-item .ud-date {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

.update-item .ud-park {
  color: var(--primary-strong);
  font-weight: 500;
}

.update-item .ud-title {
  color: var(--text);
  line-height: 1.5;
  margin-bottom: 2px;
}

.update-item .ud-status {
  font-size: 12px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.update-item .src-link {
  color: var(--primary);
  font-size: 12px;
  margin-left: 4px;
}

/* ---------- Chips / 小标签 ---------- */
.chip {
  display: inline-block;
  background: var(--primary-weak);
  color: var(--primary-strong);
  border: 1px solid var(--primary-line);
  border-radius: var(--radius-xs);
  padding: 1px 8px;
  font-size: 11.5px;
  line-height: 1.6;
  white-space: nowrap;
}

.chip.neutral {
  background: var(--surface-soft);
  color: var(--text-muted);
  border-color: var(--border);
}

.chip-pending {
  display: inline-block;
  background: var(--warning-weak);
  color: var(--warning);
  border: 1px solid #f0dcae;
  border-radius: var(--radius-xs);
  padding: 0 6px;
  font-size: 11px;
  line-height: 1.7;
  white-space: nowrap;
  vertical-align: 1px;
}

/* ---------- 占位 / 空态 ---------- */
.placeholder {
  color: var(--text-muted);
  font-size: 13px;
}

.placeholder.center {
  text-align: center;
  padding: 44px 20px;
  color: var(--text-faint);
  background: var(--surface-soft);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
}

/* ---------- 表格通用 ---------- */
.table-wrap { width: 100%; }

#parks-table,
.detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

#parks-table th,
#parks-table td,
.detail-table th,
.detail-table td {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

#parks-table thead th,
.detail-table thead th {
  background: var(--surface-soft);
  font-weight: 500;
  color: var(--text-muted);
  font-size: 12px;
  white-space: nowrap;
  border-bottom: 1px solid var(--border-strong);
}

/* 园区总表：表头吸顶 */
#parks-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  box-shadow: inset 0 -1px 0 var(--border-strong);
}

#parks-table tbody tr,
.detail-table tbody tr { transition: background .1s ease; }

#parks-table tbody tr:hover,
.detail-table tbody tr:hover { background: var(--surface-soft); }

#parks-table tbody tr:last-child td,
.detail-table tbody tr:last-child td { border-bottom: none; }

#parks-table th.sortable {
  cursor: pointer;
  user-select: none;
}

#parks-table th.sortable:hover { color: var(--primary-strong); }
#parks-table th.sortable::after {
  content: "↕";
  font-size: 10px;
  color: var(--text-faint);
  margin-left: 4px;
}

/* 类型色标 */
.type-pill {
  display: inline-block;
  color: #fff;
  font-size: 11px;
  line-height: 1.6;
  padding: 1px 8px;
  border-radius: var(--radius-xs);
  white-space: nowrap;
}

.tag-links a { margin-right: 2px; }
.tag-links { line-height: 1.9; }

/* ---------- 园区档案 ---------- */
#park-detail {
  max-width: 900px;
}

.back-nav { margin: 0 0 6px; }

.back-link {
  display: inline-block;
  font-size: 13px;
  color: var(--text-muted);
}
.back-link:hover { color: var(--primary-strong); }

.park-title {
  font-size: 22px;
  font-weight: 650;
  margin: 4px 0 20px;
  letter-spacing: -.01em;
}

.section { margin-bottom: 26px; }

.section h3 {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 12px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.section p { margin: 0 0 10px; line-height: 1.75; }
.section p:last-child { margin-bottom: 0; }

.section .note {
  color: var(--text-faint);
  font-size: 12px;
  margin-top: 8px;
}

/* chips 在段落中排布 */
.section .chip { margin: 0 2px 4px 0; }

.enrich-block {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary-line);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 12px 14px;
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--text-body);
}

/* 时间线 */
.timeline {
  list-style: none;
  padding: 0;
  margin: 4px 0 0;
}

.timeline li {
  position: relative;
  padding: 4px 0 12px 18px;
  border-left: 2px solid var(--border-strong);
  margin-left: 3px;
}

.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }

.timeline li::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 2px var(--surface);
}

.timeline .tl-date {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-faint);
  margin-right: 8px;
  font-variant-numeric: tabular-nums;
}

.timeline .tl-status {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 3px;
  line-height: 1.6;
}

/* 来源列表 */
.src-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.src-list li {
  padding: 3px 0;
  font-size: 12px;
  word-break: break-all;
}

/* ---------- 模块页 ---------- */
#view-module { padding-block: 22px 8px; }

.module-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.module-tabs .tab {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 13px;
  transition: all .12s ease;
}

.module-tabs .tab:hover {
  background: var(--surface-soft);
  color: var(--text);
  text-decoration: none;
  border-color: var(--border-strong);
}

.module-tabs .tab.active {
  background: var(--primary-weak);
  color: var(--primary-strong);
  border-color: var(--primary-line);
  font-weight: 500;
}

.module-title {
  font-size: 19px;
  font-weight: 650;
  margin: 0 0 16px;
  letter-spacing: -.01em;
}

#view-module h3 {
  font-size: 14px;
  font-weight: 600;
  margin: 22px 0 12px;
}

#view-module .note {
  color: var(--text-faint);
  font-size: 12px;
  margin-top: 12px;
}

/* 文章列表（政策 / 周报） */
.article-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.article-list li {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.article-list li:last-child { border-bottom: none; }

.article-list .art-date {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-faint);
  margin-right: 8px;
}

.article-list .art-sum {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.6;
}

/* 融资富化卡 */
.enrich-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-top: 10px;
  box-shadow: var(--shadow-sm);
}

.enrich-card h4 { font-size: 13px; margin: 0 0 6px; }
.enrich-card p { margin: 0; font-size: 13px; line-height: 1.7; color: var(--text-body); }

/* ---------- 可借鉴方案 ---------- */
.lesson-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.lesson-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  transition: border-color .12s ease;
}

.lesson-card:hover { border-color: var(--primary-line); }

.lesson-park { font-weight: 600; margin-bottom: 8px; font-size: 14px; }
.lesson-park a { color: var(--text); }
.lesson-park a:hover { color: var(--primary-strong); }

.lesson-meta {
  color: var(--text-faint);
  font-weight: 400;
  font-size: 12px;
  margin-left: 6px;
}

.lesson-text {
  margin: 0;
  font-size: 13px;
  line-height: 1.75;
  color: var(--text-body);
}

.lesson-text strong { color: var(--text); font-weight: 600; }
.lesson-text a { font-size: 11px; color: var(--primary); margin-left: 4px; }

/* ---------- Footer ---------- */
.footer {
  text-align: center;
  padding-block: 20px;
  font-size: 12px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  background: var(--surface);
  margin-top: 32px;
}

/* ---------- 细滚动条 ---------- */
#updates-feed::-webkit-scrollbar,
.table-wrap::-webkit-scrollbar { width: 6px; height: 6px; }
#updates-feed::-webkit-scrollbar-thumb,
.table-wrap::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }

/* ============================================
   响应式
   ============================================ */

/* 平板及以下：总览单列，统计 2×2 */
@media (max-width: 900px) {
  .overview-grid { grid-template-columns: minmax(0, 1fr); }
  #stats-bar { grid-template-columns: repeat(2, 1fr); }
  #map { height: 440px; }
  #updates-feed { max-height: 380px; }
  .lesson-grid { grid-template-columns: 1fr; }
  .header,
  #stats-bar,
  #view-overview,
  #view-park,
  #view-module,
  .footer { padding-inline: 18px; }
  /* 表头吸顶在滚动容器内意义有限，narrow 下取消固定避免错位 */
  #parks-table thead th { position: static; }
  /* 表格横向滚动（平板起） */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  #parks-table, .detail-table { min-width: 620px; }
}

/* 手机：顶部导航横向滚动、表格横向滚动、边距收紧 */
@media (max-width: 640px) {
  body { font-size: 13.5px; }

  .header,
  #stats-bar,
  #view-overview,
  #view-park,
  #view-module,
  .footer { padding-inline: 14px; }

  .header h1 { font-size: 18px; }

  .topnav {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    margin-inline: -14px;
    padding-inline: 14px;
  }
  .topnav::-webkit-scrollbar { display: none; }
  .topnav a { flex: 0 0 auto; }

  #stats-bar { gap: 10px; }
  .stat-card { padding: 12px 13px; }
  .stat-card .stat-value { font-size: 22px; }

  #map { height: 320px; }

  .map-panel,
  .updates-panel,
  .table-panel { padding: 13px; }

  /* 表格横向滚动（继承 900 断点，收紧字号） */
  #parks-table,
  .detail-table { font-size: 12.5px; }
  #parks-table th,
  #parks-table td,
  .detail-table th,
  .detail-table td { padding: 6px 9px; }

  .park-title { font-size: 19px; }
  .module-title { font-size: 17px; }

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

/* ===== 专题报告文档 ===== */
.report-doc {
  margin-top: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.report-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 20px;
  background: var(--surface-soft);
  border-bottom: 1px solid var(--border);
}
.report-head h3 { margin: 0; font-size: 15px; }
.report-meta { font-size: 12px; color: var(--text-faint); font-family: var(--mono); }
.report-body {
  padding: 8px 24px 24px;
  max-width: 860px;
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--text-body);
}
.report-body h2 { font-size: 17px; margin: 26px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.report-body h3 { font-size: 15px; margin: 20px 0 8px; }
.report-body h4, .report-body h5 { font-size: 13.5px; margin: 16px 0 6px; }
.report-body p { margin: 8px 0; }
.report-body ul, .report-body ol { margin: 8px 0; padding-left: 22px; }
.report-body li { margin: 4px 0; }
.report-body blockquote {
  margin: 12px 0;
  padding: 8px 14px;
  border-left: 3px solid var(--primary-line);
  background: var(--primary-weak);
  border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
  color: var(--text-muted);
  font-size: 12.5px;
}
.report-body blockquote p { margin: 4px 0; }
.report-body hr { border: 0; border-top: 1px solid var(--border); margin: 20px 0; }
.report-body code {
  font-family: var(--mono);
  font-size: 12px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 1px 5px;
}
.report-body table {
  border-collapse: collapse;
  font-size: 12.5px;
  width: 100%;
}
.report-body th, .report-body td {
  border: 1px solid var(--border);
  padding: 6px 10px;
  text-align: left;
  vertical-align: top;
}
.report-body th { background: var(--surface-soft); color: var(--text-muted); font-weight: 500; }
.report-body a { word-break: break-all; }
@media (max-width: 640px) {
  .report-body { padding: 4px 14px 16px; }
}

/* ============================================
   功能批新增组件 + 深色模式
   ============================================ */

/* ---------- Header 工具区 ---------- */
.header-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.header-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 2px;
}
.theme-toggle {
  padding: 6px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-body);
  font-size: 12.5px;
  font-family: inherit;
  cursor: pointer;
  transition: border-color .12s ease, color .12s ease;
  white-space: nowrap;
}
.theme-toggle:hover { border-color: var(--primary-line); color: var(--primary); }

/* ---------- 全局搜索 ---------- */
.search-box {
  position: relative;
  display: flex;
  align-items: center;
  width: 300px;
}
.search-icon {
  position: absolute;
  left: 11px;
  color: var(--text-faint);
  pointer-events: none;
}
.search-box input {
  width: 100%;
  padding: 7px 12px 7px 33px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-body);
  font-size: 13px;
  font-family: inherit;
}
.search-box input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-weak);
}
.search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 50;
  max-height: 420px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: 0 6px 24px rgba(17, 24, 39, .10);
}
.sr-group { padding: 6px 0; border-bottom: 1px solid var(--border); }
.sr-group:last-child { border-bottom: none; }
.sr-label {
  padding: 4px 14px 2px;
  font-size: 11px;
  color: var(--text-faint);
  letter-spacing: .05em;
}
.sr-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 14px;
  font-size: 13px;
  color: var(--text);
}
.sr-item:hover { background: var(--primary-weak); text-decoration: none; }
.sr-meta { font-size: 11.5px; color: var(--text-faint); white-space: nowrap; }
.sr-empty { padding: 16px 14px; font-size: 13px; color: var(--text-muted); text-align: center; }

/* ---------- 进展流筛选 / 加载更多 ---------- */
.updates-filter { display: inline-flex; gap: 4px; margin-bottom: 10px; }
.uf-btn {
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
}
.uf-btn:hover { border-color: var(--primary-line); color: var(--primary); }
.uf-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.updates-more { margin-top: 10px; text-align: center; }
.more-btn {
  padding: 6px 18px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--primary);
  font-size: 12.5px;
  font-family: inherit;
  cursor: pointer;
}
.more-btn:hover { border-color: var(--primary); background: var(--primary-weak); }
.more-count { display: block; margin-top: 6px; font-size: 11.5px; color: var(--text-faint); }

/* ---------- 园区档案：锚点条 / 上下园区 ---------- */
.park-anchors {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 14px 0 20px;
}
.pk-anchor {
  padding: 4px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
}
.pk-anchor:hover {
  border-color: var(--primary-line);
  color: var(--primary);
  text-decoration: none;
}
.park-prevnext {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 26px 0 10px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 13.5px;
}

/* ---------- 企业模块 ---------- */
.comp-name { font-weight: 600; color: var(--text); white-space: nowrap; }
.comp-parks { line-height: 1.9; }

/* ---------- 深色模式 ---------- */
html[data-theme="dark"] {
  --bg: #12181f;
  --surface: #1a222c;
  --surface-soft: #161e27;
  --border: #2a3542;
  --border-strong: #374457;
  --text: #e2e8f0;
  --text-body: #cbd5e1;
  --text-muted: #8b98a8;
  --text-faint: #64748b;
  --primary: #7fa3d4;
  --primary-strong: #a6c3e8;
  --primary-weak: #1d2b3d;
  --primary-line: #33507a;
  --warning: #e0a03a;
  --warning-weak: #2e2413;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow: 0 1px 3px rgba(0, 0, 0, .35);
}
html[data-theme="dark"] .topnav a.active,
html[data-theme="dark"] .uf-btn.active {
  color: #12181f;
}
html[data-theme="dark"] .legend-dot { box-shadow: 0 0 0 1px rgba(0, 0, 0, .5); }
html[data-theme="dark"] .search-results { box-shadow: 0 6px 24px rgba(0, 0, 0, .5); }
html[data-theme="dark"] .filter-row select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%238b98a8' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
}

/* ---------- 响应式补充 ---------- */
@media (max-width: 900px) {
  .header-bar { flex-direction: column; }
  .header-tools { width: 100%; }
  .search-box { flex: 1; width: auto; }
}

@media (max-width: 640px) {
  /* 胶囊导航容器：内部横滚，不撑破页面 */
  .topnav {
    display: flex;
    max-width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .topnav::-webkit-scrollbar { display: none; }
}

/* ===== 政策模块 ===== */
.art-group-title {
  font-size: 15px;
  margin: 24px 0 10px;
  padding-left: 10px;
  border-left: 3px solid var(--primary);
}
.art-count {
  margin-left: 8px;
  font-size: 12px;
  font-weight: 400;
  color: var(--text-faint);
  font-family: var(--mono);
}
.art-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 8px;
}
.art-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.art-date {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.art-title { font-size: 13.5px; font-weight: 500; color: var(--text); }
.art-title:hover { color: var(--primary); }
.score-badge {
  margin-left: auto;
  padding: 1px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 11px;
  font-family: var(--mono);
  color: var(--text-faint);
}
.score-badge.hot {
  border-color: var(--warning);
  color: var(--warning);
  background: var(--warning-weak);
}
.art-sum { margin-top: 4px; font-size: 12.5px; color: var(--text-muted); line-height: 1.6; }
.art-src { color: var(--text-faint); font-size: 11.5px; font-family: var(--mono); margin-left: 6px; }
.art-parks { margin-top: 6px; }
.chip-link { cursor: pointer; }
.chip-link:hover { text-decoration: none; filter: brightness(.95); }

/* ===== 园区档案卡片化 ===== */
.park-sections {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}
.park-sections .section {
  grid-column: span 2;
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 0 18px 16px;
  overflow: hidden;
}
.park-sections .section.half { grid-column: span 1; }
.park-sections .section > h3 {
  margin: 0 -18px 14px;
  padding: 11px 18px 10px;
  background: var(--surface-soft);
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
}
.park-sections .enrich-block {
  border-left: 3px solid var(--primary-line);
  background: var(--primary-weak);
  border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
  padding: 10px 14px;
  line-height: 1.8;
  font-size: 13px;
}
@media (max-width: 900px) {
  .park-sections { gap: 10px; }
  .park-sections .section.half { grid-column: span 2; }
}

/* 卡片化后放开档案页阅读宽度限制（卡片自身控制行长） */
#park-detail { max-width: none; }

/* ============================================
   视觉升级：磨砂玻璃 + igdp 卡片 + 呼吸灯
   ============================================ */

/* ---------- 磨砂玻璃吸顶头部 ---------- */
.header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, .5);
  -webkit-backdrop-filter: blur(14px) saturate(1.5);
  backdrop-filter: blur(14px) saturate(1.5);
}
html[data-theme="dark"] .header {
  background: rgba(18, 24, 31, .5);
}
.search-results {
  background: rgba(255, 255, 255, .5);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  backdrop-filter: blur(16px) saturate(1.4);
}
html[data-theme="dark"] .search-results {
  background: rgba(26, 34, 44, .5);
}

/* ---------- igdp 风格统计卡 ---------- */
.stat-card {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  padding: 16px 18px;
  background: linear-gradient(150deg, var(--surface) 55%, var(--surface-soft));
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(44, 74, 117, .10);
  border-color: var(--primary-line);
}
.stat-blob {
  position: absolute;
  top: -26px;
  right: -26px;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: var(--primary-weak);
  opacity: .8;
  pointer-events: none;
}
.stat-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  position: relative;
}
.stat-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--primary-weak);
  color: var(--primary);
}
.stat-card .stat-label { margin: 0; font-size: 12.5px; }
.stat-card .stat-value {
  font-size: 30px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -.02em;
  position: relative;
}
html[data-theme="dark"] .stat-card:hover { box-shadow: 0 6px 18px rgba(0, 0, 0, .4); }

/* ---------- 呼吸灯 ---------- */
.live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 8px var(--primary);
  margin-right: 7px;
  vertical-align: 1px;
  animation: breathe 2s ease-in-out infinite;
}
@keyframes breathe {
  0%, 100% { opacity: 1; box-shadow: 0 0 8px var(--primary); }
  50% { opacity: .35; box-shadow: 0 0 2px var(--primary); }
}

/* ---------- 置信徽标（Climate TRACE 式） ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 1px 9px 1px 7px;
  border-radius: 999px;
  font-size: 11px;
  white-space: nowrap;
  border: 1px solid;
}
.badge i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}
.badge-verified {
  color: #0e7a4d;
  border-color: rgba(14, 122, 77, .35);
  background: rgba(14, 122, 77, .08);
}
.badge-verified i { background: #0e9f63; }
.badge-pending {
  color: var(--warning);
  border-color: rgba(194, 121, 10, .35);
  background: var(--warning-weak);
}
.badge-pending i {
  background: var(--warning);
  animation: breathe 2.6s ease-in-out infinite;
}
html[data-theme="dark"] .badge-verified {
  color: #4ade80;
  border-color: rgba(74, 222, 128, .3);
  background: rgba(74, 222, 128, .08);
}

/* ---------- 政策筛选条（IEA 式） ---------- */
.policy-filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 12px;
  margin-bottom: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.pf-chip {
  padding: 3px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  transition: all .12s ease;
}
.pf-chip:hover { border-color: var(--primary-line); color: var(--primary); }
.pf-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
html[data-theme="dark"] .pf-chip.active { color: #12181f; }
.pf-sep {
  width: 1px;
  height: 16px;
  background: var(--border-strong);
  margin: 0 4px;
}
.pf-count {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--text-faint);
  font-family: var(--mono);
}

/* ---------- 动效克制 ---------- */
@media (prefers-reduced-motion: reduce) {
  .live-dot, .badge-pending i { animation: none; }
  .stat-card:hover { transform: none; }
}

/* ===== 滚动加载哨兵 ===== */
.scroll-sentinel {
  padding: 18px 0 26px;
  text-align: center;
  font-size: 12.5px;
  color: var(--text-faint);
}

/* ===== readhub 式折叠条目 ===== */
.collapsible { cursor: pointer; position: relative; }
.collapsible > .ud-meta::after,
.collapsible > .art-head::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 14px;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid var(--text-faint);
  border-bottom: 1.5px solid var(--text-faint);
  transform: rotate(45deg);
  transition: transform .15s ease;
}
.collapsible.open > .ud-meta::after,
.collapsible.open > .art-head::after {
  transform: rotate(225deg);
  top: 17px;
}
.ud-extra, .art-extra { display: none; }
.collapsible.open .ud-extra,
.collapsible.open .art-extra { display: block; margin-top: 6px; }
.update-item .ud-status { white-space: normal; }
.ud-foot { margin-top: 4px; display: flex; align-items: center; gap: 8px; }
.art-foot {
  margin-top: 6px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12px;
}
.art-link { font-weight: 500; }
.art-item .art-head { padding-right: 22px; }
.update-item .ud-meta { padding-right: 22px; }
.art-item:hover { border-color: var(--primary-line); }

/* ===== 专题报告分节折叠 ===== */
.doc-sec {
  border-top: 1px solid var(--border);
  margin: 0 -24px;
  padding: 0 24px;
}
.doc-sec summary {
  cursor: pointer;
  list-style: none;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  padding: 13px 26px 13px 0;
  position: relative;
  user-select: none;
}
.doc-sec summary::-webkit-details-marker { display: none; }
.doc-sec summary::after {
  content: "";
  position: absolute;
  right: 8px;
  top: 18px;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid var(--text-faint);
  border-bottom: 1.5px solid var(--text-faint);
  transform: rotate(45deg);
  transition: transform .15s ease;
}
.doc-sec[open] summary::after { transform: rotate(225deg); top: 21px; }
.doc-sec summary:hover { color: var(--primary); }
.doc-sec-body { padding-bottom: 14px; }
.report-body .doc-sec > summary + .doc-sec-body > h3:first-child { display: none; }
@media (max-width: 640px) {
  .doc-sec { margin: 0 -14px; padding: 0 14px; }
}

/* ===== 报告补充层（来源/提醒 折叠） ===== */
.doc-more {
  margin: 10px 0 16px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}
.doc-more summary {
  cursor: pointer;
  list-style: none;
  font-size: 12px;
  color: var(--text-faint);
  padding: 7px 12px;
  user-select: none;
}
.doc-more summary::-webkit-details-marker { display: none; }
.doc-more summary::before { content: "▸ "; }
.doc-more[open] summary::before { content: "▾ "; }
.doc-more summary:hover { color: var(--primary); }
.doc-more > *:not(summary) { padding: 0 14px; }
.doc-more[open] { padding-bottom: 8px; }

/* ===== readhub 式纯排版政策列表（覆盖此前卡片样式） ===== */
.art-item {
  background: none;
  border: none;
  border-radius: 0;
  border-bottom: 1px solid var(--border);
  padding: 15px 2px 14px;
  margin-bottom: 0;
}
.art-item:hover { border-color: var(--border); background: none; }
.art-item .art-head { padding-right: 0; gap: 10px; }
.art-item .art-head::after { content: none; }
.art-title { font-size: 15px; font-weight: 600; color: var(--text); line-height: 1.5; }
.art-item:hover .art-title { color: var(--primary); }
.art-date { font-size: 12px; }
.art-item .score-badge { margin-left: 0; }
/* 收起态：摘要截两行 */
.art-sum {
  margin-top: 6px;
  font-size: 13.5px;
  line-height: 1.85;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.art-item.open .art-sum { display: block; -webkit-line-clamp: unset; overflow: visible; }
.art-extra { margin-top: 10px; }
.src-line {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  font-size: 13.5px;
  color: var(--text-faint);
}
.src-line a { color: var(--text-body); }
.src-line a:hover { color: var(--primary); }
.src-line .art-src { font-size: 12.5px; color: var(--text-faint); margin-left: 2px; }
.art-parks { margin-top: 8px; }

/* 报告补充层去箱化：灰字开关 + 正常文流 */
.doc-more {
  border: none;
  background: none;
  border-radius: 0;
  margin: 6px 0 14px;
}
.doc-more summary { padding: 4px 0; }
.doc-more > *:not(summary) { padding: 0; }
.doc-more[open] { padding-bottom: 0; }
.doc-more[open] > *:not(summary) {
  border-left: 2px solid var(--border-strong);
  padding-left: 14px;
  margin-left: 2px;
}

/* ===== readhub 式相关条目时间线 ===== */
.rel-head {
  margin: 14px 0 6px;
  font-size: 12.5px;
  color: var(--text-faint);
  display: flex;
  align-items: center;
  gap: 6px;
}
.rel-timeline { position: relative; }
.rel-item {
  display: grid;
  grid-template-columns: 88px 14px 1fr;
  align-items: baseline;
  gap: 8px;
  padding: 6px 0;
  position: relative;
}
.rel-date {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.rel-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--border-strong);
  justify-self: center;
  align-self: center;
  position: relative;
  z-index: 1;
}
/* 圆点之间的竖向连线 */
.rel-item::before {
  content: "";
  position: absolute;
  left: calc(88px + 8px + 6.5px);
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--border);
}
.rel-item:first-child::before { top: 50%; }
.rel-item:last-child::before { bottom: 50%; }
.rel-item:only-child::before { display: none; }
.rel-item a { font-size: 13.5px; color: var(--text-body); }
.rel-item a:hover { color: var(--primary); }
@media (max-width: 640px) {
  .rel-item { grid-template-columns: 76px 12px 1fr; }
  .rel-item::before { left: calc(76px + 8px + 5.5px); }
}

/* ===== readhub 精确对齐：白底阅读栏 + 大字号灰阶排版 ===== */
.policy-read {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 40px 26px;
  max-width: 880px;
}
.policy-read .art-group-title {
  border-left: none;
  padding-left: 0;
  margin: 30px 0 2px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-faint);
  letter-spacing: .04em;
}
.policy-read .art-item {
  padding: 26px 0 24px;
  border-bottom: 1px solid var(--border);
}
.policy-read .art-item:last-child { border-bottom: none; }
.policy-read .art-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -.01em;
}
.policy-read .art-item:hover .art-title { color: var(--text); }
.policy-read .art-item.open .art-title,
.policy-read .art-title:hover { color: var(--primary); }
.policy-read .art-date {
  font-size: 13px;
  color: var(--text-faint);
  margin-left: 6px;
  font-family: inherit;
}
.policy-read .art-sum {
  margin-top: 10px;
  font-size: 15.5px;
  line-height: 1.9;
  color: var(--text-body);
}
.policy-read .art-extra { margin-top: 18px; }
.policy-read .src-line { font-size: 14.5px; padding: 6px 0; }
.policy-read .src-line a { color: var(--text-body); text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 4px; }
.policy-read .src-line a:hover { color: var(--primary); text-decoration-color: var(--primary-line); }
.policy-read .rel-item a { font-size: 14.5px; }
.policy-read .rel-item { padding: 8px 0; }
.policy-read .art-parks { margin-top: 10px; }
@media (max-width: 900px) {
  .policy-read { padding: 4px 18px 18px; }
  .policy-read .art-title { font-size: 16px; }
  .policy-read .art-sum { font-size: 15px; }
}

/* ============================================
   readhub 式资讯条目（最新进展）
   ============================================ */
.feed-item {
  padding: 20px 4px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .2s ease;
}
.feed-item:first-child { padding-top: 4px; }
.feed-item:hover .feed-title { color: var(--primary); }

.feed-head { display: flex; align-items: baseline; gap: 12px; }
.feed-title {
  font-size: 16.5px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.55;
  flex: 1;
  min-width: 0;
  margin: 0;
}
.feed-time {
  font-size: 12.5px;
  color: var(--text-faint);
  white-space: nowrap;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
/* 收起态：摘要截 3 行 */
.feed-summary {
  margin: 8px 0 0;
  font-size: 14.5px;
  line-height: 1.8;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.feed-item.expanded .feed-summary { -webkit-line-clamp: unset; overflow: visible; }

.feed-meta {
  margin-top: 9px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 10px;
}
.feed-park {
  font-size: 13px;
  font-weight: 500;
  color: var(--primary-strong);
}
.feed-park:hover { color: var(--primary); text-decoration: none; }
.feed-tag {
  font-size: 12px;
  color: var(--primary);
  background: var(--primary-weak);
  border: 1px solid var(--primary-line);
  padding: 1px 8px;
  border-radius: var(--radius-xs);
}
.feed-source { font-size: 12.5px; color: var(--text-faint); font-family: var(--mono); }
.feed-source:hover { color: var(--primary); }

/* 展开：仿原站 grid-rows 高度动画 */
.expand-wrap {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .28s ease;
}
.expand-wrap > .expand-inner { overflow: hidden; min-height: 0; }
.feed-item.expanded .expand-wrap { grid-template-rows: 1fr; }

.related-label {
  margin: 15px 0 6px;
  font-size: 12.5px;
  color: var(--text-faint);
  display: flex;
  align-items: center;
  gap: 6px;
}
.related-list { position: relative; }
.related-list::before {
  content: "";
  position: absolute;
  left: 97px; top: 12px; bottom: 12px;
  width: 1px;
  background: var(--border);
}
.related-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
  font-size: 13.5px;
}
.related-date {
  width: 82px;
  flex-shrink: 0;
  text-align: right;
  color: var(--text-faint);
  font-size: 12px;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.related-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--border-strong);
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}
.related-title { color: var(--text-body); }
.related-footer {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
}
.view-park { font-size: 13px; color: var(--primary); }
.view-park .arrow { display: inline-block; transition: transform .15s ease; }
.view-park:hover .arrow { transform: translateX(3px); }

/* 响应式：窄屏单列（资讯在上、地图在下），地图取消 sticky */
@media (max-width: 900px) {
  .overview-grid { grid-template-columns: minmax(0, 1fr); }
  .map-panel { position: static; }
  .feed-title { font-size: 16px; }
  .feed-summary { font-size: 14px; }
}
