/* Traces 页面样式 */

/* 痕迹页面需要更宽的空间 - 覆盖主题的 max-width: 800px */
article.traces-page {
  max-width: 100% !important;
}

.traces-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.9rem 0 1.2rem;
}

.traces-nav-link {
  border: 2px solid var(--text-color);
  border-radius: 6px;
  padding: 0.2rem 0.55rem;
  font-size: 0.82rem;
  text-decoration: none;
}

.traces-nav-link.is-active,
.traces-nav-link:hover {
  background: var(--text-color);
  color: var(--bg-color);
  text-decoration: none;
}

.traces-shell {
  display: grid;
  grid-template-columns: minmax(260px, 340px) 1fr;
  gap: 1.25rem;
  align-items: stretch;
  min-height: min(72vh, 820px);
  margin-bottom: 50px;
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
}

@media screen and (max-width: 900px) {
  .traces-shell {
    grid-template-columns: 1fr;
    min-height: unset;
  }
}

.traces-panel {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem 1.1rem;
  border-radius: 14px;
  background: var(--bg-color);
  border: 2px solid var(--text-color);
}

.traces-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.traces-filters-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--secondary-text);
  margin-right: 0.25rem;
}

.traces-chip {
  border: 2px solid var(--text-color);
  background: var(--bg-color);
  color: var(--text-color);
  font-size: 0.8125rem;
  padding: 0.28rem 0.65rem;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.traces-chip:hover {
  background: var(--text-color);
  color: var(--bg-color);
}

.traces-chip.is-active {
  background: var(--text-color);
  color: var(--bg-color);
}

.traces-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  max-height: min(58vh, 640px);
}

@media screen and (max-width: 900px) {
  .traces-list {
    max-height: 280px;
  }
}

.traces-list-item {
  display: flex;
  gap: 0.65rem;
  padding: 0.65rem 0.7rem;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s;
}

.traces-list-item:hover {
  background: var(--code-bg);
}

.traces-dot {
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 0.35rem;
}

.traces-item-body {
  min-width: 0;
}

.traces-item-title {
  display: block;
  font-size: 0.95rem;
  line-height: 1.35;
}

.traces-item-date {
  display: block;
  font-size: 0.75rem;
  color: var(--secondary-text);
  margin-top: 0.15rem;
}

.traces-item-note {
  margin: 0.35rem 0 0;
  font-size: 0.8125rem;
  color: var(--secondary-text);
  line-height: 1.5;
}

.traces-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.4rem;
}

.traces-tag {
  font-size: 0.68rem;
  padding: 0.12rem 0.45rem;
  border-radius: 6px;
  background: rgba(99, 102, 241, 0.12);
  color: #4f46e5;
}

[data-theme="dark"] .traces-tag {
  background: rgba(129, 140, 248, 0.2);
  color: #a5b4fc;
}

.traces-blog-link {
  display: inline-block;
  margin-top: 0.4rem;
  font-size: 0.8rem;
  color: #0d9488;
  text-decoration: none;
}

.traces-blog-link:hover {
  text-decoration: underline;
}

[data-theme="dark"] .traces-blog-link {
  color: #5eead4;
}

.traces-map-wrap {
  border-radius: 14px;
  overflow: hidden;
  border: 2px solid var(--text-color);
  min-height: 360px;
}

.traces-map {
  width: 100%;
  height: min(72vh, 820px);
  min-height: 360px;
  background: var(--code-bg);
}

@media screen and (max-width: 900px) {
  .traces-map {
    height: 52vh;
    min-height: 280px;
  }
}

.traces-marker-icon span {
  display: block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

[data-theme="dark"] .traces-marker-icon span {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.leaflet-popup-content .traces-popup {
  margin: 0.25rem 0.35rem;
  font-size: 0.9rem;
  line-height: 1.45;
}

.leaflet-popup-content .traces-popup strong {
  font-size: 1rem;
}

.leaflet-popup-content .traces-popup time {
  font-size: 0.8rem;
  color: var(--secondary-text);
}

.leaflet-popup-content .traces-popup p {
  margin: 0.35rem 0 0;
}

.traces-popup-blog {
  display: block;
  margin-top: 0.5rem;
  padding: 0.5rem 0.6rem;
  background: rgba(13, 148, 136, 0.08);
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.2s;
}

.traces-popup-blog:hover {
  background: rgba(13, 148, 136, 0.15);
}

.traces-popup-blog-title {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-color);
}

.traces-popup-blog-summary {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: var(--secondary-text);
  line-height: 1.4;
}

[data-theme="dark"] .traces-popup-blog {
  background: rgba(13, 148, 136, 0.15);
}
