/* ===== 双地图体系样式（桃李地图 + 网站地图）===== */


/* ===== 桃李地图布局 ===== */
.taoli-map-layout {
  display: grid;
  grid-template-rows: auto 1fr auto;
  height: 100%;
  background: #fff;
}
.taoli-map-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid #eee;
}
.taoli-map-header__title { font-size: 18px; font-weight: 600; margin: 0; }
.taoli-map-header__dims { display: flex; gap: 6px; }
.taoli-map-header__dim-btn {
  padding: 4px 12px;
  border: 1px solid #d0d0d0;
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  color: #555;
  transition: all 100ms;
}
.taoli-map-header__dim-btn--active {
  background: #1971c2;
  border-color: #1971c2;
  color: #fff;
}
.taoli-map-header__time { display: flex; align-items: center; gap: 6px; font-size: 13px; }

.taoli-map-body {
  display: grid;
  grid-template-columns: 1fr;
  overflow: hidden;
}
.taoli-map-chart {
  min-height: 480px;
  width: 100%;
  position: relative;
}
.taoli-map-chart--skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: taoli-skeleton 1.5s infinite;
}
@keyframes taoli-skeleton { 0%{background-position:200% 0} 100%{background-position:-200% 0} }

.taoli-map-side-panel {
  border-left: 1px solid #eee;
  padding: 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.taoli-map-side-panel__section h4 {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 8px;
  color: #333;
}
.taoli-map-side-panel__summary {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: #666;
}
.taoli-map-side-panel__summary span strong { color: #1971c2; }
.taoli-map-side-panel__rank-chart,
.taoli-map-side-panel__trend-chart { width: 100%; height: 180px; }

.taoli-map-legend {
  padding: 8px 16px;
  border-top: 1px solid #eee;
  font-size: 12px;
  color: #999;
  display: flex;
  align-items: center;
  gap: 16px;
}
.taoli-map-legend__band {
  display: flex;
  gap: 2px;
}
.taoli-map-legend__band span {
  width: 24px;
  height: 12px;
  display: inline-block;
}

.taoli-map-card {
  position: fixed;
  z-index: 999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 100ms;
  background: #fff;
  border: 1px solid #d0d0d0;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  padding: 12px 16px;
  font-size: 13px;
  max-width: 280px;
}
.taoli-map-card--visible { opacity: 1; }
.taoli-map-card__name { font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.taoli-map-card__row { display: flex; justify-content: space-between; color: #666; margin: 2px 0; }
.taoli-map-card__actions { display: flex; gap: 8px; margin-top: 8px; pointer-events: auto; }
.taoli-map-card__actions a {
  color: #1971c2;
  text-decoration: none;
  cursor: pointer;
  font-size: 12px;
}
.taoli-map-card__actions a:hover { text-decoration: underline; }

.taoli-map-breadcrumb {
  padding: 4px 16px;
  font-size: 13px;
  color: #999;
}
.taoli-map-breadcrumb a { color: #1971c2; cursor: pointer; }
.taoli-map-breadcrumb__sep { margin: 0 6px; }

.taoli-map-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #999;
  font-size: 14px;
  flex-direction: column;
  gap: 8px;
}
.taoli-map-empty__retry {
  padding: 6px 16px;
  border: 1px solid #1971c2;
  border-radius: 6px;
  background: #fff;
  color: #1971c2;
  cursor: pointer;
}

/* ===== 网站地图布局 ===== */
.site-map-layout {
  display: grid;
  grid-template-rows: auto 1fr auto;
  height: 100%;
  background: #fff;
}
.site-map-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid #eee;
}
.site-map-header__title { font-size: 18px; font-weight: 600; margin: 0; }
.site-map-header__search {
  flex: 1;
  max-width: 360px;
  padding: 6px 12px;
  border: 1px solid #d0d0d0;
  border-radius: 20px;
  font-size: 13px;
  outline: none;
  transition: border-color 100ms;
}
.site-map-header__search:focus { border-color: #1971c2; }

.site-map-canvas {
  width: 100%;
  height: 100%;
  overflow: hidden;
  position: relative;
  will-change: transform;
}
.site-map-canvas svg { width: 100%; height: 100%; display: block; }

.site-map-leaf {
  cursor: pointer;
  transition: filter 150ms ease, opacity 150ms ease;
  outline: none;
}
.site-map-leaf--hover { filter: drop-shadow(0 0 8px #1971c2) brightness(1.15); }
.site-map-leaf:focus { outline: 2px solid #1971c2; outline-offset: 2px; }
.site-map-leaf--match { filter: drop-shadow(0 0 6px #1971c2); }
.site-map-leaf--dim { opacity: 0.3; }
.site-map-leaf__intro {
  position: fixed;
  z-index: 999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 100ms;
  background: #fff;
  border: 1px solid #d0d0d0;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  padding: 10px 14px;
  font-size: 13px;
  max-width: 260px;
  color: #555;
}
.site-map-leaf__intro--visible { opacity: 1; }
.site-map-leaf__intro strong { display: block; color: #333; margin-bottom: 4px; }

.site-map-branch { fill: none; stroke: #bdbdbd; stroke-width: 2; transition: all 100ms; }
.site-map-branch--highlight {
  stroke: #1971c2;
  stroke-width: 4;
  filter: drop-shadow(0 0 4px rgba(25,113,194,0.4));
}
.site-map-branch--dim { opacity: 0.3; }

/* 多色高亮类 */
.site-map-branch--gold {
  stroke: #F5A623; stroke-width: 4;
  filter: drop-shadow(0 0 6px rgba(245,166,35,0.5));
}
.site-map-branch--blue {
  stroke: #54A0FF; stroke-width: 4;
  filter: drop-shadow(0 0 4px rgba(84,160,255,0.4));
}
.site-map-branch--green {
  stroke: #2ECC71; stroke-width: 4;
  filter: drop-shadow(0 0 4px rgba(46,204,113,0.4));
}
.site-map-branch--orange {
  stroke: #FF9F43; stroke-width: 4;
  filter: drop-shadow(0 0 4px rgba(255,159,67,0.4));
}
.site-map-branch--gray {
  stroke: #BDC3C7; stroke-width: 3;
}
.site-map-branch--subtle { opacity: 0.7; }

/* 树叶放大光晕 */
.site-map-leaf--active {
  transform: scale(1.3);
  filter: drop-shadow(0 0 8px rgba(245,166,35,0.6));
  transition: all 150ms ease;
}
.site-map-leaf--gold-glow {
  animation: site-map-gold-glow 1s ease-in-out 2;
}
@keyframes site-map-gold-glow {
  0% { filter: drop-shadow(0 0 4px rgba(245,166,35,0.4)); }
  50% { filter: drop-shadow(0 0 16px rgba(245,166,35,0.8)); }
  100% { filter: drop-shadow(0 0 4px rgba(245,166,35,0.4)); }
}

.site-map-guide {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.75);
  color: #fff;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 13px;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 12px;
}
.site-map-guide__btn {
  padding: 4px 12px;
  border: 1px solid rgba(255,255,255,0.5);
  border-radius: 4px;
  background: transparent;
  color: #fff;
  cursor: pointer;
  font-size: 12px;
}

.site-map-skip-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  padding: 6px 16px;
  border: 1px solid #d0d0d0;
  border-radius: 6px;
  background: rgba(255,255,255,0.9);
  color: #666;
  cursor: pointer;
  font-size: 13px;
  z-index: 100;
  transition: all 100ms;
}
.site-map-skip-btn:hover { background: #fff; color: #333; }

.site-map-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #999;
  font-size: 14px;
  flex-direction: column;
  gap: 8px;
}

/* ===== 响应式适配 ===== */
@media (max-width: 1024px) {
  .taoli-map-body { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .taoli-map-side-panel { border-left: none; border-top: 1px solid #eee; max-height: 240px; }
  .site-map-canvas { transform: scale(0.8); transform-origin: top left; }
}
@media (max-width: 768px) {
  .taoli-map-side-panel__section--rank,
  .taoli-map-side-panel__section--trend { display: none; }
  .taoli-map-header__dims { flex-wrap: wrap; }
  .site-map-canvas { transform: scale(0.6); transform-origin: top left; }
}

/* ===== 无障碍 ===== */
@media (prefers-reduced-motion: reduce) {
  .site-map-leaf { transition: none; }
  .site-map-leaf:hover { transform: none; }
  .taoli-map-chart--skeleton { animation: none; }
}

/* ===== 桃李地图增强：Tab + 数据模式 + 隐私面板 + 统计面板 + 仓库选择器 + 图例 ===== */

.taoli-map-tab { display: flex; gap: 4px; padding: 8px 16px; border-bottom: 1px solid #e0e0e0; background: #fafafa; }
.taoli-map-tab__btn { padding: 8px 20px; border: 1px solid transparent; border-radius: 6px 6px 0 0; background: transparent; cursor: pointer; font-size: 14px; color: #666; transition: all 120ms ease; }
.taoli-map-tab__btn:hover { background: #f0f0f0; }
.taoli-map-tab__btn--active { background: #fff; border-color: #e0e0e0 #e0e0e0 #fff; color: #1971c2; font-weight: 600; }

.taoli-map-header__mode { display: flex; gap: 6px; }
.taoli-map-header__mode-btn { padding: 4px 12px; border: 1px solid #d0d0d0; border-radius: 14px; background: #fff; cursor: pointer; font-size: 13px; color: #555; transition: all 100ms; }
.taoli-map-header__mode-btn--active { background: #1971c2; border-color: #1971c2; color: #fff; }

.taoli-map-privacy-panel { position: absolute; left: 16px; bottom: 16px; z-index: 50; background: rgba(255,255,255,0.92); border: 1px solid #e0e0e0; border-radius: 8px; box-shadow: 0 2px 12px rgba(0,0,0,0.1); padding: 10px 14px; font-size: 12px; color: #666; max-width: 260px; }
.taoli-map-privacy-panel__title { font-weight: 600; color: #333; margin-bottom: 4px; }
.taoli-map-privacy-panel__row { display: flex; gap: 12px; margin: 2px 0; }

.taoli-map-stats-panel { position: absolute; right: 16px; bottom: 16px; z-index: 50; width: 360px; max-height: 60vh; background: #fff; border: 1px solid #d0d0d0; border-radius: 8px; box-shadow: 0 4px 20px rgba(0,0,0,0.15); display: flex; flex-direction: column; overflow: hidden; }
.taoli-map-stats-panel--collapsed { width: 48px; height: 48px; max-height: 48px; cursor: pointer; }
.taoli-map-stats-panel__header { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; border-bottom: 1px solid #eee; font-size: 14px; font-weight: 600; }
.taoli-map-stats-panel__chart { flex: 1; min-height: 200px; padding: 8px; }
.taoli-map-stats-panel__summary { padding: 8px 12px; border-top: 1px solid #eee; font-size: 12px; color: #666; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.taoli-map-stats-panel__actions { display: flex; gap: 6px; padding: 8px 12px; border-top: 1px solid #eee; }
.taoli-map-stats-panel__chart-type-btn, .taoli-map-stats-panel__time-btn, .taoli-map-stats-panel__export-btn { padding: 3px 10px; border: 1px solid #d0d0d0; border-radius: 4px; background: #fff; cursor: pointer; font-size: 12px; color: #555; transition: all 100ms; }
.taoli-map-stats-panel__chart-type-btn--active, .taoli-map-stats-panel__time-btn--active { background: #1971c2; border-color: #1971c2; color: #fff; }

.taoli-map-repo-picker { position: fixed; top: 50%; left: 50%; transform: translate(-50%,-50%); z-index: 1000; width: 480px; max-height: 400px; background: #fff; border-radius: 12px; box-shadow: 0 8px 32px rgba(0,0,0,0.2); display: flex; flex-direction: column; overflow: hidden; }
.taoli-map-repo-picker--hidden { display: none; }
.taoli-map-repo-picker__search { padding: 8px 12px; border: none; border-bottom: 1px solid #eee; font-size: 14px; outline: none; }
.taoli-map-repo-picker__list { flex: 1; overflow-y: auto; }
.taoli-map-repo-picker__item { padding: 8px 12px; cursor: pointer; font-size: 13px; border-bottom: 1px solid #f5f5f5; transition: background 100ms; }
.taoli-map-repo-picker__item:hover { background: #f0f7ff; }

.taoli-map-legend__item--upload-public { background: #2ECC71; }
.taoli-map-legend__item--upload-hidden { background: #95A5A6; }
.taoli-map-legend__item--download-public { background: #F5A623; }
.taoli-map-legend__item--download-hidden { background: #3498DB; }
.taoli-map-legend__item--hidden-note { font-size: 11px; color: #999; }
.taoli-map-card__privacy-note { font-size: 11px; color: #999; margin-top: 6px; }
.taoli-map-empty--login, .taoli-map-empty--no-repo { text-align: center; }

@media (max-width: 1024px) {
  .taoli-map-stats-panel { width: 280px; }
  .taoli-map-privacy-panel { max-width: 200px; font-size: 11px; }
}
@media (max-width: 768px) {
  .taoli-map-stats-panel { width: 48px; height: 48px; max-height: 48px; }
  .taoli-map-privacy-panel { left: 50%; transform: translateX(-50%); bottom: auto; top: 60px; max-width: 90%; }
  .taoli-map-tab__btn { padding: 6px 10px; font-size: 12px; }
}