/* 制作组消息：首页区块（卡片列表）。独立消息页的版面在 notice.css。 */
:root {
  --news-ease: cubic-bezier(.16, 1, .3, 1);
}

.news { display: grid; grid-template-columns: minmax(0, .7fr) minmax(0, 1.3fr); gap: 32px clamp(40px, 6vw, 112px); align-items: start; }
/* 和同页的时间线、常见问题用同一条章节宽度，左缘才在一条线上。 */
main > section.section.news { width: min(calc(100% - 2 * var(--gutter)), var(--chapter-width, 86.25rem)); margin-inline: auto; }
.news > .section-heading { position: sticky; top: calc(var(--header-height, 72px) + 40px); margin: 0; }
/* 不画分隔线：条目之间只靠留白。 */
.news-cards { display: grid; gap: 0; }
.news-card {
  position: relative; isolation: isolate;
  /* 日期列定宽：有无「新」金点都不会让各条标题的起点错开。 */
  display: grid; grid-template-columns: 7.6em minmax(0, 1fr) auto; gap: 18px; align-items: start;
  padding: 26px 0;
  color: inherit; text-decoration: none; transition: color .3s var(--news-ease);
}
/* 悬停时左侧竖起一条金线，从中间向两端长开，和消息页的落点标记同一套动作。 */
.news-card::before {
  content: ''; position: absolute;
  left: calc(-1 * clamp(10px, 1.5vw, 18px)); top: 24px; bottom: 24px; width: 2px;
  background: var(--gold);
  transform: scaleY(0); transform-origin: 50% 50%; opacity: .9;
  transition: transform .6s var(--news-ease);
  pointer-events: none;
}
.news-card:hover, .news-card:focus-visible { color: var(--gold); }
.news-card:hover::before, .news-card:focus-visible::before { transform: scaleY(1); }
.news-card-date { padding-top: 5px; font-size: 12px; letter-spacing: .06em; white-space: nowrap; color: var(--gold-soft); font-variant-numeric: tabular-nums; transition: color .3s var(--news-ease), transform .55s var(--news-ease); }
/* 时分单独一行，比日期浅一档。 */
.news-card-time { display: block; margin-top: 3px; color: var(--faint); }
.news-card:hover .news-card-date, .news-card:focus-visible .news-card-date { color: var(--gold); transform: translateX(3px); }
.news-card:hover .news-card-time, .news-card:focus-visible .news-card-time { color: var(--gold-soft); }
.news-card-body { display: grid; gap: 8px; min-width: 0; transition: transform .6s var(--news-ease); }
.news-card:hover .news-card-body, .news-card:focus-visible .news-card-body { transform: translateX(4px); }
.news-card-title {
  font-size: clamp(16px, 1.35vw, 20px); font-weight: 500; line-height: 1.5;
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-size: 0 1px;
  background-position: 0 calc(100% - 1px);
  transition: background-size .6s var(--news-ease);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.news-card:hover .news-card-title, .news-card:focus-visible .news-card-title { background-size: 100% 1px; }
.news-card-excerpt { color: var(--muted); font-size: 14px; line-height: 1.75; overflow-wrap: anywhere; }
.news-card-arrow { padding-top: 2px; font-size: 18px; color: var(--gold); transition: transform .55s var(--news-ease); }
.news-card:hover .news-card-arrow, .news-card:focus-visible .news-card-arrow { transform: translateX(7px); }
.news-more {
  display: inline-flex; align-items: center; gap: 10px; margin-top: 26px;
  color: var(--gold); font-size: 15px; font-weight: 700; text-decoration: none;
}
.news-more-arrow { transition: transform .5s var(--news-ease); }
.news-more:hover .news-more-arrow, .news-more:focus-visible .news-more-arrow { transform: translateX(6px); }
.news-empty { margin: 0; padding: 22px 0; color: var(--muted); font-size: 14px; }
/* 没有消息时这一栏不能只剩一行字浮在空白中间：一条短金线起头，
   和左栏章节标题的上缘对齐，读起来仍是这一节的正文。 */
.news-empty::before {
  content: ''; display: block; width: 44px; height: 1px; margin-bottom: 16px;
  background: linear-gradient(90deg, var(--gold), oklch(.86 .16 92 / 0));
}
@media (min-width: 901px) { .news-more { grid-column: 2; justify-self: start; } }
@media (max-width: 900px) {
  .news { grid-template-columns: minmax(0, 1fr); }
  .news > .section-heading { position: static; }
}
@media (max-width: 560px) {
  .news-card { grid-template-columns: minmax(0, 1fr) auto; gap: 8px 14px; }
  .news-card-date { grid-column: 1 / -1; padding-top: 0; }
}

/* 新消息标记：日期后的小金点，72 小时内有呼吸感。首页卡片与消息页共用。 */
.news-fresh {
  display: inline-block; width: 5px; height: 5px; margin-left: 8px; vertical-align: middle;
  border-radius: 50%; background: var(--gold);
  animation: news-pulse 2.6s ease-in-out infinite;
}
@keyframes news-pulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in oklch, var(--gold) 46%, transparent); }
  55% { box-shadow: 0 0 0 5px transparent; }
}

/* ---------- 首页卡片的进场 ---------- */
.news-card.news-in {
  animation: news-item-in .85s var(--news-ease) both;
  animation-delay: calc(var(--i, 0) * 80ms);
}
@keyframes news-item-in {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .news-card.news-in { animation: none; }
  .news-fresh { animation: none; }
  .news-card:hover .news-card-body, .news-card:focus-visible .news-card-body { transform: none; }
  .news-card::before { transition: none; }
}
