/* ===== 文章动态页 .page-news 专属样式 ===== */
.page-news {
  --news-line: rgba(242, 232, 213, 0.14);
  --news-card-bg: rgba(10, 14, 26, 0.66);
  --news-section-space: clamp(3rem, 7vw, 5.5rem);
  padding-top: calc(var(--header-h) + 1rem);
  background: var(--deep);
  color: var(--parchment);
  overflow-x: hidden;
}

.page-news a {
  color: var(--parchment);
  text-decoration: none;
  transition: color 0.3s ease-out, border-color 0.3s ease-out, background 0.3s ease-out;
}

.page-news a:hover {
  color: var(--lime);
}

/* 面包屑 */
.page-news .breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-bottom: 2rem;
  font-size: var(--text-sm);
  color: var(--mist);
}

.page-news .breadcrumb a {
  color: var(--mist);
}

.page-news .breadcrumb a:hover {
  color: var(--lime);
}

.page-news .breadcrumb-sep {
  color: rgba(155, 164, 176, 0.5);
}

/* Hero 首屏 */
.news-hero {
  position: relative;
  padding-bottom: 1.5rem;
}

.news-hero::before {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 46%;
  height: 40%;
  background: linear-gradient(120deg, rgba(0, 166, 81, 0.2), rgba(0, 166, 81, 0.45));
  clip-path: polygon(6% 30%, 100% 0, 100% 100%, 0 100%);
  pointer-events: none;
  z-index: 0;
}

.news-hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 2rem;
  align-items: center;
}

.news-hero-eyebrow {
  margin: 0 0 0.75rem;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--lime);
}

.news-hero h1 {
  position: relative;
  display: inline-block;
  margin: 0;
  font-family: var(--font-heading);
  font-size: var(--text-h1);
  line-height: 1.06;
  color: var(--parchment);
}

.news-hero h1::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0.06em;
  width: 46%;
  height: 0.18em;
  background: var(--green);
  clip-path: polygon(0 0, 100% 0, 88% 100%, 0 100%);
  opacity: 0.8;
  z-index: -1;
}

.news-hero-sub {
  margin: 0.75rem 0 1.25rem;
  font-family: var(--font-heading);
  font-size: var(--text-big);
  color: var(--green);
}

.news-hero-desc {
  max-width: 52ch;
  margin: 0;
  font-size: var(--text-base);
  line-height: 1.75;
  color: var(--mist);
}

.news-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.5rem;
}

.news-hero-meta span {
  border: 1px solid rgba(200, 255, 0, 0.35);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--lime);
  background: rgba(200, 255, 0, 0.06);
}

.news-hero-figure {
  margin: 0;
  overflow: hidden;
  background: var(--pine);
  clip-path: polygon(0.8rem 0, 100% 0, 100% calc(100% - 0.8rem), 0 100%);
}

.news-hero-figure img {
  display: block;
  width: 100%;
  height: clamp(220px, 42vw, 420px);
  object-fit: cover;
  object-position: center;
}

/* 区块标题 */
.news-listing {
  padding: var(--news-section-space) 0;
}

.news-section-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 2.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--news-line);
}

.news-section-index {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--green);
}

.news-section-head h2 {
  margin: 0;
  font-family: var(--font-heading);
  font-size: var(--text-h2);
  color: var(--parchment);
}

.news-section-note {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--mist);
}

/* 最新动态：左列表 + 右索引 */
.news-listing-grid {
  display: grid;
  gap: 2.5rem;
}

.news-listing-main {
  min-width: 0;
}

.news-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.75rem;
}

.news-filter-bar a,
.news-filter-bar .is-active {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--mist);
  transition: color var(--transition), border-color var(--transition), background var(--transition);
}

.news-filter-bar a:hover {
  color: var(--lime);
  border-color: rgba(200, 255, 0, 0.3);
}

.news-filter-bar .is-active {
  color: var(--deep);
  background: var(--lime);
  border-color: var(--lime);
  font-weight: 600;
}

/* 文章条目 */
.news-item {
  position: relative;
  padding: 1.75rem 0;
  border-top: 1px solid var(--news-line);
}

.news-item:last-of-type {
  border-bottom: 1px solid var(--news-line);
}

.news-item-body {
  min-width: 0;
}

.news-item-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.7rem;
}

.news-tag {
  display: inline-block;
  padding: 0.18rem 0.6rem;
  border-radius: 4px;
  background: rgba(200, 255, 0, 0.08);
  color: var(--lime);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.06em;
}

.news-item h3 {
  margin: 0 0 0.6rem;
  font-family: var(--font-heading);
  font-size: var(--text-h3);
  line-height: 1.28;
}

.news-item h3 a {
  color: inherit;
}

.news-item h3 a:hover {
  color: var(--green);
}

.news-item-excerpt {
  max-width: 72ch;
  margin: 0 0 1rem;
  font-size: var(--text-base);
  line-height: 1.7;
  color: var(--mist);
}

.news-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--mist);
}

.news-item-read {
  color: var(--steel);
}

.news-item-date::before {
  content: "— ";
  color: rgba(155, 164, 176, 0.5);
}

.news-item-figure {
  margin: 1.25rem 0 0;
}

.news-item-figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  background: var(--pine);
}

/* 右侧索引 */
.news-aside {
  display: grid;
  gap: 1.5rem;
  align-content: start;
}

.news-aside-card {
  position: relative;
  overflow: hidden;
  padding: 1.75rem 1.5rem;
  background: var(--news-card-bg);
  border: 1px solid var(--news-line);
  border-radius: var(--radius);
}

.news-aside-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--green), var(--lime));
  clip-path: polygon(0 0, 100% 0, 96% 100%, 4% 100%);
}

.news-aside-kicker {
  margin: 0 0 0.3rem;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--lime);
}

.news-aside-card h2 {
  margin: 0 0 1.2rem;
  font-family: var(--font-heading);
  font-size: var(--text-h3);
  color: var(--parchment);
}

.topic-nav {
  display: grid;
  gap: 0.15rem;
}

.topic-nav a {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid rgba(242, 232, 213, 0.08);
  color: var(--parchment);
  font-size: var(--text-sm);
  transition: color var(--transition), padding-left var(--transition);
}

.topic-nav a:hover {
  color: var(--lime);
  padding-left: 0.35rem;
}

.topic-nav-num {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--green);
}

.news-resource-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.65rem;
}

.news-resource-list a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--mist);
  font-size: var(--text-sm);
}

.news-resource-list a::before {
  content: "→";
  color: var(--green);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
}

.news-resource-list a:hover {
  color: var(--lime);
}

/* 专题系列 */
.news-topics {
  padding: var(--news-section-space) 0;
  background:
    linear-gradient(180deg, rgba(10, 14, 26, 0.06), transparent 28rem),
    var(--env);
}

.news-topics .news-section-head {
  border-bottom-color: rgba(10, 14, 26, 0.12);
}

.news-topics .news-section-head h2 {
  color: var(--deep);
}

.news-topics .news-section-note {
  color: rgba(10, 14, 26, 0.6);
}

.topics-grid {
  display: grid;
  gap: 1.75rem;
}

.topic-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: var(--pine);
  box-shadow: var(--shadow-soft);
  transition: transform var(--transition), border-color var(--transition);
}

.topic-card:hover {
  transform: translateY(-4px);
  border-color: rgba(200, 255, 0, 0.35);
}

.topic-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  width: 100%;
  height: 5px;
  background: linear-gradient(90deg, var(--green), var(--lime));
  clip-path: polygon(0 0, 100% 0, 95% 100%, 5% 100%);
}

.topic-card::after {
  content: "";
  position: absolute;
  right: -2.25rem;
  bottom: -2.25rem;
  width: 11rem;
  height: 11rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(200, 255, 0, 0.14), transparent 70%);
  pointer-events: none;
}

.topic-figure {
  margin: 0;
  overflow: hidden;
  aspect-ratio: 16 / 9.5;
}

.topic-figure img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.topic-card:hover .topic-figure img {
  transform: scale(1.03);
}

.topic-content {
  position: relative;
  z-index: 1;
  padding: 1.6rem 1.6rem 1.8rem;
}

.topic-num {
  margin: 0 0 0.35rem;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--lime);
}

.topic-content h3 {
  margin: 0 0 0.6rem;
  font-family: var(--font-heading);
  font-size: var(--text-h3);
  color: var(--parchment);
}

.topic-content > p {
  margin: 0 0 0.9rem;
  font-size: var(--text-sm);
  line-height: 1.65;
  color: var(--mist);
}

.topic-count {
  display: inline-block;
  padding: 0.28rem 0.8rem;
  border: 1px solid var(--news-line);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--parchment);
}

.topic-details {
  margin-top: 1.1rem;
  padding-top: 0.9rem;
  border-top: 1px solid rgba(242, 232, 213, 0.12);
}

.topic-details summary {
  cursor: pointer;
  list-style: none;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--green);
  transition: color var(--transition);
}

.topic-details summary::-webkit-details-marker {
  display: none;
}

.topic-details summary::before {
  content: "+ ";
  font-family: var(--font-mono);
  color: var(--lime);
}

.topic-details[open] summary::before {
  content: "– ";
}

.topic-details summary:hover {
  color: var(--lime);
}

.topic-details ul {
  margin: 1rem 0 0;
  padding-left: 1.15rem;
  display: grid;
  gap: 0.6rem;
  font-size: var(--text-sm);
  color: var(--mist);
  line-height: 1.6;
}

.topic-details a {
  color: var(--mist);
  border-bottom: 1px solid transparent;
  transition: color var(--transition), border-color var(--transition);
}

.topic-details a:hover {
  color: var(--lime);
  border-color: rgba(200, 255, 0, 0.3);
}

/* 版本更新记录 */
.news-changelog {
  padding: var(--news-section-space) 0;
  background: linear-gradient(150deg, var(--deep) 0%, var(--pine) 64%, var(--deep) 100%);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.changelog-grid {
  display: grid;
  gap: 2.5rem;
}

.changelog-figure {
  margin: 0;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: var(--deep);
}

.changelog-figure img {
  display: block;
  width: 100%;
  height: auto;
}

.changelog-list {
  position: relative;
  margin: 0;
  padding: 0;
  list-style: none;
}

.changelog-list::before {
  content: "";
  position: absolute;
  top: 0.375rem;
  bottom: 0.375rem;
  left: 6px;
  width: 1px;
  background: rgba(242, 232, 213, 0.2);
}

.changelog-item {
  position: relative;
  padding: 0 0 2rem 1.75rem;
}

.changelog-item:last-child {
  padding-bottom: 0;
}

.changelog-item::before {
  content: "";
  position: absolute;
  top: 0.3rem;
  left: 0;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(0, 166, 81, 0.18);
}

.changelog-version {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--lime);
}

.changelog-body h3 {
  margin: 0.2rem 0 0.55rem;
  font-family: var(--font-heading);
  font-size: var(--text-h3);
  color: var(--parchment);
}

.changelog-tag {
  display: inline-block;
  margin-bottom: 0.85rem;
  padding: 0.18rem 0.6rem;
  border: 1px solid rgba(42, 157, 143, 0.5);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--steel);
  background: rgba(42, 157, 143, 0.08);
}

.changelog-body ul {
  margin: 0;
  padding-left: 1.15rem;
  font-size: var(--text-sm);
  line-height: 1.8;
  color: var(--mist);
}

/* 响应式 */
@media (min-width: 768px) {
  .news-hero-grid {
    grid-template-columns: 1.05fr 0.95fr;
    gap: 2.5rem;
  }

  .news-item-featured {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    gap: 2rem;
    align-items: center;
  }

  .news-item-figure {
    margin-top: 0;
  }

  .topics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2rem;
  }

  .changelog-grid {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: 3rem;
    align-items: start;
  }
}

@media (min-width: 1024px) {
  .news-listing-grid {
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 3rem;
  }

  .news-aside {
    position: sticky;
    top: calc(var(--header-h) + 2rem);
  }
}
