/* ========================================
   中国古诗地图 - 古典水墨风格样式
   ======================================== */

/* === CSS Custom Properties (Ink-Wash Palette) === */
:root {
  --ink-black: #1a1a1a;
  --ink-dark: #2d2d2d;
  --ink-medium: #4a4a4a;
  --ink-light: #6b6b6b;
  --ink-faint: #9a9a9a;
  --paper-white: #f5f0e8;
  --paper-light: #faf7f2;
  --paper-dark: #e8e0d0;
  --seal-red: #c23a2e;
  --libai-blue: #2c5f7c;
  --dufu-brown: #8b4513;
  --wangwei-green: #2e8b57;
  --gaoshi-orange: #cd853f;
  --meeting-gold: #d4a843;
  --font-body: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  --font-poem: "KaiTi", "STKaiti", "楷体", "SimSun", serif;
  --panel-width: 340px;
  --header-height: 64px;
}

/* === Global Reset & Base === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: var(--font-body);
  background-color: var(--paper-white);
  color: var(--ink-dark);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* === Header === */
.header {
  height: var(--header-height);
  background: linear-gradient(135deg, var(--ink-black) 0%, #2a2a2a 50%, var(--ink-medium) 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  color: var(--paper-white);
  position: relative;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.header::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, var(--seal-red) 50%, transparent 100%);
}

.header-left {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.header-title {
  font-family: var(--font-poem);
  font-size: 26px;
  letter-spacing: 6px;
  font-weight: 500;
}

.header-subtitle {
  font-size: 13px;
  color: var(--ink-faint);
  letter-spacing: 2px;
}

.header-center {
  flex: 1;
  display: flex;
  justify-content: center;
}

.header-right {
  display: flex;
  align-items: center;
}

/* === Poet Selector (Buttons or Dropdown) === */
.poet-selector {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --- Button Mode (≤5 poets) --- */
.poet-btn-group {
  display: flex;
  gap: 8px;
}

.poet-btn {
  padding: 6px 20px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 20px;
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  font-family: var(--font-body);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.25s ease;
  letter-spacing: 1px;
  white-space: nowrap;
}

.poet-btn:hover {
  border-color: rgba(255, 255, 255, 0.6);
  color: var(--paper-white);
}

.poet-btn.active {
  color: white;
  border-color: var(--poet-color, var(--seal-red));
  background: var(--poet-color, var(--seal-red));
}

/* --- Dropdown Mode (>5 poets) --- */
.poet-dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 20px;
  background: transparent;
  color: rgba(255, 255, 255, 0.8);
  font-family: var(--font-body);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.25s ease;
  letter-spacing: 1px;
  min-width: 120px;
  justify-content: space-between;
}

.dropdown-trigger:hover {
  border-color: rgba(255, 255, 255, 0.6);
  color: var(--paper-white);
}

.dropdown-trigger-arrow {
  font-size: 10px;
  transition: transform 0.2s ease;
  opacity: 0.6;
}

.dropdown-trigger.open .dropdown-trigger-arrow {
  transform: rotate(180deg);
}

/* Selected poet color dots in trigger */
.dropdown-selected-dots {
  display: flex;
  gap: 3px;
  align-items: center;
}

.dot-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.4);
  flex-shrink: 0;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 180px;
  background: rgba(45, 45, 45, 0.97);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  padding: 8px 0;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transform: translateX(-50%) translateY(-8px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

.dropdown-menu.open {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  cursor: pointer;
  transition: background 0.15s ease;
  color: rgba(255, 255, 255, 0.75);
  font-size: 14px;
  letter-spacing: 1px;
  user-select: none;
}

.dropdown-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.dropdown-item.active {
  background: rgba(255, 255, 255, 0.12);
}

/* Custom checkbox */
.dropdown-checkbox {
  width: 16px;
  height: 16px;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s ease;
  background: transparent;
}

.dropdown-item.active .dropdown-checkbox {
  border-color: var(--poet-color, var(--seal-red));
  background: var(--poet-color, var(--seal-red));
}

.dropdown-checkmark {
  display: none;
  color: white;
  font-size: 11px;
  line-height: 1;
  font-weight: bold;
}

.dropdown-item.active .dropdown-checkmark {
  display: block;
}

/* Poet color dot in dropdown item */
.dropdown-item-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.dropdown-item-name {
  flex: 1;
}

/* "全部" item special styling */
.dropdown-item-all .dropdown-checkbox {
  border-radius: 8px;
}

/* === View Switcher === */
.view-switcher {
  display: flex;
  gap: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 3px;
}

.view-btn {
  padding: 6px 16px;
  border: none;
  border-radius: 16px;
  background: transparent;
  color: rgba(255, 255, 255, 0.6);
  font-family: var(--font-body);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.25s ease;
  letter-spacing: 1px;
}

.view-btn:hover {
  color: var(--paper-white);
}

.view-btn.active {
  background: var(--paper-white);
  color: var(--ink-black);
  font-weight: 500;
}

/* === Layout Container === */
.main-container {
  display: flex;
  height: calc(100vh - var(--header-height));
}

/* === Left Panel === */
.left-panel {
  width: var(--panel-width);
  min-width: 280px;
  background: var(--paper-light);
  border-right: 1px solid var(--paper-dark);
  overflow-y: auto;
  flex-shrink: 0;
  position: relative;
}

.left-panel::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 1px;
  height: 100%;
  background: linear-gradient(
    180deg,
    transparent 0%,
    var(--ink-faint) 15%,
    var(--ink-faint) 85%,
    transparent 100%
  );
  opacity: 0.3;
}

.panel-header {
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--paper-dark);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--paper-white);
}

.panel-header h2 {
  font-family: var(--font-poem);
  font-size: 18px;
  color: var(--ink-black);
  letter-spacing: 2px;
}

.poem-count {
  font-size: 12px;
  color: var(--ink-faint);
  background: var(--paper-dark);
  padding: 2px 10px;
  border-radius: 10px;
}

.panel-poet-info {
  padding: 12px 20px;
  border-bottom: 1px solid var(--paper-dark);
  background: var(--paper-white);
  display: none;
}

.panel-poet-info.visible {
  display: block;
}

.poet-info-title {
  font-family: var(--font-poem);
  font-size: 16px;
  color: var(--ink-black);
  margin-bottom: 4px;
}

.poet-info-meta {
  font-size: 12px;
  color: var(--ink-faint);
  margin-bottom: 6px;
}

.poet-info-bio {
  font-size: 12px;
  color: var(--ink-light);
  line-height: 1.6;
}

/* 诗人肖像样式 */
.poet-info-portrait {
  width: 100%;
  margin-bottom: 12px;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.poet-info-portrait img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

/* === Poem List === */
.poem-list {
  overflow-y: visible;
  padding: 8px 12px;
}

.poem-item {
  padding: 12px 16px;
  margin-bottom: 6px;
  border-left: 3px solid transparent;
  border-radius: 0 6px 6px 0;
  cursor: pointer;
  transition: all 0.2s ease;
  background: transparent;
}

.poem-item:hover {
  background: var(--paper-dark);
  border-left-color: var(--seal-red);
}

.poem-item.active {
  background: var(--paper-dark);
  border-left-width: 4px;
}

.poem-item[data-poet="libai"].active {
  border-left-color: var(--libai-blue);
}

.poem-item[data-poet="dufu"].active {
  border-left-color: var(--dufu-brown);
}

.poem-item[data-poet="wangwei"].active {
  border-left-color: var(--wangwei-green);
}

.poem-item[data-poet="gaoshi"].active {
  border-left-color: var(--gaoshi-orange);
}

.poem-item-title {
  font-family: var(--font-poem);
  font-size: 16px;
  color: var(--ink-black);
  margin-bottom: 4px;
}

.poem-item-meta {
  font-size: 12px;
  color: var(--ink-faint);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.poem-item-meta span {
  display: inline-flex;
  align-items: center;
}

.poem-item-category {
  background: var(--paper-white);
  padding: 1px 8px;
  border-radius: 8px;
  font-size: 11px;
}

/* === Map Container === */
.map-container {
  flex: 1;
  position: relative;
  background: var(--paper-white);
}

#map-chart {
  width: 100%;
  height: 100%;
}

/* === Preview Overlay === */
.preview-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(26, 26, 26, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.preview-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.preview-card {
  background: var(--paper-light);
  border: 1px solid var(--paper-dark);
  border-radius: 8px;
  max-width: 640px;
  width: 92%;
  max-height: 82vh;
  overflow-y: auto;
  padding: 40px 36px 36px;
  position: relative;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.35);
}

.preview-close {
  position: absolute;
  top: 12px;
  right: 16px;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--ink-faint);
  font-size: 28px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
  line-height: 1;
}

.preview-close:hover {
  background: var(--paper-dark);
  color: var(--ink-black);
}

.preview-seal {
  position: absolute;
  top: 16px;
  right: 56px;
  width: 44px;
  height: 44px;
  border: 2px solid var(--seal-red);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--seal-red);
  font-family: var(--font-poem);
  font-size: 22px;
  transform: rotate(-8deg);
  opacity: 0.6;
}

.preview-title {
  font-family: var(--font-poem);
  font-size: 28px;
  color: var(--ink-black);
  text-align: center;
  margin-bottom: 8px;
  letter-spacing: 4px;
}

.preview-meta {
  text-align: center;
  font-size: 13px;
  color: var(--ink-faint);
  margin-bottom: 24px;
  letter-spacing: 1px;
}

/* 诗作配图样式 */
.preview-image-container {
  margin-bottom: 24px;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

.preview-poem-image {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

.preview-poem-text {
  font-family: var(--font-poem);
  font-size: 22px;
  line-height: 2.2;
  text-align: center;
  color: var(--ink-black);
  margin: 28px 0;
  white-space: pre-line;
  padding: 20px;
  background: var(--paper-white);
  border-radius: 4px;
  border: 1px solid var(--paper-dark);
}

.preview-location {
  font-size: 13px;
  color: var(--ink-light);
  text-align: center;
  margin-bottom: 20px;
  padding: 8px 16px;
  background: var(--paper-white);
  border-radius: 4px;
  display: inline-block;
  width: 100%;
}

.preview-location strong {
  color: var(--ink-medium);
}

.preview-background {
  font-size: 14px;
  color: var(--ink-light);
  line-height: 1.9;
  padding: 16px 20px;
  background: var(--paper-white);
  border-radius: 4px;
  border-left: 3px solid var(--ink-faint);
  margin-top: 8px;
}

.preview-background::before {
  content: "创作背景";
  display: block;
  font-family: var(--font-poem);
  font-size: 14px;
  color: var(--ink-medium);
  margin-bottom: 8px;
  letter-spacing: 2px;
}

/* === Scrollbar Styling === */
.left-panel::-webkit-scrollbar,
.poem-list::-webkit-scrollbar,
.preview-card::-webkit-scrollbar {
  width: 5px;
}

.left-panel::-webkit-scrollbar-track,
.poem-list::-webkit-scrollbar-track,
.preview-card::-webkit-scrollbar-track {
  background: var(--paper-white);
}

.left-panel::-webkit-scrollbar-thumb,
.poem-list::-webkit-scrollbar-thumb,
.preview-card::-webkit-scrollbar-thumb {
  background: var(--ink-faint);
  border-radius: 3px;
}

.left-panel::-webkit-scrollbar-thumb:hover,
.poem-list::-webkit-scrollbar-thumb:hover,
.preview-card::-webkit-scrollbar-thumb:hover {
  background: var(--ink-light);
}

/* === Loading State === */
.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--ink-faint);
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--paper-dark);
  border-top-color: var(--seal-red);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* === Responsive: Tablet === */
@media (max-width: 1023px) and (min-width: 768px) {
  :root {
    --panel-width: 280px;
  }

  .header-title {
    font-size: 22px;
    letter-spacing: 4px;
  }

  .header-subtitle {
    display: none;
  }

  .poem-item-title {
    font-size: 15px;
  }

  .preview-card {
    max-width: 520px;
    padding: 32px 28px 28px;
  }

  .preview-poem-text {
    font-size: 20px;
  }
}

/* === Responsive: Mobile === */
@media (max-width: 767px) {
  :root {
    --panel-width: 300px;
  }

  .header {
    padding: 0 12px;
    flex-wrap: wrap;
    height: auto;
    min-height: var(--header-height);
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .header-left {
    width: 100%;
    margin-bottom: 8px;
  }

  .header-title {
    font-size: 20px;
    letter-spacing: 3px;
  }

  .header-subtitle {
    display: none;
  }

  .header-center {
    order: 3;
    width: 100%;
    justify-content: flex-start;
    margin-top: 8px;
  }

  .header-right {
    order: 2;
  }

  .poet-selector {
    gap: 6px;
  }

  .poet-btn-group {
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .poet-btn {
    padding: 5px 14px;
    font-size: 13px;
  }

  /* Mobile dropdown adjustments */
  .dropdown-trigger {
    padding: 5px 12px;
    font-size: 13px;
    min-width: 100px;
  }

  .dropdown-menu {
    min-width: 160px;
    left: 0;
    transform: translateX(0) translateY(-8px);
  }

  .dropdown-menu.open {
    transform: translateX(0) translateY(0);
  }

  .view-switcher {
    gap: 2px;
    padding: 2px;
  }

  .view-btn {
    padding: 5px 12px;
    font-size: 12px;
  }

  .main-container {
    flex-direction: column;
    height: calc(100vh - 110px);
  }

  .left-panel {
    position: fixed;
    top: var(--header-height);
    left: 0;
    bottom: 0;
    width: 85vw;
    max-width: 320px;
    z-index: 150;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    box-shadow: 4px 0 16px rgba(0, 0, 0, 0.2);
  }

  .left-panel.open {
    transform: translateX(0);
  }

  .map-container {
    width: 100%;
    height: 100%;
  }

  .preview-card {
    max-width: 95vw;
    padding: 28px 20px 24px;
    max-height: 75vh;
  }

  .preview-title {
    font-size: 22px;
  }

  .preview-poem-text {
    font-size: 18px;
    line-height: 2;
    padding: 16px;
  }

  .preview-seal {
    width: 36px;
    height: 36px;
    font-size: 18px;
    top: 12px;
    right: 48px;
  }

  /* Mobile menu toggle */
  .menu-toggle {
    display: flex !important;
    width: 36px;
    height: 36px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    background: transparent;
    color: var(--paper-white);
    font-size: 20px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-right: 12px;
  }

  /* Mobile overlay for panel */
  .panel-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 140;
  }

  .panel-overlay.visible {
    display: block;
  }
}

.menu-toggle {
  display: none;
}

/* === Map Legend === */
.map-legend {
  position: absolute;
  bottom: 20px;
  right: 20px;
  background: rgba(245, 240, 232, 0.95);
  border: 1px solid #d4cfc4;
  border-radius: 6px;
  padding: 12px 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  z-index: 10;
  min-width: 160px;
}

.legend-title {
  font-family: var(--font-poem);
  font-size: 13px;
  color: var(--ink-black);
  margin-bottom: 8px;
  letter-spacing: 1px;
  border-bottom: 1px solid #e8e0d0;
  padding-bottom: 6px;
}

.legend-item {
  display: flex;
  align-items: center;
  margin: 6px 0;
  font-size: 12px;
  color: var(--ink-medium);
}

.legend-icon {
  width: 20px;
  height: 20px;
  margin-right: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.legend-icon.poem-libai {
  width: 12px;
  height: 12px;
  background: #2c5f7c;
  border-radius: 50%;
  border: 2px solid #f5f0e8;
}

.legend-icon.poem-dufu {
  width: 12px;
  height: 12px;
  background: #8b4513;
  border-radius: 50%;
  border: 2px solid #f5f0e8;
}

.legend-icon.poem-wangwei {
  width: 12px;
  height: 12px;
  background: #2e8b57;
  border-radius: 50%;
  border: 2px solid #f5f0e8;
}

.legend-icon.poem-gaoshi {
  width: 12px;
  height: 12px;
  background: #cd853f;
  border-radius: 50%;
  border: 2px solid #f5f0e8;
}

.legend-icon.waypoint {
  width: 10px;
  height: 10px;
  background: currentColor;
  border-radius: 50%;
  border: 2px solid #f5f0e8;
}

.legend-icon.landmark {
  width: 14px;
  height: 14px;
  background: #d4a843;
  clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
}

.legend-icon.meeting {
  width: 12px;
  height: 12px;
  background: #d4a843;
  border-radius: 50%;
  border: 2px solid #f5f0e8;
  position: relative;
}

.legend-icon.meeting::after {
  content: '';
  position: absolute;
  top: -3px;
  left: -3px;
  right: -3px;
  bottom: -3px;
  border: 1px solid rgba(212, 168, 67, 0.4);
  border-radius: 50%;
}

.legend-icon.line-libai {
  width: 24px;
  height: 2px;
  background: repeating-linear-gradient(
    90deg,
    #2c5f7c 0px,
    #2c5f7c 4px,
    transparent 4px,
    transparent 6px
  );
}

.legend-icon.line-dufu {
  width: 24px;
  height: 2px;
  background: repeating-linear-gradient(
    90deg,
    #8b4513 0px,
    #8b4513 4px,
    transparent 4px,
    transparent 6px
  );
}

.legend-icon.line-wangwei {
  width: 24px;
  height: 2px;
  background: repeating-linear-gradient(
    90deg,
    #2e8b57 0px,
    #2e8b57 4px,
    transparent 4px,
    transparent 6px
  );
}

.legend-icon.line-gaoshi {
  width: 24px;
  height: 2px;
  background: repeating-linear-gradient(
    90deg,
    #cd853f 0px,
    #cd853f 4px,
    transparent 4px,
    transparent 6px
  );
}

.legend-text {
  flex: 1;
}

/* 临时地点诗作面板中的诗作列表样式 */
#temp-location-panel .poem-item {
  padding: 12px 16px;
  margin-bottom: 6px;
  border-left: 3px solid transparent;
  border-radius: 0 6px 6px 0;
  cursor: pointer;
  transition: all 0.2s ease;
  background: transparent;
}

#temp-location-panel .poem-item:hover {
  background: #e8e0d0;
  border-left-color: #c23a2e;
}

#temp-location-panel .poem-item-title {
  font-family: var(--font-poem);
  font-size: 16px;
  color: var(--ink-black);
  margin-bottom: 4px;
}

#temp-location-panel .poem-item-meta {
  font-size: 12px;
  color: var(--ink-faint);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

#temp-location-panel .poem-item-meta span {
  display: inline-flex;
  align-items: center;
}

#temp-location-panel .poem-item-category {
  background: var(--paper-white);
  padding: 1px 8px;
  border-radius: 8px;
  font-size: 11px;
}

/* === 热力图统计面板样式 === */
.heatmap-stats {
  flex: 1;
  overflow-y: auto;
  padding: 8px 12px;
}

.heatmap-stat-section {
  margin-bottom: 16px;
  background: var(--paper-white);
  border-radius: 6px;
  padding: 12px;
  border: 1px solid var(--paper-dark);
}

.heatmap-stat-title {
  font-family: var(--font-poem);
  font-size: 14px;
  color: var(--ink-black);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--paper-dark);
  letter-spacing: 1px;
}

/* 总体概览网格 */
.heatmap-stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.heatmap-stat-item {
  text-align: center;
  padding: 8px 4px;
  background: var(--paper-light);
  border-radius: 4px;
}

.heatmap-stat-value {
  font-family: var(--font-poem);
  font-size: 16px;
  color: var(--seal-red);
  font-weight: bold;
}

.heatmap-stat-label {
  font-size: 11px;
  color: var(--ink-faint);
  margin-top: 4px;
}

/* 诗人分布条形图 */
.heatmap-poet-bars {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.heatmap-poet-bar-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.heatmap-poet-bar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.heatmap-poet-bar-name {
  font-family: var(--font-poem);
  font-size: 14px;
  font-weight: bold;
}

.heatmap-poet-bar-count {
  font-size: 12px;
  color: var(--ink-faint);
}

.heatmap-poet-bar-track {
  height: 8px;
  background: var(--paper-dark);
  border-radius: 4px;
  overflow: hidden;
}

.heatmap-poet-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}

/* 地点热力排行 */
.heatmap-location-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.heatmap-location-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  background: var(--paper-light);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.heatmap-location-item:hover {
  background: var(--paper-dark);
}

.heatmap-location-rank {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--seal-red);
  color: white;
  font-size: 12px;
  font-weight: bold;
  border-radius: 50%;
  flex-shrink: 0;
}

.heatmap-location-rank:nth-child(n+4) {
  background: var(--ink-faint);
}

.heatmap-location-info {
  flex: 1;
  min-width: 0;
}

.heatmap-location-name {
  font-family: var(--font-poem);
  font-size: 14px;
  color: var(--ink-black);
  margin-bottom: 2px;
}

.heatmap-location-meta {
  font-size: 11px;
  color: var(--ink-faint);
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.heatmap-poet-tag {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 500;
}

/* 创作高峰期 */
.heatmap-peak-years {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.heatmap-peak-year-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  background: var(--paper-light);
  border-radius: 4px;
}

.heatmap-peak-year-rank {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #d4a843;
  color: white;
  font-size: 12px;
  font-weight: bold;
  border-radius: 50%;
  flex-shrink: 0;
}

.heatmap-peak-year-info {
  flex: 1;
}

.heatmap-peak-year-value {
  font-family: var(--font-poem);
  font-size: 14px;
  color: var(--ink-black);
  font-weight: bold;
}

.heatmap-peak-year-meta {
  font-size: 11px;
  color: var(--ink-faint);
  display: flex;
  gap: 6px;
  align-items: center;
  margin-top: 2px;
}

/* 题材分类 */
.heatmap-category-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.heatmap-category-item {
  display: grid;
  grid-template-columns: 60px 1fr 24px;
  gap: 8px;
  align-items: center;
}

.heatmap-category-name {
  font-family: var(--font-poem);
  font-size: 13px;
  color: var(--ink-medium);
}

.heatmap-category-bar-track {
  height: 6px;
  background: var(--paper-dark);
  border-radius: 3px;
  overflow: hidden;
}

.heatmap-category-bar-fill {
  height: 100%;
  background: var(--seal-red);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.heatmap-category-count {
  font-size: 12px;
  color: var(--ink-faint);
  text-align: right;
}

/* Responsive: Mobile legend */
@media (max-width: 767px) {
  .map-legend {
    bottom: 10px;
    right: 10px;
    padding: 10px 12px;
    min-width: 140px;
  }
  
  .legend-title {
    font-size: 12px;
  }
  
  .legend-item {
    font-size: 11px;
    margin: 5px 0;
  }
}
