/*
 * Theme: theme-Serenity
 * Author: Serenity
 * Build: 2026-06-03 10:28:07
 * Fingerprint: 18f8d0015be24d2b
 * Copyright (c) 2026 Serenity. All rights reserved.
 */

/* 页面标题 */
.page-header {
  margin-bottom: var(--space-6);
  padding-top: calc(var(--header-height) + var(--space-8));
  text-align: center;
}

/* ========== 标签面板 ========== */
.tags-panel {
  position: relative;
  padding: var(--space-6);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: visible;
}

[data-theme="light"] .tags-panel {
  background: rgba(0, 0, 0, 0.01);
}

.tags-panel-watermark {
  position: absolute;
  right: 20px;
  bottom: 20px;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--color-accent);
  opacity: 0.08;
  transform: rotate(-45deg);
  pointer-events: none;
  user-select: none;
}

/* ---- 上半：统计区 ---- */
.tags-stats {
  display: flex;
  align-items: stretch;
  gap: var(--space-6);
  min-height: 220px;
}

/* 左：圆环 */
.stats-ring {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.rings-container {
  position: relative;
  width: 200px;
  height: 200px;
}

.rings-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.ring-bg {
  fill: none;
  stroke: var(--color-border);
  stroke-width: 12;
  opacity: 0.3;
}

.ring {
  fill: none;
  stroke-width: 12;
  stroke-linecap: round;
  cursor: pointer;
  transition: all 0.3s ease;
}

.ring:hover {
  stroke-width: 16;
  filter: brightness(1.1);
}

/* 圆环颜色通过 inline style 的 stroke 属性设置，不再硬编码 */

.rings-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
}

.rings-total {
  display: block;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1;
}

.rings-label {
  font-size: 11px;
  color: var(--color-text-muted);
  margin-top: 4px;
}

/* 圆环提示框 */
.ring-tooltip {
  position: absolute;
  padding: 8px 12px;
  background: var(--color-bg-soft);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--color-text);
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  pointer-events: none;
  z-index: 10;
  left: 50%;
  transform: translateX(-50%);
  top: -40px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.ring-tooltip::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--color-border);
}

.ring-tooltip .tooltip-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}

.ring-tooltip .tooltip-count {
  font-weight: 600;
  margin-left: 8px;
  color: var(--color-text-muted);
}

/* ---- 右：竖柱图（所有标签） ---- */
.stats-chart {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.chart-area {
  flex: 1;
  display: flex;
  align-items: flex-end;
  gap: 6px;
  position: relative;
}

.chart-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  cursor: pointer;
}

/* 柱子容器 — 无背景，胶囊圆角 */
.col-bar {
  width: 100%;
  max-width: 36px;
  height: 160px;
  background: transparent;
  border-radius: 18px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  transition: transform 0.2s ease;
}

/* hover 时柱子微微放大（ECharts 风格） */
.chart-col:hover .col-bar {
  transform: scaleX(1.3);
}

/* 非 hover 的柱子变淡（ECharts 高亮对比） */
.chart-area:hover .chart-col:not(:hover) .col-fill {
  opacity: 0.35;
}

/* 柱子填充 — 胶囊圆角两头圆 */
.col-fill {
  width: 100%;
  border-radius: 18px;
  height: 0;
  background: linear-gradient(to top, var(--bar-color, #ffffff), color-mix(in srgb, var(--bar-color, #ffffff) 60%, white));
  transition: height 1s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease;
}

/* 图表 tooltip — ECharts 风格浮动气泡 */
.chart-tooltip {
  position: absolute;
  padding: 8px 14px;
  background: var(--color-bg-soft);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--color-text);
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 20;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  transition: opacity 0.15s ease;
  transform: translateX(-50%);
}

.chart-tooltip::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--color-border);
}

.chart-tooltip-name {
  font-weight: 600;
  margin-right: 10px;
}

.chart-tooltip-count {
  font-family: var(--font-mono);
  color: var(--color-text-muted);
}

/* ---- 分隔线 ---- */
.tags-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-border), transparent);
  margin: var(--space-6) 0;
}

/* ---- 下半：标签墙 ---- */
.tags-wall {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--tag-color, #ffffff);
  background: color-mix(in srgb, var(--tag-color, #ffffff) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--tag-color, #ffffff) 20%, transparent);
  border-radius: 6px;
  white-space: nowrap;
  transition: all var(--duration-fast);
}

.tag-chip:hover {
  background: color-mix(in srgb, var(--tag-color, #ffffff) 20%, transparent);
  border-color: var(--tag-color, #ffffff);
  color: var(--tag-color, #ffffff);
}

.chip-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--tag-color, #ffffff);
  flex-shrink: 0;
}

.tag-chip:hover .chip-dot {
  opacity: 1;
}

.chip-lg { font-size: 14px; padding: 7px 16px; font-weight: 600; }
.chip-md { font-size: 13px; padding: 5px 12px; }
.chip-sm { font-size: 12px; padding: 5px 10px; }

.chip-count {
  font-size: 10px;
  padding: 2px 7px;
  background: color-mix(in srgb, var(--tag-color, #ffffff) 15%, transparent);
  border-radius: 6px;
  color: var(--tag-color, #ffffff);
  font-family: var(--font-mono);
}

.tag-chip:hover .chip-count {
  background: var(--tag-color, #ffffff);
  color: #fff;
}

/* 联动高亮态 */
.tag-chip.chip-highlight {
  border-color: var(--tag-color, #ffffff);
  color: var(--tag-color, #ffffff);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08),
              0 0 0 1px var(--tag-color, #ffffff);
}

.tag-chip.chip-highlight .chip-dot {
  opacity: 1;
  box-shadow: 0 0 6px var(--tag-color, #ffffff);
}

.tag-chip.chip-highlight .chip-count {
  background: var(--tag-color, #ffffff);
  color: #fff;
}

/* 空状态 */
.tags-empty {
  text-align: center;
  padding: var(--space-10) 0;
  color: var(--color-text-muted);
  font-size: 14px;
}

/* ========== 移动端适配 ========== */
@media (max-width: 768px) {
  .tags-panel {
    padding: var(--space-4);
  }

  .tags-stats {
    gap: var(--space-4);
    min-height: auto;
  }

  /* 圆环 + 中心文字适配 */
  .rings-container {
    width: 180px;
    height: 180px;
  }
  .rings-total {
    font-size: 0.75rem;
  }
  .rings-label {
    font-size: 8px;
    margin-top: 2px;
  }
  .ring {
    stroke-width: 10;
  }
  .ring-bg {
    stroke-width: 10;
  }

  /* 柱图缩小 */
  .chart-area {
    gap: 3px;
  }
  .col-bar {
    max-width: 16px;
    height: 100px;
    border-radius: 8px;
  }
  .col-fill {
    border-radius: 8px;
  }

  .tags-divider {
    margin: var(--space-4) 0;
  }

  /* tooltip 缩小 */
  .chart-tooltip {
    font-size: 10px;
    padding: 5px 8px;
  }
  .ring-tooltip {
    font-size: 10px;
    padding: 5px 8px;
  }

  /* 标签墙缩小 */
  .tags-wall {
    gap: 6px;
  }
  .chip-lg {
    font-size: 11px;
    padding: 4px 10px;
    font-weight: 500;
  }
  .chip-md {
    font-size: 10px;
    padding: 3px 8px;
  }
  .chip-sm {
    font-size: 10px;
    padding: 3px 8px;
  }
  .chip-dot {
    width: 4px;
    height: 4px;
  }
  .chip-count {
    font-size: 9px;
    padding: 1px 5px;
  }
  .tag-chip {
    gap: 4px;
  }
}

@media (max-width: 480px) {
  .rings-container {
    width: 150px;
    height: 150px;
  }
  .rings-total {
    font-size: 0.7rem;
  }
  .rings-label {
    font-size: 7px;
  }
  .ring {
    stroke-width: 9;
  }
  .ring-bg {
    stroke-width: 9;
  }
  .col-bar {
    max-width: 12px;
    height: 80px;
    border-radius: 6px;
  }
  .col-fill {
    border-radius: 6px;
  }
}


/* ========== Categories 分类页（保持不变） ========== */
.categories-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-4);
  padding: var(--space-6) 0;
  padding-bottom: var(--space-10);
}

.category-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  transition: all var(--duration-fast);
  overflow: hidden;
}

[data-theme="light"] .category-card {
  background: rgba(0, 0, 0, 0.01);
}

.category-card:hover {
  border-color: var(--color-accent);
  background: rgba(255, 255, 255, 0.04);
}

[data-theme="light"] .category-card:hover {
  background: rgba(0, 0, 0, 0.02);
}

.category-watermark {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%) rotate(-45deg);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-accent);
  opacity: 0.08;
  letter-spacing: 0.1em;
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
}

.category-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(245, 150, 170, 0.1);
  border-radius: var(--radius-md);
  flex-shrink: 0;
}

[data-theme="light"] .category-icon {
  background: rgba(51, 166, 184, 0.1);
}

.category-icon svg {
  width: 22px;
  height: 22px;
  color: var(--color-accent);
}

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

.category-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 4px;
  transition: color var(--duration-fast);
}

.category-card:hover .category-name {
  color: var(--color-accent);
}

.category-count {
  font-size: 12px;
  color: var(--color-text-muted);
}

/* 分类页移动端缩小 */
@media (max-width: 768px) {
  .categories-list {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: var(--space-2);
    padding: var(--space-4) 0;
  }

  .category-card {
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
  }

  .category-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
  }

  .category-icon svg {
    width: 16px;
    height: 16px;
  }

  .category-name {
    font-size: 12px;
    margin-bottom: 2px;
  }

  .category-count {
    font-size: 10px;
  }

  .category-watermark {
    font-size: 1rem;
  }
}
