/* ============================================================================
 * Changelog page — status.claude.com-style timeline of product updates.
 *
 * Uses the design tokens from styles.css (--bg-0, --ink-0..3, --panel,
 * --good, --purple, --warn). No new color palette. Page layout: hero
 * header, filter chips, then a timeline grouped by month with one card
 * per entry. Also defines `.nav-unread-dot` used by every nav file to
 * show "there is something new" on the 更新 link.
 * ========================================================================== */

.changelog-page {
  max-width: 880px;
  margin: 0 auto;
  padding: 120px 28px 120px;
  color: var(--ink-1);
}

.changelog-hero {
  margin-bottom: 56px;
  text-align: center;
}
.changelog-eyebrow {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 18px;
}
.changelog-hero h1 {
  margin: 0 0 14px;
  font-family: var(--serif);
  font-size: clamp(38px, 5vw, 56px);
  line-height: 1.05;
  background: var(--grad-text);
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
  letter-spacing: 0.005em;
}
.changelog-hero p {
  margin: 0 auto;
  max-width: 520px;
  color: var(--ink-2);
  font-size: 16px;
  line-height: 1.6;
}

/* ============== Filter chips ============== */
.changelog-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 48px;
}
.changelog-filter {
  background: transparent;
  border: 1px solid var(--line-strong);
  color: var(--ink-2);
  border-radius: 999px;
  padding: 7px 16px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background .2s, color .2s, border-color .2s;
}
.changelog-filter:hover {
  color: var(--ink-0);
  border-color: var(--purple);
}
.changelog-filter[aria-pressed="true"] {
  background: rgba(139, 92, 255, 0.16);
  border-color: var(--purple);
  color: var(--ink-0);
}

/* ============== Month group ============== */
.changelog-month {
  margin-bottom: 40px;
}
.changelog-month-header {
  position: sticky;
  top: 84px;
  z-index: 2;
  background: linear-gradient(180deg, var(--bg-0) 76%, transparent);
  padding: 14px 0 18px;
  margin-bottom: 8px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--ink-3);
  border-bottom: 1px solid var(--line);
}

/* ============== Entry card ============== */
.changelog-entry {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 28px;
  padding: 24px 0 28px;
  border-bottom: 1px dashed var(--line);
}
.changelog-entry:last-child { border-bottom: none; }

.changelog-entry-date {
  font-family: var(--mono);
  color: var(--ink-3);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  padding-top: 6px;
}
.changelog-entry-date-day {
  display: block;
  font-family: var(--serif);
  font-size: 30px;
  color: var(--ink-0);
  letter-spacing: 0;
  text-transform: none;
  line-height: 1;
  margin-bottom: 6px;
}

.changelog-entry-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.changelog-entry-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}
.changelog-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid currentColor;
  background: rgba(255, 255, 255, 0.02);
  white-space: nowrap;
}
.changelog-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}
.changelog-badge--feature { color: var(--good); }
.changelog-badge--content { color: var(--purple-bright); }
.changelog-badge--fix     { color: var(--warn); }

.changelog-entry-title {
  margin: 0;
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1.3;
  color: var(--ink-0);
  letter-spacing: 0.005em;
}
.changelog-entry-summary {
  margin: 0;
  color: var(--ink-1);
  font-size: 15px;
  line-height: 1.65;
}
.changelog-entry-details {
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.changelog-entry-details li {
  position: relative;
  padding-left: 18px;
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.6;
}
.changelog-entry-details li::before {
  content: "›";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--purple);
  font-weight: 700;
}

.changelog-entry-img {
  display: block;
  margin-top: 8px;
  max-width: 100%;
  width: 480px;
  border-radius: 12px;
  border: 1px solid var(--line);
}

/* ============== Loading / empty / error state ============== */
.changelog-state {
  text-align: center;
  color: var(--ink-2);
  padding: 80px 20px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
}
.changelog-state-action {
  display: inline-block;
  margin-top: 14px;
  padding: 8px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--ink-1);
  background: transparent;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.2em;
}
.changelog-state-action:hover {
  border-color: var(--purple);
  color: var(--ink-0);
}

/* ============== Nav unread dot (shared by every nav) ==============
 * Placed in this stylesheet because every nav file (landing-nav.jsx +
 * 7 internal navs + national-exam-review.html) reads it; including it
 * once here means each page only needs to load styles-changelog.css to
 * pick up the dot styling.
 */
.nav-unread-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--bad);
  margin-left: 6px;
  vertical-align: middle;
  box-shadow: 0 0 8px rgba(255, 93, 122, 0.65);
  animation: jvn-unread-pulse 2.2s ease-in-out infinite;
}
@keyframes jvn-unread-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.55; transform: scale(0.82); }
}

/* ============================================================================
 * AIONIOS SKIN OVERRIDES
 *
 * Mirrors the recipe in styles-aionios-pages.css:60-145 (the .cat-* page):
 * (1) main containers get cream fill + 2.5px navy border + 6px ink-offset
 * shadow; (2) headings -> --a-ink, body -> --a-ink-soft; (3) chips/buttons
 * get cream-2 fill + navy border + offset shadow + hover translate + yellow
 * pop. Without this block the page is invisible on Aionios — dark-mode
 * --ink-0..3 are cream-leaning on a cream sky background.
 * ========================================================================== */
body.mode-aionios .changelog-eyebrow {
  color: var(--a-ink-soft);
}
body.mode-aionios .changelog-hero h1 {
  background: none;
  -webkit-background-clip: initial;
          background-clip: initial;
  color: var(--a-ink);
  font-family: 'Fredoka', system-ui, sans-serif;
  font-weight: 700;
}
body.mode-aionios .changelog-hero p {
  color: var(--a-ink-soft);
}

body.mode-aionios .changelog-filter {
  background: var(--a-cream-2);
  color: var(--a-ink);
  border: 2.5px solid var(--a-ink);
  box-shadow: 2px 2px 0 var(--a-ink);
  font-family: 'Fredoka', system-ui, sans-serif;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  transition: transform .12s, box-shadow .12s, background .12s;
}
body.mode-aionios .changelog-filter:hover {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 var(--a-ink);
  background: var(--a-yellow);
  color: var(--a-ink);
}
body.mode-aionios .changelog-filter[aria-pressed="true"] {
  background: var(--a-ink);
  color: var(--a-cream);
  box-shadow: 2px 2px 0 var(--a-ink);
}

body.mode-aionios .changelog-month-header {
  /* Cream gradient mask so entries scrolling under the sticky header
   * don't show through; matches the dark-mode behaviour. */
  background: linear-gradient(180deg, var(--a-cream) 78%, transparent);
  color: var(--a-ink-soft);
  border-bottom: 1.5px dashed rgba(29, 26, 59, .25);
  font-family: 'Fredoka', system-ui, sans-serif;
  font-weight: 600;
}

body.mode-aionios .changelog-entry {
  border-bottom: 1.5px dashed rgba(29, 26, 59, .18);
}
body.mode-aionios .changelog-entry-date {
  color: var(--a-ink-soft);
  font-family: 'Fredoka', system-ui, sans-serif;
}
body.mode-aionios .changelog-entry-date-day {
  color: var(--a-ink);
  font-family: 'Fredoka', system-ui, sans-serif;
  font-weight: 700;
}
body.mode-aionios .changelog-entry-title {
  color: var(--a-ink);
  font-family: 'Fredoka', system-ui, sans-serif;
  font-weight: 700;
}
body.mode-aionios .changelog-entry-summary {
  color: var(--a-ink);
}
body.mode-aionios .changelog-entry-details li {
  color: var(--a-ink-soft);
}
body.mode-aionios .changelog-entry-details li::before {
  color: var(--a-pink);
}
body.mode-aionios .changelog-entry-img {
  border: 2.5px solid var(--a-ink);
  border-radius: 18px;
  box-shadow: 4px 4px 0 var(--a-ink);
}

/* Category badges: turn into the same "cream-2 chip with navy border +
 * offset shadow" pattern as other Aionios chips, with the category
 * accent driving only the inner dot + text colour. */
body.mode-aionios .changelog-badge {
  background: var(--a-cream-2);
  border: 2px solid var(--a-ink);
  box-shadow: 2px 2px 0 var(--a-ink);
  color: var(--a-ink);
  font-family: 'Fredoka', system-ui, sans-serif;
  font-weight: 600;
}
body.mode-aionios .changelog-badge--feature { color: var(--a-mint); }
body.mode-aionios .changelog-badge--content { color: var(--a-violet); }
body.mode-aionios .changelog-badge--fix     { color: var(--a-orange); }
body.mode-aionios .changelog-badge--feature,
body.mode-aionios .changelog-badge--content,
body.mode-aionios .changelog-badge--fix {
  /* Keep the chip outline navy regardless of accent (cleaner on cream). */
  border-color: var(--a-ink);
}
/* The ::before dot inherits currentColor (accent), but the trailing
 * Chinese label text needs to stay navy so it actually reads. We add a
 * specific selector for the text node — but since the dot is a
 * pseudo-element and the label is plain text in the same span, we just
 * override colour back to ink for the chip body, and rely on a small
 * separate accent ring via inset box-shadow. */
body.mode-aionios .changelog-badge::before {
  /* Already inherits currentColor → accent; keep but soften the glow
   * which was tuned for dark mode (looked like a halo on cream). */
  box-shadow: 0 0 0 2px rgba(29, 26, 59, .08);
}
body.mode-aionios .changelog-badge {
  /* Re-apply ink color to the chip text (overrides the accent currentColor
   * set above) — the ::before dot still picks up the accent because its
   * background is set to currentColor at the rule above, which is
   * computed before this override applies. Specificity-equal, source
   * order wins. */
  color: var(--a-ink);
}
/* Restore the accent dot colour explicitly via background-color so the
 * ink override on the chip text doesn't drag the dot back to navy. */
body.mode-aionios .changelog-badge--feature::before { background: var(--a-mint); }
body.mode-aionios .changelog-badge--content::before { background: var(--a-violet); }
body.mode-aionios .changelog-badge--fix::before     { background: var(--a-orange); }

body.mode-aionios .changelog-state {
  color: var(--a-ink-soft);
  font-family: 'Fredoka', system-ui, sans-serif;
}
body.mode-aionios .changelog-state-action {
  background: var(--a-cream-2);
  color: var(--a-ink);
  border: 2.5px solid var(--a-ink);
  box-shadow: 2px 2px 0 var(--a-ink);
  font-family: 'Fredoka', system-ui, sans-serif;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
}
body.mode-aionios .changelog-state-action:hover {
  background: var(--a-yellow);
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 var(--a-ink);
}

/* nav-unread-dot already reads in both modes (red on either cream or
 * navy), but tighten the glow on cream so it doesn't look bloomed. */
body.mode-aionios .nav-unread-dot {
  box-shadow: 0 0 0 2px rgba(255, 93, 122, .25);
}

/* ============== Mobile ============== */
@media (max-width: 640px) {
  .changelog-page { padding: 100px 18px 80px; }
  .changelog-month-header { top: 74px; padding: 12px 0 14px; }
  .changelog-entry {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 20px 0 22px;
  }
  .changelog-entry-date {
    display: inline-flex;
    align-items: baseline;
    gap: 10px;
    padding-top: 0;
  }
  .changelog-entry-date-day {
    display: inline;
    font-size: 22px;
    margin-bottom: 0;
  }
  .changelog-entry-title { font-size: 19px; }
  .changelog-entry-img   { width: 100%; }
}
