/* 发展历程专属样式 — 作用域严格限定于 .gh-history */
.gh-history {
  --hist-accent: #b5112a;
  --hist-accent-hover: #8e0c20;
  --hist-ink: #211a1e;
  --hist-muted: #62575e;
  --hist-line: #e7dfe2;
  --hist-surface: #ffffff;
  --hist-canvas: #f7f5f5;
  --hist-soft-red: #fdf1f4;
  --hist-soft-gray: #f8f5f6;
  --hist-shadow: 0 10px 30px rgba(46, 24, 34, .07);

  color: var(--hist-ink);
  background: var(--hist-canvas);
  font-size: 1rem;
  line-height: 1.7;
  scrollbar-color: #c8bcc1 transparent;
}

.gh-history ::selection {
  color: #ffffff;
  background: var(--hist-accent);
}

.gh-history :is(a, button, [tabindex]):focus-visible {
  outline: 2px solid var(--hist-accent);
  outline-offset: 4px;
}

.gh-history__wrap {
  width: min(1240px, calc(100% - 64px));
  margin-inline: auto;
}

/* ---------- 1. Hero ---------- */
.gh-history__hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  color: #ffffff;
  background: #28181e;
}

.gh-history__hero-media {
  position: absolute;
  inset: 0;
  z-index: -1;
}

.gh-history__hero-img {
  position: absolute;
  inset-block: 0;
  inset-inline-end: 0;
  width: 70%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
}

.gh-history__hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, #28181e 28%, rgba(40, 24, 30, .86) 52%, rgba(40, 24, 30, .38) 84%, rgba(40, 24, 30, .25) 100%),
    linear-gradient(180deg, rgba(40, 24, 30, .32) 0%, rgba(40, 24, 30, .58) 100%);
}

.gh-history__hero-inner {
  padding-block: 24px 78px;
}

.gh-history__hero a:focus-visible {
  outline-color: #ffffff;
}

.gh-history__crumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  color: #e7d8dd;
  font-size: .875rem;
}

.gh-history__crumb a {
  color: #f6e9ed;
  text-underline-offset: 3px;
}

.gh-history__crumb a:hover {
  text-decoration: underline;
}

.gh-history__intro {
  max-width: 68ch;
  margin-block-start: 28px;
}

.gh-history__intro h1 {
  margin: 0;
  color: inherit;
  font-size: clamp(2.125rem, 4.4vw, 3.25rem);
  font-weight: 720;
  line-height: 1.18;
  letter-spacing: -.02em;
  text-wrap: balance;
}

.gh-history__hero-lead {
  margin: 16px 0 0;
  color: #f2e6ea;
  font-size: clamp(1rem, 1.5vw, 1.125rem);
  line-height: 1.72;
}

.gh-history__hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-block-start: 24px;
}

.gh-history__btn {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  border: 1px solid transparent;
  border-radius: 8px;
  font: inherit;
  font-size: .9375rem;
  font-weight: 650;
  line-height: 1.4;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .18s ease, border-color .18s ease, color .18s ease;
}

.gh-history__btn--primary {
  background: var(--hist-accent);
  color: #ffffff;
}

.gh-history__btn--primary:hover {
  background: var(--hist-accent-hover);
  color: #ffffff;
}

.gh-history__btn--light {
  border-color: #957d87;
  background: #3f2933;
  color: #ffffff;
}

.gh-history__btn--light:hover {
  border-color: #e6d4db;
  background: #523643;
  color: #ffffff;
}

.gh-history__subnav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
  margin-block-start: 22px;
  padding-block-start: 16px;
  border-block-start: 1px solid rgba(255, 255, 255, .14);
}

.gh-history__subnav-label {
  color: #dfd0d5;
  font-size: .875rem;
}

.gh-history__subnav a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  padding-inline: 2px;
  color: #ffffff;
  font-size: .9375rem;
  font-weight: 550;
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, .36);
  text-underline-offset: 4px;
}

.gh-history__subnav a:hover {
  text-decoration-color: #ffffff;
}

/* ---------- 2. 主体叠层与区块 ---------- */
.gh-history__body {
  position: relative;
  margin-block-start: -36px;
  padding-block-end: 64px;
}

.gh-history__section {
  margin-block-start: 52px;
}

.gh-history__section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px 24px;
  margin-block-end: 22px;
}

.gh-history__section-head h2 {
  margin: 0;
  color: var(--hist-ink);
  font-size: clamp(1.375rem, 2.5vw, 1.875rem);
  font-weight: 720;
  line-height: 1.28;
  letter-spacing: -.015em;
  text-wrap: balance;
}

.gh-history__section-head p {
  margin: 0;
  max-width: 65ch;
  color: var(--hist-muted);
  font-size: .9375rem;
}

/* ---------- 3. 四阶段演进叠层带 ---------- */
.gh-history__phases {
  border: 1px solid var(--hist-line);
  border-radius: 16px;
  background: var(--hist-surface);
  box-shadow: var(--hist-shadow);
  overflow: hidden;
}

.gh-history__phases-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.gh-history__phase {
  display: block;
  padding: 22px 22px 20px;
  color: inherit;
  text-decoration: none;
  transition: background-color .16s ease;
}

.gh-history__phase + .gh-history__phase {
  border-inline-start: 1px solid var(--hist-line);
}

.gh-history__phase:hover {
  background: #fdf9fa;
}

.gh-history__phase-years {
  display: block;
  color: var(--hist-accent);
  font-size: clamp(1.25rem, 2vw, 1.55rem);
  font-weight: 740;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.gh-history__phase-title {
  display: block;
  margin-block-start: 7px;
  color: var(--hist-ink);
  font-size: .95rem;
  font-weight: 680;
  line-height: 1.45;
}

.gh-history__phase-desc {
  display: block;
  margin-block-start: 4px;
  color: var(--hist-muted);
  font-size: .8125rem;
  line-height: 1.55;
}

.gh-history__source-note {
  padding: 11px 22px;
  border-block-start: 1px solid var(--hist-line);
  background: var(--hist-soft-gray);
  color: var(--hist-muted);
  font-size: .8125rem;
}

/* ---------- 4. 编年史筛选与分组节点 ---------- */
.gh-history__timeline-box {
  border: 1px solid var(--hist-line);
  border-radius: 14px;
  background: var(--hist-surface);
  overflow: hidden;
}

.gh-history__filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 18px;
  padding: 18px 24px;
  border-block-end: 1px solid var(--hist-line);
  background: var(--hist-soft-gray);
}

.gh-history__filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.gh-history__filter-btn {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  padding: 8px 15px;
  border: 1px solid #d9cfd4;
  border-radius: 8px;
  background: #ffffff;
  color: var(--hist-ink);
  font: inherit;
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .16s ease, background-color .16s ease, color .16s ease;
}

.gh-history__filter-btn:hover {
  border-color: var(--hist-accent);
  color: var(--hist-accent-hover);
}

.gh-history__filter-btn[aria-pressed="true"] {
  border-color: var(--hist-accent);
  background: var(--hist-accent);
  color: #ffffff;
}

.gh-history__count {
  margin: 0;
  color: var(--hist-muted);
  font-size: .875rem;
  font-variant-numeric: tabular-nums;
}

.gh-history__groups {
  padding: 10px 24px 28px;
}

.gh-history__group + .gh-history__group {
  margin-block-start: 28px;
  padding-block-start: 24px;
  border-block-start: 1px solid var(--hist-line);
}

.gh-history__group[hidden] {
  display: none;
}

.gh-history__group-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 16px;
  margin-block-end: 10px;
}

.gh-history__group-head h3 {
  margin: 0;
  color: var(--hist-ink);
  font-size: 1.125rem;
  font-weight: 720;
}

.gh-history__group-head span {
  color: var(--hist-accent-hover);
  font-size: .8125rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.gh-history__tl-list {
  display: grid;
}

.gh-history__tl-item {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  gap: 10px 24px;
  padding-block: 18px;
  border-block-end: 1px solid #f0eaec;
}

.gh-history__tl-item:last-child {
  border-block-end: 0;
  padding-block-end: 4px;
}

.gh-history__tl-item[hidden] {
  display: none;
}

.gh-history__tl-date {
  font-variant-numeric: tabular-nums;
}

.gh-history__tl-date strong {
  display: block;
  color: var(--hist-accent);
  font-size: 1.45rem;
  font-weight: 740;
  line-height: 1.15;
}

.gh-history__tl-date span {
  display: block;
  margin-block-start: 3px;
  color: var(--hist-muted);
  font-size: .8125rem;
  font-weight: 600;
}

.gh-history__tl-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 12px;
}

.gh-history__tl-head h4 {
  margin: 0;
  color: var(--hist-ink);
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.4;
}

.gh-history__badge {
  display: inline-flex;
  padding: 2px 9px;
  border-radius: 6px;
  background: var(--hist-soft-gray);
  border: 1px solid var(--hist-line);
  color: var(--hist-muted);
  font-size: .75rem;
  font-weight: 600;
}

.gh-history__badge--cert {
  background: var(--hist-soft-red);
  border-color: #f0d7df;
  color: var(--hist-accent-hover);
}

.gh-history__tl-body p {
  margin: 7px 0 0;
  color: var(--hist-muted);
  font-size: .9375rem;
  line-height: 1.72;
}

/* ---------- 5. 现行有效资质汇总响应式表 ---------- */
.gh-history__table-panel {
  border: 1px solid var(--hist-line);
  border-radius: 14px;
  background: var(--hist-surface);
  overflow: hidden;
}

.gh-history__table-wrap {
  overflow: auto;
  max-inline-size: 100%;
  max-block-size: min(520px, 75vh);
  container-type: inline-size;
  scrollbar-width: thin;
}

.gh-history__table {
  width: 100%;
  margin: 0;
  border-collapse: separate;
  border-spacing: 0;
  --col-1: "资质 / 认证项目";
  --col-2: "证书编号 / 标准";
  --col-3: "有效期";
}

.gh-history__table th,
.gh-history__table td {
  padding: 13px 18px;
  border-block-end: 1px solid var(--hist-line);
  text-align: left;
  vertical-align: top;
  font-size: .9375rem;
  line-height: 1.58;
}

.gh-history__table thead th {
  position: sticky;
  inset-block-start: 0;
  z-index: 2;
  background: #f3eeef;
  color: var(--hist-ink);
  font-size: .875rem;
  font-weight: 700;
  white-space: nowrap;
}

.gh-history__table tbody th[scope="row"] {
  position: sticky;
  inset-inline-start: 0;
  z-index: 1;
  background: var(--hist-surface);
  color: var(--hist-ink);
  font-weight: 650;
}

.gh-history__table tbody td:nth-child(2),
.gh-history__table tbody td:nth-child(3) {
  font-variant-numeric: tabular-nums;
}

.gh-history__table tbody tr:last-child :is(th, td) {
  border-block-end: 0;
}

.gh-history__table tbody tr:hover :is(th, td) {
  background: #fdf9fa;
}

@container (width < 640px) {
  .gh-history__table-wrap {
    max-block-size: none;
    overflow: visible;
    padding: 14px;
    background: var(--hist-soft-gray);
  }

  .gh-history__table,
  .gh-history__table thead,
  .gh-history__table tbody,
  .gh-history__table tr,
  .gh-history__table th,
  .gh-history__table td {
    display: block;
    width: 100%;
  }

  .gh-history__table thead {
    display: none;
  }

  .gh-history__table tbody tr {
    margin-block-end: 12px;
    border: 1px solid var(--hist-line);
    border-radius: 10px;
    background: var(--hist-surface);
    overflow: hidden;
  }

  .gh-history__table tbody tr:last-child {
    margin-block-end: 0;
  }

  .gh-history__table tbody th[scope="row"] {
    position: sticky;
    inset-block-start: 0;
    z-index: 2;
    padding: 11px 16px;
    border-block-end: 1px solid var(--hist-line);
    background: #f5eff1;
  }

  .gh-history__table tbody td {
    padding: 9px 16px;
    border-block-end: 1px solid #f2ecef;
  }

  .gh-history__table tbody td:last-child {
    border-block-end: 0;
  }

  .gh-history__table tbody td:nth-child(2)::before {
    content: var(--col-2) "：";
    color: var(--hist-muted);
    font-weight: 600;
    margin-inline-end: 6px;
  }

  .gh-history__table tbody td:nth-child(3)::before {
    content: var(--col-3) "：";
    color: var(--hist-muted);
    font-weight: 600;
    margin-inline-end: 6px;
  }
}

.gh-history__links-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  margin-block-start: 16px;
}

.gh-history__inline-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 6px;
  color: var(--hist-accent-hover);
  font-size: .9375rem;
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.gh-history__inline-link .icon {
  width: 16px;
  height: 16px;
}

.gh-history__inline-link:hover {
  color: var(--hist-accent);
}

/* ---------- 6. 底部转化横幅 ---------- */
.gh-history__cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px 28px;
  margin-block-start: 52px;
  padding: clamp(24px, 3.2vw, 36px);
  border-radius: 14px;
  background: #28181e;
  color: #ffffff;
}

.gh-history__cta-copy {
  max-width: 60ch;
}

.gh-history__cta-copy h2 {
  margin: 0;
  color: inherit;
  font-size: clamp(1.25rem, 2.2vw, 1.625rem);
  font-weight: 700;
  line-height: 1.32;
}

.gh-history__cta-copy p {
  margin: 8px 0 0;
  color: #f0e2e7;
  font-size: .9375rem;
}

.gh-history__cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* ---------- 7. 响应式断点 ---------- */
@media (min-width: 1200px) {
  .gh-history__hero-inner {
    padding-block-start: calc(var(--header-height, 80px) + 28px);
  }
}

@media (max-width: 1020px) {
  .gh-history__phases-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gh-history__phase:nth-child(odd) {
    border-inline-start: 0;
  }

  .gh-history__phase:nth-child(n+3) {
    border-block-start: 1px solid var(--hist-line);
  }
}

@media (max-width: 820px) {
  .gh-history__wrap {
    width: calc(100% - 40px);
  }

  .gh-history__hero-img {
    width: 100%;
    opacity: .68;
  }

  .gh-history__hero-media::after {
    background: linear-gradient(180deg, rgba(40, 24, 30, .74) 0%, #28181e 95%);
  }

  .gh-history__hero-inner {
    padding-block: 22px 62px;
  }

  .gh-history__body {
    margin-block-start: -24px;
    padding-block-end: 44px;
  }

  .gh-history__groups,
  .gh-history__filter-bar {
    padding-inline: 18px;
  }
}

@media (max-width: 580px) {
  .gh-history__wrap {
    width: calc(100% - 32px);
  }

  .gh-history__phase {
    padding: 16px;
  }

  .gh-history__phase-years {
    font-size: 1.1875rem;
    white-space: nowrap;
  }

  .gh-history__tl-item {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }

  .gh-history__tl-date {
    display: flex;
    align-items: baseline;
    gap: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gh-history *,
  .gh-history *::before,
  .gh-history *::after {
    transition: none;
  }
}
