/* ============================================================
   光品猫官网 · 前台样式
   视觉底线：石墨黑 #1C1D1F 主背景 / 无第二装饰色 / 单色线性图形
   ============================================================ */

:root {
  --bg: #1C1D1F;
  --bg-deep: #0E0F10;
  --card: #242628;
  --line: #3A3D40;
  --text: #F2F2F0;
  --dim: #9A9C9E;
  --radius: 12px;
  /* 光谱三色：与首页光路背景的光子同色，仅用于极小面积点缀 */
  --rgb-r: #D9A3A3;
  --rgb-g: #A9D2B1;
  --rgb-b: #94B8DF;
  --font-cn: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-mono: "IBM Plex Mono", "Inter", "SFMono-Regular", Consolas, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-cn);
  font-size: 16px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--text); text-decoration: none; }
a:hover { color: #fff; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
.wrap.narrow { max-width: 720px; }
.center { text-align: center; }
.dim { color: var(--dim); }
.mono { font-family: var(--font-mono); letter-spacing: .02em; }

/* ---------- 头部 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(14, 15, 16, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 600; }
.brand-mark { color: var(--text); display: inline-flex; }
.ring-r { stroke: var(--rgb-r); }
.ring-g { stroke: var(--rgb-g); }
.ring-b { stroke: var(--rgb-b); }
.site-nav { display: flex; gap: 28px; }
.site-nav a { color: var(--dim); font-size: 15px; padding: 4px 0; border-bottom: 2px solid transparent; }
.site-nav a:hover { color: var(--text); }
.site-nav a.on { color: var(--text); border-bottom-color: var(--text); }
.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: 10px; }
.nav-toggle span { display: block; width: 22px; height: 1.5px; background: var(--text); margin: 5px 0; }

/* ---------- Hero ---------- */
.hero { background: var(--bg-deep); border-bottom: 1px solid var(--line); }
.hero-inner {
  display: grid; grid-template-columns: 1.2fr 1fr; gap: 48px; align-items: center;
  padding: 120px 24px;
}
.hero h1 { font-size: 40px; line-height: 1.3; font-weight: 600; }
.hero-sub { color: var(--dim); margin-top: 16px; font-size: 18px; }
.hero-cta { margin-top: 36px; display: flex; gap: 16px; flex-wrap: wrap; }
.hero-model { margin-top: 28px; color: var(--dim); font-size: 14px; }
.hero-visual { color: var(--text); max-width: 360px; margin: 0 auto; width: 100%; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-block; padding: 12px 32px;
  background: var(--text); color: var(--bg-deep);
  border: 1px solid var(--text); border-radius: 999px;
  font-size: 15px; cursor: pointer; transition: opacity .2s;
}
.btn:hover { opacity: .85; color: var(--bg-deep); }
.btn-ghost { background: transparent; color: var(--text); }
.btn-ghost:hover { color: #fff; }

/* ---------- 区块 ---------- */
.section { padding: 120px 0; }
.section-alt { background: var(--bg-deep); }
.section-title { font-size: 26px; font-weight: 600; margin-bottom: 24px; }
.section-title::before {
  content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 12px;
  border-radius: 50%; vertical-align: 3px;
  background: linear-gradient(135deg, var(--rgb-r), var(--rgb-g), var(--rgb-b));
}
.page-head { padding: 80px 0 40px; }
.page-head h1 { font-size: 34px; font-weight: 600; }
.note-line { margin-top: 32px; }

/* ---------- 卡片 ---------- */
.cards3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.cards2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 32px;
  position: relative; overflow: hidden;
}
/* 悬停时顶部 1px 光谱线：静态不占视觉面积，只是交互反馈 */
.card::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px;
  opacity: 0; transition: opacity .25s ease; pointer-events: none;
  background: linear-gradient(90deg,
    transparent 0%, var(--rgb-r) 30%, var(--rgb-g) 52%, var(--rgb-b) 72%, transparent 100%);
}
.card:hover::before { opacity: .95; }
@media (prefers-reduced-motion: reduce) { .card::before { transition: none; } }
.card h3 { font-size: 18px; font-weight: 600; margin-bottom: 10px; }
.card-icon { color: var(--text); margin-bottom: 18px; }

/* ---------- SKU 卡 ---------- */
.sku-card .sku-model { color: var(--dim); font-size: 14px; margin: 4px 0 12px; }
.sku-price { font-size: 26px; font-family: var(--font-mono); margin: 8px 0 14px; }
.sku-price.big { font-size: 34px; }
.price-note { font-size: 14px; font-family: var(--font-cn); }
.sku-card .btn { margin-top: 18px; }

/* ---------- 场景条 ---------- */
.scene-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.scene-item {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 18px; text-align: center; color: var(--dim);
  transition: border-color .2s, color .2s;
}
.scene-item:hover { border-color: var(--text); color: var(--text); }

/* ---------- 产品 ---------- */
/* ---------- 导航下拉 ---------- */
.nav-item { position: relative; display: inline-flex; align-items: center; }
.nav-item > .nav-link::after {
  content: ''; display: inline-block; width: 5px; height: 5px;
  margin-left: 6px; margin-bottom: 2px;
  border-right: 1px solid currentColor; border-bottom: 1px solid currentColor;
  transform: rotate(45deg); opacity: .6;
}
.nav-item::after { content: ''; position: absolute; left: 0; right: 0; top: 100%; height: 18px; }
.nav-drop {
  position: absolute; top: calc(100% + 16px); left: 50%;
  transform: translate(-50%, 6px);
  min-width: 240px; padding: 8px;
  background: var(--bg-deep); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .35);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .18s ease, transform .18s ease, visibility .18s;
  z-index: 60;
}
.nav-item:hover .nav-drop, .nav-item:focus-within .nav-drop {
  opacity: 1; visibility: visible; pointer-events: auto; transform: translate(-50%, 0);
}
.nav-drop a {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 10px 12px; border-bottom: 0 !important; border-radius: 6px;
  color: var(--dim); font-size: 14px;
}
.nav-drop a:hover { background: rgba(255, 255, 255, .05); color: var(--text); }
.nav-drop-meta { font-size: 12px; opacity: .7; }
.nav-drop-all { margin-top: 6px; border-top: 1px solid var(--line) !important; color: var(--text) !important; }

.series-block { margin-bottom: 96px; }
.product-card { display: block; transition: border-color .2s; }
.product-card:hover { border-color: var(--dim); color: var(--text); }
.product-thumb { color: var(--dim); text-align: center; margin-bottom: 20px; }
.product-thumb img { max-width: 100%; border-radius: var(--radius); }
.product-thumb svg { width: 120px; }
.product-model { font-size: 20px; color: var(--dim); margin-top: 8px; }
.product-hero { max-width: 480px; margin: 0 auto; color: var(--text); }
.product-hero img { width: 100%; border-radius: var(--radius); }

/* ---------- 支持与下载 ---------- */
.support-layout { display: grid; grid-template-columns: 240px 1fr; gap: 56px; align-items: start; }
.support-side { position: sticky; top: 88px; }
.support-search input {
  width: 100%; padding: 11px 14px;
  background: var(--bg-deep); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px;
  font-family: var(--font-cn); font-size: 14px;
}
.support-search input:focus { outline: none; border-color: var(--dim); }
.support-cats { display: flex; flex-direction: column; gap: 4px; margin-top: 20px; }
.support-cats .cat {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  width: 100%; padding: 10px 14px;
  background: none; border: 0; border-radius: 8px;
  color: var(--dim); font-family: var(--font-cn); font-size: 15px;
  cursor: pointer; text-align: left;
}
.support-cats .cat:hover { color: var(--text); background: rgba(255, 255, 255, .04); }
.support-cats .cat.is-active { color: var(--text); background: rgba(255, 255, 255, .07); }
.support-cats .count { font-family: var(--font-mono); font-size: 12px; opacity: .6; }
.support-help { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--line); }
.support-help p { margin-bottom: 12px; font-size: 14px; }
.doc-count { font-size: 13px; margin-bottom: 20px; }
.doc-group { margin-bottom: 44px; }
.doc-group-title { font-size: 20px; font-weight: 600; margin-bottom: 8px; }
.doc-list { list-style: none; border-top: 1px solid var(--line); }
.doc-item {
  display: grid; grid-template-columns: 44px 1fr auto; gap: 18px;
  align-items: center; padding: 18px 0; border-bottom: 1px solid var(--line);
}
.doc-ico { color: var(--dim); }
.doc-body { min-width: 0; }
.doc-title { font-size: 16px; color: var(--text); }
.doc-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 4px; font-size: 13px; color: var(--dim); }
.doc-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.doc-pending { font-size: 13px; color: var(--dim); }
.doc-empty { padding: 48px 0; color: var(--dim); text-align: center; border-top: 1px solid var(--line); }

/* ---------- 表格 ---------- */
.spec-table { width: 100%; border-collapse: collapse; }
.spec-table th, .spec-table td {
  text-align: left; padding: 14px 16px;
  border-bottom: 1px solid var(--line); vertical-align: top;
}
.spec-table th { color: var(--dim); font-weight: 400; width: 40%; }

.article h2 { font-size: 22px; margin: 48px 0 16px; font-weight: 600; }
.article h2[id] { scroll-margin-top: 88px; }
.article h3 { font-size: 18px; margin: 32px 0 12px; font-weight: 600; }
.article p { margin-bottom: 16px; color: var(--dim); }
.article ul, .article ol { margin: 0 0 16px 22px; color: var(--dim); }
.article table { width: 100%; border-collapse: collapse; margin: 24px 0; font-size: 15px; }
.article th, .article td { border: 1px solid var(--line); padding: 12px 14px; text-align: left; }
.article th { background: var(--bg-deep); font-weight: 600; color: var(--text); }
.article td { color: var(--dim); }
.article strong { color: var(--text); }

/* ---------- 公开文档页 ---------- */
.doc-wrap { max-width: 1080px; }
.doc-lead { padding: 14px 18px; border: 1px solid var(--line); border-radius: 8px; }
.doc-filter { display: flex; align-items: center; gap: 14px; margin: 28px 0 8px; flex-wrap: wrap; }
.doc-filter input {
  width: 320px; max-width: 100%; padding: 10px 14px;
  background: var(--bg-deep); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px;
  font-family: var(--font-cn); font-size: 14px;
}
.doc-filter input:focus { outline: none; border-color: var(--dim); }
.doc-table { overflow-x: auto; margin: 20px 0; }
.doc-table table { min-width: 760px; margin: 0; font-size: 14px; }
.doc-table td:first-child { white-space: nowrap; font-family: var(--font-mono); color: var(--text); }
.doc-page blockquote {
  margin: 20px 0; padding: 14px 18px;
  border-left: 2px solid var(--line); background: var(--bg-deep);
}
.doc-page blockquote p { margin: 0; }
.doc-page code {
  font-family: var(--font-mono); font-size: 13px;
  background: var(--bg-deep); border: 1px solid var(--line);
  border-radius: 4px; padding: 1px 5px;
}
.btn.sm { padding: 8px 20px; font-size: 14px; }
.cap-table th:first-child { width: 38%; }

/* ---------- 面包屑 ---------- */
.crumb { font-size: 14px; color: var(--dim); margin-bottom: 20px; }
.crumb a { color: var(--dim); }
.crumb a:hover { color: var(--text); }

/* ---------- 表单 ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 64px; }
.form-row { margin-bottom: 18px; }
.form label { display: block; font-size: 14px; color: var(--dim); margin-bottom: 6px; }
.form input, .form select, .form textarea {
  width: 100%; padding: 12px 14px;
  background: var(--bg-deep); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px;
  font-family: var(--font-cn); font-size: 15px;
}
.form input:focus, .form select:focus, .form textarea:focus { outline: none; border-color: var(--dim); }
.form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.notice { padding: 16px 20px; border-radius: 8px; border: 1px solid var(--line); }
.notice.ok { border-color: var(--dim); }
.notice.err { border-color: #8a4a4a; color: #e0a0a0; }

/* ---------- 页脚 ---------- */
.site-footer { background: var(--bg-deep); border-top: 1px solid var(--line); padding: 56px 0 28px; }
.footer-grid { display: grid; grid-template-columns: 1.3fr .9fr 1.2fr 1.1fr 1.2fr; gap: 24px; padding-bottom: 36px; align-items: start; }
.footer-brand { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.footer-title { font-size: 14px; color: var(--dim); margin-bottom: 12px; }
.footer-link { display: block; color: var(--dim); font-size: 14px; margin-bottom: 6px; white-space: nowrap; }
a.footer-link:hover { color: var(--text); }
.footer-bottom {
  position: relative;
  padding-top: 24px;
  display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 24px;
  color: var(--dim); font-size: 13px; text-align: center;
}
.footer-bottom::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--rgb-r), var(--rgb-g), var(--rgb-b), transparent);
  opacity: .5;
}
.footer-bottom .icp-link {
  display: inline-flex; align-items: center; gap: 6px;
  color: inherit; text-decoration: none; white-space: nowrap;
}
.footer-bottom .icp-link span { border-bottom: 1px solid var(--line); }
.footer-bottom .icp-link:hover { color: #fff; }
.footer-bottom .icp-link:hover span { border-bottom-color: #fff; }
.footer-bottom .icp-ico { flex: none; display: block; }

/* ---------- 动效（仅淡入） ---------- */
.card, .scene-item, .hero-text, .hero-visual { animation: fadein .6s ease both; }
@keyframes fadein { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- 响应式 ---------- */
@media (max-width: 1024px) {
  .hero-inner { padding: 96px 24px; }
  .section { padding: 96px 0; }
}
@media (max-width: 800px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
  .footer-grid > div:first-child { grid-column: 1 / -1; }
}
@media (max-width: 768px) {
  .hero-inner { grid-template-columns: 1fr; padding: 72px 24px; }
  .hero h1 { font-size: 30px; }
  .cards3 { grid-template-columns: 1fr; }
  .cards2 { grid-template-columns: 1fr; }
  .scene-strip { grid-template-columns: repeat(2, 1fr); }
  .contact-grid { grid-template-columns: 1fr; gap: 48px; }
  .support-layout { grid-template-columns: 1fr; gap: 28px; }
  .support-side { position: static; }
  .support-cats { flex-direction: row; overflow-x: auto; padding-bottom: 4px; }
  .support-cats .cat { width: auto; white-space: nowrap; }
  .support-help { margin-top: 20px; padding-top: 16px; }
  .doc-item { grid-template-columns: 36px 1fr; gap: 12px; }
  .doc-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .section { padding: 72px 0; }
  .section-title { font-size: 22px; }

  .nav-toggle { display: block; }
  .site-nav {
    display: none; position: absolute; top: 64px; left: 0; right: 0;
    background: var(--bg-deep); border-bottom: 1px solid var(--line);
    flex-direction: column; padding: 16px 24px 24px; gap: 16px;
  }
  .site-nav.open { display: flex; }
  .nav-item { display: block; }
  .nav-item > .nav-link::after { display: none; }
  .nav-item::after { display: none; }
  .nav-drop {
    position: static; transform: none; opacity: 1; visibility: visible; pointer-events: auto;
    min-width: 0; margin-top: 6px; padding: 0 0 0 16px;
    background: transparent; border: 0; border-radius: 0; box-shadow: none;
  }
  .nav-drop a { padding: 8px 0; }
  .nav-drop-all { border-top: 0 !important; margin-top: 0; }
}
@media (max-width: 375px) {
  .scene-strip { grid-template-columns: 1fr; }
  .hero h1 { font-size: 26px; }
}

/* ============ 首页动态光路背景 ============ */
/* 尺寸固定，不随浏览器窗口缩放。
   宽度 2180px：让 准直/聚光镜（SVG x≈350）与 光栅（SVG x≈1252）
   分别落在内容列 1080px 的外侧约 70px 处，即背景明显宽于前景卡片、
   但又只比它宽一点点。高度按 16:9 = 1226px。 */
.optics-fixed {
  position: fixed; top: 50%; left: 50%;
  /* 整体上移 78px：让底部的 传感器/ADC/MCU/显示屏 一排图标避开首屏
     hero 最后一行文字（“一台机器，看三种光”），不再被前面的内容压住 */
  transform: translate(-50%, calc(-50% - 78px));
  width: 2180px; height: auto;
  aspect-ratio: 16 / 9;
  max-width: none;
  z-index: 0; opacity: .45;
  pointer-events: none;
}
/* 平板 / 手机：光学图形（SVG x 308~1330）铺满屏幕宽度，
   左右只留约 2.5vw 空隙；超出视口的部分只是 SVG 的空白边距，会被裁掉。
   整体再左移 2vw，避免右侧光源贴边 */
@media (max-width: 1024px) {
  .optics-fixed {
    width: 149vw;
    /* 手机端不能改宽高比：等比放大会把左右两侧的反射镜、光栅、光源裁掉。
       只做纵向拉伸 scaleY(1.3)：准直镜↔光栅↔聚光镜 的纵向间距变大，
       再把整体下移 26vw，让底部那排图标落到产品图下方的空白处。 */
    transform: translate(-50%, -50%) translateY(26vw) translateX(-2vw) scaleY(1.3);
  }
}
.optics-page { position: relative; z-index: 1; }
/* 首页区域背景透明化，让光路透出；卡片仍不透明，滚动时自然遮盖 */
.optics-page .hero { background: transparent; border-bottom-color: transparent; }
.optics-page .section-alt { background: transparent; }

.optics .elem { stroke: var(--dim); stroke-width: 1.5; fill: none; }
.optics .elem.bar { stroke-width: 3; opacity: .75; }
.optics .elem.ghost { opacity: .45; }
.optics .elem-fill { stroke: var(--dim); stroke-width: 1.5; fill: var(--card); }
.optics .source-core { fill: #E8E5D9; animation: src-pulse 2.4s ease-in-out infinite; }
.optics .source-ray { stroke: #E8E5D9; stroke-width: 1.5; animation: src-pulse 2.4s ease-in-out infinite; }
@keyframes src-pulse { 0%,100% { opacity: .35; } 50% { opacity: 1; } }
.optics .px { fill: #E8E5D9; opacity: .15; transition: opacity .25s ease; }
.optics .px.is-on { opacity: 1; }
/* ADC 内部高亮台阶（JS 控制，同一时间恰好 1 个亮） */
.optics .adc-hi { opacity: 0; transition: opacity .25s ease; }
.optics .adc-hi.is-on { opacity: 1; }
/* 光子：简单光点（亮点核心 + 柔光晕）沿直线光路移动（运动由 SVG animateMotion 驱动）
   三种颜色：红 / 绿 / 蓝，颜色类挂在光子分组上 */
/* 光子：screen 混合，使贴合在一起的 RGB 三色叠加成白色 */
.optics .photon, .optics .photon-halo { stroke: none; mix-blend-mode: screen; }
.optics .photon { fill: #E8E5D9; }
.optics .photon-halo { fill: #E8E5D9; opacity: .25; }
/* 光子：只有经过光栅（.sep）之后才显示 R/G/B 本征颜色，之前一律白色（RGB 叠加） */
.optics .ph.c-r.sep .photon, .optics .ph.c-r.sep .photon-halo { fill: #D9A3A3; }
.optics .ph.c-g.sep .photon, .optics .ph.c-g.sep .photon-halo { fill: #A9D2B1; }
.optics .ph.c-b.sep .photon, .optics .ph.c-b.sep .photon-halo { fill: #94B8DF; }
.optics .elem-txt {
  fill: var(--dim); stroke: none;
  font-size: 9px; letter-spacing: .12em; text-anchor: middle;
  font-family: var(--font-mono);
}
/* 传输方式符号：JS 控制随机点亮 */
.optics .sig-ico { opacity: .38; transition: opacity .4s ease; }
.optics .sig-ico.is-on { opacity: 1; }
/* MCU 引脚：JS 控制随机 1~2 根连续点亮 */
.optics .pin { opacity: .35; transition: opacity .5s ease; }
.optics .pin.is-on { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .optics * { animation: none !important; }
  .optics .ph { display: none; }
}
