/* Hikvision CN homepage visual clone
   Palette: white header, #333 ink, #D7150E accent, #F5F5F5 news band, #505050 footer */

:root {
  --accent: #d7150e;
  --accent-strong: #b20f0a;
  --accent-soft: #cf261c;
  --ink: #333333;
  --ink-soft: #666666;
  --line: #eaeaea;
  --band: #f5f5f5;
  --footer: #505050;
  --white: #ffffff;
  --container: 1310px;
  --radius-lg: 12px;
  --shadow-card: 0 0 12px rgba(0, 0, 0, 0.06);
  --font: "Microsoft YaHei", "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "WenQuanYi Micro Hei", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 300;
  padding: 10px 18px;
  background: var(--accent);
  color: #fff;
  border-radius: 6px;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 12px;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 30px;
}

/* ---------- Header ---------- */

.header {
  position: sticky;
  top: 0;
  z-index: 120;
  background: rgba(255, 255, 255, 0.98);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.header.is-scrolled {
  border-bottom-color: var(--line);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.05);
}

.header__inner {
  max-width: var(--container);
  margin: 0 auto;
  height: 64px;
  padding: 0 30px;
  display: flex;
  align-items: center;
  gap: 27px;
}

.brand {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.brand__logo {
  width: 184px;
  height: 23px;
}

.nav {
  margin-left: auto;
}

.nav__list {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav__link {
  display: block;
  padding: 0 16px;
  font-size: 16px;
  line-height: 64px;
  color: var(--ink);
  position: relative;
  transition: color 0.18s ease;
}

.nav__link::after {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.18s ease;
}

.nav__link:hover,
.nav__link:focus-visible,
.nav__link.is-current {
  color: var(--accent);
}

.nav__link:hover::after,
.nav__link.is-current::after {
  transform: scaleX(1);
}

.header__search {
  margin-left: 8px;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  transition: color 0.18s ease;
}

.header__search svg {
  width: 22px;
  height: 22px;
}

.header__search:hover,
.header__search:focus-visible {
  color: var(--accent);
}

.nav-toggle {
  display: none;
  margin-left: auto;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--ink);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  min-height: 472px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: #eef0f1;
}

.hero__media {
  position: absolute;
  inset: 0;
}

.hero__media picture,
.hero__media img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center right;
}

.hero__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(246, 247, 248, 0.94) 0%, rgba(246, 247, 248, 0.86) 38%, rgba(246, 247, 248, 0.18) 66%, rgba(246, 247, 248, 0) 100%);
}

.hero__inner {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 56px 30px;
}

.hero__content {
  max-width: 620px;
}

.hero__eyebrow {
  display: inline-block;
  font-size: 14px;
  letter-spacing: 0.12em;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 14px;
}

.hero__title {
  font-size: 40px;
  line-height: 1.3;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.01em;
}

.hero__desc {
  margin-top: 16px;
  font-size: 16px;
  line-height: 1.75;
  color: #4a4a4a;
  max-width: 32em;
}

.hero__actions {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-top: 30px;
  flex-wrap: wrap;
}

.hero__secondary {
  font-size: 15px;
  color: var(--ink);
  font-weight: 500;
  border-bottom: 1px solid rgba(51, 51, 51, 0.35);
  padding-bottom: 2px;
  transition: color 0.18s ease, border-color 0.18s ease;
}

.hero__secondary:hover,
.hero__secondary:focus-visible {
  color: var(--accent);
  border-color: var(--accent);
}

/* Primary download CTA */

.download-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 60px;
  padding: 0 40px;
  border-radius: 30px;
  background: linear-gradient(135deg, #e0231b 0%, var(--accent) 45%, var(--accent-strong) 100%);
  color: #ffffff;
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 16px 40px -12px rgba(215, 21, 14, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.28);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  animation: download-cta-glow 3s ease-in-out infinite;
  cursor: pointer;
}

.download-cta__icon {
  width: 22px;
  height: 22px;
}

.download-cta:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 22px 52px -12px rgba(215, 21, 14, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.34);
}

.download-cta:active {
  transform: translateY(0) scale(0.99);
}

.download-cta:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

@keyframes download-cta-glow {
  0%,
  100% {
    box-shadow: 0 16px 40px -12px rgba(215, 21, 14, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.28);
  }
  50% {
    box-shadow: 0 18px 52px -8px rgba(215, 21, 14, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.28);
  }
}

/* ---------- Sections ---------- */

.section__title {
  font-size: 34px;
  line-height: 1.2;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 35px;
}

/* ---------- Capabilities ---------- */

.capabilities {
  padding: 66px 0 6px;
}

.capabilities__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 26px;
}

.capability {
  padding: 30px 26px 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.capability:hover {
  transform: translateY(-4px);
  border-color: rgba(215, 21, 14, 0.35);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.07);
}

.capability__icon {
  display: inline-flex;
  width: 56px;
  height: 56px;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  background: rgba(215, 21, 14, 0.06);
  border-radius: 10px;
  margin-bottom: 20px;
}

.capability__icon svg {
  width: 34px;
  height: 34px;
}

.capability__title {
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 10px;
}

.capability__text {
  font-size: 15px;
  line-height: 1.75;
  color: var(--ink-soft);
}

/* ---------- Topics ---------- */

.topics {
  margin-top: 40px;
  padding-bottom: 70px;
}

.topics__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
  grid-auto-rows: 397px;
}

.topic-card {
  position: relative;
  display: block;
  overflow: hidden;
  background-color: #2a2a2a;
  background-image: var(--card-image);
  background-size: cover;
  background-position: center;
  color: #fff;
}

.topic-card--wide {
  grid-column: span 2;
}

.topic-card__mask {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 32%, rgba(0, 0, 0, 0.28) 58%, rgba(0, 0, 0, 0.72) 100%);
  transition: background 0.25s ease;
}

.topic-card:hover .topic-card__mask {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.06) 28%, rgba(0, 0, 0, 0.38) 60%, rgba(0, 0, 0, 0.8) 100%);
}

.topic-card__body {
  position: absolute;
  left: 32px;
  right: 32px;
  bottom: 30px;
  z-index: 2;
}

.topic-card__title {
  display: block;
  font-size: 22px;
  line-height: 1.45;
  font-weight: 700;
}

.topic-card__sub {
  display: block;
  margin-top: 8px;
  font-size: 15px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.86);
}

.topic-card__more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  font-size: 14px;
  color: #fff;
  opacity: 0.9;
  border-bottom: 1px solid rgba(255, 255, 255, 0.5);
  padding-bottom: 2px;
}

.topic-card__more img {
  width: 14px;
  height: 14px;
  filter: brightness(0) invert(1);
}

/* ---------- News ---------- */

.news {
  background: var(--band);
  padding: 50px 0 60px;
}

.news__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 234px;
  gap: 26px;
}

.news-card {
  background: #fff;
  height: 100%;
  overflow: hidden;
}

.news-card--feature {
  grid-row: span 2;
}

.news-card__link {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 20px 28px;
}

.news-card--feature .news-card__link {
  padding-bottom: 24px;
}

.news-card__image {
  display: block;
  margin: -20px -28px 18px;
  height: 214px;
  overflow: hidden;
}

.news-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.news-card:hover .news-card__image img {
  transform: scale(1.04);
}

.news-card__tag {
  align-self: flex-start;
  display: inline-block;
  padding: 0 10px;
  height: 25px;
  line-height: 25px;
  font-size: 14px;
  color: var(--accent-soft);
  background: rgba(207, 38, 28, 0.1);
  border-radius: 4px;
  margin-bottom: 12px;
}

.news-card__title {
  font-size: 18px;
  line-height: 30px;
  font-weight: 700;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.18s ease;
}

.news-card:hover .news-card__title {
  color: var(--accent);
}

.news-card__desc {
  margin-top: 8px;
  font-size: 15px;
  line-height: 24px;
  color: #555;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-card__time {
  margin-top: auto;
  padding-top: 10px;
  font-size: 14px;
  color: #8b8b8b;
}

/* ---------- Contact ---------- */

.contact {
  padding: 40px 0 20px;
}

.contact__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 25px;
}

.contact-card {
  display: flex;
  align-items: center;
  gap: 20px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-card);
  padding: 20px;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.contact-card:hover {
  transform: translateY(-3px);
  border-color: rgba(215, 21, 14, 0.32);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.08);
}

.contact-card__icon {
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
}

.contact-card__icon img {
  width: 56px;
  height: 56px;
}

.contact-card__title {
  font-size: 20px;
  font-weight: 500;
  color: var(--ink);
}

/* ---------- Footer ---------- */

.footer {
  margin-top: 50px;
  background: var(--footer);
  color: #ededed;
}

.footer__inner {
  display: flex;
  gap: 40px;
  padding-top: 36px;
  padding-bottom: 28px;
}

.footer__brand {
  flex: 0 0 208px;
}

.footer__brand img {
  width: 196px;
  height: auto;
}

.footer__tagline {
  margin-top: 16px;
  font-size: 14px;
  line-height: 1.8;
  color: rgba(237, 237, 237, 0.75);
}

.footer__groups {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 24px;
}

.footer__group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer__title {
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 4px;
}

.footer__group a {
  font-size: 14px;
  line-height: 1.7;
  color: #ededed;
  transition: color 0.18s ease;
}

.footer__group a:hover,
.footer__group a:focus-visible {
  color: #ffffff;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer__qr {
  width: 96px;
  height: 96px;
  object-fit: cover;
  background: #fff;
  padding: 4px;
}

.footer__bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  padding-top: 18px;
  padding-bottom: 22px;
}

.footer__copy {
  font-size: 14px;
  color: #ededed;
}

/* ---------- Responsive ---------- */

@media (max-width: 1200px) {
  .capabilities__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer__inner {
    flex-direction: column;
    gap: 28px;
  }

  .footer__brand {
    flex: none;
  }
}

@media (max-width: 1024px) {
  .topics__grid {
    grid-auto-rows: 320px;
  }

  .news__grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 250px;
  }

  .contact__grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .footer__groups {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .nav {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    background: #fff;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 18px 32px rgba(0, 0, 0, 0.1);
    transform: translateY(-12px);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.2s ease, opacity 0.2s ease, visibility 0.2s ease;
    max-height: calc(100vh - 64px);
    overflow-y: auto;
  }

  .nav.is-open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 16px 16px;
  }

  .nav__link {
    line-height: 48px;
    padding: 0 12px;
    border-bottom: 1px solid var(--line);
  }

  .nav__link::after {
    display: none;
  }

  .nav-toggle {
    display: flex;
  }

  .header__search {
    margin-left: 0;
  }

  .hero {
    min-height: 460px;
  }

  .hero__media::after {
    background: linear-gradient(180deg, rgba(246, 247, 248, 0.94) 0%, rgba(246, 247, 248, 0.88) 52%, rgba(246, 247, 248, 0.6) 100%);
  }

  .hero__inner {
    padding: 48px 24px 44px;
  }

  .hero__title {
    font-size: 32px;
  }

  .container {
    padding: 0 24px;
  }

  .topics__grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 300px;
  }

  .topic-card--wide {
    grid-column: span 2;
  }

  .news__grid {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
  }

  .news-card--feature {
    grid-row: auto;
  }

  .news-card {
    min-height: 220px;
  }

  .footer__groups {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px 18px;
  }
}

@media (max-width: 640px) {
  .header__inner {
    padding: 0 18px;
    gap: 12px;
  }

  .brand__logo {
    width: 150px;
    height: auto;
  }

  .hero {
    min-height: 500px;
    align-items: flex-end;
  }

  .hero__media img {
    object-position: center top;
  }

  .hero__media::after {
    background: linear-gradient(180deg, rgba(246, 247, 248, 0.72) 0%, rgba(246, 247, 248, 0.9) 34%, rgba(246, 247, 248, 0.97) 62%, #f6f7f8 100%);
  }

  .hero__inner {
    padding: 220px 20px 32px;
  }

  .hero__title {
    font-size: 27px;
    line-height: 1.35;
  }

  .hero__desc {
    font-size: 15px;
  }

  .hero__actions {
    gap: 16px;
    margin-top: 24px;
  }

  .download-cta {
    min-height: 54px;
    width: 100%;
    padding: 0 24px;
    font-size: 1.0625rem;
  }

  .hero__secondary {
    font-size: 14px;
  }

  .container {
    padding: 0 20px;
  }

  .section__title {
    font-size: 26px;
    margin-bottom: 24px;
  }

  .capabilities {
    padding: 44px 0 4px;
  }

  .capabilities__grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .topics {
    margin-top: 26px;
    padding-bottom: 44px;
  }

  .topics__grid {
    grid-template-columns: 1fr;
    grid-auto-rows: 230px;
    gap: 16px;
  }

  .topic-card--wide {
    grid-column: auto;
  }

  .topic-card__body {
    left: 22px;
    right: 22px;
    bottom: 22px;
  }

  .topic-card__title {
    font-size: 19px;
  }

  .news {
    padding: 36px 0 44px;
  }

  .news__grid {
    gap: 16px;
  }

  .news-card__link {
    padding: 18px 20px;
  }

  .news-card__image {
    margin: -18px -20px 16px;
    height: 190px;
  }

  .contact {
    padding: 32px 0 12px;
  }

  .contact-card {
    padding: 16px;
  }

  .contact-card__title {
    font-size: 18px;
  }

  .footer {
    margin-top: 36px;
  }

  .footer__inner {
    padding-top: 28px;
  }

  .footer__groups {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .footer__brand img {
    width: 168px;
  }

  .footer__group a {
    padding: 2px 0;
  }
}

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

  .download-cta {
    animation: none;
    transition: none;
  }

  .download-cta:hover,
  .download-cta:active {
    transform: none;
  }

  .capability,
  .contact-card,
  .news-card__image img {
    transition: none;
  }
}
