/* ============================================================
   中科普瑞 · 公司动态页（news.html）独立样式表
   设计基调：沿袭全站编辑式白 / 浅灰视觉体系（#fff · #f5f5f7 · #1d1d1f · #0066cc），
   采用 Apple Newsroom 式的重点条目叙事、毛玻璃年份筛选栏与年份对齐台账。
   仅作用于挂载 <body class="nw ep"> 的页面，零全局副作用。
   ============================================================ */

body.nw {
  --nw-ink: var(--ep-ink, var(--ap-ink));
  --nw-body: var(--ep-body, var(--ap-body));
  --nw-mute: var(--ep-mute, var(--ap-muted));
  --nw-line: var(--ep-line, var(--ap-line));
  --nw-line-soft: var(--ap-line-light);
  --nw-blue: var(--ep-blue, var(--ap-blue));
  --nw-blue-hover: var(--ap-blue-hover);
  --nw-blue-tint: var(--ap-blue-soft);
  --nw-alt: var(--ep-alt, var(--ap-alt));
  --nw-bar-h: 54px;
  --nw-radius-lg: var(--radius-lg);
  --nw-radius-md: var(--radius-md);
  --nw-radius-sm: var(--radius-md);
  --nw-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* 页头与指标带微调：与 purifiers / smart-equipment 等顶层页完全同构，导语通栏铺满不提前断行 */
body.nw .ep-head .ep-lead {
  max-width: none;
}

body.nw .ep-stat span {
  text-wrap: pretty;
}

/* 四列指标带：字号与全站一致；首列文案较长，列宽按 1.18 : 1 分配以保证「2019~2026 年主要业绩」单行 */
@media (min-width: 1081px) {
  body.nw .ep-stats-grid {
    grid-template-columns: minmax(0, 1.18fr) repeat(3, minmax(0, 1fr));
  }
  body.nw .ep-stat:last-child {
    padding-right: 0;
  }
  body.nw .ep-stat b {
    white-space: nowrap;
  }
}

/* 章节通用标头 */

/* ============================================================
   1. 签约条目通用元素（锚点高亮 / 徽标 / 详情按钮 / 装置链接）
   ============================================================ */

/* 锚点命中态：由首页跳转至指定动态条目时高亮提示 */
.nw-flag-row:target,
.nw-flag-row.is-targeted,
.nw-contract-card:target,
.nw-contract-card.is-targeted {
  border-color: var(--nw-blue);
  box-shadow: 0 0 0 2px var(--nw-blue), 0 16px 36px rgba(0, 102, 204, 0.14);
}

/* 详情弹窗徽标 */
.nw-badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: var(--fs-12);
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1;
}

.nw-badge--fresh {
  background: var(--nw-blue);
  color: #ffffff;
}

.nw-badge--cat {
  background: var(--nw-blue-tint);
  color: var(--nw-blue);
}

.nw-badge--env {
  background: var(--nw-blue-tint);
  color: var(--nw-blue);
}

.nw-year-pill {
  font-size: var(--fs-13);
  font-weight: 600;
  color: var(--nw-mute);
  font-variant-numeric: tabular-nums;
}

/* 重点条目操作 */
.nw-read-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0;
  border: none;
  background: none;
  font-family: inherit;
  font-size: var(--fs-14);
  font-weight: 600;
  color: var(--nw-blue);
  cursor: pointer;
  transition: color 0.18s ease;
}

.nw-read-btn:hover {
  color: var(--nw-blue-hover);
}

.nw-read-btn svg {
  width: 14px;
  height: 14px;
  transition: transform 0.2s ease;
}

.nw-flag-row:hover .nw-read-btn svg {
  transform: translateX(2px);
}

/* ============================================================
   2. 历年签约归档 — 毛玻璃吸顶年份筛选栏 + 年份锚定双列台账（白底 #fff）
   ============================================================ */
.nw-archive {
  background: #ffffff;
  padding: var(--sec-y) 0;
  scroll-margin-top: var(--header-h, 65px);
}

/* Apple 风格毛玻璃吸顶筛选条（z-index: 120 < .nav-veil 890 < .header 900） */
.nw-toolbar {
  position: sticky;
  top: var(--header-h, 65px);
  z-index: 120;
  background: rgba(255, 255, 255, 0.97);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--nw-line);
  box-shadow: 0 6px 22px rgba(9, 36, 66, 0.04);
  padding: 12px 0;
  margin-top: 22px;
  margin-bottom: 28px;
}

/* 年份筛选条：macOS 分段控件（Segmented Control），替代原圆形胶囊 */
.nw-yearbar {
  display: flex;
  align-items: center;
  gap: 2px;
  width: -moz-fit-content;
  width: fit-content;
  max-width: 100%;
  padding: 3px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.05);
  overflow-x: auto;
  scrollbar-width: none;
}

.nw-yearbar::-webkit-scrollbar {
  display: none;
}

.nw-year-btn {
  flex-shrink: 0;
  height: 28px;
  padding: 0 13px;
  border: none;
  border-radius: 7px;
  background: transparent;
  font-family: inherit;
  font-size: var(--fs-13);
  font-weight: 500;
  color: var(--nw-body);
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.nw-year-btn:hover {
  background: rgba(255, 255, 255, 0.6);
  color: var(--nw-ink);
}

.nw-year-btn.is-active {
  background: #ffffff;
  color: var(--nw-ink);
  font-weight: 600;
  box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.12);
}

/* ============================================================
   3. 年份分区（左粘性年份导轨 + 右侧项目台账）
   ============================================================ */
.nw-years {
  margin: 0;
  padding: 0;
  list-style: none;
}

.nw-year-block {
  display: grid;
  grid-template-columns: 164px minmax(0, 1fr);
  gap: 36px;
  padding: 40px 0 46px;
  border-top: 1px solid var(--nw-line);
  scroll-margin-top: calc(var(--header-h, 65px) + var(--nw-bar-h, 112px) + 12px);
}

.nw-year-block:first-child,
.nw-year-block.is-first-visible {
  padding-top: 8px;
  border-top: none;
}

.nw-year-block[hidden],
.nw-flag-row[hidden],
.nw-contract-card[hidden],
.nw-year-flagships[hidden],
.nw-ledger-grid[hidden] {
  display: none !important;
}

/* 左侧粘性年份大字 */
.nw-year-rail {
  position: relative;
}

.nw-year-sticky {
  position: sticky;
  top: calc(var(--header-h, 65px) + var(--nw-bar-h, 112px) + 22px);
}

.nw-year-num {
  font-size: var(--fs-page);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--nw-ink);
  font-variant-numeric: tabular-nums;
}

/* 右侧年份内容区 */
.nw-year-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* 末组不再叠加下内边距，使页脚上方留白与全站 36px 章节节奏一致 */
.nw-year-block:last-child,
.nw-year-block:not([hidden]):not(:has(~ .nw-year-block:not([hidden]))) {
  padding-bottom: 0;
}

/* 年内重点定制/工程条目（通栏高光行，避免破坏下方 20 项双列对称） */
.nw-year-flagships {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nw-flag-row {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  padding: 16px 20px;
  background: #fafafc;
  border: 1px solid var(--nw-line-soft);
  border-radius: var(--nw-radius-md);
  cursor: pointer;
  scroll-margin-top: calc(var(--header-h, 65px) + var(--nw-bar-h, 112px) + 18px);
  transition: border-color 0.24s ease, box-shadow 0.24s ease, transform 0.24s var(--nw-ease);
}

.nw-flag-row:hover {
  transform: translateY(-2px);
  background: #ffffff;
  border-color: rgba(0, 102, 204, 0.28);
  box-shadow: var(--ep-shadow-hover);
}

.nw-flag-thumb {
  width: 116px;
  height: 84px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nw-flag-thumb.is-studio {
  padding: 8px;
}

.nw-flag-thumb.is-studio img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.nw-flag-thumb.is-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.nw-flag-content {
  min-width: 0;
}

.nw-flag-top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 5px;
}

.nw-flag-kind {
  font-size: var(--fs-12);
  font-weight: 600;
  color: var(--nw-blue);
}

.nw-flag-meta-inline {
  font-size: var(--fs-12);
  color: var(--nw-mute);
}

.nw-flag-title {
  font-size: var(--fs-16);
  font-weight: 600;
  line-height: 1.42;
  color: var(--nw-ink);
  transition: color 0.18s ease;
}

.nw-flag-row:hover .nw-flag-title {
  color: var(--nw-blue);
}

.nw-flag-desc {
  margin-top: 6px;
  font-size: var(--fs-13);
  line-height: 1.68;
  color: var(--nw-body);
}

.nw-flag-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  align-self: start;
  gap: 8px;
  flex-shrink: 0;
}

/* 年内标准纯化装备签约台账（严格 2 列等高对称网格：20 项 = 10 行 × 2 列） */
.nw-ledger-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nw-contract-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  background: #ffffff;
  border: 1px solid var(--nw-line-soft);
  border-radius: var(--nw-radius-sm);
  box-shadow: var(--shadow-sm);
  scroll-margin-top: calc(var(--header-h, 65px) + var(--nw-bar-h, 112px) + 18px);
  transition:
    border-color 0.22s ease,
    background 0.22s ease,
    box-shadow 0.22s ease,
    transform 0.22s var(--nw-ease);
}

.nw-contract-card:hover {
  border-color: rgba(0, 102, 204, 0.28);
  background: #ffffff;
  box-shadow: var(--ep-shadow-hover);
  transform: translateY(-2px);
}

.nw-contract-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.nw-contract-badges {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.nw-model-code {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  background: var(--nw-alt);
  color: var(--nw-ink);
  font-size: var(--fs-12);
  font-weight: 600;
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
}

.nw-gas-tag {
  font-size: var(--fs-12);
  color: var(--nw-mute);
}

.nw-kind-label {
  font-size: var(--fs-12);
  color: var(--nw-mute);
  flex-shrink: 0;
}

.nw-contract-title {
  font-size: var(--fs-15);
  font-weight: 600;
  line-height: 1.5;
  color: var(--nw-ink);
}

.nw-contract-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(0, 0, 0, 0.045);
  font-size: var(--fs-12);
  color: var(--nw-mute);
}

.nw-client-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nw-model-link {
  flex-shrink: 0;
  font-size: var(--fs-12);
  font-weight: 500;
  color: var(--nw-mute);
  transition: color 0.18s ease;
}

.nw-contract-card:hover .nw-model-link,
.nw-model-link:hover {
  color: var(--nw-blue);
}

/* ============================================================
   4. Apple Newsroom 风格快读详情弹窗（原生 <dialog>）
   ============================================================ */
.nw-modal {
  padding: 0;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 24px;
  max-width: 740px;
  width: calc(100% - 32px);
  max-height: calc(100vh - 48px);
  background: #ffffff;
  color: var(--nw-ink);
  box-shadow: 0 28px 80px rgba(9, 30, 60, 0.24);
  overflow: hidden;
  margin: auto;
}

.nw-modal::backdrop {
  background: rgba(15, 23, 42, 0.44);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.nw-modal-sheet {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  outline: none;
}

.nw-modal-topbar {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 24px;
  background: rgba(255, 255, 255, 0.88);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.nw-modal-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.nw-modal-close {
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: #f2f2f7;
  color: #515154;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}

.nw-modal-close:hover {
  background: #e5e5ea;
  color: var(--nw-ink);
}

.nw-modal-close svg {
  width: 16px;
  height: 16px;
}

.nw-modal-stage {
  height: 290px;
  background: radial-gradient(circle at 50% 42%, #ffffff 0%, #eef1f6 100%);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.nw-modal-stage.is-studio {
  padding: 24px 36px;
}

.nw-modal-stage.is-studio img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.nw-modal-stage.is-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.nw-modal-body {
  padding: 28px 32px 32px;
}

.nw-modal-title {
  font-size: var(--fs-h3);
  font-weight: 600;
  line-height: 1.38;
  letter-spacing: -0.015em;
  color: var(--nw-ink);
}

.nw-modal-specs {
  margin-top: 20px;
  padding: 16px 20px;
  background: var(--nw-alt);
  border-radius: 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 24px;
}

.nw-modal-specs dt {
  font-size: var(--fs-12);
  color: var(--nw-mute);
}

.nw-modal-specs dd {
  margin: 3px 0 0;
  font-size: var(--fs-14);
  font-weight: 600;
  color: var(--nw-ink);
}

.nw-modal-desc {
  margin-top: 20px;
  font-size: var(--fs-15);
  line-height: 1.88;
  color: var(--nw-body);
}

.nw-modal-actions {
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid rgba(0, 0, 0, 0.07);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* 弹窗操作按钮：Apple 圆角矩形，主 / 次按钮共用同一套高度、圆角与字号 */
body.nw .nw-modal-actions .ep-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  /* 中文字面在 em 框内偏上约 1px，用 2px 上内边距做视觉校正（不改行高） */
  padding: 2px 20px 0;
  border-radius: 10px;
  font-size: var(--fs-14);
  font-weight: 500;
  letter-spacing: 0;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

body.nw .nw-modal-actions .ep-btn-solid {
  background: var(--nw-blue);
  color: #fff;
}

body.nw .nw-modal-actions .ep-btn-solid:hover {
  background: var(--nw-blue-hover);
  color: #fff;
  transform: none;
}

body.nw .nw-modal-actions .ep-btn-line {
  border: 1px solid rgba(0, 0, 0, 0.16);
  background: #fff;
  color: var(--nw-ink);
}

body.nw .nw-modal-actions .ep-btn-line:hover {
  border-color: rgba(0, 0, 0, 0.28);
  background: var(--nw-alt);
  color: var(--nw-ink);
  transform: none;
}

body.nw .nw-modal-actions .ep-btn:active {
  transform: scale(0.985);
}

body.nw .nw-modal-actions .ep-btn:focus-visible {
  outline: 2px solid var(--nw-blue);
  outline-offset: 2px;
}

/* 键盘焦点轮廓 */
body.nw :is(.nw-read-btn, .nw-year-btn, .nw-modal-close, .nw-model-link):focus-visible {
  outline: 2px solid var(--nw-blue);
  outline-offset: 2px;
}

/* ============================================================
   5. 响应式适配（960 / 760）
   ============================================================ */
@media (max-width: 900px) {
  body.nw {
    --nw-bar-h: 54px;
  }

  .nw-year-block {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: var(--sec-y) 0;
  }

  .nw-year-sticky {
    position: static;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--nw-line-soft);
  }

  .nw-flag-row {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 16px;
  }

  .nw-flag-thumb {
    width: 100%;
    height: 168px;
  }

  .nw-flag-side {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding-top: 10px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
  }

}

@media (max-width: 640px) {
  .nw-archive {
    padding: var(--sec-y-compact) 0;
  }

  .nw-ledger-grid {
    grid-template-columns: 1fr;
  }

  .nw-modal-stage {
    height: 220px;
  }

  .nw-modal-body {
    padding: 22px 20px 24px;
  }

  .nw-modal-specs {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

@media (max-width: 640px) {
  .nw-archive {
    padding: var(--sec-y-compact) 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nw-flag-row,
  .nw-contract-card,
  .nw-read-btn svg {
    transition: none !important;
  }
}
