/* ============ 搜连接器 · 设计系统 ============ */
:root {
  --primary: #1a56db;
  --primary-dark: #1746b0;
  --primary-light: #eef4ff;
  --text: #1f2937;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --bg: #f5f7fa;
  --card: #ffffff;
  --accent: #f59e0b;
  --danger: #dc2626;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  font-size: 15px;
}

.container { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
main.container { padding-top: 24px; padding-bottom: 60px; }

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--text-muted); font-weight: 400; font-size: .9em; }

/* ============ 页头 ============ */
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
}
.header-inner { display: flex; align-items: center; gap: 16px; height: 60px; justify-content: flex-end; }
.header-links { display: flex; align-items: center; gap: 16px; }
.logo { font-size: 18px; font-weight: 700; color: var(--text); white-space: nowrap; }
.logo:hover { text-decoration: none; }
.header-search { flex: 1; display: flex; gap: 8px; }
.header-search input {
  flex: 1; padding: 9px 14px; border: 1px solid var(--border);
  border-radius: 8px; font-size: 14px;
}
.header-search button, .hero-search button {
  padding: 9px 18px; background: var(--primary); color: #fff;
  border: none; border-radius: 8px; cursor: pointer; font-size: 14px; white-space: nowrap;
}
.header-search button:hover { background: var(--primary-dark); }
.header-link { color: var(--text); font-weight: 600; font-size: 14px; white-space: nowrap; }

/* ============ 首页 hero ============ */
.hero { text-align: center; padding: 48px 0 32px; }
.hero h1 { font-size: 30px; margin-bottom: 8px; }
.hero h1 span { color: var(--primary); }
.hero-sub { color: var(--text-muted); margin-bottom: 24px; }
.hero-search { display: flex; gap: 10px; max-width: 620px; margin: 0 auto; }
.hero-search input {
  flex: 1; padding: 14px 18px; border: 2px solid var(--primary);
  border-radius: 10px; font-size: 16px;
}

/* ============ 面板 ============ */
.panel {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; margin-bottom: 24px;
  box-shadow: var(--shadow);
}
.panel h2 { font-size: 19px; margin-bottom: 16px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.panel-head h2 { margin-bottom: 0; }
.btn-domestic {
  padding: 8px 18px; background: #fef3c7; color: var(--text);
  border: 1px solid #1a56db; border-radius: 8px;
  cursor: pointer; font-size: 14px; font-weight: 600; white-space: nowrap;
}
.btn-domestic:hover { background: #fde68a; }
.panel-actions { display: flex; align-items: center; gap: 10px; }
.btn-purchase {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 6px 12px; background: #fef3c7; color: var(--text);
  border: 1px solid #1a56db; border-radius: 8px;
  cursor: pointer; font-size: 12px; font-weight: 600; line-height: 1.4; white-space: nowrap;
}
.btn-purchase:hover { background: #fde68a; }
.panel.intro ul { list-style: none; display: grid; gap: 10px; }
.panel.intro li { padding: 10px 14px; background: var(--bg); border-radius: 8px; }

/* ============ 筛选 ============ */
.filter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.filter-item { display: flex; flex-direction: column; gap: 6px; }
.filter-item label { font-size: 13px; color: var(--text-muted); }
.filter-select, .filter-item input, .filter-item select {
  padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px;
  background: #fff; width: 100%;
}
.temp-range { display: flex; align-items: center; gap: 8px; }
.temp-range .filter-select { flex: none; width: 58px; text-align: center; padding-left: 6px; padding-right: 6px; }
.temp-sep { color: var(--text-muted); font-size: 14px; }
.result-bar { margin: 18px 0 12px; color: var(--text-muted); font-size: 14px; }
.btn-secondary {
  padding: 9px 16px; background: #fff; border: 1px solid var(--border);
  border-radius: 8px; cursor: pointer; font-size: 14px;
}
.btn-primary {
  padding: 11px 22px; background: var(--primary); color: #fff;
  border: none; border-radius: 8px; cursor: pointer; font-size: 15px; font-weight: 600;
}
.btn-primary:hover { background: var(--primary-dark); }

/* ============ 结果列表 ============ */
.result-list { display: flex; flex-direction: column; gap: 8px; }
.part-row {
  display: flex; align-items: center; gap: 16px; padding: 12px 16px;
  border: 1px solid var(--border); border-radius: 8px; color: var(--text);
}
.part-row:hover { border-color: var(--primary); text-decoration: none; box-shadow: var(--shadow); }
.part-pn { font-weight: 700; color: var(--primary); min-width: 140px; }
.part-gender { min-width: 60px; color: var(--text-muted); font-size: 13px; }
.part-spec { color: var(--text-muted); font-size: 13px; }

/* 结果行：参数横排在型号右方（字段块竖排：标签上值下，方便上下对比） */
.search-row { flex-direction: row; align-items: center; gap: 18px; flex-wrap: wrap; }
.row-link { display: flex; align-items: center; gap: 18px; flex: 1; min-width: 0; text-decoration: none; }
.row-link:hover { text-decoration: none; }
.fld { display: flex; flex-direction: column; gap: 3px; white-space: nowrap; }
.fld em { font-style: normal; color: var(--text-muted); font-size: 12px; }
.fld b { font-weight: 600; color: var(--text); font-size: 14px; }
.alt-hint {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 6px 12px; background: #fef3c7; color: var(--text);
  border: 1px solid #1a56db; border-radius: 8px;
  font-size: 12px; font-weight: 600; line-height: 1.4; white-space: nowrap;
  text-decoration: none; cursor: pointer;
}
.alt-hint:hover { background: #fde68a; }

/* 结果分组标题（连接器 / 端子） */
.result-group-title {
  font-size: 15px; font-weight: 600; color: var(--text-muted);
  margin: 18px 0 8px; padding-bottom: 6px; border-bottom: 1px solid var(--border);
}
.result-group-title:first-child { margin-top: 4px; }

/* 端子结果行 */
.term-row {
  border: 1px solid var(--border); border-radius: 10px;
  padding: 14px 16px; margin-bottom: 8px; background: var(--card);
  display: flex; flex-direction: column; gap: 8px;
}
.term-head { display: flex; align-items: center; gap: 12px; }
.tag-term {
  background: #e0f2fe; color: #0369a1; font-size: 12px;
  padding: 2px 8px; border-radius: 20px; white-space: nowrap;
}
.term-fields { display: flex; gap: 14px; flex-wrap: wrap; }
.term-conns { font-size: 13px; color: var(--text); line-height: 1.9; }
.term-conns em {
  font-style: normal; color: var(--text-muted); font-size: 12px; margin-right: 6px;
}
.term-conn-link { margin-right: 4px; }

/* ============ 品牌/系列卡片 ============ */
.brand-grid, .series-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.brand-card, .series-card {
  display: flex; flex-direction: column; gap: 4px; padding: 18px;
  border: 1px solid var(--border); border-radius: 10px; color: var(--text);
}
.brand-card:hover, .series-card:hover { border-color: var(--primary); text-decoration: none; }
.brand-card strong, .series-card strong { font-size: 16px; }
.brand-card span, .series-card span { color: var(--text-muted); font-size: 13px; }
.brand-card.empty { opacity: .55; border-style: dashed; }

/* ============ 面包屑 / 标题 ============ */
.breadcrumb { color: var(--text-muted); font-size: 13px; margin-bottom: 14px; }
.part-title { font-size: 24px; margin-bottom: 20px; }
.part-title .muted { font-size: .6em; }

/* ============ 详情页 ============ */
.spec-table { width: 100%; border-collapse: collapse; }
.spec-table th, .spec-table td { padding: 10px 14px; border-bottom: 1px solid var(--border); text-align: left; }
.spec-table th { width: 180px; color: var(--text-muted); font-weight: 500; background: var(--bg); }

.mate-chain { display: grid; gap: 8px; }
.mate-item { display: flex; align-items: center; gap: 14px; padding: 10px 14px; background: var(--bg); border-radius: 8px; }
.mate-label { color: var(--text-muted); min-width: 120px; font-size: 14px; }
.mate-value { font-weight: 600; color: var(--primary); word-break: break-all; }

/* 锁区（登录钩子） */
.panel.locked { background: linear-gradient(180deg, #fff, #f8faff); }
.lock-summary { display: flex; flex-direction: column; gap: 14px; }
.lock-item { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px dashed var(--border); border-radius: 10px; }
.lock-badge { font-size: 22px; }
.lock-item strong { display: block; }
.lock-item span { color: var(--text-muted); font-size: 13px; }

/* ============ 弹窗 ============ */
.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center; z-index: 100;
}
.modal[hidden] { display: none; }
.modal-card {
  background: #fff; border-radius: 14px; padding: 28px; width: 400px; max-width: 92vw;
  box-shadow: var(--shadow-md);
}
.modal-card h3 { margin-bottom: 18px; }
.modal-card label { display: block; font-size: 14px; color: var(--text-muted); margin-bottom: 12px; }
.modal-card input { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; margin-top: 4px; }
.modal-card textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 8px; font-size: 14px; margin-top: 4px; font-family: inherit;
  resize: vertical;
}
.modal-actions { display: flex; gap: 10px; margin-top: 18px; }
.tab-switch { display: flex; gap: 0; margin-bottom: 16px; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.tab-switch button { flex: 1; padding: 10px; border: none; background: #fff; cursor: pointer; font-size: 14px; }
.tab-switch button.active { background: var(--primary); color: #fff; }
.msg { font-size: 13px; margin-top: 8px; }
.msg.err { color: var(--danger); }
.msg.ok { color: #16a34a; }

/* 登录后填充的详细参数 / 替代件 */
.detail-params table { width: 100%; border-collapse: collapse; margin-top: 10px; }
.detail-params th, .detail-params td { padding: 9px 12px; border-bottom: 1px solid var(--border); text-align: left; }
.detail-params th { width: 170px; color: var(--text-muted); font-weight: 500; background: var(--bg); }
.alt-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.alt-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 8px; }
.alt-item .tag-domestic { background: #dcfce7; color: #15803d; font-size: 12px; padding: 2px 8px; border-radius: 20px; white-space: nowrap; }
.alt-score { color: var(--text-muted); font-size: 12px; white-space: nowrap; }

/* 对比表（登录后：型号 + 参数 + 替代件，横向滚动） */
.compare-wrap { overflow-x: auto; margin-top: 10px; }
.compare-table { border-collapse: collapse; width: 100%; min-width: 2200px; }
.compare-table th, .compare-table td {
  padding: 8px 12px; border-bottom: 1px solid var(--border);
  text-align: left; white-space: nowrap; font-size: 12px;
}
.compare-table thead th {
  background: var(--bg); color: var(--text-muted); font-weight: 600;
  position: sticky; top: 0; z-index: 1;
}
.compare-table tbody tr:hover { background: #f8faff; }
.compare-table .self-row td { background: var(--primary-light); font-weight: 600; }
.compare-table .alt-divider td {
  background: #f3f4f6; color: var(--text-muted); font-weight: 600;
  padding: 6px 12px; font-size: 12px;
}
.compare-table td a { font-weight: 600; }

/* ============ 表单 ============ */
.lead-form { display: flex; flex-direction: column; gap: 14px; max-width: 520px; }
.lead-form label { font-size: 14px; color: var(--text-muted); }
.lead-form input, .lead-form textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 8px; font-size: 14px; margin-top: 4px; font-family: inherit;
}
.lead-form .consent { font-size: 12px; color: var(--text-muted); }

.empty-tip { color: var(--text-muted); padding: 24px; text-align: center; }

/* ============ 页脚 ============ */
.site-footer { border-top: 1px solid var(--border); background: var(--card); padding: 28px 0; margin-top: 40px; }
.site-footer p { color: var(--text-muted); font-size: 13px; margin-bottom: 4px; }
.footer-inner { text-align: center; }
.footer-name { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.site-footer a { color: var(--primary); text-decoration: none; }

@media (max-width: 640px) {
  .header-search { display: none; }
  .part-row { flex-wrap: wrap; }
  .part-pn { min-width: 100%; }
  .spec-table th { width: 110px; }
}

/* ============ 首页第一屏：抬头(上1/2) + 左右两栏(下1/2) ============ */
/* 上 1/2：抬头（星空互联背景，白字） */
.home-hero {
  position: relative;
  height: 50vh;
  min-height: 300px;
  margin: -24px -20px 0;
  padding: 20px 24px;
  background: linear-gradient(135deg, #1a3a6b 0%, #17365f 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
}
.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
.home-hero .hero-actions,
.home-hero h1,
.home-hero .hero-sub { position: relative; z-index: 1; }
.home-hero h1 {
  color: #fff;
  font-size: 44px;
  font-weight: 800;
  margin-bottom: 14px;
  letter-spacing: 2px;
}
.home-hero .hero-sub {
  color: rgba(255,255,255,.9);
  font-size: 17px;
}

/* 首页隐藏顶部导航栏；联系站长 / 登录注册 移到抬头右上角 */
body.home .site-header { display: none; }
.home-hero .hero-actions {
  position: absolute; top: 20px; right: 24px;
  display: flex; flex-direction: column; align-items: flex-end; gap: 6px;
}
.home-hero .hero-actions a { color: rgba(255,255,255,.92); font-weight: 600; font-size: 14px; }
.home-hero .hero-actions a:hover { color: #fff; text-decoration: underline; }

/* 下 1/2：左右两栏，统一淡绿灰背景（外围细灰框同 panel、中间灰粗线） */
.home-two-col {
  height: 50vh;
  min-height: 340px;
  margin: 0 -20px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--border);
  overflow: hidden;
}
.col {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
  padding: 32px 44px;
}
.col-left { background: #eaf4f0; border-right: 2px solid #6b7280; }
.col-right { background: #eaf4f0; }
.col h2 { font-size: 26px; font-weight: 700; }
.col-desc { color: var(--text-muted); font-size: 15px; }

/* 首页各板块直角（去掉圆角） */
body.home .panel { border-radius: 0; }

.pn-search { display: flex; gap: 10px; margin-top: 6px; }
.pn-search input {
  flex: 1; padding: 14px 16px; border: 2px solid var(--primary);
  border-radius: 10px; font-size: 16px; min-width: 0; background: #fff;
}
.pn-search button {
  padding: 14px 24px; background: var(--primary); color: #fff;
  border: none; border-radius: 10px; cursor: pointer; font-size: 15px; white-space: nowrap;
}
.pn-search button:hover { background: var(--primary-dark); }

/* 应用类型圆点（点选） */
.apptype-radios {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 6px;
}
.radio-pill {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 13px 16px; border: 2px solid var(--border); border-radius: 12px;
  cursor: pointer; font-size: 15px; font-weight: 500; color: var(--text);
  transition: all .15s; user-select: none; background: #fff;
}
.radio-pill:hover { border-color: var(--primary); }
.radio-pill input {
  appearance: none; -webkit-appearance: none;
  width: 18px; height: 18px; flex-shrink: 0;
  border: 2px solid #cbd5e1; border-radius: 50%;
  cursor: pointer; margin: 0;
}
.radio-pill input:checked {
  border-color: var(--primary);
  background: var(--primary);
  box-shadow: inset 0 0 0 4px #fff;
}
.radio-pill:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}

/* 过渡页动作区 */
.filter-actions { display: flex; gap: 12px; align-items: center; margin-top: 4px; }
.btn-link {
  display: inline-flex; align-items: center; padding: 9px 16px;
  background: #fff; border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px; color: var(--text);
}
.btn-link:hover { text-decoration: none; border-color: var(--primary); }

@media (max-width: 640px) {
  .home-hero, .home-two-col { height: auto; min-height: 0; }
  .home-two-col { grid-template-columns: 1fr; }
  .home-hero h1 { font-size: 28px; }
  .apptype-radios { grid-template-columns: 1fr; }
}

/* 替代提示（公开写进 HTML，SEO 命中"国产替代"） */
.alt-public-hint {
  margin: 12px 0 16px; padding: 12px 16px;
  background: var(--primary-light); border: 1px solid var(--border); border-radius: 10px;
  font-size: 14px; color: var(--text); line-height: 1.6;
}
.alt-public-hint a { font-weight: 600; color: var(--primary); }

/* 详情页顶部登录引导按钮（替代提示框上方） */
.login-cta-top { margin: 16px 0 4px; }
.login-cta-top .btn-primary { width: 100%; max-width: 360px; }

/* 搜索结果遮罩（未登录：参数显示"登录查看"） */
.masked { color: var(--text-muted); font-weight: 400; }
.masked-login-link { color: var(--primary); cursor: pointer; font-weight: 600; }
