@charset "UTF-8";
/* ============================================================
   YFX LED 驱动电源产品册 —— 样式表
   移动优先 (mobile-first) + 浅色主题
   ============================================================ */

/* ---------- 1. 设计令牌 ---------- */
:root {
  --brand-900: #0a2540;
  --brand-700: #0f3f75;
  --brand-600: #1257d6;
  --brand-500: #1a6ef0;
  --brand-050: #eaf1fe;

  --accent-600: #e05d00;
  --accent-500: #ff6f1a;

  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-2: #f8fafd;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;

  --text: #16202e;
  --text-2: #42546b;
  --muted: #6b7c93;

  --ok: #0f8a4f;

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;

  --shadow-sm: 0 1px 2px rgba(16, 32, 56, .06), 0 2px 6px rgba(16, 32, 56, .04);
  --shadow: 0 4px 12px rgba(16, 32, 56, .08), 0 12px 28px rgba(16, 32, 56, .06);
  --shadow-lg: 0 12px 40px rgba(10, 37, 64, .18);

  --header-h: 62px;
  --wrap: 1240px;

  /* 系列主题色 */
  --s-H: #1257d6;
  --s-K: #0e8f8f;
  --s-R: #7048d8;
  --s-S: #11864a;
  --s-X: #d1480f;
}

/* ---------- 2. 基础重置 ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; line-height: 1.3; font-weight: 700; letter-spacing: -.01em; }
p { margin: 0; }
img { max-width: 100%; height: auto; display: block; }
ul, ol, dl, dd { margin: 0; padding: 0; list-style: none; }
a { color: var(--brand-600); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }

/* hidden 属性必须始终生效。
   注意：作者样式里的 display 会覆盖浏览器默认的 [hidden]{display:none}，
   若不显式声明，#searchClear 这类设了 display:grid 的元素将永远显示。 */
[hidden] { display: none !important; }

/* 键盘焦点必须可见（无障碍要求） */
:focus-visible {
  outline: 3px solid var(--brand-500);
  outline-offset: 2px;
  border-radius: 4px;
}

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 20px; }

.sr-only {
  position: absolute; 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: 200;
  background: var(--brand-600); color: #fff; padding: 10px 16px;
  border-radius: var(--radius-sm); transition: top .2s;
}
.skip-link:focus { top: 12px; color: #fff; }

/* ---------- 3. 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border: 1px solid transparent; border-radius: 999px;
  font-size: 15px; font-weight: 600; cursor: pointer;
  transition: background-color .18s, color .18s, border-color .18s, transform .12s, box-shadow .18s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-block { width: 100%; }

.btn-primary { background: var(--brand-600); color: #fff; box-shadow: 0 2px 10px rgba(18, 87, 214, .28); }
.btn-primary:hover { background: var(--brand-500); }

.btn-ghost { background: transparent; color: var(--brand-700); border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--brand-050); border-color: var(--brand-600); }

/* ---------- 4. 顶部导航 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 16px; height: var(--header-h); }

.brand { display: flex; align-items: center; gap: 11px; color: inherit; }
.brand-mark {
  display: grid; place-items: center;
  width: 40px; height: 40px; border-radius: 10px;
  background: linear-gradient(135deg, var(--brand-600), var(--brand-500));
  color: #fff; font-weight: 800; font-size: 14px; letter-spacing: .02em;
  box-shadow: 0 2px 8px rgba(18, 87, 214, .3);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-size: 16px; }
.brand-text em { font-style: normal; font-size: 12px; color: var(--muted); }

.nav { margin-left: auto; display: none; gap: 26px; }
.nav a { color: var(--text-2); font-size: 15px; font-weight: 500; padding: 6px 0; border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--brand-600); border-bottom-color: var(--brand-600); }

.header-cta { margin-left: auto; padding: 9px 18px; font-size: 14px; }
.nav + .header-cta { margin-left: 0; }

/* ---------- 5. 首屏 ---------- */
.hero {
  background:
    radial-gradient(1100px 520px at 12% -10%, #dce9ff 0%, rgba(220, 233, 255, 0) 60%),
    radial-gradient(900px 460px at 92% 0%, #ffe6cf 0%, rgba(255, 230, 207, 0) 62%),
    var(--surface);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.hero-inner {
  display: grid; gap: 40px;
  padding-top: 48px; padding-bottom: 52px;
}

.eyebrow {
  display: inline-block; margin-bottom: 16px;
  padding: 5px 13px; border-radius: 999px;
  background: var(--brand-050); color: var(--brand-700);
  font-size: 13px; font-weight: 600;
}
.hero h1 { font-size: clamp(28px, 7vw, 46px); letter-spacing: -.02em; }
.hero h1 .hl { color: var(--brand-600); }
.lead { margin-top: 16px; color: var(--text-2); font-size: clamp(15px, 3.6vw, 17px); max-width: 60ch; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }

.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px 14px; margin-top: 34px; }
.stats > div { border-left: 3px solid var(--brand-600); padding-left: 12px; }
.stats dt { font-size: clamp(20px, 5vw, 26px); font-weight: 800; color: var(--brand-700); line-height: 1.1; }
.stats dd { font-size: 13px; color: var(--muted); }

/* 首屏装饰图：小屏隐藏，避免拖慢加载 */
.hero-art { display: none; }

/* ---------- 6. 通用区块标题 ---------- */
.section-title { font-size: clamp(22px, 5vw, 30px); }
.section-sub { margin-top: 8px; color: var(--muted); font-size: 15px; }

/* ---------- 7. 系列速览 ---------- */
.series { padding: 56px 0 8px; }
.series-grid {
  display: grid; grid-template-columns: 1fr; gap: 14px;
  margin-top: 26px;
}
.series-card {
  display: flex; flex-direction: column; gap: 6px; text-align: left;
  padding: 20px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); cursor: pointer;
  transition: transform .16s, box-shadow .2s, border-color .2s;
}
.series-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--border-strong); }
.series-card[aria-pressed="true"] { border-color: var(--brand-600); box-shadow: 0 0 0 3px var(--brand-050); }
.series-card .sc-top { display: flex; align-items: center; gap: 10px; }
.series-card .sc-dot { width: 12px; height: 12px; border-radius: 4px; background: var(--c, var(--brand-600)); }
.series-card .sc-name { font-size: 17px; font-weight: 700; }
.series-card .sc-count { margin-left: auto; font-size: 13px; color: var(--muted); }
.series-card .sc-desc { font-size: 14px; color: var(--text-2); }

/* ---------- 8. 工具栏 ---------- */
.products { padding: 40px 0 60px; }
.toolbar {
  position: sticky; top: var(--header-h); z-index: 40;
  display: grid; gap: 14px;
  padding: 16px; margin-bottom: 24px;
  background: rgba(255, 255, 255, .95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.search-box { position: relative; display: flex; align-items: center; }
.search-icon { position: absolute; left: 14px; width: 19px; height: 19px; color: var(--muted); pointer-events: none; }
#searchInput {
  width: 100%; padding: 12px 42px 12px 42px;
  border: 1px solid var(--border-strong); border-radius: 999px;
  background: var(--surface); font-size: 15px;
}
#searchInput::-webkit-search-cancel-button { display: none; }
.search-clear {
  position: absolute; right: 10px; width: 28px; height: 28px;
  display: grid; place-items: center;
  border: 0; border-radius: 50%; background: var(--surface-2);
  color: var(--muted); font-size: 20px; line-height: 1; cursor: pointer;
}
.search-clear:hover { background: var(--border); color: var(--text); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 7px 15px; border: 1px solid var(--border-strong); border-radius: 999px;
  background: var(--surface); color: var(--text-2);
  font-size: 14px; font-weight: 500; cursor: pointer;
  transition: background-color .16s, color .16s, border-color .16s;
}
.chip:hover { border-color: var(--brand-600); color: var(--brand-700); }
.chip[aria-pressed="true"] { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }

.toolbar-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.sort { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
#sortSelect {
  padding: 8px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); font-size: 14px;
}
.result-count { font-size: 14px; color: var(--muted); }
.result-count b { color: var(--brand-700); font-weight: 700; }

/* ---------- 9. 产品网格 ---------- */
.grid {
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
}

.card {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; cursor: pointer;
  transition: transform .18s, box-shadow .22s, border-color .18s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--border-strong); }

/* 预留图片空间，防止懒加载引起布局抖动（CLS） */
.card-media {
  position: relative;
  aspect-ratio: 520 / 735;
  background: linear-gradient(160deg, #eef3fa, #e3eaf4);
  overflow: hidden;
}
.card-media img { width: 100%; height: 100%; object-fit: cover; }

.badge {
  position: absolute; top: 10px; left: 10px;
  min-width: 34px; padding: 3px 9px; border-radius: 7px;
  background: var(--c, var(--brand-600)); color: #fff;
  font-size: 13px; font-weight: 800; letter-spacing: .02em;
  box-shadow: 0 2px 8px rgba(10, 37, 64, .25);
}

.card-body { display: flex; flex-direction: column; gap: 8px; padding: 14px; flex: 1; }
.card-model { font-size: 17px; font-weight: 800; }
.card-name {
  font-size: 13px; color: var(--text-2); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.card-specs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 10px; margin-top: auto; padding-top: 10px; border-top: 1px dashed var(--border); }
.card-specs div { display: flex; align-items: baseline; gap: 6px; font-size: 13px; min-width: 0; }
.card-specs span { color: var(--muted); flex: none; }
.card-specs b { color: var(--text); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.tag-row { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  padding: 3px 9px; border-radius: 6px;
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: 12px; color: var(--text-2);
}
.tag.ip { background: #e8f6ee; border-color: #bfe5d0; color: #0b6b3d; }

/* ---------- 10. 空状态 ---------- */
.empty { padding: 60px 20px; text-align: center; }
.empty-title { font-size: 18px; font-weight: 700; }
.empty-hint { margin-top: 8px; color: var(--muted); font-size: 14px; }

/* ---------- 11. 询价区 ---------- */
.contact {
  padding: 56px 0;
  background: linear-gradient(180deg, var(--surface) 0%, #eef4ff 100%);
  border-top: 1px solid var(--border);
}
.contact-inner { display: grid; gap: 32px; }
.contact-copy h2 { font-size: clamp(22px, 5vw, 30px); }
.contact-list { display: grid; gap: 10px; margin-top: 20px; }
.contact-list li { position: relative; padding-left: 26px; font-size: 15px; color: var(--text-2); }
.contact-list li::before {
  content: "✓"; position: absolute; left: 0; top: 0;
  color: var(--ok); font-weight: 800;
}
.contact-list strong { color: var(--text); margin-right: 6px; }

.contact-form {
  display: grid; gap: 14px;
  padding: 24px; border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--surface); box-shadow: var(--shadow);
  align-content: start;
}
.field { display: grid; gap: 6px; }
.field label { font-size: 14px; font-weight: 600; }
.req { color: #d33; }
.field input, .field textarea {
  width: 100%; padding: 11px 13px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface-2); font-size: 15px;
  transition: border-color .16s, background-color .16s;
}
.field input:focus, .field textarea:focus { background: var(--surface); border-color: var(--brand-600); outline: 2px solid var(--brand-050); }
.field textarea { resize: vertical; min-height: 76px; }
.field input[aria-invalid="true"] { border-color: #d33; background: #fff6f6; }
.err { font-size: 13px; color: #c22; }
.form-note { font-size: 13px; color: var(--muted); text-align: center; }
.form-ok {
  padding: 10px 14px; border-radius: var(--radius-sm);
  background: #e8f6ee; border: 1px solid #bfe5d0; color: #0b6b3d;
  font-size: 14px; text-align: center;
}
/* 提交失败提示：绝不能让客户以为提交成功，必须给出备用联系方式 */
.form-err {
  padding: 10px 14px; border-radius: var(--radius-sm);
  background: #fdecea; border: 1px solid #f5c2bd; color: #a3241b;
  font-size: 14px; text-align: center; line-height: 1.6;
}
.form-err a { color: #a3241b; text-decoration: underline; font-weight: 600; }
.contact-form button[disabled] { opacity: .7; cursor: not-allowed; }

/* ---------- 12. 页脚 ---------- */
.site-footer { background: var(--brand-900); color: #c8d6e8; padding: 36px 0 28px; }
.footer-inner { display: grid; gap: 18px; }
.footer-brand { display: flex; align-items: center; gap: 12px; }
.footer-brand p { font-size: 13px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 18px; }
.footer-links a { color: #c8d6e8; font-size: 14px; }
.footer-links a:hover { color: #fff; }
.copyright { font-size: 12px; color: #8ba0bb; border-top: 1px solid rgba(255, 255, 255, .12); padding-top: 16px; }

/* ---------- 13. 详情弹窗 ---------- */
.modal { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: 16px; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(10, 25, 45, .62); backdrop-filter: blur(3px); }
.modal-panel {
  position: relative; z-index: 1;
  width: 100%; max-width: 940px; max-height: calc(100dvh - 32px);
  background: var(--surface); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); overflow: auto;
  animation: pop .22s ease-out;
}
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }

.modal-close {
  position: absolute; top: 10px; right: 12px; z-index: 3;
  width: 38px; height: 38px; display: grid; place-items: center;
  border: 0; border-radius: 50%; background: rgba(255, 255, 255, .92);
  color: var(--text); font-size: 26px; line-height: 1; cursor: pointer;
  box-shadow: var(--shadow-sm);
}
.modal-close:hover { background: #fff; }

.modal-body { display: grid; grid-template-columns: 1fr; }
.modal-media { position: relative; background: var(--surface-2); }
.modal-media img { width: 100%; aspect-ratio: 520 / 735; object-fit: contain; }
.zoom-hint {
  position: absolute; bottom: 12px; right: 12px;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 13px; border: 0; border-radius: 999px;
  background: rgba(10, 37, 64, .82); color: #fff;
  font-size: 13px; font-weight: 600; cursor: pointer;
}
.zoom-hint svg { width: 15px; height: 15px; }

.modal-info { padding: 22px; display: grid; gap: 14px; align-content: start; }
.modal-info .badge { position: static; justify-self: start; }
.modal-info h2 { font-size: 26px; }
.modal-name { color: var(--text-2); font-size: 14px; }

.spec-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.spec-table th, .spec-table td { padding: 9px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.spec-table th { width: 88px; color: var(--muted); font-weight: 500; white-space: nowrap; }
.spec-table td { font-weight: 600; }

.modal-desc { font-size: 14px; color: var(--text-2); line-height: 1.75; }
.modal-actions { display: flex; flex-wrap: wrap; gap: 10px; padding-top: 4px; }

/* ---------- 14. 灯箱 ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 400;
  display: grid; place-items: center; gap: 12px;
  padding: 20px; background: rgba(6, 14, 26, .93);
}
.lightbox[hidden] { display: none; }
.lightbox img { max-width: min(100%, 900px); max-height: calc(100dvh - 110px); object-fit: contain; border-radius: 8px; }
.lightbox-cap { color: #d7e3f4; font-size: 14px; text-align: center; }
.lightbox-close {
  position: absolute; top: 16px; right: 18px;
  width: 44px; height: 44px; display: grid; place-items: center;
  border: 0; border-radius: 50%; background: rgba(255, 255, 255, .14);
  color: #fff; font-size: 30px; line-height: 1; cursor: pointer;
}
.lightbox-close:hover { background: rgba(255, 255, 255, .26); }

body.no-scroll { overflow: hidden; }

/* ---------- 15. 响应式断点 ---------- */
@media (min-width: 480px) {
  .stats { grid-template-columns: repeat(4, 1fr); }
  .card-specs { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 700px) {
  .series-grid { grid-template-columns: repeat(2, 1fr); }
  .toolbar { grid-template-columns: minmax(240px, 340px) 1fr; align-items: center; }
  .search-box { grid-column: 1; }
  .chips { grid-column: 2; justify-content: flex-end; }
  .toolbar-row { grid-column: 1 / -1; }
  .contact-inner { grid-template-columns: 1fr 1fr; align-items: start; }
}

@media (min-width: 900px) {
  .nav { display: flex; }
  .header-cta { margin-left: 0; }
  .hero-inner { grid-template-columns: 1.05fr .95fr; align-items: center; gap: 48px; padding-top: 62px; padding-bottom: 68px; }
  .hero-art { display: block; position: relative; height: 400px; }
  .art-card {
    position: absolute; border-radius: var(--radius); overflow: hidden;
    box-shadow: var(--shadow); background: #fff;
    border: 1px solid var(--border);
  }
  .art-card img { width: 100%; height: 100%; object-fit: cover; }
  .art-card-1 { width: 220px; height: 311px; left: 8%; top: 10px; transform: rotate(-6deg); z-index: 3; }
  .art-card-2 { width: 200px; height: 283px; right: 6%; top: 52px; transform: rotate(5deg); z-index: 2; }
  .art-card-3 { width: 186px; height: 263px; left: 42%; bottom: 0; transform: rotate(-2deg); z-index: 1; }
  .series-grid { grid-template-columns: repeat(3, 1fr); }
  .modal-body { grid-template-columns: 380px 1fr; }
  .modal-media img { aspect-ratio: auto; height: 100%; max-height: calc(100dvh - 32px); }
}

@media (min-width: 1100px) {
  .series-grid { grid-template-columns: repeat(5, 1fr); }
}

/* ---------- 16. 打印 & 减少动效 ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
