/* 新闻整页（#view=news，src/views/newsPage.js）。白面板放在画布底色上，和安全地图同一套
   面板语言；面板不加阴影，一条细边分层。版式「简报」：头条+官方更新并排，下面三栏话题。 */

.news-page {
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 1240px;
  color: var(--text);
}

.news-page a {
  color: inherit;
  text-decoration: none;
}

.news-page a:hover .np-lead-title-text,
.news-page h2 a:hover,
.news-page h3 a:hover {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

/* ——— topic chips ———
   They sit in the section header row (.safety-head, safetyMap.js) right after the
   安全地图 / 新闻 tabs, so the stories start at the top of the page. */

.np-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
}

.np-chips button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
}

.np-chips button span {
  color: var(--muted);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Same recipe as the 校园信息 news chips (.news-topic-chip.is-active), which
   Dark Reader already turns into a readable filled chip. */
.np-chips button.is-active {
  border-color: var(--brand, #001b4b);
  background: var(--brand, #001b4b);
  color: #ffffff;
}

.np-chips button.is-active span {
  color: inherit;
  opacity: 0.75;
}

.np-updated {
  flex: none;
  color: var(--muted);
  font-size: 12.5px;
}

/* ——— shared parts ——— */

.np-topic {
  display: block;
  margin-bottom: 6px;
  color: var(--brand);
  font-size: 12.5px;
  font-weight: 800;
}

.np-source {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 8px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.4;
}

.np-fav {
  width: 16px;
  height: 16px;
  margin-right: -2px;
  border-radius: 3px;
  flex: none;
}

.np-outlet {
  color: var(--text);
  font-weight: 700;
}

.np-more {
  color: var(--text);
}

.np-time::before,
.np-more::before {
  content: "·";
  margin-right: 8px;
  color: var(--soft, var(--muted));
}

.np-block-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.np-block-head h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  color: var(--ink-strong);
}

.np-block-note {
  color: var(--muted);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

.np-more-link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--brand);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.np-more-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Panels: white on the canvas, one hairline, no shadow. */
.np-lead,
.np-official,
.np-topic-block,
.np-topic-page {
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

/* Pictures: one treatment everywhere — 8px corners, covered, a tone-step fill
   while loading or when the outlet refuses the hotlink. */
.np-lead-pic,
.np-first-pic,
.np-row-pic {
  display: block;
  overflow: hidden;
  border-radius: 10px;
  background: var(--surface-3);
}

.np-lead-pic img,
.np-first-pic img,
.np-row-pic img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.is-broken {
  display: none;
}

/* ——— lead story ——— */

/* Stacked (picture over headline) so its column matches the height of the
   university list beside it. */
.np-lead {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  padding: 20px;
}

.np-lead-pic {
  aspect-ratio: 2 / 1;
}

.np-lead-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.np-lead-title {
  margin: 0 0 10px;
  color: var(--ink-strong);
  font-size: 28px;
  font-weight: 800;
  line-height: 1.32;
  letter-spacing: -0.01em;
}

/* How other outlets wrote the same story. */
.np-takes-wrap {
  margin-top: auto;
  padding-top: 16px;
}

.np-takes-head {
  display: block;
  margin-bottom: 8px;
  color: var(--ink-strong);
  font-size: 13px;
  font-weight: 800;
}

.np-takes {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.np-lead .np-takes {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

/* Folded related coverage under a row or card. */
.np-related {
  margin-top: 8px;
  font-size: 13px;
}

.np-related summary {
  width: fit-content;
  color: var(--brand);
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.np-related summary::-webkit-details-marker {
  display: none;
}

.np-related summary::after {
  content: " ▾";
  font-size: 11px;
}

.np-related[open] summary::after {
  content: " ▴";
}

.np-related .np-takes {
  margin-top: 10px;
  padding-left: 12px;
  border-left: 2px solid var(--line);
}

.np-takes li {
  font-size: 13.5px;
  line-height: 1.45;
}

.np-takes a,
.np-takes li > span {
  display: block;
}

.np-take-outlet {
  display: block;
  margin-bottom: 1px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.np-take-title {
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.np-takes a:hover .np-take-title {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ——— university updates ——— */

.np-official {
  padding: 18px 20px 8px;
}

.np-official .np-block-head {
  flex-direction: column;
  gap: 2px;
  margin-bottom: 6px;
}

.np-off-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.np-off-list li + li {
  border-top: 1px solid var(--line);
}

.np-off-row {
  display: grid;
  gap: 3px;
  padding: 11px 0;
}

.np-off-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
}

.np-off-label {
  color: var(--brand);
  font-weight: 800;
}

.np-off-meta .np-time {
  color: var(--muted);
}

.np-off-meta .np-time::before {
  content: none;
}

.np-off-title {
  color: var(--ink-strong);
  font-size: 14.5px;
  font-weight: 800;
  line-height: 1.4;
}

.np-off-sum {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.np-off-more {
  margin: 0 0 12px;
}

.np-off-more .np-off-list {
  margin-top: 4px;
}

.np-off-more .np-off-list li:first-child {
  border-top: 1px solid var(--line);
}

.np-off-row:hover .np-off-title {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ——— safety map tie-in ——— */

.np-safety-tie {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 2px 12px;
  width: 100%;
  margin: 0 0 14px;
  padding: 11px 14px;
  border: 0;
  border-radius: 10px;
  background: color-mix(in srgb, #c2410c 9%, var(--surface));
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.np-safety-tie strong {
  grid-column: 1;
  font-size: 13.5px;
  font-weight: 800;
  color: #9a3412;
}

.np-safety-tie span:not(.np-arrow) {
  grid-column: 1;
  color: var(--muted);
  font-size: 12.5px;
}

.np-safety-tie .np-arrow {
  grid-column: 2;
  grid-row: 1 / span 2;
  color: #9a3412;
  font-weight: 800;
}

.np-safety-tie:hover strong {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ——— rows ——— */

.np-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  padding: 14px 0;
}

.np-row.has-pic {
  grid-template-columns: minmax(0, 1fr) 132px;
}

.np-row-pic {
  aspect-ratio: 3 / 2;
  align-self: start;
}

.np-row-title {
  margin: 0 0 7px;
  color: var(--ink-strong);
  font-size: 16px;
  font-weight: 800;
  line-height: 1.45;
}

/* ——— page layout ——— */

.np-top {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr);
  gap: 18px;
  align-items: start;
}

/* Topic blocks flow down three columns, so a short topic leaves no hole. */
.np-topics {
  columns: 3;
  column-gap: 18px;
}

.np-topic-block {
  break-inside: avoid;
  margin-bottom: 18px;
  padding: 18px 20px 6px;
}

.np-first {
  padding-bottom: 14px;
}

.np-first-pic {
  aspect-ratio: 16 / 9;
  margin-bottom: 12px;
}

.np-first-title {
  margin: 0 0 7px;
  color: var(--ink-strong);
  font-size: 17px;
  font-weight: 800;
  line-height: 1.42;
}

.np-topic-block .np-row {
  border-top: 1px solid var(--line);
  padding: 12px 0;
}

.np-topic-block .np-row-title {
  font-size: 15px;
  margin-bottom: 5px;
}

/* ——— one topic chosen ——— */

.np-topic-page {
  max-width: 860px;
  padding: 8px 24px;
}

.np-topic-page .np-safety-tie {
  margin-top: 12px;
}

.np-topic-page > .np-row + .np-row,
.np-topic-page > .np-official + .np-row,
.np-topic-page > .np-row + .np-official,
.np-topic-page > .np-official + .np-official {
  border-top: 1px solid var(--line);
}

.np-official.is-inline {
  padding: 4px 0;
  border: 0;
  border-radius: 0;
}

.np-official.is-inline .np-block-head {
  display: none;
}

/* ——— narrower screens ——— */

@media (max-width: 1180px) {
  .np-topics {
    columns: 2;
  }
  .np-top {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  .news-page {
    gap: 14px;
  }
  .np-lead {
    gap: 14px;
    padding: 14px;
  }
  .np-lead-title {
    font-size: 21px;
  }
  .np-lead .np-takes {
    grid-template-columns: minmax(0, 1fr);
  }
  .np-topics {
    columns: 1;
  }
  .np-official,
  .np-topic-block,
  .np-topic-page {
    padding-left: 16px;
    padding-right: 16px;
  }
  .np-row.has-pic {
    grid-template-columns: minmax(0, 1fr) 96px;
    gap: 12px;
  }
  .np-row-title {
    font-size: 15px;
  }
}
