/* ==================================================================
   News Tools · 共享设计系统 (Kami design system)
   warm parchment, ink-blue accent, serif-led
   ================================================================== */

/* ========== Fonts ========== */

@font-face {
  font-family: "JetBrains Mono";
  src: url("assets/fonts/JetBrainsMono.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ========== Design Tokens ========== */

:root {
  --parchment:    #f5f4ed;
  --ivory:        #faf9f5;
  --warm-sand:    #e8e6dc;

  --brand:        #1B365D;
  --brand-light:  #2D5A8A;
  --brand-tint:   #EEF2F7;

  --near-black:   #141413;
  --dark-warm:    #3d3d3a;
  --olive:        #504e49;
  --stone:        #6b6a64;

  --border:       #e8e6dc;
  --border-soft:  #e5e3d8;
  --line:         #d8d5c8;

  --serif: "PingFang SC", "PingFang TC", "Microsoft YaHei",
           system-ui, -apple-system, sans-serif;
  --sans:  "Microsoft YaHei", "Microsoft YaHei UI", system-ui, -apple-system, sans-serif;
  --mono:  "JetBrains Mono", "SF Mono", "Fira Code", Consolas, Monaco, monospace;
  --latin-ui: var(--sans);

  --sidebar-w: 200px;
  --index-w: 260px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  background: var(--parchment);
  color: var(--near-black);
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.58;
  letter-spacing: 0.4px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--brand);
  text-decoration: none;
  transition: color 0.15s;
}
a:hover { color: var(--brand-light); }

img { max-width: 100%; height: auto; }

/* ==================================================================
   Shared: Page Layout
   ================================================================== */

.page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 88px 64px 80px;
}

.page-detail {
  max-width: 820px;
  margin: 0 auto;
  padding: 56px 64px 80px;
}

body.has-sidebar {
  padding-left: var(--sidebar-w);
  padding-right: var(--index-w);
}

/* ==================================================================
   Shared: Buttons
   ================================================================== */

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--brand);
  color: var(--ivory);
  font-family: var(--latin-ui);
  font-weight: 500;
  font-size: 15px;
  font-variant-numeric: lining-nums tabular-nums;
  letter-spacing: 0.2px;
  padding: 13px 28px;
  border-radius: 999px;
  border: 1.5px solid var(--brand);
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
  cursor: pointer;
  min-width: 158px;
}
.btn-primary:hover {
  background: var(--brand-light);
  border-color: var(--brand-light);
  color: var(--ivory);
  transform: translateY(-1px);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--latin-ui);
  font-weight: 500;
  font-size: 15px;
  font-variant-numeric: lining-nums tabular-nums;
  color: var(--brand);
  background: transparent;
  padding: 13px 28px;
  border-radius: 999px;
  border: 1.5px solid var(--brand);
  transition: background 0.15s, color 0.15s, transform 0.15s;
  cursor: pointer;
  min-width: 158px;
}
.btn-ghost:hover {
  background: var(--brand-tint);
  color: var(--brand);
  transform: translateY(-1px);
}

/* ==================================================================
   Shared: Sidebar (detail pages)
   ================================================================== */

.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background: var(--parchment);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
  padding: 20px 0 16px;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--line); border-radius: 2px; }

.sidebar-home {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px 18px;
  margin: 0 0 6px;
  color: var(--near-black);
  text-decoration: none;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 18px;
  border-bottom: 1px solid var(--border-soft);
}
.sidebar-home:hover { color: var(--brand); }
.sidebar-home .icon { font-size: 20px; }

.sidebar-section {
  padding: 0 16px;
  margin-top: 8px;
}
.sidebar-section:last-child { margin-bottom: 0; }

.sidebar-month-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  padding: 8px 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 15px;
  color: var(--brand);
  letter-spacing: 0.3px;
}
.sidebar-month-toggle:hover { color: var(--brand-light); }
.sidebar-month-toggle .arrow {
  font-size: 13px;
  color: var(--stone);
  transition: transform 0.25s ease;
}
.sidebar-month-group.is-collapsed .sidebar-month-toggle .arrow {
  transform: rotate(-90deg);
}

.sidebar-month-items {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.2s ease;
  max-height: none;
  opacity: 1;
}
.sidebar-month-group.is-collapsed .sidebar-month-items {
  max-height: 0 !important;
  opacity: 0;
  pointer-events: none;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 0 7px 18px;
  color: var(--olive);
  text-decoration: none;
  font-family: var(--serif);
  font-size: 14px;
  border-radius: 4px;
  position: relative;
  transition: color 0.15s, background 0.15s;
}
.sidebar-item:hover { color: var(--brand); background: var(--brand-tint); }
.sidebar-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--line);
}
.sidebar-item.is-active { color: var(--brand); font-weight: 500; }
.sidebar-item.is-active::before { background: var(--brand); width: 9px; height: 9px; }

.sidebar-footer {
  margin-top: auto;
  padding: 16px 16px 0;
  border-top: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sidebar-footer a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  color: var(--stone);
  text-decoration: none;
  font-family: var(--serif);
  font-size: 13px;
}
.sidebar-footer a:hover { color: var(--brand); }
.sidebar-footer .icon { font-size: 16px; width: 20px; text-align: center; }

/* ==================================================================
   Shared: Right Index Nav (detail pages)
   ================================================================== */

.index-nav {
  position: fixed;
  right: 0;
  top: 0;
  bottom: 0;
  width: var(--index-w);
  background: var(--parchment);
  border-left: 1px solid var(--border);
  z-index: 99;
  overflow-y: auto;
  padding: 28px 0 20px;
  display: flex;
  flex-direction: column;
}
.index-nav::-webkit-scrollbar { width: 4px; }
.index-nav::-webkit-scrollbar-thumb { background: var(--line); border-radius: 2px; }

.index-nav .index-head {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 18px;
  letter-spacing: 0;
  color: var(--near-black);
  padding: 0 16px 14px;
  margin: 0 0 6px;
  border-bottom: 1px solid var(--border-soft);
}

.index-nav .index-item {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 6px 16px;
  font-family: var(--serif);
  font-size: 14px;
  line-height: 1.5;
  color: var(--olive);
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
  border-right: 2px solid transparent;
}
.index-nav .index-item:hover {
  color: var(--brand);
  background: var(--brand-tint);
}
.index-nav .index-item.is-active {
  color: var(--brand);
  font-weight: 500;
  background: var(--brand-tint);
  border-right-color: var(--brand);
}

.index-nav .index-item .idx-num {
  font-family: var(--latin-ui);
  font-size: 11px;
  font-weight: 500;
  color: var(--stone);
  min-width: 22px;
  text-align: right;
  flex-shrink: 0;
}
.index-nav .index-item.is-active .idx-num { color: var(--brand); }

.index-nav .index-summary {
  font-weight: 500;
  color: var(--near-black);
}
.index-nav .index-summary .idx-num {
  color: var(--brand);
  font-size: 11px;
}

.index-nav .index-divider {
  height: 1px;
  background: var(--border-soft);
  margin: 6px 16px 8px;
}

/* ==================================================================
   Shared: Footer
   ================================================================== */

footer.foot {
  margin-top: 72px;
  padding-top: 40px;
  border-top: 1px solid var(--border-soft);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 48px;
  font-family: var(--serif);
  font-size: 13px;
  color: var(--stone);
}
footer.foot-detail {
  margin-top: 64px;
  padding-top: 36px;
}

.foot .mark {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2px;
}
.foot .mark-simple {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2px;
}

.foot .mark .wm-name {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 28px;
  color: var(--near-black);
  line-height: 1.1;
  letter-spacing: 0;
}
.foot .mark .wm-line {
  font-size: 13px;
  color: var(--olive);
  margin-top: 2px;
}

.foot .colophon {
  text-align: right;
  max-width: 480px;
}
.foot .colophon .links {
  font-family: var(--latin-ui);
  color: var(--dark-warm);
  margin-bottom: 16px;
  line-height: 1.55;
}
.foot .colophon .links a { color: var(--dark-warm); }
.foot .colophon .links a:hover { color: var(--brand); }

.foot .colophon .ethos {
  color: var(--olive);
  line-height: 1.55;
  max-width: 360px;
  margin-left: auto;
}

/* ==================================================================
   Landing Page: Hero
   ================================================================== */

.hero {
  padding-bottom: 36px;
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 40px;
}

.eyebrow {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-family: var(--latin-ui);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--stone);
  margin: 0 0 28px;
}
.version-link {
  color: var(--brand);
  font-weight: 600;
}
.version-link:hover { color: var(--brand-light); }

.hero-links {
  display: flex;
  gap: 12px;
  align-items: center;
}
.hero-links a {
  color: var(--stone);
  display: flex;
  align-items: center;
}
.hero-links a:hover { color: var(--dark-warm); }

.hero h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 88px;
  line-height: 1.05;
  letter-spacing: 0;
  margin: 0 0 18px;
  color: var(--near-black);
  opacity: 0;
  transform: translateY(10px);
  filter: blur(6px);
  animation: hero-rise 900ms cubic-bezier(0.16, 1, 0.3, 1) 120ms forwards;
}
@keyframes hero-rise {
  to { opacity: 1; transform: translateY(0); filter: blur(0); }
}

.hero .tagline {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 20px;
  line-height: 1.55;
  letter-spacing: 0.4px;
  color: var(--olive);
  margin: 0 0 24px;
  max-width: 820px;
}

.hero-tokens {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin: 0 0 28px;
  font-family: var(--latin-ui);
  font-size: 13px;
  color: var(--stone);
}
.hero-tokens span {
  display: inline-flex;
  gap: 6px;
  align-items: baseline;
}
.hero-tokens b {
  color: var(--dark-warm);
  font-weight: 500;
}

/* ==================================================================
   Landing Page: Tab Bar
   ================================================================== */

.tab-bar {
  display: flex;
  gap: 4px;
  margin-bottom: 36px;
  border-bottom: 1px solid var(--border-soft);
  padding-bottom: 0;
}

.tab-btn {
  font-family: var(--latin-ui);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.3px;
  color: var(--stone);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 12px 24px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  margin-bottom: -1px;
  -webkit-tap-highlight-color: transparent;
}
.tab-btn:hover { color: var(--dark-warm); }
.tab-btn.is-active {
  color: var(--brand);
  border-bottom-color: var(--brand);
}
.tab-btn .tab-icon { margin-right: 6px; }

.tab-panel { display: none; }
.tab-panel.is-active { display: block; }

/* ==================================================================
   Landing Page: Section Headers
   ================================================================== */

.section-head {
  margin-bottom: 32px;
}
.section-num {
  font-family: var(--latin-ui);
  font-weight: 400;
  font-size: 14px;
  color: var(--brand);
  letter-spacing: 0.4px;
  margin: 0 0 6px;
}
.section-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 34px;
  line-height: 1.2;
  color: var(--near-black);
  margin: 0;
  letter-spacing: 1.2px;
}
.section-lede {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.55;
  letter-spacing: 0.4px;
  color: var(--olive);
  margin: 14px 0 0;
}

/* ==================================================================
   Landing Page: Timeline + Month Groups + Report Cards
   ================================================================== */

.timeline {
  position: relative;
  padding-left: 36px;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 15px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--line);
  border-radius: 1px;
}

.month-group {
  position: relative;
  margin-bottom: 12px;
}
.month-group:last-child { margin-bottom: 0; }
.month-group::before {
  content: "";
  position: absolute;
  left: -25px;
  top: 10px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 2px var(--parchment);
  z-index: 1;
}

.month-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  padding: 1px 0 8px;
  -webkit-tap-highlight-color: transparent;
}
.month-toggle:hover .month-label { color: var(--brand-light); }
.month-label {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 18px;
  color: var(--brand);
  letter-spacing: 0.4px;
  transition: color 0.15s;
}
.month-arrow {
  font-family: var(--latin-ui);
  font-size: 18px;
  color: var(--stone);
  transition: transform 0.25s ease;
  display: inline-block;
  line-height: 1;
}
.month-group.is-collapsed .month-arrow { transform: rotate(-90deg); }

.report-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.month-group.is-collapsed .report-grid { display: none; }

.report-card {
  display: block;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--ivory);
  padding: 24px 26px 24px 32px;
  text-decoration: none;
  color: inherit;
  position: relative;
  transition: box-shadow 0.2s, transform 0.15s;
}
.report-card:hover {
  box-shadow: 0 4px 24px rgba(0,0,0,0.05);
  transform: translateY(-2px);
}
.report-card .card-date {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 20px;
  color: var(--near-black);
  margin: 0 0 6px;
  letter-spacing: 0.1px;
}
.report-card .card-meta {
  font-family: var(--latin-ui);
  font-size: 14px;
  color: var(--stone);
  margin-bottom: 10px;
}
.report-card .card-desc {
  font-size: 15px;
  color: var(--olive);
  line-height: 1.55;
  margin: 0;
}

/* ==================================================================
   Detail Page Header
   ================================================================== */

.page-header {
  margin-bottom: 40px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border-soft);
}

.page-header .eyebrow {
  font-family: var(--latin-ui);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.4px;
  color: var(--stone);
  margin: 0 0 16px;
}
.page-header .eyebrow a { color: var(--brand); }

.page-header h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 38px;
  line-height: 1.15;
  letter-spacing: 0.6px;
  color: var(--near-black);
  margin: 0 0 12px;
}

.page-header .meta {
  font-family: var(--latin-ui);
  font-size: 14px;
  color: var(--stone);
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
}

.page-header .meta .tag {
  display: inline-block;
  background: var(--brand);
  color: var(--ivory);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 2px 10px;
  border-radius: 999px;
}

/* ==================================================================
   XWLB: Summary Section
   ================================================================== */

.summary-label {
  font-family: var(--latin-ui);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.6px;
  color: var(--brand);
  padding: 8px 0 6px 24px;
  position: relative;
  margin-top: 6px;
}
.summary-label::before {
  content: "\25C6";
  position: absolute;
  left: 0;
  top: 8px;
  color: var(--brand);
  font-size: 8px;
}

.summary-list {
  list-style: none;
  padding: 0;
  margin: 0 0 48px;
}
.summary-list li {
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.6;
  color: var(--dark-warm);
  padding: 3px 0 3px 24px;
  position: relative;
}
.summary-list li::before {
  content: "\25C6";
  position: absolute;
  left: 0;
  top: 9px;
  color: var(--brand);
  font-size: 8px;
}
.summary-list li.summary-subitem {
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.5;
  color: var(--stone);
  padding: 2px 0 2px 11px;
  position: relative;
  list-style: none;
}
.summary-list li.summary-subitem::before {
  content: "\25CB" !important;
  position: absolute;
  left: 5px;
  top: 5px;
  color: var(--line);
  font-size: 8px;
}

/* ==================================================================
   XWLB: News Items
   ================================================================== */

.news-section { margin-top: 40px; }

.news-item {
  margin-bottom: 40px;
  padding-bottom: 36px;
  border-bottom: 1px solid var(--border);
}
.news-item:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

.news-item .item-number {
  font-family: var(--latin-ui);
  font-size: 12px;
  font-weight: 500;
  color: var(--brand);
  letter-spacing: 0.3px;
  margin-bottom: 6px;
}

.news-item .item-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 21px;
  line-height: 1.35;
  color: var(--near-black);
  margin: 0 0 14px;
  letter-spacing: 0.3px;
}
.news-item .item-title a { color: inherit; }
.news-item .item-title a:hover { color: var(--brand); }

.news-item .item-content {
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.7;
  color: var(--olive);
  padding: 14px 18px;
  background: var(--ivory);
  border-left: 3px solid var(--brand);
  border-radius: 3px;
}
.news-item .item-content p {
  margin: 0 0 10px;
  text-indent: 2em;
}
.news-item .item-content p:last-child { margin-bottom: 0; }
.news-item .item-content .express-title {
  font-weight: 500;
  color: var(--near-black);
}
.news-item .item-content .express-body {
  padding-left: 16px;
  margin-bottom: 8px;
  color: var(--dark-warm);
}

/* ==================================================================
   Wallstreet: 详情页栏目
   ================================================================== */

.wallstreet-summary {
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.6;
  color: var(--olive);
  padding: 14px 18px;
  background: var(--ivory);
  border-left: 3px solid var(--brand);
  border-radius: 3px;
  margin: 0 0 36px;
}

.wallstreet-section {
  margin-top: 44px;
  padding-top: 36px;
  border-top: 1px solid var(--border);
}
.wallstreet-section:first-of-type { margin-top: 0; }

.wallstreet-section .section-head {
  margin-bottom: 20px;
}
.wallstreet-section .section-title {
  font-size: 20px;
  line-height: 1.4;
  color: var(--near-black);
  margin-top: 4px;
}

.wallstreet-cover {
  margin: 0 0 18px;
  max-width: 640px;
}
.wallstreet-cover img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.wallstreet-list {
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.7;
  color: var(--olive);
  padding: 0;
  margin: 0;
  list-style: none;
}
.wallstreet-list li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 10px;
  color: var(--dark-warm);
}
.wallstreet-list li::before {
  content: "◆";
  position: absolute;
  left: 0;
  top: 2px;
  font-size: 10px;
  color: var(--brand);
}

.wallstreet-foot {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 18px;
  font-family: var(--latin-ui);
  font-size: 12px;
  color: var(--stone);
}
.wallstreet-source {
  color: var(--brand);
  text-decoration: none;
  border-bottom: 1px dotted currentColor;
}
.wallstreet-source:hover { border-bottom-style: solid; }
.wallstreet-time { color: var(--stone); }

.wallstreet-empty .section-title {
  color: var(--stone);
}
.wallstreet-empty-note {
  font-family: var(--serif);
  font-size: 14px;
  color: var(--stone);
  margin: 0;
  padding: 16px 18px;
  background: var(--ivory);
  border-radius: 3px;
}

/* ==================================================================
   GitHub: Cover Summary
   ================================================================== */

.cover-summary {
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.65;
  color: var(--olive);
  margin: 0 0 28px;
  padding: 16px 20px;
  background: var(--ivory);
  border-left: 3px solid var(--brand);
  border-radius: 3px;
}
.cover-summary .hl { color: var(--brand); font-weight: 500; }
.cover-summary strong { color: var(--near-black); font-weight: 500; }

/* ==================================================================
   GitHub: Rank Table
   ================================================================== */

.rank-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  text-align: left;
  margin-bottom: 48px;
}
.rank-table thead th {
  font-weight: 500;
  color: var(--brand);
  padding: 6px 10px;
  border-bottom: 1.5px solid var(--brand);
  letter-spacing: 0.4px;
  font-size: 14px;
}
.rank-table tbody td {
  padding: 5px 10px;
  border-bottom: 0.5px solid var(--border-soft);
  color: var(--dark-warm);
  line-height: 1.45;
}
.rank-table tbody tr:last-child td { border-bottom: none; }
.rank-table .td-rank {
  color: var(--stone);
  font-family: var(--mono);
  font-size: 16px;
  width: 30px;
  text-align: center;
}
.rank-table .td-repo {
  font-weight: 500;
  color: var(--near-black);
  font-size: 16px;
}
.rank-table .td-repo .author {
  font-weight: 400;
  color: var(--stone);
  font-size: 13px;
}
.rank-table .td-stars,
.rank-table .td-forks {
  font-family: var(--mono);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.rank-table .td-stars { color: var(--brand); font-weight: 500; }
.rank-table .td-forks { color: var(--stone); }

/* ==================================================================
   GitHub: Repo Items
   ================================================================== */

.repo-section { margin-top: 24px; }

.repo-item {
  margin-bottom: 40px;
  padding-bottom: 36px;
  border-bottom: 2px solid var(--line);
  position: relative;
}
.repo-item:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

.repo-item .repo-number {
  font-family: var(--serif);
  font-size: 72px;
  font-weight: 500;
  color: var(--brand);
  line-height: 1;
  opacity: 0.06;
  position: absolute;
  top: -6px;
  right: 0;
  pointer-events: none;
  user-select: none;
}

.repo-item .repo-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  padding-right: 64px;
}
.repo-item .repo-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
  overflow: hidden;
  border: 1px solid var(--border);
}
.repo-item .repo-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.repo-item .repo-name {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 21px;
  line-height: 1.3;
  color: var(--near-black);
  word-break: break-all;
}
.repo-item .repo-name .author-name {
  font-weight: 400;
  font-size: 13px;
  color: var(--stone);
  display: block;
  margin-top: 1px;
}
.repo-item .repo-name a { color: inherit; }
.repo-item .repo-name a:hover { color: var(--brand); }

.repo-item .repo-metrics {
  display: flex;
  gap: 14px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.repo-item .repo-metric {
  display: flex;
  align-items: baseline;
  gap: 3px;
  font-size: 13px;
}
.repo-item .repo-metric .val {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 500;
  color: var(--brand);
  font-variant-numeric: tabular-nums;
}
.repo-item .repo-metric .lbl {
  font-size: 11px;
  color: var(--stone);
  letter-spacing: 0.3px;
}
.repo-item .repo-metric .lang-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 2px;
  vertical-align: middle;
}

.repo-item .repo-desc {
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.6;
  color: var(--olive);
  margin-bottom: 10px;
  padding: 10px 16px;
  background: var(--ivory);
  border-left: 3px solid var(--brand);
  border-radius: 3px;
}

.repo-item .repo-features {
  list-style: none;
  padding: 0;
  margin: 0 0 10px;
}
.repo-item .repo-features li {
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.45;
  color: var(--dark-warm);
  padding: 2px 0 2px 18px;
  position: relative;
}
.repo-item .repo-features li::before {
  content: "\25C6";
  position: absolute;
  left: 0;
  color: var(--brand);
  font-size: 7px;
  top: 6px;
}

.repo-item .repo-audience {
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  color: var(--stone);
  padding: 6px 12px;
  background: var(--brand-tint);
  border-radius: 4px;
  margin-bottom: 10px;
  display: inline-block;
}
.repo-item .repo-audience strong {
  color: var(--brand);
  font-weight: 500;
}

.repo-item .repo-url {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--stone);
  word-break: break-all;
  padding-top: 6px;
  margin-top: 8px;
  border-top: 1px solid var(--border);
  letter-spacing: 0.2px;
  line-height: 1.4;
}
.repo-item .repo-url a { color: var(--brand); text-decoration: none; }

/* ==================================================================
   Loading / Error States
   ================================================================== */

.loading-spinner {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 80px 20px;
  color: var(--stone);
  font-family: var(--serif);
  font-size: 16px;
}
.loading-spinner::after {
  content: "";
  width: 24px;
  height: 24px;
  margin-left: 12px;
  border: 2px solid var(--border);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

.error-message {
  padding: 40px 20px;
  text-align: center;
  color: var(--stone);
  font-family: var(--serif);
  font-size: 16px;
}

/* ==================================================================
   Responsive
   ================================================================== */

@media (max-width: 1200px) {
  .index-nav { display: none; }
  body.has-sidebar { padding-right: 0; }
}

@media (max-width: 880px) {
  .page { padding: 64px 32px 60px; }
  .page-detail { padding: 40px 28px 60px; }
  .hero { margin-bottom: 32px; padding-bottom: 24px; }
  .hero h1 { font-size: 56px; letter-spacing: 0; }
  .hero .tagline { font-size: 17px; }
  .section-title { font-size: 30px; letter-spacing: 0.8px; }
  .tab-btn { padding: 10px 16px; font-size: 13px; }
  .page-header h1 { font-size: 34px; letter-spacing: 0.4px; }
  .page-header { margin-bottom: 32px; padding-bottom: 24px; }
  .section-title { font-size: 22px; }
  .news-item .item-title { font-size: 18px; }
  .repo-item .repo-name { font-size: 18px; }
  .foot {
    flex-direction: column;
    align-items: flex-start;
    gap: 32px;
    padding-top: 32px;
    margin-top: 48px;
  }
  .foot .colophon { text-align: left; max-width: 100%; }
  .foot .colophon .ethos { margin-left: 0; }
  .foot { align-items: flex-start; }
}

@media (max-width: 800px) {
  .sidebar {
    position: relative;
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    padding: 12px 16px;
    border-right: none;
    border-bottom: 1px solid var(--border);
    overflow-y: visible;
    gap: 8px;
  }
  .sidebar-home { border-bottom: none; padding: 0; margin: 0; }
  .sidebar-section { display: none; }
  .sidebar-footer { margin-top: 0; border-top: none; padding: 0; flex-direction: row; }
  body.has-sidebar { padding: 0; }
  .page-detail { padding: 32px 20px 48px; }
  .page-header h1 { font-size: 28px; }
  .page-header .meta { flex-direction: column; gap: 8px; align-items: flex-start; }
  .summary-list li { font-size: 15px; }
  .news-item .item-content { padding: 12px 14px; }
  .repo-item { margin-bottom: 28px; padding-bottom: 24px; }
  .repo-item .repo-desc { padding: 8px 12px; font-size: 14px; }
  .rank-table { font-size: 13px; }
}

@media (max-width: 480px) {
  .page { padding: 24px 16px 40px; }
  .page-detail { padding: 24px 16px 40px; }
  .hero h1 { font-size: 48px; }
  .hero .tagline { font-size: 16px; }
  .tab-bar { gap: 2px; }
  .tab-btn { padding: 8px 12px; font-size: 12px; }
  .tab-btn .tab-icon { margin-right: 4px; }
  .page-header { margin-bottom: 20px; padding-bottom: 16px; }
  .page-header h1 { font-size: 22px; letter-spacing: 0.2px; }
  .page-header .meta { font-size: 12px; gap: 6px; }
  .section-title { font-size: 18px; }
  .news-item { margin-bottom: 28px; padding-bottom: 24px; }
  .news-item .item-title { font-size: 16px; }
  .news-item .item-content { padding: 10px 12px; font-size: 14px; }
  .summary-list { margin-bottom: 32px; }
  .summary-list li { font-size: 14px; padding: 2px 0 2px 18px; }
  .sidebar-month-toggle { font-size: 14px; }
  .cover-summary { font-size: 14px; padding: 12px 14px; }
  .repo-item .repo-name { font-size: 16px; }
  .repo-item .repo-name .author-name { font-size: 12px; }
  .repo-item .repo-header { gap: 8px; }
  .repo-item .repo-avatar { width: 32px; height: 32px; }
  .repo-item .repo-metrics { gap: 10px; }
  .repo-item .repo-metric { font-size: 12px; }
  .repo-item .repo-metric .val { font-size: 13px; }
  .repo-item .repo-desc { font-size: 14px; padding: 8px 12px; }
  .repo-item .repo-features li { font-size: 13px; }
  .repo-item .repo-audience { font-size: 12px; }
  .repo-item .repo-url { font-size: 11px; }
  .repo-item .repo-number { font-size: 48px; }
  .rank-table { font-size: 12px; }
  .rank-table thead th { font-size: 11px; padding: 4px 6px; }
  .rank-table tbody td { padding: 3px 6px; }
  .rank-table .td-repo { font-size: 13px; }
  .rank-table .td-repo .author { font-size: 10px; }
  footer.foot { margin-top: 40px; padding-top: 24px; flex-direction: column; gap: 24px; }
  footer.foot .colophon { text-align: left; max-width: 100%; }
  footer.foot-detail { margin-top: 40px; padding-top: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  .hero h1 { animation: none; opacity: 1; transform: none; filter: none; }
  .page-header h1 { animation: none; opacity: 1; transform: none; filter: none; }
}
