:root {
  --ink: #14201c;
  --ink-soft: #3d4f48;
  --muted: #6b7c74;
  --paper: #f3f6f2;
  --paper-2: #e8efe9;
  --teal: #0d6b5f;
  --teal-deep: #084c44;
  --teal-soft: #d5ebe6;
  --lime: #b8d12a;
  --lime-ink: #3a4a0a;
  --line: rgba(20, 32, 28, 0.1);
  --line-strong: rgba(20, 32, 28, 0.18);
  --shadow: 0 18px 40px rgba(8, 76, 68, 0.08);
  --radius: 14px;
  --max: 920px;
  --font-display: "Outfit", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-body: "Figtree", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: auto;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  background:
    radial-gradient(1200px 700px at 12% -10%, rgba(184, 209, 42, 0.18), transparent 55%),
    radial-gradient(900px 600px at 100% 8%, rgba(13, 107, 95, 0.16), transparent 50%),
    linear-gradient(180deg, #f7faf6 0%, var(--paper) 42%, #eef3ef 100%);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(13, 107, 95, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(13, 107, 95, 0.045) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, #000 0%, transparent 70%);
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  cursor: pointer;
  border: 0;
  background: none;
}

img {
  max-width: 100%;
  display: block;
}

.site {
  position: relative;
  z-index: 1;
}

/* —— Top bar —— */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: calc(var(--max) + 80px);
  margin: 0 auto;
  padding: 1.35rem 1.25rem 0.25rem;
}

.topbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: 0.04em;
  color: var(--teal-deep);
}

.topbar-logo {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  object-fit: cover;
  flex-shrink: 0;
}

.topbar-meta {
  color: var(--muted);
  font-size: 0.98rem;
  font-weight: 500;
}

/* —— Hero —— */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(140px, 220px);
  align-items: center;
  gap: 1.5rem 2rem;
  max-width: calc(var(--max) + 80px);
  margin: 0 auto;
  padding: 1.75rem 1.25rem 2.25rem;
}

.hero-visual {
  position: relative;
  width: 100%;
  max-width: 200px;
  margin-left: auto;
  pointer-events: none;
}

.hero-logo {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  border-radius: 18px;
  object-fit: cover;
  background: #fff;
}

.hero-copy {
  position: relative;
  z-index: 2;
  min-width: 0;
}

.brand {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2rem, 4.5vw, 2.75rem);
  line-height: 1.05;
  letter-spacing: 0.01em;
  color: var(--teal-deep);
}

.hero-title {
  margin: 0 0 0.55rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.15rem, 2.4vw, 1.4rem);
  letter-spacing: -0.02em;
  color: var(--ink);
}

.hero-desc {
  margin: 0 0 1.15rem;
  color: var(--ink-soft);
  font-size: 0.98rem;
  font-weight: 500;
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 40px;
  padding: 0.55rem 1.05rem;
  border-radius: 9px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--teal);
  color: #f7faf6;
  box-shadow: 0 10px 24px rgba(13, 107, 95, 0.28);
}

.btn-primary:hover {
  background: var(--teal-deep);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.55);
  color: var(--teal-deep);
  border: 1px solid var(--line-strong);
  backdrop-filter: blur(8px);
}

.btn-ghost:hover {
  background: #fff;
}

/* —— Ads —— */
.ad-section {
  max-width: calc(var(--max) + 80px);
  margin: 0 auto 1.75rem;
  padding: 0 1.25rem;
}

.ad-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.ad-item {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-height: 100%;
  padding: 0.85rem 0.9rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.ad-item:hover {
  border-color: rgba(13, 107, 95, 0.35);
  box-shadow: 0 10px 28px rgba(8, 76, 68, 0.14);
}

.ad-item--hot {
  border-color: rgba(13, 107, 95, 0.32);
  background:
    linear-gradient(145deg, rgba(184, 209, 42, 0.16), transparent 55%),
    rgba(255, 255, 255, 0.9);
}

.ad-item--hot .ad-item-tag {
  background: #fde8e6;
  color: #c0392b;
}

.ad-item--empty {
  cursor: default;
  opacity: 0.72;
  border-style: dashed;
  background: rgba(255, 255, 255, 0.45);
}

.ad-item--empty:hover {
  border-color: var(--line);
  box-shadow: 0 8px 22px rgba(8, 76, 68, 0.1);
}

.ad-item--empty .ad-item-tag {
  background: var(--paper-2);
  color: var(--muted);
}

.ad-item-tag {
  align-self: flex-start;
  padding: 0.1rem 0.45rem;
  border-radius: 5px;
  background: var(--teal-soft);
  color: var(--teal-deep);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.ad-item-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.ad-item-desc {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
  font-weight: 500;
}

/* —— Main —— */
.main {
  max-width: calc(var(--max) + 80px);
  margin: 0 auto;
  padding: 0 1.25rem 4.5rem;
}

.toolbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem 1rem;
  margin-bottom: 1.75rem;
  padding: 0.85rem 0;
  background: linear-gradient(180deg, rgba(243, 246, 242, 0.94) 55%, rgba(243, 246, 242, 0));
  backdrop-filter: blur(10px);
}

.toolbar-label {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.filters--scope {
  width: 100%;
  margin-top: -0.25rem;
}

.filter-btn {
  min-height: 36px;
  padding: 0.35rem 0.85rem;
  border-radius: 8px;
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 0.88rem;
  border: 1px solid transparent;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.filter-btn:hover {
  background: rgba(255, 255, 255, 0.7);
  border-color: var(--line);
}

.filter-btn.is-active {
  background: var(--ink);
  color: #f3f6f2;
  border-color: var(--ink);
}

/* —— Timeline —— */
.timeline {
  --rail-x: 11px;
  --rail-gap: 28px;
  --dot-top: 1.35rem;
  --dot-size: 12px;
  position: relative;
  list-style: none;
  margin: 0;
  padding: 0 0 0 var(--rail-gap);
}

.release {
  position: relative;
  margin: 0 0 1.35rem;
  padding-left: 0;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.release:last-child {
  margin-bottom: 0;
}

.release.is-visible {
  opacity: 1;
  transform: none;
}

.release.is-hidden {
  display: none;
}

/* 圆点之间连线，不超出首尾节点 */
.release:not(:last-child)::before {
  content: "";
  position: absolute;
  left: calc(var(--rail-x) - var(--rail-gap));
  top: calc(var(--dot-top) + var(--dot-size) / 2);
  height: calc(100% + 1.35rem);
  width: 2px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, var(--teal) 0%, rgba(13, 107, 95, 0.22) 100%);
  border-radius: 2px;
  z-index: 0;
}

.release-dot {
  position: absolute;
  left: calc(var(--rail-x) - var(--rail-gap));
  top: var(--dot-top);
  width: var(--dot-size);
  height: var(--dot-size);
  transform: translateX(-50%);
  border-radius: 50%;
  background: var(--lime);
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px var(--teal);
  z-index: 1;
}

.release-panel {
  padding: 1.25rem 1.3rem 1.35rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.release-panel:hover {
  border-color: rgba(13, 107, 95, 0.28);
}

.release.is-latest .release-panel {
  border-color: rgba(13, 107, 95, 0.35);
  background:
    linear-gradient(135deg, rgba(184, 209, 42, 0.12), transparent 42%),
    rgba(255, 255, 255, 0.82);
}

.release-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.45rem 0.85rem;
  margin-bottom: 0.35rem;
}

.release-version {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
  color: var(--teal-deep);
}

.release-date {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
}

.release-tag {
  display: inline-flex;
  align-items: center;
  margin-left: auto;
  padding: 0.15rem 0.55rem;
  border-radius: 6px;
  background: var(--lime);
  color: var(--lime-ink);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.release-summary {
  margin: 0 0 1rem;
  color: var(--ink-soft);
  font-size: 0.98rem;
}

.change-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.65rem;
}

.change-item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.change-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.5rem;
  min-width: 0;
}

.change-type {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  min-width: 2.6rem;
  padding: 0.14rem 0.4rem;
  border-radius: 5px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.3;
}

.change-type--new {
  background: #e8eef8;
  color: #2f54eb;
}

.change-type--improve {
  background: #eef3d4;
  color: #4a5a12;
}

.change-type--fix {
  background: #f3e8e4;
  color: #7a3b2e;
}

/* 大标签：程序来源用类型标签即可；插件/模板用 scope */
.change-scope {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  min-width: 2.8rem;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.3;
}

.change-scope--plugin {
  background: #f3e8ff;
  color: #722ed1;
}

.change-scope--theme {
  background: #ddf1f0;
  color: #1a6a72;
}

.change-pkg {
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0;
}

.change-pkg em {
  font-style: normal;
  font-weight: 500;
  color: var(--ink);
}

/* 程序：类型大标签 + 正文同一行 */
.change-main .change-text {
  margin: 0;
  flex: 1 1 12rem;
  min-width: 0;
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.5;
}

.change-item:not(.change-item--pkg) .change-type {
  min-width: 2.8rem;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  font-size: 0.78rem;
}

/* 插件/模板：大标签 + 名称；每条说明前再挂类型标签 */
.change-item--pkg .change-main {
  align-items: flex-start;
}

.change-content {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1 1 12rem;
  min-width: 0;
}

.change-desc {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.4rem 0.5rem;
  margin: 0;
}

.change-desc-text {
  flex: 1 1 10rem;
  min-width: 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.55;
}

.empty-state {
  display: none;
  padding: 2.5rem 1rem;
  text-align: center;
  color: var(--muted);
  font-weight: 500;
}

.empty-state.is-show {
  display: block;
}

/* —— Footer —— */
.footer {
  max-width: calc(var(--max) + 80px);
  margin: 0 auto;
  padding: 0 1.25rem 2.5rem;
  color: var(--muted);
  font-size: 0.88rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1rem;
}

.footer strong {
  color: var(--teal-deep);
  font-family: var(--font-display);
  font-weight: 700;
}

/* —— Motion —— */
@keyframes float-soft {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.hero-visual {
  animation: float-soft 7s ease-in-out infinite;
}

/* —— Responsive —— */
@media (max-width: 860px) {
  .ad-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 0;
    padding-top: 1.25rem;
    padding-bottom: 1.75rem;
  }

  .hero-visual {
    display: none;
  }

  .hero-copy {
    text-align: center;
  }

  .hero-desc {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-actions {
    justify-content: center;
    flex-wrap: nowrap;
  }

  .hero-actions .btn {
    flex: 1 1 0;
    min-width: 0;
    padding-left: 0.7rem;
    padding-right: 0.7rem;
    white-space: nowrap;
  }

  .brand {
    font-size: clamp(1.85rem, 8vw, 2.35rem);
  }

  .ad-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .topbar {
    padding-top: 1.15rem;
  }

  .hero,
  .ad-section,
  .main,
  .footer {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .filters {
    width: 100%;
  }

  .filter-btn {
    flex: 1 1 auto;
    text-align: center;
  }

  .release-tag {
    margin-left: 0;
  }

  .release-panel {
    padding: 1.05rem 1rem 1.15rem;
  }

  .timeline {
    --rail-gap: 24px;
  }

  .hero-actions {
    width: 100%;
    gap: 0.55rem;
  }

  .hero-actions .btn {
    font-size: 0.84rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .hero-visual,
  .release {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}
