#content.stats-page {
  color: var(--color-text-body);
}

#content.stats-page > .entry-title,
#content.stats-page > .entry-content:empty {
  display: none;
}

#content.stats-page .stats-ledger {
  width: 100%;
  min-width: 0;
}

#content.stats-page .stats-ledger [hidden] {
  display: none;
}

#content.stats-page .stats-hero {
  padding: 1.65rem 0 0.25rem;
}

#content.stats-page .stats-kicker {
  margin: 0 0 0.55rem;
  color: var(--color-accent);
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.16em;
}

#content.stats-page .stats-hero h2 {
  max-width: 20ch;
  margin: 0;
  color: var(--color-text);
  font-family: Georgia, "Songti SC", STSong, "Noto Serif CJK SC", serif;
  font-size: clamp(1.85rem, 5vw, 2.65rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

#content.stats-page .stats-updated {
  margin: 0.6rem 0 0;
  color: var(--color-text-muted);
  font-size: 0.78rem;
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
}

#content.stats-page .stats-alert {
  margin: 1.25rem 0 0;
  padding: 0.65rem 0.8rem;
  border-left: 2px solid var(--color-accent);
  color: var(--color-text-secondary);
  background: var(--color-bg);
  font-size: 0.82rem;
}

#content.stats-page .stats-overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 2.3rem 0 3.6rem;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

#content.stats-page .stats-overview > div {
  min-width: 0;
  padding: 1.1rem 1rem 1rem;
  border-left: 1px solid var(--color-border);
}

#content.stats-page .stats-overview > div:first-child {
  border-left: 0;
  padding-left: 0;
}

#content.stats-page .stats-overview > div:last-child {
  padding-right: 0;
}

#content.stats-page .stats-overview strong,
#content.stats-page .stats-overview span {
  display: block;
}

#content.stats-page .stats-overview strong {
  overflow-wrap: anywhere;
  color: var(--color-text);
  font-family: Georgia, "Songti SC", STSong, serif;
  font-size: clamp(1.25rem, 3.3vw, 1.75rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

#content.stats-page .stats-overview span {
  margin-top: 0.45rem;
  color: var(--color-text-muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

#content.stats-page .stats-section {
  margin: 0 0 3.4rem;
}

#content.stats-page .stats-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--color-border);
}

#content.stats-page .stats-section-head h3,
#content.stats-page .stats-section h4,
#content.stats-page #statsReports h3 {
  margin: 0;
  color: var(--color-text);
  font-weight: 600;
}

#content.stats-page .stats-section-head h3 {
  font-size: 1.15rem;
  line-height: 1.35;
}

#content.stats-page .stats-section-head > span {
  color: var(--color-text-muted);
  font-size: 0.78rem;
  line-height: 1.45;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

#content.stats-page .stats-writing-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(16rem, 1fr);
  gap: clamp(1.5rem, 4vw, 2.8rem);
  padding-top: 1.35rem;
}

#content.stats-page #statsWritingChart {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(0.24rem, 1vw, 0.55rem);
  min-width: 0;
  height: 13rem;
  padding-top: 0.5rem;
  border-bottom: 1px solid var(--color-border);
}

#content.stats-page #statsWritingChart li {
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr) 1.05rem;
  min-width: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

#content.stats-page #statsWritingChart li::before {
  content: none;
}

#content.stats-page #statsWritingChart li::after {
  align-self: end;
  color: var(--color-text-muted);
  font-size: 0.58rem;
  line-height: 1.8;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

#content.stats-page #statsWritingChart li:nth-child(1)::after { content: "1月"; }
#content.stats-page #statsWritingChart li:nth-child(3)::after { content: "3月"; }
#content.stats-page #statsWritingChart li:nth-child(5)::after { content: "5月"; }
#content.stats-page #statsWritingChart li:nth-child(7)::after { content: "7月"; }
#content.stats-page #statsWritingChart li:nth-child(9)::after { content: "9月"; }
#content.stats-page #statsWritingChart li:nth-child(11)::after { content: "11月"; }

#content.stats-page #statsWritingChart i {
  align-self: end;
  width: 100%;
  min-height: 2px;
  height: max(2px, var(--stats-value));
  background: var(--color-accent);
  opacity: 0.74;
}

#content.stats-page #statsWritingChart li > span,
#content.stats-page #statsWritingChart li > strong,
#content.stats-page #statsTrafficChart li > span,
#content.stats-page #statsTrafficChart li > strong {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

#content.stats-page #statsCategories {
  min-width: 0;
}

#content.stats-page #statsCategories li {
  display: grid;
  grid-template-columns: minmax(5rem, 0.8fr) minmax(4rem, 1.45fr) minmax(4.5rem, auto);
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 0.75rem;
  padding: 0;
  list-style: none;
}

#content.stats-page #statsCategories li::before {
  content: none;
}

#content.stats-page #statsCategories span {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--color-text-secondary);
  font-size: 0.82rem;
  line-height: 1.35;
}

#content.stats-page #statsCategories i {
  display: block;
  width: var(--stats-value);
  min-width: 2px;
  height: 0.28rem;
  background: var(--color-accent);
  opacity: 0.85;
}

#content.stats-page #statsCategories strong {
  color: var(--color-text-muted);
  font-size: 0.76rem;
  font-weight: 400;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

#content.stats-page .stats-traffic-summary {
  display: grid;
  grid-template-columns: minmax(11rem, 0.5fr) minmax(0, 1.5fr);
  gap: clamp(1.5rem, 4vw, 2.8rem);
  align-items: stretch;
  padding: 1.45rem 0 2rem;
}

#content.stats-page .stats-traffic-summary > div:first-child {
  align-self: center;
}

#content.stats-page .stats-traffic-summary > div:first-child strong,
#content.stats-page .stats-traffic-summary > div:first-child span {
  display: block;
}

#content.stats-page .stats-traffic-summary > div:first-child strong {
  color: var(--color-text);
  font-family: Georgia, "Songti SC", STSong, serif;
  font-size: clamp(1.65rem, 4vw, 2.25rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

#content.stats-page .stats-traffic-summary > div:first-child span {
  margin-top: 0.4rem;
  color: var(--color-text-muted);
  font-size: 0.78rem;
}

#content.stats-page #statsTrafficChart {
  position: relative;
  display: flex;
  align-items: end;
  gap: 2px;
  min-width: 0;
  height: 6.4rem;
  border-bottom: 1px solid var(--color-border);
}

#content.stats-page #statsTrafficChart[hidden] {
  display: none;
}

#content.stats-page #statsTrafficChart li {
  position: relative;
  display: flex;
  flex: 1 1 0;
  align-items: end;
  height: 100%;
  min-width: 1px;
  margin: 0;
  padding: 0;
  list-style: none;
}

#content.stats-page #statsTrafficChart li::before {
  content: none;
}

#content.stats-page #statsTrafficChart i {
  display: block;
  width: 100%;
  min-height: 2px;
  height: max(2px, var(--stats-value));
  background: var(--color-accent);
  opacity: 0.62;
}


#content.stats-page .stats-traffic-lists {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(10rem, 0.85fr);
  gap: clamp(2.5rem, 5vw, 4.2rem);
  margin-top: 3.2rem;
}

#content.stats-page .stats-traffic-lists h4,
#content.stats-page .stats-list-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.94rem;
  line-height: 1.4;
  letter-spacing: 0.02em;
  margin: 0;
}

#content.stats-page .stats-list-heading h4 {
  padding-bottom: 0;
  border-bottom: none;
  font-size: inherit;
  line-height: inherit;
  letter-spacing: inherit;
  margin: 0;
}

#content.stats-page .stats-tab-group {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

#content.stats-page .stats-tab {
  appearance: none;
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  font-family: inherit;
  font-size: inherit;
  color: var(--color-text-muted);
  cursor: pointer;
  line-height: inherit;
  text-decoration: none;
  transition: color 0.15s ease;
}

#content.stats-page .stats-tab:hover {
  color: var(--color-text);
}

#content.stats-page .stats-tab.is-active {
  color: var(--color-accent);
  font-weight: 500;
  cursor: default;
}

#content.stats-page .stats-tab-sep {
  opacity: 0.4;
  user-select: none;
}

#content.stats-page .stats-traffic-lists ol,
#content.stats-page .stats-traffic-lists ul {
  margin: 0.4rem 0 0;
  padding: 0;
  list-style: none;
}

#content.stats-page .stats-traffic-lists li {
  display: grid;
  align-items: baseline;
  gap: 1rem;
  margin: 0;
  padding: 0.85rem 0;
  list-style: none;
  font-size: 0.94rem;
  line-height: 1.6;
}

#content.stats-page .stats-traffic-lists li::before {
  content: none;
}

#content.stats-page #statsTopArticles li {
  grid-template-columns: 2.2ch minmax(0, 1fr) minmax(3.8rem, auto);
}

#content.stats-page #statsReferrers li {
  grid-template-columns: minmax(0, 1fr) minmax(3.8rem, auto);
}

#content.stats-page .stats-traffic-lists li > span {
  color: var(--color-text-muted);
  font-size: 0.82rem;
  opacity: 0.7;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}

#content.stats-page #statsReferrers li > span {
  color: var(--color-text-body);
  font-size: 0.94rem;
  opacity: 1;
}

#content.stats-page .stats-traffic-lists li > strong {
  color: var(--color-text-muted);
  font-size: 0.86rem;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

#content.stats-page .stats-traffic-lists a {
  justify-self: start;
  max-width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--color-text-body);
  transition: color 0.15s ease;
}

#content.stats-page .stats-traffic-lists a:hover,
#content.stats-page .stats-traffic-lists a:active {
  color: var(--color-accent);
}

#content.stats-page #statsReports {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 1rem;
  padding: 0.85rem 0;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

#content.stats-page #statsReports[hidden] {
  display: none;
}

#content.stats-page #statsReports h3 {
  font-size: 0.92rem;
}
#content.stats-page #statsReports [data-report-links] {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.4rem 1rem;
  font-size: 0.84rem;
}

#content.stats-page #statsReports a::after {
  content: " →";
}


@media (max-width: 720px) {
  #content.stats-page .stats-hero {
    padding-top: 0.8rem;
  }

  #content.stats-page .stats-overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 1.8rem 0 2.8rem;
  }

  #content.stats-page .stats-overview > div {
    padding: 0.9rem 0.75rem;
  }

  #content.stats-page .stats-overview > div:nth-child(odd) {
    padding-left: 0;
    border-left: 0;
  }

  #content.stats-page .stats-overview > div:nth-child(n + 3) {
    border-top: 1px solid var(--color-border);
  }

  #content.stats-page .stats-section-head {
    display: block;
  }

  #content.stats-page .stats-section-head > span {
    display: block;
    margin-top: 0.3rem;
    text-align: left;
  }

  #content.stats-page .stats-writing-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 2rem;
  }

  #content.stats-page .stats-traffic-lists {
    grid-template-columns: minmax(0, 1fr);
    gap: 2.4rem;
  }

  #content.stats-page #statsWritingChart {
    height: 11rem;
  }

  #content.stats-page .stats-traffic-summary {
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
  }

  #content.stats-page #statsTrafficChart {
    height: 6.2rem;
  }
}

@media (max-width: 420px) {
  #content.stats-page .stats-overview strong {
    font-size: 1.2rem;
  }

  #content.stats-page #statsWritingChart {
    gap: 0.2rem;
  }

  #content.stats-page #statsWritingChart li::after {
    font-size: 0.52rem;
  }

  #content.stats-page #statsCategories li {
    grid-template-columns: minmax(4.3rem, 0.8fr) minmax(3rem, 1.2fr) minmax(4rem, auto);
    gap: 0.5rem;
  }

  #content.stats-page #statsReports {
    grid-template-columns: minmax(0, 1fr);
  }

  #content.stats-page #statsReports [data-report-links] {
    justify-content: flex-start;
  }
}
