:root {
  --bg: #ffffff;
  --text: #1d2d3a;
  --primary: #c40000;
  --primary-dark: #9d0000;
  --muted: #55677a;
  --surface: #ffffff;
  --border: #d0d9e4;
  --navy: #0f1720;
  --navy-dark: #0a1016;
  --rayzer-gray: #6b6b6b;
  /* White strip height (top pad + inner + bottom pad above red); match content so no extra gap above red */
  --top-white-h: 102px;
  /* Same gap: flag↔Login/HTTP, Login/HTTP↔red nav, logo↔red (blue), and top↔search (green) */
  --header-meta-breath: 12px;
  --red-nav-h: 48px;
  /* WebKit scrollbar thickness: 3/4 of a 12px baseline */
  --scrollbar-size: 9px;
}

html,
body {
  height: 100%;
  overflow-y: scroll;
}

html {
  scrollbar-gutter: stable both-edges;
  scrollbar-color: #1f1f1f #e8e8e8;
  scrollbar-width: thin;
}

html::-webkit-scrollbar {
  width: var(--scrollbar-size);
  height: var(--scrollbar-size);
}

html::-webkit-scrollbar-track {
  background: #e8e8e8;
}

html::-webkit-scrollbar-thumb {
  background: #1f1f1f;
  border-radius: 5px;
  border: 2px solid #e8e8e8;
  background-clip: padding-box;
}

html::-webkit-scrollbar-thumb:hover {
  background: #0d0d0d;
}

body::-webkit-scrollbar {
  width: var(--scrollbar-size);
  height: var(--scrollbar-size);
}

body::-webkit-scrollbar-track {
  background: #e8e8e8;
}

body::-webkit-scrollbar-thumb {
  background: #1f1f1f;
  border-radius: 5px;
  border: 2px solid #e8e8e8;
  background-clip: padding-box;
}

body::-webkit-scrollbar-thumb:hover {
  background: #0d0d0d;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.45;
  min-height: 100vh;
  padding-top: calc(var(--top-white-h) + var(--red-nav-h));
}

.container {
  width: min(1260px, 98vw);
  margin: 0 auto;
}

.site-header {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-bottom: 0;
  color: var(--text);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: calc(var(--top-white-h) + var(--red-nav-h));
  box-sizing: border-box;
}

.site-header > .top-white {
  flex: 0 0 var(--top-white-h);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  box-sizing: border-box;
  min-height: 0;
}

.top-white {
  background: #fff;
}

.top-white-inner {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  width: 100%;
  /* Green (page top → search): margin-top = meta-breath, same as blue (HTTP → red) padding-bottom */
  margin-top: var(--header-meta-breath);
  padding: 0 14px var(--header-meta-breath);
  box-sizing: border-box;
  min-height: 0;
  height: auto;
  flex: 0 0 auto;
}

.top-left-group {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: flex-end;
  gap: 22px;
  flex-wrap: nowrap;
}

.top-white-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-start;
  gap: var(--header-meta-breath);
  flex: 0 0 auto;
}

.head-search-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  flex: 0 0 auto;
  gap: 5px;
}

.brand {
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  font-size: 22px;
}

.brand-dark {
  color: #111;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.brand-logo-wrap {
  width: 292px;
  height: 52px;
  overflow: hidden;
  display: inline-block;
  flex: 0 0 auto;
}

.brand-logo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 50%;
  display: block;
}

.search-box {
  width: 380px;
  max-width: none;
  display: flex;
  align-items: stretch;
  flex: 0 0 auto;
  min-width: 0;
}

.head-search {
  width: 100%;
  height: 42px;
  border: 1px solid #d0d6dd;
  border-right: 0;
  border-radius: 2px;
  padding: 8px 12px;
  font-size: 13px;
  min-width: 0;
}

.search-btn {
  width: 44px;
  height: 42px;
  border: 1px solid #d0d6dd;
  background: #fff;
  color: #2f3d4c;
  cursor: pointer;
  font-size: 17px;
}

.search-sub {
  font-size: 12px;
  line-height: 1.25;
  color: #0f5d9f;
}

.head-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  color: #53606f;
  justify-content: flex-end;
  white-space: nowrap;
}

#auth-area {
  display: flex;
  align-items: center;
  line-height: 1.25;
}

.head-cn-flag-strip {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 0;
  box-sizing: border-box;
  background: transparent;
}

.head-cn-flag {
  display: block;
  width: 64px;
  aspect-ratio: 3 / 2;
  height: auto;
  object-fit: cover;
  border-radius: 3px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.16);
}

.meta-link {
  font-size: 13px;
  color: #53606f;
  text-decoration: none;
  font-family: Arial, "Segoe UI", sans-serif;
}

.meta-mode {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 46px;
  min-height: 22px;
  text-align: center;
  font-size: 11px;
  line-height: 1.2;
  border: 1px solid #cfd7df;
  border-radius: 10px;
  color: #2f3d4c;
  background: #f5f8fb;
  padding: 0 8px;
  box-sizing: border-box;
}

.logout-link {
  border: 0;
  background: transparent;
  color: #53606f;
  font-size: 13px;
  cursor: pointer;
  padding: 0;
}

.meta-sep {
  display: inline-block;
  width: 1px;
  height: 14px;
  background: #cdd4db;
  margin: 0 2px;
  vertical-align: middle;
}

.red-nav {
  flex: 0 0 var(--red-nav-h);
  background: #c40000;
  border-bottom: 3px solid var(--primary);
  height: var(--red-nav-h);
}

/* Full viewport width like ti.com; inner row uses horizontal padding instead of max-width */
.red-nav-inner.container {
  width: 100%;
  max-width: none;
  margin-left: 0;
  margin-right: 0;
  padding-left: clamp(16px, 2.5vw, 40px);
  padding-right: clamp(16px, 2.5vw, 40px);
  box-sizing: border-box;
}

.red-nav-inner {
  height: calc(var(--red-nav-h) - 3px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  box-sizing: border-box;
}

.menu-row {
  min-width: 0;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: max-content;
  gap: 34px;
}

.menu-row a {
  color: #fff;
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  line-height: calc(var(--red-nav-h) - 3px);
  opacity: 0.98;
  white-space: nowrap;
}

.menu-row a.active {
  box-shadow: inset 0 -3px 0 #fff;
}

/* Match .menu-row a: full strip height so inset bottom bar aligns with other red-nav links */
.red-nav-inner > .cart-link {
  display: inline-flex;
  align-items: center;
  align-self: stretch;
  justify-content: center;
  color: #fff;
  text-decoration: none;
  font-size: 24px;
  line-height: 1;
  font-weight: 400;
  white-space: nowrap;
  opacity: 0.98;
  padding: 0 6px;
  box-sizing: border-box;
}

.cart-link--current {
  box-shadow: inset 0 -3px 0 #fff;
}

.ti-hero-wrap {
  background: #0a0d12;
}

.ti-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 460px;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.82) 0%, rgba(0, 0, 0, 0.55) 43%, rgba(4, 22, 35, 0.66) 100%),
    radial-gradient(circle at 76% 56%, rgba(80, 149, 133, 0.45), rgba(0, 0, 0, 0) 38%),
    linear-gradient(110deg, #121822 0%, #0e141c 48%, #1f2f3a 100%);
  overflow: hidden;
}

.ti-hero.slide-0 {
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.82) 0%, rgba(0, 0, 0, 0.55) 43%, rgba(4, 22, 35, 0.66) 100%),
    radial-gradient(circle at 76% 56%, rgba(80, 149, 133, 0.45), rgba(0, 0, 0, 0) 38%),
    linear-gradient(110deg, #121822 0%, #0e141c 48%, #1f2f3a 100%);
}

.ti-hero.slide-1 {
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.86) 0%, rgba(0, 0, 0, 0.55) 46%, rgba(12, 40, 50, 0.66) 100%),
    radial-gradient(circle at 74% 50%, rgba(53, 109, 182, 0.45), rgba(0, 0, 0, 0) 40%),
    linear-gradient(110deg, #111722 0%, #0e131b 50%, #182233 100%);
}

.ti-hero.slide-2 {
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.86) 0%, rgba(0, 0, 0, 0.55) 46%, rgba(28, 30, 55, 0.66) 100%),
    radial-gradient(circle at 78% 55%, rgba(181, 92, 61, 0.35), rgba(0, 0, 0, 0) 38%),
    linear-gradient(110deg, #14151e 0%, #0f1118 55%, #2c2736 100%);
}

.hero-inner {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(16px, 3vw, 40px);
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 clamp(24px, 4vw, 56px) 0 clamp(56px, 8vw, 120px);
  box-sizing: border-box;
  min-height: 0;
}

.hero-side-visual {
  margin: 0;
  flex: 0 1 min(480px, 44vw);
  max-width: min(480px, 44vw);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 0;
}

/* Height-driven; width follows aspect ratio */
.hero-product-img {
  display: block;
  width: auto;
  max-width: min(480px, 44vw);
  height: min(400px, 52vh);
  object-fit: contain;
  object-position: center right;
}

/* Wide enough for longest slide title "Remote Controller Test Kit" at 44px + 3em (≈3 CJK widths) slack */
.hero-overlay {
  flex: 1 1 auto;
  min-width: 0;
  max-width: min(640px, 100%);
  color: #fff;
  padding: clamp(12px, 2.5vh, 28px) 0;
  box-sizing: border-box;
}

.hero-overlay h1 {
  margin-top: 0;
  margin-bottom: 16px;
  line-height: 1.2;
  font-size: 44px;
  font-weight: 500;
}

/* Full viewport width: keep headline on one line; narrow screens may wrap */
@media (min-width: 1024px) {
  .hero-overlay h1 {
    white-space: nowrap;
    padding-right: 3em;
    box-sizing: content-box;
    max-width: none;
  }
}

.hero-overlay p {
  color: rgba(255, 255, 255, 0.8);
  max-width: min(520px, 100%);
  white-space: normal;
  margin-bottom: 20px;
}

.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.8);
  font-size: 52px;
  cursor: pointer;
}

.carousel-arrow.left {
  left: 12px;
}

.carousel-arrow.right {
  right: 12px;
}

.hero-dot-bar {
  background: var(--rayzer-gray);
  height: 26px;
}

.hero-dot-bar-inner {
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.carousel-dots {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
}

.dot {
  border: 0;
  padding: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #111;
  opacity: 0.9;
  cursor: pointer;
}

.dot.active {
  background: #c40000;
  opacity: 1;
}

.kicker {
  color: var(--primary);
  letter-spacing: 1px;
  font-size: 12px;
  margin-bottom: 10px;
}

h1, h2 {
  margin-top: 0;
}

.lead {
  color: var(--muted);
  max-width: 52ch;
}

.btn {
  display: inline-block;
  border-radius: 2px;
  padding: 10px 14px;
  text-decoration: none;
  border: 1px solid #ccd5df;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2px;
}

.btn-primary {
  background: #c40000;
  color: #fff;
  border-color: #c40000;
}

.btn-primary:hover {
  background: #9d0000;
}

.btn-secondary {
  background: #fff;
  color: var(--text);
}

.btn-outline-light {
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.8);
  background: transparent;
  font-size: 12px;
}

.btn-outline-light:hover {
  background: rgba(255, 255, 255, 0.12);
}

.hero-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.layout {
  margin: 30px auto;
  display: grid;
  gap: 16px;
}

/* Subpages: black bar between fixed nav and top gray content frame */
body:not([data-page="home"]) main.container.layout {
  margin-top: 12px;
}

body:not([data-page="home"]) main.container.layout::before {
  content: "";
  display: block;
  width: 100%;
  height: 12px;
  background: #000;
  grid-column: 1 / -1;
}

/* Outer frame: hero + filters + card grid scroll together when viewport is short (e.g. products page) */
.page-stack-scroll {
  --page-stack-offset: calc(var(--top-white-h) + var(--red-nav-h) + 48px);
  max-height: calc(100vh - var(--page-stack-offset));
  max-height: calc(100dvh - var(--page-stack-offset));
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 16px;
  background: var(--surface);
  display: grid;
  gap: 16px;
  -webkit-overflow-scrolling: touch;
}

/* Inner pages only (not Home): outer gray frames 3× thicker (1px → 3px) */
body:not([data-page="home"]) main.container.layout > .page-stack-scroll {
  border-width: 3px;
}

body:not([data-page="home"]) main.container.layout > .page-hero,
body:not([data-page="home"]) main.container.layout > .filter-bar {
  border-width: 3px;
}

body:not([data-page="home"]) main.container.layout > .stat-grid > .stat-card {
  border-width: 3px;
}

/* Subpages: gray frames use same color as Home hero dot strip (.hero-dot-bar / --rayzer-gray) */
body:not([data-page="home"]) .page-stack-scroll,
body:not([data-page="home"]) .page-hero,
body:not([data-page="home"]) .filter-bar,
body:not([data-page="home"]) .stat-card,
body:not([data-page="home"]) .doc-row,
body:not([data-page="home"]) .site-footer {
  border-color: var(--rayzer-gray);
}

.page-hero {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 18px 20px;
}

.page-hero h1,
.page-hero h2 {
  margin-bottom: 8px;
}

/* Inner pages: larger red kicker (e.g. ABOUT RAYZERLINK, DESIGN & DEVELOPMENT) */
.page-hero .kicker {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 1.2px;
  margin-bottom: 12px;
}

.page-hero--split {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: clamp(16px, 3vw, 32px);
}

.page-hero--split .page-hero-copy {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.page-hero--split .page-hero-copy-main {
  flex: 0 1 auto;
}

.page-hero--split .page-hero-manual {
  margin-top: auto;
  padding-top: 20px;
}

.page-hero--split .page-hero-manual-title {
  margin: 0 0 10px 0;
  font-size: 14px;
}

.page-hero--split .page-hero-manual-btn {
  display: inline-block;
  text-decoration: none;
}

.page-hero--split .page-hero-side-img {
  flex: 0 0 auto;
  margin: 0;
  max-width: min(380px, 44%);
  align-self: center;
}

.page-hero--split .page-hero-side-img img {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(280px, 38vh);
  object-fit: contain;
}

@media (max-width: 720px) {
  .page-hero--split {
    flex-direction: column;
    align-items: stretch;
  }

  .page-hero--split .page-hero-side-img {
    max-width: 100%;
    order: 1;
  }

  .page-hero--split .page-hero-copy {
    order: 0;
  }

  .page-hero--split .page-hero-side-img img {
    max-height: min(220px, 40vh);
    margin: 0 auto;
  }
}

.filter-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  background: #f8fbff;
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 10px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.stat-card {
  background: #fff;
  border: 1px solid var(--border);
  padding: 14px;
  border-radius: 2px;
}

.stat-card .label {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.stat-card .value {
  font-size: 24px;
  font-weight: 700;
  margin-top: 6px;
}

.split-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 12px;
}

.quick-links {
  margin: 26px auto;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.quick-link {
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.section-head a {
  color: var(--primary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.product-card h3 {
  margin-bottom: 8px;
}

.product-card h3 a {
  color: inherit;
  text-decoration: none;
}

.product-card h3 a:hover {
  color: var(--primary);
  text-decoration: underline;
}

.jingwei-detail-list {
  margin: 0;
  padding-left: 1.25em;
}

.corp-band {
  background: #f7f9fc;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 26px 0;
}

.corp-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.grid-2 {
  grid-template-columns: 1fr 1fr;
}

label {
  font-size: 14px;
  display: block;
  margin-bottom: 6px;
}

input, textarea, select {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
}

form .field {
  margin-bottom: 12px;
}

#login-form label {
  font-size: 13px;
}

#login-form input {
  width: 45ch;
  max-width: 100%;
  font-size: 13px;
}

.note {
  color: var(--muted);
  font-size: 13px;
}

.list {
  display: grid;
  gap: 10px;
}

.doc-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: #fbfdff;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 2px;
  background: #eaf3ff;
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 700;
}

.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 48px;
  padding: 18px 0;
  color: var(--muted);
  font-size: 13px;
  background: #fff;
}

.site-footer-inner {
  display: block;
}

.site-footer-line {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
}

.beian-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.beian-icon {
  width: 14px;
  height: 14px;
  object-fit: contain;
  display: inline-block;
}

.beian-row a {
  color: var(--muted);
  text-decoration: none;
}

.beian-row a:hover {
  text-decoration: underline;
}

.copyright-row {
  text-align: center;
  white-space: nowrap;
}

.error {
  color: #bb1f1f;
}

.success {
  color: #157a2f;
}

@media (max-width: 900px) {
  .hero, .grid-2, .product-grid, .corp-grid, .quick-links, .stat-grid, .split-grid {
    grid-template-columns: 1fr;
  }

  .top-white-inner {
    flex-direction: column;
    align-items: stretch;
    flex-wrap: nowrap;
    gap: 10px;
    padding: 0 10px var(--header-meta-breath);
    min-height: 0;
    height: auto;
  }

  .top-white-right {
    align-self: flex-end;
    width: auto;
  }

  .head-meta {
    width: 100%;
    justify-content: flex-end;
  }

  .red-nav {
    height: var(--red-nav-h);
  }

  .red-nav-inner {
    height: calc(var(--red-nav-h) - 3px);
  }

  body {
    --top-white-h: 168px;
    padding-top: calc(var(--top-white-h) + var(--red-nav-h));
  }

  .top-left-group {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 12px;
  }

  .head-search {
    max-width: none;
  }

  .head-search-wrap {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    min-width: 100%;
  }

  .search-box {
    width: 100%;
    max-width: none;
  }

  .head-cn-flag {
    width: 52px;
  }

  .menu-row {
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .brand-logo-wrap {
    width: 240px;
    height: 46px;
  }

  .meta-link,
  .logout-link {
    font-size: 14px;
  }

  .menu-row a {
    font-size: 13px;
    font-weight: 700;
    line-height: 46px;
  }

  .red-nav-inner > .cart-link {
    font-size: 20px;
  }

  .hero-overlay h1 {
    font-size: 30px;
    white-space: normal;
    padding-right: 0;
  }

  .ti-hero {
    min-height: 400px;
  }

  .hero-inner {
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    padding: 0 24px 0 42px;
    gap: 8px;
  }

  .hero-side-visual {
    flex: 0 0 auto;
    max-width: 100%;
    justify-content: center;
    padding-bottom: 12px;
    order: 2;
  }

  .hero-product-img {
    max-width: 100%;
    height: min(280px, 42vh);
  }

  .hero-overlay {
    order: 1;
    padding-top: 20px;
    padding-bottom: 8px;
    padding-left: 0;
    padding-right: 0;
    max-width: 100%;
  }
}
