/* ============================================================
   文章库 / 站内文章
   与 knowledge.css 共用浙大蓝、阿里橙、飞书绿体系
   ============================================================ */

:root {
  --shadow-sm: 0 14px 34px rgba(0, 42, 86, 0.08);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.knowledge-header nav a[aria-current="page"] {
  color: #fff;
}

.knowledge-header nav a[aria-current="page"]::after {
  transform: scaleX(1);
}

.knowledge-footer a {
  color: var(--blue-200);
  border-bottom: 1px solid rgba(185, 210, 238, 0.35);
}

.knowledge-footer a:hover {
  color: #fff;
  border-color: var(--orange);
}

/* ─── 文章库 ─────────────────────────────────────────── */
.articles-page {
  background: var(--paper);
}

.articles-main {
  overflow: hidden;
}

.articles-hero {
  position: relative;
  overflow: hidden;
  padding: 76px 0 98px;
  background:
    radial-gradient(840px 420px at 84% 12%, rgba(31, 111, 208, 0.38), transparent 66%),
    linear-gradient(130deg, var(--blue-950) 0%, var(--blue-900) 58%, var(--blue-800) 100%);
  color: #fff;
}

.articles-hero::before {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 56px 56px;
  content: "";
  mask-image: linear-gradient(90deg, #000, transparent 82%);
  pointer-events: none;
}

.articles-hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  grid-template-columns: minmax(0, 1fr) 230px;
  align-items: end;
  gap: clamp(36px, 6vw, 92px);
}

.articles-kicker {
  margin: 0 0 18px;
  color: var(--orange-300);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.articles-hero h1 {
  max-width: 800px;
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(42px, 5.6vw, 72px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.055em;
}

.articles-hero h1 span {
  color: var(--blue-200);
}

.articles-deck {
  max-width: 690px;
  margin: 24px 0 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 14px;
  line-height: 1.95;
}

.articles-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 34px;
  margin-top: 38px;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.articles-stats div {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.articles-stats strong {
  color: #fff;
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
}

.articles-stats span {
  color: rgba(255, 255, 255, 0.54);
  font-size: 10px;
  letter-spacing: 0.05em;
}

.articles-hero-mark {
  display: flex;
  min-height: 180px;
  padding-left: 22px;
  border-left: 1px solid rgba(255, 255, 255, 0.22);
  flex-direction: column;
  justify-content: flex-end;
  gap: 8px;
}

.articles-hero-mark strong {
  color: var(--orange);
  font-family: var(--font-display);
  font-size: clamp(76px, 9vw, 116px);
  font-weight: 700;
  line-height: 0.9;
  letter-spacing: -0.06em;
}

.articles-hero-mark span {
  color: rgba(255, 255, 255, 0.62);
  font-size: 12px;
  line-height: 1.7;
}

.articles-categories {
  position: relative;
  z-index: 2;
  display: grid;
  width: min(1180px, calc(100% - 48px));
  margin: -50px auto 0;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.articles-cat {
  position: relative;
  display: flex;
  min-height: 168px;
  padding: 22px 20px 20px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--cat, var(--blue-700));
  background: var(--card);
  box-shadow: 0 12px 34px rgba(0, 42, 86, 0.06);
  color: var(--ink);
  cursor: pointer;
  flex-direction: column;
  text-align: left;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.articles-cat:hover,
.articles-cat.is-active {
  border-color: var(--cat, var(--blue-700));
  box-shadow: 0 18px 44px rgba(0, 42, 86, 0.1);
  transform: translateY(-4px);
}

.articles-cat-index {
  color: var(--cat, var(--blue-700));
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.articles-cat-count {
  position: absolute;
  top: 20px;
  right: 20px;
  color: var(--muted-light);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.06em;
}

.articles-cat strong {
  display: block;
  margin-top: 22px;
  color: var(--blue-800);
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.025em;
}

.articles-cat small {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.75;
}

.articles-library {
  width: min(1180px, calc(100% - 48px));
  margin: 56px auto 0;
}

.articles-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.articles-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.articles-filter {
  padding: 8px 12px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease;
}

.articles-filter span {
  margin-left: 3px;
  color: var(--muted-light);
  font-family: var(--font-mono);
  font-size: 8px;
}

.articles-filter:hover,
.articles-filter.is-active {
  border-color: var(--blue-800);
  background: var(--blue-800);
  color: #fff;
}

.articles-filter.is-active span {
  color: var(--blue-200);
}

.articles-search {
  flex: 0 0 238px;
}

.articles-search input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 11px;
  outline: none;
}

.articles-search input:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(255, 106, 0, 0.08);
}

.articles-search input::placeholder {
  color: var(--muted-light);
}

.articles-list-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  margin: 22px 0 18px;
}

.articles-list-head p {
  margin: 0;
  color: var(--muted-light);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.05em;
}

.articles-list-head .articles-count {
  color: var(--blue-800);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0;
}

.articles-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.article-card {
  display: flex;
  min-height: 252px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  flex-direction: column;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.article-card-media {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--blue-50);
}

.article-card-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 520ms cubic-bezier(0.2, 0.65, 0.3, 1);
}

.article-card:hover .article-card-media img {
  transform: scale(1.025);
}

.article-card-body {
  display: flex;
  padding: 20px 22px 22px;
  flex: 1;
  flex-direction: column;
}

.article-card:hover {
  border-color: var(--blue-300);
  box-shadow: var(--shadow-sm);
  transform: translateY(-4px);
}

.article-card[hidden] {
  display: none;
}

.article-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.article-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 7px;
  border: 1px solid color-mix(in srgb, var(--cat, var(--blue-700)) 24%, transparent);
  background: color-mix(in srgb, var(--cat, var(--blue-700)) 7%, #fff);
  color: var(--cat, var(--blue-700));
  font-size: 9px;
  font-weight: 650;
  line-height: 1.4;
  white-space: nowrap;
}

.article-card time {
  color: var(--muted-light);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.02em;
}

.article-card h2 {
  display: -webkit-box;
  overflow: hidden;
  margin: 14px 0 0;
  color: var(--blue-900);
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: -0.025em;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  text-wrap: balance;
}

.article-card p {
  display: -webkit-box;
  overflow: hidden;
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.75;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.article-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted-light);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.02em;
}

.article-card--local .article-open {
  color: var(--orange-600);
}

.article-card--external .article-open {
  color: var(--blue-700);
}

.article-open {
  white-space: nowrap;
}

.article-open span {
  display: inline-block;
  transition: transform 160ms ease;
}

.article-card:hover .article-open span {
  transform: translateX(3px);
}

.articles-empty {
  padding: 44px 0;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.articles-note {
  display: flex;
  width: min(1180px, calc(100% - 48px));
  margin: 54px auto 0;
  padding: 24px 0 0;
  border-top: 1px solid var(--line);
  align-items: flex-start;
  justify-content: space-between;
  gap: 36px;
}

.articles-note p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.8;
}

.articles-note strong {
  margin-right: 7px;
  color: var(--blue-800);
}

.articles-note a {
  flex: 0 0 auto;
  padding-bottom: 3px;
  border-bottom: 1px solid var(--orange);
  color: var(--orange-600);
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}

/* ─── 站内文章 ───────────────────────────────────────── */
.article-layout {
  padding-top: 48px;
}

.article-article {
  padding: clamp(28px, 4.8vw, 58px);
}

.article-kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px 13px;
  margin: 0 0 16px;
  color: var(--orange-600);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.11em;
  line-height: 1.6;
}

.article-kicker span + span {
  color: var(--muted-light);
}


.article-article h1 {
  margin-bottom: 20px;
  font-size: clamp(34px, 4.2vw, 50px);
  line-height: 1.2;
  letter-spacing: -0.04em;
  text-wrap: balance;
}

.title-seg {
  white-space: nowrap;
}

.article-subtitle {
  margin: 0 0 18px;
  color: var(--orange-600);
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.7;
}

.article-deck {
  margin: 24px 0 0;
  padding-left: 17px;
  border-left: 3px solid var(--orange);
  color: var(--muted);
  font-size: 15px;
  line-height: 1.9;
}

.article-byline {
  margin: 18px 0 0;
  color: var(--muted-light);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.04em;
}

.article-cover {
  margin: 26px 0 0;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--blue-50);
}

.article-cover img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 21 / 9;
  object-fit: cover;
}

.article-body {
  margin-top: 36px;
  padding-top: 2px;
  border-top: 1px solid var(--line);
}

.article-body > p:first-child {
  margin-top: 26px;
}

.article-body p {
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.95;
}

.article-body h3,
.article-body h2 {
  margin: 42px 0 14px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--blue-800);
  font-family: var(--font-display);
  font-size: clamp(23px, 2.5vw, 29px);
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: -0.025em;
}

.article-body h3::before,
.article-body h2::before {
  display: none;
}

.article-body h3:first-child,
.article-body h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.article-body strong {
  color: var(--blue-800);
  font-weight: 650;
}

.article-body a {
  color: var(--blue-700);
}

.article-body blockquote {
  margin: 26px 0;
  padding: 20px 24px;
  border-left: 3px solid var(--orange);
  background: var(--orange-50);
  color: var(--blue-800);
  font-family: var(--font-display);
  font-size: 18px;
  line-height: 1.75;
}

.article-body blockquote p {
  margin: 0;
  color: inherit;
  font: inherit;
}

.article-body table {
  display: block;
  overflow-x: auto;
  white-space: nowrap;
}

.article-end {
  margin-top: 52px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.article-source {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
}

.article-source p {
  margin: 0;
  color: var(--muted-light);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.04em;
}

.article-source a,
.article-source span {
  color: var(--orange-600);
  font-size: 11px;
  font-weight: 650;
}

.article-source a {
  border-bottom: 1px solid var(--orange);
}

.article-note {
  margin: 18px 0 0;
  color: var(--muted-light);
  font-size: 10px;
  line-height: 1.75;
}

.article-adjacent-nav {
  display: grid;
  margin-top: 34px;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.article-adjacent {
  display: flex;
  min-height: 92px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  background: var(--blue-50);
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  transition: border-color 160ms ease, background 160ms ease;
}

.article-adjacent:hover {
  border-color: var(--blue-300);
  background: #fff;
}

.article-adjacent span {
  color: var(--muted-light);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.04em;
}

.article-adjacent strong {
  color: var(--blue-800);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
}

.article-back {
  margin: 28px 0 0;
}

.article-back a {
  color: var(--orange-600);
  font-size: 11px;
  font-weight: 650;
}

.article-aside .aside-links a span {
  color: var(--muted-light);
  font-family: var(--font-mono);
  font-size: 9px;
}

.article-aside .aside-contact span {
  color: var(--blue-800);
  font-size: 12px;
  font-weight: 600;
}

/* ─── 响应式 ───────────────────────────────────────── */
@media (max-width: 1120px) {
  .articles-hero-inner {
    grid-template-columns: minmax(0, 1fr) 190px;
    gap: 42px;
  }

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

@media (max-width: 980px) {
  .article-layout {
    padding-top: 30px;
  }
}

@media (max-width: 860px) {
  .articles-categories {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .articles-hero {
    padding: 52px 0 78px;
  }

  .articles-hero-inner {
    width: min(100% - 32px, 620px);
    grid-template-columns: 1fr;
    gap: 26px;
  }

  .articles-hero h1 {
    font-size: clamp(38px, 10vw, 54px);
  }

  .articles-hero-mark {
    display: none;
  }

  .articles-stats {
    gap: 16px 26px;
  }

  .articles-categories,
  .articles-library,
  .articles-note {
    width: min(100% - 32px, 620px);
  }

  .articles-categories {
    margin-top: -40px;
    grid-template-columns: 1fr;
  }

  .articles-cat {
    min-height: 152px;
  }

  .articles-toolbar {
    align-items: stretch;
    flex-direction: column;
    gap: 14px;
  }

  .articles-search {
    flex: 0 0 auto;
    width: 100%;
  }

  .articles-list-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .articles-grid {
    grid-template-columns: 1fr;
  }

  .article-card {
    min-height: 220px;
  }

  .article-card-body {
    padding: 18px 20px 20px;
  }

  .articles-note {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .article-layout {
    width: min(100% - 28px, 620px);
    padding: 22px 0 48px;
  }

  .article-article {
    padding: 26px 20px;
  }

  .article-article h1 {
    font-size: clamp(30px, 7.8vw, 40px);
  }

  .article-subtitle {
  margin: 0 0 18px;
  color: var(--orange-600);
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.7;
}

.article-cover {
    margin-top: 20px;
  }

.article-cover img {
    aspect-ratio: 16 / 9;
  }

.article-deck {
    font-size: 14px;
  }

  .article-body p {
    font-size: 15.5px;
  }

  .article-source {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .article-adjacent-nav {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  .articles-stats strong {
    font-size: 28px;
  }

  .articles-filter {
    padding: 7px 9px;
    font-size: 10px;
  }

  .article-card {
    padding: 0;
  }

  .article-card-body {
    padding: 16px 18px 18px;
  }

  .article-card h2 {
    font-size: 19px;
  }
}
