/* ═══════════════════════════════════════════════════════════════
   shared.css — 瑞霏光电官网共有样式
   包含：tokens / reset / header / nav / page-hero / section /
         footer / common-components / responsive (header+footer)
   不包含：各页面专属布局（保留在页面内联 <style> 中）
═══════════════════════════════════════════════════════════════ */

/* ── TOKENS ─────────────────────────────────────────────────── */
:root {
  --bg:       #e8ebf1;
  --bg-deep:  #0a1430;
  --paper:    #ffffff;
  --ink:      #0a1430;
  --ink-2:    #2a3550;
  --muted:    #6a7388;
  --line:     #c4cad6;
  --accent:       #d8441a;
  --accent-light: #f06a31;
  --accent-ring:  rgba(216,68,26,.22);
  --brand:    #003f97;
  --serif:    'Noto Serif SC', 'Songti SC', Georgia, serif;
  --sans:     'Noto Sans SC', 'PingFang SC', 'Helvetica Neue', sans-serif;
  --mono:     'JetBrains Mono', ui-monospace, monospace;
  --header-h: 72px;
}

/* ── RESET ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { background: var(--bg); color: var(--ink); font-family: var(--sans); line-height: 1.6; }
a { text-decoration: none; color: inherit; }
img { display: block; max-width: 100%; }
button, input, textarea, select { font-family: inherit; }

/* ── LAYOUT ──────────────────────────────────────────────────── */
.wrap { max-width: 1440px; margin: 0 auto; padding: 0 80px; }

/* ── HEADER ──────────────────────────────────────────────────── */
.site-header { position: sticky; top: 0; z-index: 300; background: var(--bg); border-bottom: 1px solid var(--line); }
.bar { max-width: 1440px; margin: 0 auto; padding: 0 80px; display: flex; align-items: center; justify-content: space-between; gap: 22px; height: var(--header-h); }
.brand-group { display: flex; align-items: center; }
.brand-mark { display: flex; align-items: center; }
.brand-mark img { height: 37px; width: auto; object-fit: contain; }
.brand-sep { width: 1px; height: 22px; background: var(--line); margin: 0 14px; flex-shrink: 0; }
.brand-tagline { font-family: var(--mono); font-size: 9px; letter-spacing: .22em; color: var(--muted); text-transform: uppercase; white-space: nowrap; line-height: 1.4; }
.nav-phone-wrap { display: flex; flex-direction: column; gap: 1px; line-height: 1; }
.nav-phone-label { font-family: var(--mono); font-size: 8px; letter-spacing: .2em; color: var(--muted); text-transform: uppercase; }
.nav-phone-val { font-family: var(--mono); font-size: 12px; letter-spacing: .04em; color: var(--ink-2); white-space: nowrap; }

/* ── NAV ─────────────────────────────────────────────────────── */
.nav-primary { list-style: none; display: flex; gap: 28px; }
.nav-primary a { font-size: 14px; font-weight: 500; color: var(--ink); padding: 4px 0; position: relative; }
.nav-primary a::after { content: ''; position: absolute; bottom: -2px; left: 0; right: 0; height: 1.5px; background: var(--accent); transform: scaleX(0); transition: transform .2s; }
.nav-primary a:hover::after, .nav-primary a.active::after { transform: scaleX(1); }
.nav-primary a.active { color: var(--accent); }
.btn-demo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 22px;
  border: 1px solid var(--accent);
  background: var(--accent);
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  transition: background .2s ease, border-color .2s ease;
}
.btn-demo:hover,
.btn-demo:focus-visible {
  background: var(--accent-light);
  border-color: var(--accent-light);
  color: #fff;
}
.btn-demo:focus-visible {
  outline: 2px solid var(--accent-ring);
  outline-offset: 2px;
}
.nav-toggle { display: none; flex-direction: column; gap: 5px; padding: 8px; border: 0; background: transparent; cursor: pointer; }
.nav-toggle span { display: block; width: 22px; height: 1.5px; background: var(--ink); transition: transform .2s, opacity .2s; }
.nav-toggle.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }
.nav-primary > li { position: relative; }
.has-submenu { padding-bottom: 18px; margin-bottom: -18px; }
.nav-submenu { position: absolute; top: calc(100% + 6px); left: 50%; transform: translateX(-50%) translateY(6px); width: max-content; background: var(--paper); border: 1px solid var(--line); border-top: 2px solid var(--accent); box-shadow: 0 14px 30px rgba(10,20,48,.12); padding: 8px 0; display: flex; flex-direction: column; opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .16s, transform .16s, visibility .16s; z-index: 500; }
.nav-submenu::before { content: ''; position: absolute; top: -6px; left: 0; right: 0; height: 6px; }
.has-submenu:hover .nav-submenu, .has-submenu:focus-within .nav-submenu { opacity: 1; visibility: visible; pointer-events: auto; transform: translateX(-50%) translateY(0); }
.nav-submenu a { display: block; padding: 10px 18px !important; font-size: 13px !important; line-height: 1.35; white-space: nowrap; color: var(--ink-2) !important; }
.nav-submenu a::after { display: none !important; }
.nav-submenu a:hover { color: var(--accent) !important; background: rgba(216,68,26,.06); }
.nav-group-label { display: block; padding: 8px 18px 2px; font-family: var(--mono); font-size: 9px; letter-spacing: .24em; color: var(--accent); text-transform: uppercase; pointer-events: none; user-select: none; }
.nav-group-sep { display: block; height: 1px; background: var(--line); margin: 4px 0; }

/* ── FLYOUT (L2) ─────────────────────────────────────────────── */
.has-flyout { position: relative; }
.has-flyout > a { display: flex !important; justify-content: space-between !important; align-items: center !important; gap: 18px; }
.flyout-caret { font-style: normal; font-size: 11px; opacity: .45; flex-shrink: 0; transition: transform .15s, opacity .15s; }
.has-flyout:hover .flyout-caret, .has-flyout:focus-within .flyout-caret { opacity: .9; transform: translateX(2px); }
.nav-flyout { position: absolute; left: calc(100% + 1px); top: -9px; width: max-content; background: var(--paper); border: 1px solid var(--line); border-top: 2px solid var(--accent); box-shadow: 0 14px 30px rgba(10,20,48,.12); padding: 8px 0; display: flex; flex-direction: column; opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .16s, transform .16s, visibility .16s; z-index: 501; transform: translateX(6px); }
.nav-flyout::before { content: ''; position: absolute; top: 0; left: -6px; width: 6px; height: 100%; }
.has-flyout:hover .nav-flyout, .has-flyout:focus-within .nav-flyout { opacity: 1; visibility: visible; pointer-events: auto; transform: translateX(0); }
.nav-flyout a { display: block !important; padding: 9px 18px !important; font-size: 12px !important; line-height: 1.35 !important; white-space: nowrap !important; color: var(--ink-2) !important; }
.nav-flyout a::after { display: none !important; }
.nav-flyout a:hover { color: var(--accent) !important; background: rgba(216,68,26,.06) !important; }
@media (max-width: 767px) {
  .flyout-caret { display: none; }
  .has-flyout { position: static; }
  .nav-flyout { position: static; opacity: 1; visibility: visible; pointer-events: auto; transform: none; box-shadow: none; border: none; border-left: 2px solid var(--line); margin-left: 16px; padding: 2px 0; }
  .nav-flyout::before { display: none; }
}

/* ── PAGE HERO ───────────────────────────────────────────────── */
.page-hero { background: var(--bg); padding: 72px 0 56px; position: relative; overflow: hidden; border-bottom: 1px solid var(--line); }
.page-hero::before, .page-hero::after { content: ''; position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line); pointer-events: none; }
.page-hero::before { left: 40px; }
.page-hero::after  { right: 40px; }
.page-hero--breadcrumb-only { padding: 34px 0 0; }
.page-hero--breadcrumb-only .breadcrumb { margin-bottom: 34px; }
.breadcrumb { font-family: var(--mono); font-size: 11px; letter-spacing: .2em; color: var(--muted); margin-bottom: 40px; display: flex; gap: 10px; flex-wrap: wrap; }
.hero-label { font-family: var(--mono); font-size: 11px; letter-spacing: .44em; color: var(--accent); margin-bottom: 28px; }
.hero-h1 { font-family: var(--serif); font-size: 56px; font-weight: 600; color: var(--ink); line-height: 1.1; letter-spacing: .02em; }
.hero-h1 em { color: var(--accent); font-style: normal; font-weight: 500; }
.hero-rule { width: 56px; height: 1px; background: var(--ink); margin: 32px 0 22px; }
.hero-lead { max-width: 760px; font-size: 15px; line-height: 1.9; color: var(--ink-2); }

/* ── SECTIONS ────────────────────────────────────────────────── */
.section      { padding: 72px 0; }
.section-tight{ padding: 48px 0; }
.eyebrow { font-family: var(--mono); font-size: 11px; letter-spacing: .32em; color: var(--accent); text-transform: uppercase; }
.section-title { font-family: var(--serif); font-size: 36px; line-height: 1.25; font-weight: 600; margin-top: 16px; }
.muted { color: var(--muted); }
.band-dark { background: var(--bg-deep); color: #efe9d8; }
.band-dark .muted, .band-dark p { color: rgba(239,233,216,.62); }

/* ── COMMON COMPONENTS ───────────────────────────────────────── */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.news-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.news-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 28px;
}
.news-filter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .14em;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.news-filter:hover { border-color: var(--ink); color: var(--ink); }
.news-filter.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}
.card { background: var(--paper); border: 1px solid var(--line); padding: 26px; }
.card h3 { font-family: var(--serif); font-size: 20px; line-height: 1.35; margin-bottom: 10px; }
.card p, .card li { font-size: 14px; line-height: 1.85; color: var(--ink-2); }
.card ul { padding-left: 18px; }
.meta { font-family: var(--mono); font-size: 10px; letter-spacing: .16em; color: var(--accent); margin-bottom: 14px; }
.cta-row { display: flex; justify-content: space-between; align-items: center; gap: 32px; }
.btn-primary { display: inline-flex; align-items: center; justify-content: center; padding: 14px 24px; background: var(--accent); color: #fff; font-weight: 700; }
.btn-ghost   { display: inline-flex; align-items: center; justify-content: center; padding: 13px 24px; border: 1px solid var(--line); color: var(--ink); }

/* ── FOOTER ──────────────────────────────────────────────────── */
.site-footer { background: var(--bg-deep); border-top: 1px solid rgba(255,255,255,.08); padding: 0 0 40px; }
/* contact band */
.footer-contact-band { border-bottom: 1px solid rgba(255,255,255,.12); padding: 20px 0; }
.footer-band-inner { max-width: 1440px; margin: 0 auto; padding: 0 80px; display: flex; align-items: center; gap: 36px; }
.footer-cb-brand { flex: 0 0 auto; padding-right: 36px; border-right: 1px solid rgba(255,255,255,.1); }
.footer-cb-brand .cb-cn { font-family: var(--serif); font-size: 16px; color: #efe9d8; display: block; }
.footer-cb-brand .cb-en { font-family: var(--mono); font-size: 9px; letter-spacing: .2em; color: rgba(239,233,216,.3); display: block; margin-top: 2px; }
.footer-cb-item { display: flex; flex-direction: column; gap: 2px; }
.footer-cb-label { font-family: var(--mono); font-size: 9px; letter-spacing: .24em; color: rgba(239,233,216,.3); text-transform: uppercase; }
.footer-cb-val { font-family: var(--mono); font-size: 13px; letter-spacing: .04em; color: rgba(239,233,216,.72); }
.footer-cb-val a { color: inherit; }
.footer-cb-cta { margin-left: auto; flex-shrink: 0; padding: 8px 20px; border: 1px solid rgba(216,68,26,.55); font-size: 13px; font-weight: 600; color: var(--accent); transition: background .15s, color .15s; white-space: nowrap; }
.footer-cb-cta:hover { background: var(--accent); color: #fff; }
/* main footer layout */
.footer-top  { display: flex; justify-content: space-between; gap: 40px; padding: 48px 0 40px; border-bottom: 1px solid rgba(255,255,255,.08); }
.footer-brand .cn { font-family: var(--serif); font-size: 18px; color: #efe9d8; }
.footer-brand .en { font-family: var(--mono); font-size: 9px; letter-spacing: .22em; color: rgba(239,233,216,.35); margin-top: 4px; display: block; }
.footer-addr { font-size: 12px; line-height: 1.9; color: rgba(168,182,204,.7); margin-top: 24px; }
.footer-cols { display: flex; gap: 0; }
.footer-col { padding: 0 40px; border-left: 1px solid rgba(255,255,255,.08); }
.footer-col:first-child { border-left: none; padding-left: 0; }
.footer-col h5 { font-family: var(--sans); font-size: 11px; font-weight: 700; color: rgba(239,233,216,.65); letter-spacing: .1em; text-transform: uppercase; margin-bottom: 16px; }
.footer-col ul { list-style: none; }
.footer-col a, .footer-col li { font-size: 12px; color: rgba(168,182,204,.7); line-height: 2.1; }
.footer-col a:hover { color: rgba(220,230,240,.9); }
.footer-bottom { display: flex; justify-content: space-between; padding-top: 20px; margin-top: 8px; border-top: 1px solid rgba(255,255,255,.06); }
.footer-copy { font-family: var(--mono); font-size: 10px; letter-spacing: .2em; color: rgba(239,233,216,.25); }

/* ── RESPONSIVE — TABLET ≤ 1100px ───────────────────────────── */
@media (max-width: 1100px) {
  .wrap, .bar { padding: 0 40px; }
  .news-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ── RESPONSIVE — MOBILE ≤ 767px ────────────────────────────── */
@media (max-width: 767px) {
  :root { --header-h: 60px; }
  .wrap, .bar { padding: 0 22px; }

  /* Nav */
  .nav-primary { display: none; }
  .nav-actions { gap: 10px; }
  .btn-demo {
    padding: 7px 14px;
    font-size: 12px;
    line-height: 1;
  }
  .nav-toggle { display: flex; }
  .nav-primary.open {
    display: flex; flex-direction: column; gap: 0;
    position: absolute; top: var(--header-h); left: 0; right: 0;
    background: var(--bg); border-bottom: 1px solid var(--line);
    padding: 12px 22px 20px; z-index: 299;
  }
  .nav-primary.open li a { display: block; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .nav-primary.open .has-submenu { padding-bottom: 0; margin-bottom: 0; }
  .nav-primary.open .nav-submenu {
    position: static; transform: none; min-width: 0;
    background: transparent; border: 0; box-shadow: none;
    padding: 0 0 0 16px; display: flex;
    opacity: 1; visibility: visible; pointer-events: auto;
  }
  .nav-primary.open .nav-submenu a { padding: 10px 0 !important; border-bottom: 1px solid var(--line); font-size: 14px !important; }

  /* Hero */
  .page-hero { padding: 48px 0 40px; }
  .page-hero--breadcrumb-only { padding: 26px 0 0; }
  .page-hero--breadcrumb-only .breadcrumb { margin-bottom: 26px; }
  .page-hero::before, .page-hero::after { display: none; }
  .hero-h1 { font-size: 36px; }

  /* Grids */
  .grid-3, .grid-2, .news-grid { grid-template-columns: 1fr; }
  .news-filter-bar { gap: 8px; margin-bottom: 20px; }
  .news-filter { min-height: 38px; padding: 0 14px; }

  /* Nav extras */
  .brand-sep, .brand-tagline, .nav-phone-wrap { display: none; }
  /* Footer */
  .footer-band-inner { padding: 0 22px; flex-wrap: wrap; gap: 16px; }
  .footer-cb-brand { padding-right: 0; border-right: none; }
  .footer-cb-cta { margin-left: 0; }
  .footer-top, .cta-row { flex-direction: column; align-items: flex-start; }
  .footer-cols { flex-wrap: wrap; gap: 0; }
  .footer-col { padding: 0; border-left: none; margin-bottom: 20px; }
  .footer-bottom { flex-direction: column; gap: 8px; }
}
