/* ========================================================================
   [AI Context]
   SanchoExo 官网更新历程页：版本概览、时间轴与发布说明分组布局。
   仅依赖 site.css 的主题变量，保持深浅主题和响应式行为一致。
   ======================================================================== */

.changelog-page {
  min-height: 100vh;
}

.changelog-page > .glow-bg {
  left: 0 !important;
}

.changelog-page > .glow-purple {
  right: 0 !important;
  left: auto !important;
}

.changelog-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.changelog-main {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 128px clamp(20px, 5vw, 56px) 88px;
  position: relative;
  z-index: 2;
}

.changelog-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.44fr);
  align-items: end;
  gap: clamp(28px, 6vw, 68px);
  margin-bottom: 42px;
  padding-bottom: 38px;
  border-bottom: 1px solid var(--line);
}

.changelog-hero-copy {
  min-width: 0;
}

.changelog-hero .eyebrow {
  margin-bottom: 14px;
}

.changelog-hero h1 {
  margin: 0 0 16px;
  font-size: clamp(42px, 6vw, 72px);
  line-height: 0.98;
  letter-spacing: -2.4px;
}

.changelog-hero .lead {
  max-width: 720px;
  margin: 0;
  color: var(--text-secondary);
  font-size: clamp(16px, 1.7vw, 19px);
  line-height: 1.72;
}

.release-overview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  padding: 0;
  background: var(--line);
}

.release-overview:hover {
  background: var(--line);
}

.release-stat {
  min-width: 0;
  min-height: 132px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--bg-card);
}

.release-stat > span {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.release-stat strong {
  display: block;
  overflow: hidden;
  color: var(--text-primary);
  font-size: clamp(28px, 3vw, 38px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -1px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.release-stat small {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
}

.latest-stat strong {
  color: var(--cyan);
}

.timeline {
  position: relative;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
  list-style: none;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 30px;
  bottom: 30px;
  left: 48px;
  width: 1px;
  background: linear-gradient(180deg, var(--cyan), var(--purple) 52%, transparent);
  opacity: 0.3;
  pointer-events: none;
}

.timeline > .release-card {
  position: relative;
  z-index: 1;
  min-width: 0;
  padding: clamp(22px, 3vw, 30px);
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr);
  gap: 0 22px;
  transition: transform 0.24s ease, border-color 0.24s ease, background-color 0.24s ease, box-shadow 0.24s ease;
}

.timeline > .release-card:hover {
  transform: translateY(-2px);
}

.timeline > .release-card.is-latest {
  border-color: color-mix(in srgb, var(--cyan) 34%, transparent);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--cyan) 8%, transparent), transparent 42%),
    var(--bg-card);
  box-shadow: var(--shadow-premium), 0 0 34px color-mix(in srgb, var(--cyan) 8%, transparent);
}

.release-marker {
  position: relative;
  z-index: 2;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  justify-self: center;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--bg-main);
  color: var(--text-muted);
  font-family: "Inter", ui-monospace, monospace;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: -0.2px;
  box-shadow: 0 0 0 8px var(--bg-card);
  transition: border-color 0.24s ease, color 0.24s ease, background-color 0.24s ease;
}

.release-card:hover .release-marker {
  border-color: var(--cyan);
  color: var(--cyan);
}

.release-card.is-latest .release-marker {
  border-color: var(--cyan);
  background: linear-gradient(145deg, var(--cyan), var(--cyan-dark));
  color: #071016;
  box-shadow: 0 0 0 8px var(--bg-card), var(--shadow-glow);
}

.release-body {
  min-width: 0;
}

.release-body > summary {
  list-style: none;
  cursor: pointer;
}

.release-body > summary::-webkit-details-marker {
  display: none;
}

.release-body > summary::marker {
  content: "";
}

.release-body > summary:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 5px;
  border-radius: 8px;
}

.ver-header {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.ver-title-row {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.ver-num {
  margin: 0;
  color: var(--text-primary);
  font-size: clamp(22px, 2.4vw, 30px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.9px;
}

.latest-pill {
  padding: 4px 9px;
  border: 1px solid color-mix(in srgb, var(--cyan) 30%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--cyan) 10%, transparent);
  color: var(--cyan);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.6px;
}

.ver-date {
  flex: 0 0 auto;
  color: var(--text-muted);
  font-family: "Inter", ui-monospace, monospace;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.ver-summary-meta {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.summary-chevron {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: color-mix(in srgb, var(--bg-main) 54%, transparent);
  transition: transform 0.24s ease, border-color 0.24s ease, color 0.24s ease;
}

.summary-chevron::before {
  content: "";
  width: 6px;
  height: 6px;
  margin-top: -3px;
  border-right: 1.5px solid var(--text-muted);
  border-bottom: 1.5px solid var(--text-muted);
  transform: rotate(45deg);
}

.release-body[open] .summary-chevron {
  transform: rotate(180deg);
}

.release-body > summary:hover .summary-chevron {
  border-color: var(--cyan);
}

.ver-sections {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.ver-section {
  min-width: 0;
  padding: 16px 18px 17px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--bg-main) 54%, transparent);
}

.ver-section:only-child {
  grid-column: 1 / -1;
}

.ver-section-heading {
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ver-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.ver-tag::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 10px currentColor;
}

.section-feature .ver-tag { color: var(--cyan); }
.section-fix .ver-tag { color: var(--red); }
.section-maintenance .ver-tag { color: var(--purple); }
.section-summary .ver-tag { color: var(--amber); }

.ver-item-count {
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text-muted);
  font-family: "Inter", ui-monospace, monospace;
  font-size: 10px;
  font-weight: 700;
}

.ver-section ul {
  margin: 0;
  padding: 0;
  display: grid;
  gap: 9px;
  list-style: none;
}

.ver-section li {
  min-width: 0;
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 8px;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.62;
  overflow-wrap: break-word;
}

.ver-section li::before {
  content: "";
  width: 5px;
  height: 1px;
  margin-top: 0.78em;
  background: var(--text-muted);
}

.release-card.is-git-tag .release-marker {
  border-style: dashed;
}

.release-card.is-git-tag .ver-section {
  background: transparent;
}

.timeline-loading,
.timeline-message {
  min-height: 150px;
  padding: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--text-muted);
  text-align: center;
}

.timeline-loading p {
  margin: 0;
}

.loading-pulse {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--cyan) 42%, transparent);
  animation: changelog-pulse 1.5s ease-out infinite;
}

@keyframes changelog-pulse {
  70% { box-shadow: 0 0 0 10px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

@media (max-width: 900px) {
  .changelog-page .top-nav-right nav {
    display: none;
  }

  .changelog-hero {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .release-overview {
    width: min(480px, 100%);
  }
}

@media (max-width: 760px) {
  .changelog-main {
    padding-top: 108px;
  }

  .ver-sections {
    grid-template-columns: 1fr;
  }

  .ver-section:only-child {
    grid-column: auto;
  }
}

@media (max-width: 560px) {
  .changelog-main {
    padding-inline: 14px;
    padding-bottom: 60px;
  }

  .changelog-hero {
    margin-bottom: 28px;
    padding-bottom: 28px;
  }

  .changelog-hero h1 {
    font-size: 42px;
    letter-spacing: -1.6px;
  }

  .release-stat {
    min-height: 112px;
    padding: 16px;
  }

  .timeline {
    gap: 12px;
  }

  .timeline::before {
    left: 34px;
  }

  .timeline > .release-card {
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 0 12px;
    padding: 18px 15px;
  }

  .release-marker {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    font-size: 8px;
    box-shadow: 0 0 0 6px var(--bg-card);
  }

  .release-card.is-latest .release-marker {
    box-shadow: 0 0 0 6px var(--bg-card), var(--shadow-glow);
  }

  .ver-header {
    min-height: 32px;
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .ver-summary-meta {
    width: 100%;
    justify-content: space-between;
  }

  .ver-num {
    font-size: 22px;
  }

  .ver-sections {
    margin-top: 14px;
    gap: 10px;
  }

  .ver-section {
    padding: 14px;
  }

  .ver-section li {
    font-size: 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .timeline > .release-card,
  .loading-pulse {
    animation: none;
    transition: none;
  }
}
