/* ============================================================
   国内低空经济案例地图 · 样式
   设计语言：纸本雅致 · 衬线标题 · 墨色字 · 靛蓝赭金
   ============================================================ */

:root {
  /* 基色 */
  --bg: #F4F1EA;
  --bg-soft: #EDE8DC;
  --bg-card: #FFFFFF;
  --bg-elevated: #FBF9F3;

  /* 文字 */
  --ink: #1F2937;
  --ink-soft: #4B5563;
  --ink-faint: #9CA3AF;
  --ink-mute: #6B7280;

  /* 线条与边框 */
  --line: #E2DCCB;
  --line-soft: #ECE7D8;
  --line-strong: #D4CCB6;

  /* 主色 */
  --accent: #1E3A8A;          /* 靛蓝 */
  --accent-soft: #3B5BB8;
  --accent-deep: #152C6E;
  --gold: #B89055;            /* 赭金 */
  --gold-soft: #D4B06A;
  --danger: #B23A48;
  --map-empty: #EAE4D2;

  /* 阴影与圆角 */
  --shadow-xs: 0 1px 2px rgba(31, 41, 55, 0.04);
  --shadow-sm: 0 2px 8px rgba(31, 41, 55, 0.06);
  --shadow-md: 0 8px 24px rgba(31, 41, 55, 0.08);
  --shadow-lg: 0 18px 50px rgba(15, 23, 42, 0.18);

  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  background:
    radial-gradient(ellipse at top left, rgba(184, 144, 85, 0.06), transparent 50%),
    radial-gradient(ellipse at bottom right, rgba(30, 58, 138, 0.05), transparent 50%),
    var(--bg);
  background-attachment: fixed;
  color: var(--ink);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.page { max-width: 1320px; margin: 0 auto; padding: 0 32px 80px; }

/* ============ Hero ============ */
.hero {
  position: relative;
  padding: 64px 0 38px;
  border-bottom: 1px solid var(--line);
}
.hero::before {
  content: "";
  position: absolute;
  top: 64px;
  left: 0;
  width: 4px;
  height: 56px;
  background: linear-gradient(180deg, var(--accent), var(--gold));
  border-radius: 2px;
}
.hero-manage-link {
  position: absolute;
  top: 64px;
  right: 0;
  font-size: 13px;
  color: var(--ink-mute);
  text-decoration: none;
  padding: 6px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--bg-card);
  transition: all 0.2s var(--ease);
  letter-spacing: 1px;
}
.hero-manage-link:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
  box-shadow: var(--shadow-xs);
}
.hero-inner { padding-left: 20px; }
.site-title {
  font-family: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", serif;
  font-size: 44px;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--ink);
  position: relative;
  display: inline-block;
  line-height: 1.2;
}
.site-title::after {
  content: " ·";
  color: var(--gold);
  font-weight: 400;
  font-size: 36px;
}
.lede {
  margin-top: 18px;
  max-width: 880px;
  font-size: 15.5px;
  color: var(--ink-soft);
  line-height: 1.85;
}
.stats {
  display: flex;
  gap: 56px;
  margin-top: 32px;
}
.stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat-num {
  font-family: "Georgia", "Times New Roman", "Noto Serif SC", serif;
  font-size: 36px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  letter-spacing: -0.5px;
}
.stat-label {
  font-size: 13px;
  color: var(--ink-mute);
  letter-spacing: 2px;
}

/* ============ 更新控制栏 ============ */
.update-bar {
  padding: 20px 0 6px;
  border-bottom: 1px solid var(--line);
}
.update-bar-inner {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  flex-wrap: wrap;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow-xs);
}
.update-field { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 220px; }
.update-field-narrow { flex: none; width: 200px; }
.update-label {
  font-size: 12px;
  color: var(--ink-mute);
  letter-spacing: 1px;
  font-weight: 600;
}
.update-input {
  padding: 10px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  font-size: 14px;
  background: var(--bg-elevated);
  color: var(--ink);
  outline: none;
  transition: all 0.2s var(--ease);
  font-family: inherit;
}
.update-input:focus {
  border-color: var(--accent);
  background: var(--bg-card);
  box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.12);
}
.update-btn {
  flex: none;
  padding: 10px 22px;
  border: 1px solid var(--gold);
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--gold), var(--gold-soft));
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  font-family: inherit;
  letter-spacing: 1px;
  box-shadow: 0 2px 8px rgba(184, 144, 85, 0.25);
}
.update-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(184, 144, 85, 0.35);
}
.update-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.update-hint {
  flex-basis: 100%;
  font-size: 12px;
  color: var(--ink-faint);
}

/* ============ 筛选区 ============ */
.filters {
  padding: 26px 0 22px;
  border-bottom: 1px solid var(--line);
}
.filter-group {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 14px;
}
.filter-label {
  flex: none;
  width: 76px;
  font-size: 12px;
  color: var(--ink-faint);
  letter-spacing: 2px;
  padding-top: 6px;
  text-transform: uppercase;
  font-weight: 600;
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--line-strong);
  background: var(--bg-card);
  color: var(--ink);
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  font-family: inherit;
}
.chip:hover {
  border-color: var(--accent-soft);
  color: var(--accent-soft);
  transform: translateY(-1px);
  box-shadow: var(--shadow-xs);
}
.chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(30, 58, 138, 0.25);
}

.search-row { align-items: center; margin-top: 6px; }
.search-wrap { position: relative; flex: 1; max-width: 440px; }
#search-input {
  width: 100%;
  padding: 11px 16px 11px 40px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  font-size: 14px;
  background: var(--bg-card);
  color: var(--ink);
  outline: none;
  transition: all 0.2s var(--ease);
  font-family: inherit;
}
.search-wrap::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='8'/><line x1='21' y1='21' x2='16.65' y2='16.65'/></svg>");
  background-size: contain;
  background-repeat: no-repeat;
  pointer-events: none;
}
#search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.12);
}
.suggestions {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  list-style: none;
  max-height: 280px;
  overflow: auto;
  display: none;
  z-index: 30;
  padding: 4px 0;
}
.suggestions.visible { display: block; }
.suggestions li {
  padding: 9px 16px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.12s var(--ease);
}
.suggestions li:hover { background: var(--bg-soft); }
.suggestions mark {
  background: linear-gradient(180deg, transparent 60%, rgba(184, 144, 85, 0.35) 60%);
  color: inherit;
  padding: 0 1px;
}
.search-btn {
  padding: 11px 22px;
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  font-family: inherit;
  letter-spacing: 1px;
}
.search-btn:hover {
  background: var(--accent-deep);
  border-color: var(--accent-deep);
  box-shadow: 0 4px 12px rgba(30, 58, 138, 0.25);
  transform: translateY(-1px);
}
.reset-btn {
  padding: 11px 20px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink-soft);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  font-family: inherit;
}
.reset-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.filter-status {
  margin-top: 6px;
  font-size: 13px;
  color: var(--ink-soft);
}
.filter-status .fs-title { font-weight: 600; color: var(--ink); }

/* ============ 主体布局 ============ */
.viewport {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 32px;
  padding-top: 32px;
  align-items: start;
}
.viewport.view-detail {
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
}

.map-section { position: relative; }
.map-wrapper {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}
.map-wrapper svg {
  width: 100%;
  height: auto;
  display: block;
}
.map-tooltip {
  position: absolute;
  pointer-events: none;
  background: rgba(15, 23, 42, 0.92);
  color: #fff;
  padding: 7px 13px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.18s var(--ease);
  z-index: 10;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.map-tooltip.visible { opacity: 1; }
.map-tooltip .count {
  font-weight: 700;
  margin-left: 6px;
  color: var(--gold-soft);
}

/* 地图路径 */
.province {
  stroke: #FFFFFF;
  stroke-width: 0.7;
  cursor: pointer;
  transition: filter 0.18s var(--ease);
}
.province.empty { fill: var(--map-empty); cursor: default; }
.province:hover:not(.empty) { filter: brightness(1.06) saturate(1.05); }
.province.active {
  stroke: var(--accent);
  stroke-width: 1.8;
}
.province-label {
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 10px;
  fill: #4A453D;
  text-anchor: middle;
  pointer-events: none;
}
.province-label.major { font-size: 12px; font-weight: 700; }

/* ============ 案例面板 ============ */
.panel-section { min-height: 320px; }

.panel-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.back-link {
  border: none;
  background: transparent;
  color: var(--accent);
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
  padding: 6px 0;
  transition: color 0.15s var(--ease);
  font-family: inherit;
}
.back-link:hover { color: var(--accent-deep); text-decoration: underline; }
.panel-title { display: flex; align-items: baseline; gap: 12px; flex: 1; }
.panel-title h2 {
  font-family: "Noto Serif SC", "Songti SC", "STSong", serif;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 1px;
}
.panel-count {
  font-size: 13px;
  color: var(--ink-faint);
  background: var(--bg-soft);
  padding: 2px 10px;
  border-radius: 999px;
}
.panel-search-hint { font-size: 13px; color: var(--ink-soft); }

.cases-list { display: flex; flex-direction: column; gap: 12px; }
.case-card {
  display: flex;
  gap: 16px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  position: relative;
  overflow: hidden;
}
.case-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--gold);
  opacity: 0;
  transition: opacity 0.2s var(--ease);
}
.case-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--line-strong);
  transform: translateY(-2px);
}
.case-card:hover::before { opacity: 1; }

.case-headshot { flex: none; }
.case-headshot-img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: var(--radius-sm);
}
.case-headshot-placeholder {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  font-family: "Noto Serif SC", "Songti SC", serif;
}

.case-body { min-width: 0; flex: 1; }
.case-card-row1 { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.case-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--ink);
}
.case-year {
  flex: none;
  font-family: "Georgia", serif;
  color: var(--gold);
  font-size: 15px;
  font-weight: 700;
}
.case-court-line {
  margin-top: 5px;
  font-size: 13px;
  color: var(--ink-soft);
}
.case-number {
  margin-top: 2px;
  font-size: 12px;
  color: var(--ink-faint);
  font-family: "Consolas", "Menlo", monospace;
}
.case-meta { margin-top: 10px; display: flex; gap: 6px; flex-wrap: wrap; }
.case-tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  color: #fff;
  background: var(--gold);
}
.case-tag.status-pending {
  background: var(--accent-soft);
}
.case-note {
  margin-top: 10px;
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.empty-state {
  padding: 64px 24px;
  text-align: center;
  color: var(--ink-faint);
  background: var(--bg-card);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  font-size: 14px;
  line-height: 1.8;
}

/* ---- 省份视图：法院分组 ---- */
.courts-list { display: flex; flex-direction: column; gap: 14px; }
.court-block {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  transition: border-color 0.2s var(--ease);
}
.court-block:hover { border-color: var(--line-strong); }
.court-block.special {
  border-color: var(--accent-soft);
  background: linear-gradient(180deg, #fff 0%, #F8FAFD 100%);
}
.court-block-head { display: flex; align-items: baseline; gap: 12px; }
.court-special-badge {
  font-size: 11px;
  background: var(--accent);
  color: #fff;
  padding: 2px 8px;
  border-radius: var(--radius-xs);
  letter-spacing: 1px;
}
.court-name {
  font-size: 16px;
  font-weight: 700;
  font-family: "Noto Serif SC", "Songti SC", serif;
}
.court-count-label { font-size: 13px; color: var(--ink-faint); }
.court-count-label .ccl-num {
  font-weight: 700;
  color: var(--accent);
  font-family: "Georgia", serif;
  margin-right: 2px;
}
.court-case-peek {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-top: 10px;
  padding: 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.18s var(--ease);
}
.court-case-peek:hover { background: var(--bg-soft); }
.cc-peek-thumb .case-headshot-img,
.cc-peek-thumb .case-headshot-placeholder {
  width: 40px;
  height: 40px;
  font-size: 16px;
  border-radius: var(--radius-xs);
}
.cc-peek-title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--ink);
}
.cc-peek-meta { margin-top: 3px; font-size: 12px; color: var(--ink-soft); }
.cc-insight-btn {
  display: inline-block;
  margin-left: 6px;
  font-size: 11px;
  color: var(--accent);
  text-decoration: none;
  border: 1px solid var(--accent-soft);
  padding: 1px 8px;
  border-radius: var(--radius-xs);
  transition: all 0.18s var(--ease);
}
.cc-insight-btn:hover { background: var(--accent); color: #fff; }

/* ============ 弹窗 ============ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 24px;
  animation: fade-in 0.25s var(--ease);
}
.modal-backdrop.visible { display: flex; }
.modal {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  max-width: 640px;
  width: 100%;
  max-height: 86vh;
  overflow: auto;
  padding: 32px 36px;
  position: relative;
  box-shadow: var(--shadow-lg);
  animation: modal-pop 0.28s var(--ease);
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-pop {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-close {
  position: absolute;
  top: 16px;
  right: 20px;
  width: 32px;
  height: 32px;
  border: none;
  background: var(--bg-soft);
  border-radius: 50%;
  font-size: 18px;
  color: var(--ink-soft);
  cursor: pointer;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s var(--ease);
}
.modal-close:hover {
  background: var(--accent);
  color: #fff;
  transform: rotate(90deg);
}

.modal-eyebrow {
  font-size: 12px;
  color: var(--ink-faint);
  margin-bottom: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-weight: 600;
}
.modal-header-flex { display: flex; gap: 18px; align-items: flex-start; }
.modal-headshot { flex: none; }
.modal-headshot .case-headshot-img,
.modal-headshot .case-headshot-placeholder {
  width: 84px;
  height: 84px;
  font-size: 32px;
  border-radius: var(--radius-sm);
}
.modal-title {
  font-family: "Noto Serif SC", "Songti SC", "STSong", serif;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 1px;
}
.modal-tags { margin-top: 12px; display: flex; gap: 6px; flex-wrap: wrap; }
.modal-meta {
  margin-top: 24px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px 20px;
  padding: 18px 20px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
}
.modal-meta-label {
  font-size: 12px;
  color: var(--ink-faint);
  letter-spacing: 1px;
  padding-top: 2px;
}
.modal-meta-value { font-size: 14px; color: var(--ink); }
.modal-meta-value.mono { font-family: "Consolas", "Menlo", monospace; }
.modal-note {
  margin-top: 20px;
  padding: 16px 18px;
  background: var(--bg-elevated);
  border-left: 3px solid var(--gold);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 14px;
  color: var(--ink);
  line-height: 1.85;
}
.modal-actions { margin-top: 26px; display: flex; gap: 12px; }
.modal-link-btn,
.modal-insight-btn {
  display: inline-block;
  padding: 11px 24px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-size: 14px;
  transition: all 0.2s var(--ease);
  letter-spacing: 1px;
}
.modal-link-btn {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(30, 58, 138, 0.2);
}
.modal-link-btn:hover {
  background: var(--accent-deep);
  box-shadow: 0 4px 12px rgba(30, 58, 138, 0.3);
  transform: translateY(-1px);
}
.modal-insight-btn {
  border: 1px solid var(--accent);
  color: var(--accent);
}
.modal-insight-btn:hover {
  background: var(--accent);
  color: #fff;
}

/* ============ 页脚 ============ */
.footer {
  margin-top: 56px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.85;
}
.footer .disclaimer { max-width: 920px; }
.footer-credit { margin-top: 12px; color: var(--ink-faint); }

/* ============ 响应式 ============ */
@media (max-width: 980px) {
  .page { padding: 0 20px 60px; }
  .viewport, .viewport.view-detail { grid-template-columns: 1fr; }
  .stats { gap: 36px; }
  .site-title { font-size: 32px; letter-spacing: 2px; }
  .site-title::after { font-size: 26px; }
  .hero { padding: 40px 0 26px; }
  .hero::before { top: 40px; height: 44px; }
  .hero-manage-link { top: 40px; font-size: 12px; padding: 5px 12px; }
  .modal { padding: 24px 20px; }
}
@media (max-width: 560px) {
  .page { padding: 0 14px 40px; }
  .hero { padding-top: 32px; }
  .hero::before { display: none; }
  .hero-inner { padding-left: 0; }
  .stats { flex-wrap: wrap; gap: 20px 28px; }
  .stat-num { font-size: 28px; }
  .filter-label { display: none; }
  .search-row { flex-wrap: wrap; }
  .search-wrap { max-width: 100%; flex-basis: 100%; }
  .map-wrapper { padding: 10px; }
  .modal { padding: 22px 18px; }
  .modal-header-flex { flex-direction: column; gap: 12px; }
  .panel-title h2 { font-size: 20px; }
}
