/* Wenworks AI 共用视觉规范见 design/wenworks-ai-design.md。
   黑白灰加一个橙色；直角；1px 线分隔；不用渐变、模糊、发光；不做深色模式。 */
:root {
  color-scheme: light;
  --bg: #ffffff;
  --ink: #171717;
  --mute: #525252;
  --soft: #f5f5f5;
  --softer: #fafafa;
  --line: #e5e5e5;
  --line-strong: #d4d4d4;
  --accent: #ec5b13;
  --sans: "IBM Plex Sans", ui-sans-serif, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  box-sizing: border-box;
  min-width: 0;
}

html {
  scroll-padding-top: 4.5rem;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

@keyframes site-header-in {
  from { opacity: 0; transform: translateY(-0.35rem); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes site-content-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.site-header {
  animation: site-header-in 360ms var(--ease) both;
}

.site-content {
  animation: site-content-in 460ms var(--ease) 60ms both;
}

/* ---- Wenworks AI 共用页头 ----
   这一段由 shared/site-header.css 同步而来，不要在这里改。
   改 shared/site-header.css，然后运行 node scripts/sync-shared.mjs。 */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: #ffffff;
  border-bottom: 1px solid #e5e5e5;
}

.site-header-inner {
  display: flex;
  align-items: center;
  height: 3.5rem;
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.site-brand {
  flex: none;
  margin-right: 1rem;
  color: #171717;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
  transition: opacity 180ms ease;
}

.site-brand:hover {
  opacity: 0.7;
}

.site-switch,
.site-nav {
  display: flex;
  align-items: center;
}

.site-switch {
  flex: none;
}

.site-nav {
  flex: 1 1 auto;
  min-width: 0;
}

.site-nav-end {
  display: flex;
  align-items: center;
  margin-left: auto;
}

.site-sep {
  flex: none;
  width: 1px;
  height: 1.25rem;
  margin: 0 0.75rem;
  background: #e5e5e5;
}

.site-header nav a {
  position: relative;
  display: inline-flex;
  flex: none;
  align-items: center;
  height: 2.75rem;
  padding: 0 0.75rem;
  color: #525252;
  font-size: 0.875rem;
  text-decoration: none;
  white-space: nowrap;
  transition: color 180ms ease, transform 180ms ease;
}

.site-header nav a::after {
  position: absolute;
  right: 0.75rem;
  bottom: 0.55rem;
  left: 0.75rem;
  height: 1px;
  background: currentColor;
  content: "";
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 180ms ease;
}

.site-header nav a:hover {
  color: #171717;
  transform: translateY(-1px);
}

.site-header nav a[aria-current="page"] {
  color: #171717;
  font-weight: 500;
}

.site-header nav a:hover::after,
.site-header nav a[aria-current="page"]::after {
  transform: scaleX(1);
  transform-origin: left;
}

.site-menu-button {
  display: none;
  flex: none;
  align-items: center;
  height: 2.75rem;
  margin-left: auto;
  padding: 0 0.75rem;
  border: 1px solid #e5e5e5;
  border-radius: 0;
  background: #ffffff;
  color: #171717;
  font: inherit;
  font-size: 0.875rem;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 180ms ease, background-color 180ms ease;
}

.site-menu-button:hover {
  border-color: #d4d4d4;
  background: #f5f5f5;
}

@media (max-width: 52rem) {
  .site-header-inner {
    padding: 0 1rem;
  }

  .site-brand {
    margin-right: 0.5rem;
  }

  /* 三个站点入口始终显示；屏幕再窄时可以横向滑动。 */
  .site-switch {
    flex: 0 1 auto;
    min-width: 0;
    margin-right: 0.5rem;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .site-switch::-webkit-scrollbar {
    display: none;
  }

  .site-header .site-switch a {
    padding: 0 0.5rem;
  }

  .site-header .site-switch a::after {
    right: 0.5rem;
    left: 0.5rem;
  }

  .site-sep {
    display: none;
  }

  .site-menu-button {
    display: inline-flex;
  }

  .site-nav {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 0.5rem 1rem;
    border-bottom: 1px solid #e5e5e5;
    background: #ffffff;
    box-shadow: 0 8px 24px rgb(0 0 0 / 6%);
  }

  .site-nav[data-open="true"] {
    display: flex;
  }

  .site-nav-end {
    margin-left: 0;
    border-top: 1px solid #e5e5e5;
  }

  .site-header .site-nav a {
    justify-content: flex-start;
    padding: 0;
  }

  .site-header .site-nav a::after {
    display: none;
  }

  .site-header .site-nav a:hover {
    transform: none;
  }

  .site-header .site-nav > a + a {
    border-top: 1px solid #e5e5e5;
  }
}

@media (max-width: 25rem) {
  .site-brand {
    margin-right: 0.25rem;
  }

  .site-switch {
    margin-right: 0.25rem;
  }

  .site-header .site-switch a {
    padding: 0 0.375rem;
  }

  .site-header .site-switch a::after {
    right: 0.375rem;
    left: 0.375rem;
  }

  .site-menu-button {
    padding: 0 0.5rem;
  }
}
/* ---- 共用页头结束 ---- */

/* ---- 页面 ---- */
.site-content {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1rem 3rem;
}

@media (min-width: 40rem) {
  .site-content {
    padding: 0 1.5rem 4rem;
  }
}

.num {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

.quiet {
  color: var(--mute);
}

.mark {
  display: inline-block;
  margin-right: 0.5rem;
  padding: 0 0.375rem;
  background: var(--accent);
  color: #ffffff;
  font-size: 0.75rem;
  line-height: 1.5;
  vertical-align: 0.1em;
}

/* 刊头 */
.hero {
  padding: 3rem 0 2rem;
}

@media (min-width: 40rem) {
  .hero {
    padding: 4.5rem 0 2.5rem;
  }
}

.eyebrow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin: 0 0 1rem;
  color: var(--mute);
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
}

.eyebrow b {
  padding: 0.125rem 0.5rem;
  background: var(--ink);
  color: #ffffff;
  font-weight: 500;
}

.hero h1 {
  max-width: 18em;
  margin: 0;
  font-size: clamp(2rem, 6vw, 3.5rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.hero h1 a {
  text-decoration: none;
}

.hero h1 em {
  color: var(--accent);
  font-style: normal;
}

.lede {
  max-width: 44rem;
  margin: 1rem 0 0;
  color: var(--mute);
  font-size: 1.0625rem;
  line-height: 1.6;
}

.lede a {
  text-underline-offset: 3px;
}

/* 本期要点：一排数字 */
.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  margin: 0;
  border-top: 1px solid var(--ink);
  border-left: 1px solid var(--line);
}

.fact {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-height: 7.5rem;
  padding: 1rem;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.fact dt {
  color: var(--mute);
  font-size: 0.8125rem;
}

.fact dd {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 500;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.fact .big {
  font-size: 2.25rem;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.03em;
}

.fact dd.fact-note {
  margin-top: auto;
  padding-top: 0.5rem;
  color: var(--mute);
  font-size: 0.8125rem;
  font-weight: 400;
}

.fact-lead {
  margin-top: -1px;
  padding-top: calc(1rem - 2px);
  border-top: 3px solid var(--accent);
}

@media (max-width: 46rem) {
  .facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .fact {
    min-height: 6.5rem;
  }

  .fact-lead {
    grid-column: 1 / -1;
    min-height: 0;
  }
}

/* 首页：三个入口，一行 */
.front-hero {
  padding: 2rem 0 1.25rem;
}
.front-hero h1 {
  font-size: clamp(1.5rem, 4vw, 2rem);
  letter-spacing: -0.02em;
}
.doors {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--ink);
  border-left: 1px solid var(--line);
}
.door {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  padding: 0.75rem 1rem;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  transition: background-color 180ms ease;
}
.door:hover {
  background: var(--soft);
}
.door b {
  font-size: 1.0625rem;
  font-weight: 600;
}
.door b span {
  color: var(--accent);
}
.door > span {
  overflow: hidden;
  color: var(--mute);
  font-size: 0.8125rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 40rem) {
  .doors {
    grid-template-columns: 1fr;
  }
  .door {
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
  }
  .door b {
    flex: none;
  }
}
/* 首页：最近更新，一句话一行 */
.recent {
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
}
.recent li {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.375rem 0;
  font-size: 0.9375rem;
}
.recent .num {
  flex: none;
  width: 4.5rem;
  color: var(--mute);
  font-size: 0.8125rem;
}
.recent b {
  flex: none;
  padding: 0 0.375rem;
  border: 1px solid var(--line-strong);
  color: var(--mute);
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.5;
}
.recent .line {
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.recent a {
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 4px;
}
.recent a:hover {
  text-decoration-color: currentColor;
}
/* 首页：热点分两栏，两栏逐行对齐，条目之间只用留白 */
.front {
  margin-top: 3rem;
}
.front section {
  padding: 2.5rem 0 3rem;
}
.cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 2rem 3rem;
}
.hot-col {
  counter-reset: hot;
}
.hot {
  margin: 0;
  padding: 0;
}
.issue .hot-col h3 {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin: 0 0 0.5rem;
  letter-spacing: 0;
}
.hot-col h3 b {
  padding: 0.125rem 0.5rem;
  background: var(--ink);
  color: #ffffff;
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 500;
}
.hot li {
  display: flex;
  align-items: baseline;
  gap: 0.875rem;
  padding: 0.5rem 0;
  counter-increment: hot;
}
.hot li::before {
  flex: none;
  width: 1.25rem;
  color: var(--mute);
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
  content: counter(hot, decimal-leading-zero);
}
.hot li:first-child::before {
  color: var(--accent);
  font-weight: 500;
}
.hot .line {
  flex: 1;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.front .hot a,
.front .rows a {
  text-decoration: none;
}
.front .hot a:hover,
.front .rows a:hover {
  text-decoration: underline;
  text-decoration-color: currentColor;
}
.hot .line > a {
  font-weight: 500;
}
/* 项目简介在名字下面，一行，完整内容悬停可看 */
.hot .desc {
  display: block;
  margin-top: 0.125rem;
  overflow: hidden;
  color: var(--mute);
  font-size: 0.875rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hot .side {
  flex: none;
  color: var(--mute);
  font-size: 0.8125rem;
  white-space: nowrap;
}
.hot li:first-child .side {
  color: var(--accent);
}
/* 首页的推荐文章：标题下面一句推荐理由 */
.picks .why {
  display: block;
  margin-top: 0.125rem;
  color: var(--mute);
  font-size: 0.875rem;
}
/* 首页的文章列表：不画分隔线 */
.front .rows li,
.front .rows li:last-child {
  padding: 0.5rem 0;
  border: 0;
}
.front .count a {
  text-decoration: none;
}
.front .count a:hover {
  text-decoration: underline;
}
@media (max-width: 64rem) {
  .cols {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 46rem) {
  .front section {
    padding: 2rem 0 2.25rem;
  }
  .recent .num {
    width: auto;
  }
}
/* 一期简报：左边栏目名，右边内容 */
.issue {
  margin-top: 2.5rem;
  border-top: 1px solid var(--ink);
}

.issue section {
  display: grid;
  grid-template-columns: 13rem minmax(0, 1fr);
  gap: 1rem 2rem;
  padding: 2rem 0;
  border-bottom: 1px solid var(--line);
}

.sec-head {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  align-self: start;
}

.issue h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.count {
  color: var(--mute);
  font-size: 0.8125rem;
}

.sec-body > :first-child {
  margin-top: 0;
}

.issue h3 {
  margin: 1.5rem 0 0.5rem;
  color: var(--mute);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.issue p {
  margin: 0 0 0.5rem;
}

.issue .lead {
  font-size: 1.1875rem;
  line-height: 1.5;
}

.issue ul,
.issue ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.rows li,
.rank li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding: 0.625rem 0;
  border-top: 1px solid var(--line);
  overflow-wrap: anywhere;
}

.rows li:last-child,
.rank li:last-child {
  border-bottom: 1px solid var(--line);
}

.side {
  flex: none;
  font-size: 0.875rem;
  white-space: nowrap;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chips li {
  display: inline-flex;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.375rem 0.625rem;
  border: 1px solid var(--line);
  border-top: 2px solid var(--accent);
  font-size: 0.9375rem;
}

.chips .num {
  color: var(--mute);
  font-size: 0.8125rem;
}

.chip {
  display: inline-block;
  padding: 0.0625rem 0.375rem;
  border: 1px solid var(--line);
  color: var(--mute);
  font-size: 0.75rem;
  line-height: 1.5;
  white-space: nowrap;
}

.chip[data-tier="T1"] { border-color: #ec5b13; background: #ec5b13; color: #ffffff; }
.chip[data-tier="T2"] { border-color: #f07f45; background: #f07f45; color: #ffffff; }
.chip[data-tier="T3"] { border-color: #f5a77a; background: #f5a77a; color: #171717; }
.chip[data-tier="T4"] { border-color: #f9c9ac; background: #f9c9ac; color: #171717; }
.chip[data-tier="T5"] { border-color: #fde4d4; background: #fde4d4; color: #171717; }

.rank {
  counter-reset: rank;
}

.rank li {
  justify-content: flex-start;
  counter-increment: rank;
}

.rank li::before {
  flex: none;
  width: 1.25rem;
  color: var(--mute);
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 0.875rem;
  content: counter(rank);
}

.rank .quiet {
  margin-left: auto;
  font-size: 0.875rem;
}

.issue a {
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 4px;
  transition: text-decoration-color 180ms ease;
}

.issue a:hover {
  text-decoration-color: currentColor;
}

.issue .more {
  margin: 1rem 0 0;
  font-size: 0.875rem;
}

.issue .note .sec-body {
  padding: 1rem 1.25rem;
  border-left: 3px solid var(--accent);
  background: var(--softer);
}

.issue .note p:last-child {
  margin-bottom: 0;
}

.issue .note ul {
  padding-left: 1.25rem;
  list-style: square;
}

.issue code {
  font-family: var(--mono);
  font-size: 0.875em;
}

@media (max-width: 46rem) {
  .issue section {
    grid-template-columns: 1fr;
    gap: 0.75rem;
    padding: 1.5rem 0;
  }

  .sec-head {
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
  }

  .rows li {
    flex-direction: column;
    gap: 0.25rem;
  }
}

.pager {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin: 1.5rem 0 0;
  color: var(--mute);
  font-size: 0.875rem;
}

.pager a {
  text-underline-offset: 3px;
}

/* 往期列表 */
.archive {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--ink);
}

.archive li {
  border-bottom: 1px solid var(--line);
}

.archive a {
  display: grid;
  grid-template-columns: 6rem 15rem minmax(0, 1fr);
  align-items: baseline;
  gap: 0.25rem 1.5rem;
  padding: 1.125rem 0;
  text-decoration: none;
  transition: background-color 180ms ease;
}

.archive a:hover {
  background: var(--soft);
}

.archive .n {
  font-weight: 500;
}

.archive span {
  color: var(--mute);
  font-size: 0.875rem;
}

@media (max-width: 46rem) {
  .archive a {
    grid-template-columns: 5rem minmax(0, 1fr);
  }

  .archive span {
    grid-column: 1 / -1;
  }
}

.site-foot {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1rem 2.5rem;
  color: var(--mute);
  font-size: 0.8125rem;
}

@media (min-width: 40rem) {
  .site-foot {
    padding: 0 1.5rem 2.5rem;
  }
}

.site-foot p {
  margin: 0;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.site-foot a {
  text-underline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .site-header nav a:hover {
    transform: none !important;
  }
}
