/* 网站统计页面（/statistic/）专属样式
 * 页面结构见 source/statistic/index.md，渲染见 /js/butterfly/statistics-page.js
 * 复刻自 qiqi.ee（Nuxt 版 /statistics）：小站资讯 + 分类统计 + 热门文章
 */

.stat-page {
  width: 100%;
}
.stat-section {
  background-color: var(--card-bg, #ffffff);
  border: 1px solid #e8e8e8;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
}
.stat-section-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--font-color, #303133);
  padding-bottom: 12px;
  margin-bottom: 16px;
  border-bottom: 1px dashed #e8e8e8;
}
.stat-section-title i {
  margin-right: 8px;
  color: #39c5bb;
}
.stat-loading {
  padding: 40px 0;
  text-align: center;
  color: #858585;
  font-size: 15px;
}

/* 小站资讯概览 */
.stat-overview {
  display: flex;
  flex-wrap: wrap;
}
.stat-overview-item {
  width: calc(100% / 4 - 10px);
  margin: 5px;
  padding: 14px 10px;
  background-color: #f7f9fa;
  border-radius: 10px;
  text-align: center;
}
.stat-overview-item .item-name {
  height: 24px;
  line-height: 24px;
  color: #53585c;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stat-overview-item .item-value {
  height: 32px;
  line-height: 32px;
  color: #1f1f1f;
  font-size: 20px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 分类统计 */
.stat-category-item {
  margin-bottom: 14px;
}
.stat-category-item:last-child {
  margin-bottom: 0;
}
.stat-category-item .cat-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 28px;
}
.stat-category-item .cat-name {
  color: #1f1f1f;
  font-size: 14.7px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stat-category-item .cat-count {
  color: #858585;
  font-size: 13.2px;
  white-space: nowrap;
}
.stat-category-item .cat-bar {
  height: 8px;
  background-color: #f0f2f3;
  border-radius: 4px;
  overflow: hidden;
}
.stat-category-item .cat-bar-inner {
  height: 100%;
  background: linear-gradient(to right, #39c5bb, #6de0d8);
  border-radius: 4px;
  transition: width 0.6s ease;
}

/* 最新文章（沿用旧站热门文章排行样式） */
.stat-post-item {
  display: flex;
  align-items: center;
  height: 44px;
  padding: 0 6px;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
}
.stat-post-item:hover {
  background-color: #f7f9fa;
}
.stat-post-item .rank {
  width: 22px;
  height: 22px;
  margin-right: 10px;
  border-radius: 4px;
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
  background-color: #b8bcbe;
}
.stat-post-item .rank-1 {
  background-color: #f56c6c;
}
.stat-post-item .rank-2 {
  background-color: #e6a23c;
}
.stat-post-item .rank-3 {
  background-color: #409eff;
}
.stat-post-item .post-title {
  flex: 1;
  color: #1f1f1f;
  font-size: 14.7px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stat-post-item .post-date {
  margin-left: 12px;
  color: #858585;
  font-size: 13.2px;
  white-space: nowrap;
  flex-shrink: 0;
}
.stat-post-item .post-date i {
  margin-right: 4px;
}

/* 暗黑模式适配 */
[data-theme='dark'] .stat-section {
  border-color: #323232;
}
[data-theme='dark'] .stat-section-title {
  border-bottom-color: #323232;
}
[data-theme='dark'] .stat-overview-item,
[data-theme='dark'] .stat-post-item:hover {
  background-color: #2a2a2a;
}
[data-theme='dark'] .stat-overview-item .item-name,
[data-theme='dark'] .stat-category-item .cat-name,
[data-theme='dark'] .stat-post-item .post-title {
  color: #e8e8e8;
}
[data-theme='dark'] .stat-category-item .cat-bar {
  background-color: #323232;
}

/* 移动端 */
@media (max-width: 768px) {
  .stat-overview-item {
    width: calc(100% / 2 - 10px);
  }
}
