/* ============================================================
   元器件品牌渠道平台 - 全局样式
   ============================================================ */

:root {
  --navy-900: #0a1628;
  --navy-800: #10233d;
  --navy-700: #17325a;
  --brand-600: #1667d1;
  --brand-500: #2b7fff;
  --brand-100: #e8f1ff;
  --teal-600: #0f9d8f;
  --teal-100: #e3f7f4;
  --amber-600: #b7791f;
  --amber-100: #fdf4e0;
  --red-600: #d1384a;
  --red-100: #fdeaec;
  --green-600: #1f9d5b;
  --green-100: #e6f6ee;
  --ink-900: #16202e;
  --ink-700: #3d4b60;
  --ink-500: #6b7a90;
  --ink-300: #a9b4c4;
  --line: #e3e8f0;
  --bg: #f5f7fb;
  --card: #ffffff;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(16, 35, 61, .06), 0 2px 8px rgba(16, 35, 61, .05);
  --shadow-md: 0 6px 24px rgba(16, 35, 61, .10);
  --shadow-lg: 0 18px 48px rgba(10, 22, 40, .18);
  --max: 1240px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink-900);
  font-size: 14px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand-600); text-decoration: none; }
a:hover { color: var(--brand-500); }

img { max-width: 100%; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }

/* ---------- header ---------- */
.site-header {
  background: linear-gradient(120deg, var(--navy-900) 0%, var(--navy-700) 62%, #1d4d8c 100%);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 14px rgba(10, 22, 40, .25);
}
.site-header .bar {
  display: flex;
  align-items: center;
  gap: 18px;
  height: 62px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  letter-spacing: .3px;
  white-space: nowrap;
}
.logo:hover { color: #fff; }
.logo .mark {
  width: 56px; height: 34px;
  border-radius: 8px;
  background: linear-gradient(135deg, #4ea8ff, #0f9d8f);
  /* "元渠"两字左右并排（牌匾式） */
  display: flex;
  align-items: center;
  justify-content: center;
  /* 古风字体：行楷优先，逐级回退到隶书 / 楷体 / 宋体（手机上没有行楷时落到楷体） */
  font-family: 'STXingkai', '华文行楷', 'STLiti', '华文隶书', 'STKaiti', '华文楷体', 'KaiTi', '楷体', 'SimSun', serif;
  font-size: 18px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 1px;
  color: #04121f;
  /* 印章感：一圈内描边 + 极轻的做旧 */
  box-shadow: inset 0 0 0 1px rgba(4, 18, 31, .30);
  text-shadow: 0 1px 0 rgba(255, 255, 255, .22);
}
.logo .mark b { font-weight: 400; }
.logo small { display: block; font-size: 11px; font-weight: 400; color: #9fc0e8; letter-spacing: 0; }

.nav { display: flex; align-items: center; gap: 4px; margin-left: 8px; flex-wrap: wrap; }
.nav a {
  color: #d4e2f5;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
}
.nav a:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.nav a.active { background: rgba(255, 255, 255, .16); color: #fff; font-weight: 600; }

/* ---------- 导航下拉（品牌库 / 渠道商展示） ---------- */
.nav-menu { position: relative; }
.nav-btn {
  background: transparent;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  color: #d4e2f5;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
}
.nav-btn:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.nav-btn.active { background: rgba(255, 255, 255, .16); color: #fff; font-weight: 600; }
.nav-btn .car { font-style: normal; font-size: 11px; margin-left: 3px; opacity: .85; }
.nav-menu-list {
  display: none;
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  min-width: 170px;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 16px 40px rgba(9, 20, 40, .22);
  z-index: 320;
}
.nav-menu-list.show { display: block; }
.nav-menu-list a {
  display: block;
  padding: 9px 12px;
  border-radius: 7px;
  color: var(--ink-700);
  font-size: 13.5px;
  white-space: nowrap;
}
.nav-menu-list a:hover { background: var(--brand-100); color: var(--brand-600); }
.nav-menu-list a.active { background: var(--brand-100); color: var(--brand-600); font-weight: 600; }

.header-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

/* ---------- 顶栏「个人中心」下拉菜单 ---------- */
.header-menu { position: relative; }
.header-menu .btn { white-space: nowrap; }
.header-menu-list {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 178px;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 16px 40px rgba(9, 20, 40, .22);
  z-index: 320;
}
.header-menu-list.show { display: block; }
.header-menu-list a {
  display: block;
  padding: 9px 12px;
  border-radius: 7px;
  color: var(--ink-700);
  font-size: 13.5px;
  text-decoration: none;
  white-space: nowrap;
}
.header-menu-list a:hover { background: var(--brand-100); color: var(--brand-600); }
.header-menu-list .menu-divider { height: 1px; background: var(--line); margin: 6px 4px; }
.header-menu-list a.menu-admin { font-weight: 600; color: var(--brand-600); }
.header-menu-list a.menu-admin.active { background: var(--brand-100); }
.header-search {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 20px;
  padding: 4px 6px 4px 14px;
}
.header-search input {
  background: transparent;
  border: 0;
  outline: 0;
  color: #fff;
  width: 168px;
  font-size: 13px;
}
.header-search input::placeholder { color: #a9c3e3; }
.header-search button {
  border: 0;
  background: var(--brand-500);
  color: #fff;
  border-radius: 16px;
  padding: 5px 12px;
  cursor: pointer;
  font-size: 13px;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  background: var(--brand-600);
  color: #fff;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  cursor: pointer;
  transition: .18s;
  white-space: nowrap;
}
.btn:hover { background: var(--brand-500); color: #fff; }
.btn.ghost { background: #fff; color: var(--ink-700); border-color: var(--line); }
.btn.ghost:hover { background: #f7f9fc; color: var(--brand-600); border-color: #c9d8ef; }
.btn.dark { background: var(--navy-800); }
.btn.dark:hover { background: var(--navy-700); }
.btn.teal { background: var(--teal-600); }
.btn.teal:hover { background: #12b3a2; }
.btn.danger { background: var(--red-600); }
.btn.danger:hover { background: #e04a5c; }
.btn.success { background: var(--green-600); }
.btn.success:hover { background: #24b269; }
.btn.sm { padding: 5px 11px; font-size: 13px; }
.btn.lg { padding: 12px 24px; font-size: 15px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- hero ---------- */
.hero {
  background:
    radial-gradient(900px 320px at 12% -10%, rgba(43, 127, 255, .35), transparent 60%),
    radial-gradient(700px 300px at 88% 0%, rgba(15, 157, 143, .28), transparent 62%),
    linear-gradient(150deg, #0a1628, #143055 70%, #1b4478);
  color: #fff;
  padding: 24px 0 18px;
}
.hero-title { font-size: 34px; line-height: 1.3; margin: 0 0 38px; letter-spacing: .5px; }
.hero-search {
  display: flex;
  gap: 10px;
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .2);
  padding: 8px;
  border-radius: 14px;
  max-width: 660px;
  backdrop-filter: blur(4px);
}
.hero-search input {
  flex: 1;
  border: 0;
  outline: 0;
  background: #fff;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 15px;
}
.hero-tags { margin-top: 18px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; color: #9fc0e8; font-size: 13px; }

/* ---------- hero 两栏：左侧搜索统计 + 书法标语，右侧求购框 ---------- */
/* 标题独占一行；左栏收窄给右侧求购框让出宽度 */
.hero-grid { display: flex; align-items: flex-start; gap: 44px; }
.hero-main {
  flex: 0 0 468px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
.hero-rfq {
  flex: 1 1 auto;
  min-width: 0;
  margin-top: -100px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}
.hero-brush {
  margin-top: 38px;
  font-family: 'STXingkai', '华文行楷', 'FZShuTi', '方正舒体', 'STXinwei', '华文新魏',
               'LiSu', '隶书', 'KaiTi', '楷体', 'STKaiti', 'Kaiti SC', 'cursive', serif;
  writing-mode: horizontal-tb;
  font-size: 42px;
  line-height: 1.2;
  letter-spacing: 9px;
  text-align: center;
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 0 22px rgba(120, 190, 255, .5), 0 3px 12px rgba(3, 10, 22, .55);
  white-space: nowrap;
}

/* ---------- 首页求购信息跑马灯 ---------- */
.rfq-marquee {
  width: 100%;
  height: 460px;
  border: 1px solid rgba(255, 255, 255, .85);
  border-radius: 12px;
  background: #ffffff;
  overflow: hidden;
  position: relative;
  box-shadow: 0 10px 26px rgba(3, 12, 26, .32);
}
.rfq-marquee .track { display: flex; flex-direction: column; }
.rfq-marquee .track.scroll { animation: rfq-scroll-up 30s linear infinite; }
/* 框上方的"全部求购"按钮：蓝底白字，右对齐框的右边缘 */
.rfq-all-btn {
  align-self: flex-end;
  display: inline-block;
  height: 40px;
  line-height: 40px;
  padding: 0 20px;
  margin-bottom: 14px;
  border-radius: 10px;
  background: #2b7fff;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(3, 12, 26, .28);
}
.rfq-all-btn:hover { background: #1667d1; color: #fff; }
/* 每行五列等间距：品牌 142（含 28px LOGO）｜ 型号 1fr ｜ 封装 96 ｜ 数量 92 ｜ 年份 98，列间距 14 */
.rfq-marquee .item {
  display: grid;
  grid-template-columns: 142px 1fr 96px 92px 98px;
  gap: 14px;
  align-items: center;
  height: 45px;
  padding: 0 14px;
  color: #16324f;
  font-size: 13.5px;
  border-bottom: 1px dashed #e6ecf5;
  text-decoration: none;
}
.rfq-marquee .item > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rfq-marquee .item .brand {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: #0b4b96;
  font-weight: 700;
}
.rfq-marquee .item .brand .bl {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  object-fit: contain;
  background: #fff;
  border: 1px solid #e6edf7;
  border-radius: 7px;
  padding: 2px;
  box-sizing: border-box;
}
.rfq-marquee .item .brand .ph {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #8fa2b8;
  border: 1px solid #e3ebf5;
}
.rfq-marquee .item .brand .bn {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rfq-marquee .item .m { color: #16324f; }
.rfq-marquee .item .p { color: #3d4b60; }
.rfq-marquee .item:hover { background: #f2f7ff; }
.rfq-marquee .item.empty {
  display: block;
  text-align: center;
  line-height: 41px;
  color: #6b7a90;
}
@keyframes rfq-scroll-up {
  from { transform: translateY(0); }
  to { transform: translateY(-50%); }
}
.rfq-marquee-more {
  color: #cbdcf3;
  font-size: 12.5px;
  margin-top: 10px;
  white-space: nowrap;
}
.rfq-marquee-more:hover { color: #ffffff; }
.hero-tags a { color: #cfe2ff; background: rgba(255, 255, 255, .1); padding: 3px 10px; border-radius: 12px; }
.hero-tags a:hover { background: rgba(255, 255, 255, .2); }

.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 32px; max-width: 760px; }
.stat {
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: var(--radius);
  padding: 12px;
}
.stat b {
  display: block;
  font-size: 24px;
  line-height: 1.2;
  color: #fff;
  white-space: nowrap;
  /* 数字累加动画时保持等宽数字，避免位数变化造成左右跳动 */
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}
.stat span { color: #a9c3e3; font-size: 12px; white-space: nowrap; }

/* ---------- layout ---------- */
.page { padding: 28px 0 60px; }
.page-head { margin-bottom: 20px; }
.page-head h2 { margin: 0 0 6px; font-size: 22px; }
.page-head p { margin: 0; color: var(--ink-500); }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-pad { padding: 20px; }
.card + .card { margin-top: 18px; }
.card h3 { margin: 0 0 14px; font-size: 16px; }

.section { margin-top: 34px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }
.section-head h2 { margin: 0; font-size: 20px; }
.section-head p { margin: 4px 0 0; color: var(--ink-500); }
.section-head .more { font-size: 13px; }

.grid { display: grid; gap: 14px; }
/* 网格内的卡片间距由 gap 控制，避免 .card + .card 的 18px 上边距把并排卡片顶歪 */
.grid > .card + .card { margin-top: 0; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

/* ---------- brand card ---------- */
.brand-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: .18s;
  /* 固定卡片框架：所有品牌卡片尺寸完全一致（内容超出裁切） */
  height: 248px;
  overflow: hidden;
}
.brand-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: #cfdcf0; }
.brand-card .top { display: flex; gap: 12px; align-items: center; height: 56px; flex: 0 0 auto; overflow: hidden; }
.brand-card .top > div { min-width: 0; }
.brand-card .logo-box {
  width: 56px; height: 56px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  display: grid;
  place-items: center;
  overflow: hidden;
  flex: 0 0 auto;
}
.brand-card .logo-box img { max-width: 86%; max-height: 80%; object-fit: contain; }
.brand-card .logo-box .ph { color: var(--ink-300); font-size: 18px; font-weight: 700; }
.brand-card .name { font-size: 15.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-card .en { color: var(--ink-500); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-card .desc {
  color: var(--ink-700);
  font-size: 12.8px;
  line-height: 1.6;
  height: 62px;              /* 固定 3 行高度：短描述也占满，保证下方区块对齐 */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 0 0 auto;
}
/* 第一行标签（梯队 / 封测模式 / 产地）：固定一行，超出裁切 */
.brand-card .meta {
  display: flex; gap: 6px; align-items: center; flex-wrap: nowrap;
  height: 22px; overflow: hidden; flex: 0 0 auto;
}
/* 第二行标签（产品品类）：固定两行高度，超出裁切 */
.brand-card .tags {
  margin-top: auto;
  display: flex; gap: 6px; align-content: flex-start; flex-wrap: wrap;
  height: 50px; overflow: hidden; flex: 0 0 auto;
}
.brand-card .foot { margin-top: auto; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

/* ---------- badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: 11px;
  font-size: 12px;
  background: #eef2f8;
  color: var(--ink-700);
  border: 1px solid #e2e8f2;
  white-space: nowrap;
}
.badge.blue { background: var(--brand-100); color: #14509f; border-color: #cfe1ff; }
.badge.teal { background: var(--teal-100); color: #0a7d72; border-color: #c8ece7; }
.badge.amber { background: var(--amber-100); color: var(--amber-600); border-color: #f5e3bd; }
.badge.red { background: var(--red-100); color: var(--red-600); border-color: #f8cfd4; }
.badge.green { background: var(--green-100); color: var(--green-600); border-color: #c9ecd9; }
.badge.gray { background: #f1f3f7; color: var(--ink-500); }

/* ---------- filters ---------- */
.filters {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  /* 底部对齐：即使某个标签折行，输入框/下拉框也始终在同一水平线上 */
  align-items: flex-end;
  box-shadow: var(--shadow-sm);
}
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 12.5px; color: var(--ink-500); }
input[type=text], input[type=password], input[type=email], input[type=tel], input[type=search], select, textarea {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 11px;
  font-size: 14px;
  font-family: inherit;
  color: var(--ink-900);
  background: #fff;
  outline: none;
  transition: .16s;
  min-width: 0;
}
input:focus, select:focus, textarea:focus { border-color: var(--brand-500); box-shadow: 0 0 0 3px rgba(43, 127, 255, .12); }
textarea { resize: vertical; min-height: 74px; }
.filters .grow { flex: 1 1 200px; min-width: 180px; max-width: 300px; }
.filters input, .filters select { width: 100%; }
/* 筛选栏标签强制一行，避免折行把输入框挤下去 */
.filters .field label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.filters .field { min-width: 0; }
.filters select { min-width: 108px; max-width: 190px; }

.result-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 14px 0; flex-wrap: wrap; color: var(--ink-500); font-size: 13px; }

.pager { display: flex; gap: 6px; justify-content: center; margin: 26px 0 0; flex-wrap: wrap; }
.pager button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  cursor: pointer;
  font-size: 13px;
}
.pager button.active { background: var(--navy-800); color: #fff; border-color: var(--navy-800); }

/* ---------- tables ---------- */
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th, table.data td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.data th { background: #f8fafd; color: var(--ink-700); font-weight: 600; white-space: nowrap; }
table.data tr:hover td { background: #fafcff; }
.table-scroll { overflow-x: auto; }

/* ---------- forms ---------- */
/* 注册：账号类型选择卡（原厂 / 代理商 / 采购商） */
.type-option {
  display: flex; gap: 10px; align-items: flex-start;
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; background: #fff; cursor: pointer; transition: .16s;
}
.type-option:hover { border-color: #c9d8ef; }
.type-option.on { border-color: var(--brand-500); background: var(--brand-100); box-shadow: 0 0 0 3px rgba(43, 127, 255, .10); }
.type-option input { margin-top: 4px; flex: 0 0 auto; }
.type-option b { display: block; font-size: 14px; }
.type-option span.tip { color: var(--ink-500); font-size: 12.5px; line-height: 1.5; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 18px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid label { font-size: 13px; color: var(--ink-700); display: block; margin-bottom: 5px; }
.form-grid label .req { color: var(--red-600); }
.form-grid input, .form-grid select, .form-grid textarea { width: 100%; }
.hint { color: var(--ink-500); font-size: 12px; margin-top: 4px; }

.upload-box {
  border: 1.5px dashed #c3d3ea;
  border-radius: var(--radius);
  padding: 18px;
  text-align: center;
  color: var(--ink-500);
  background: #fbfdff;
  cursor: pointer;
  transition: .18s;
}
.upload-box:hover { border-color: var(--brand-500); background: var(--brand-100); color: var(--brand-600); }
.thumb-list { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.thumb {
  width: 108px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #fff;
  position: relative;
}
.thumb img { width: 100%; height: 76px; object-fit: cover; display: block; }
.thumb .x {
  position: absolute; top: 4px; right: 4px;
  background: rgba(10, 22, 40, .7); color: #fff;
  border: 0; border-radius: 50%; width: 20px; height: 20px; cursor: pointer; line-height: 1;
}
.thumb .cap { font-size: 11px; padding: 3px 5px; color: var(--ink-500); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- brand chips (multi select) ---------- */
.chips { display: flex; gap: 6px; flex-wrap: wrap; padding: 8px; border: 1px solid var(--line); border-radius: var(--radius-sm); min-height: 44px; background: #fff; }
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--brand-100); color: #14509f; border: 1px solid #cfe1ff;
  border-radius: 12px; padding: 2px 8px; font-size: 12.5px;
}
.chip button { border: 0; background: transparent; color: #14509f; cursor: pointer; font-size: 13px; line-height: 1; }

/* ---------- misc ---------- */
.notice { border-radius: var(--radius); padding: 12px 14px; font-size: 13px; border: 1px solid; }
.notice.info { background: var(--brand-100); border-color: #cfe1ff; color: #14509f; }
.notice.warn { background: var(--amber-100); border-color: #f5e3bd; color: #8a5a10; }
.notice.ok { background: var(--green-100); border-color: #c9ecd9; color: #12724a; }
.notice.err { background: var(--red-100); border-color: #f8cfd4; color: #a3242f; }

.empty { text-align: center; color: var(--ink-500); padding: 40px 16px; }
.empty .big { font-size: 30px; margin-bottom: 8px; }

.kv { display: grid; grid-template-columns: 92px 1fr; gap: 6px 12px; font-size: 13.5px; }
.kv dt { color: var(--ink-500); }
.kv dd { margin: 0; color: var(--ink-900); }

.brand-hero { display: flex; gap: 22px; align-items: flex-start; flex-wrap: wrap; }
/* 品牌资料卡：主营产品很长时（半导小芯品类）独占整行并分栏显示，让各模块体量均衡 */
.brand-info .span-all { grid-column: 1 / -1; }
/* 资料卡标题 + 块级「纠错」入口 */
.bf-flag { outline: 2px solid #f0a020 !important; outline-offset: 1px; background: #fffaf0 !important; }
.bf-star { color: #d97706; font-weight: 700; }
.block-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.block-head h3 { flex: 1 1 auto; }
.block-fix { flex: 0 0 auto; background: none; border: 0; padding: 2px 4px; margin-top: -2px;
  color: var(--brand-600); font: inherit; font-size: 12px; cursor: pointer; white-space: nowrap; }
.block-fix:hover { text-decoration: underline; }
/* 品牌归类标签的"展开全部"（用 button 实现，避免误触跳转） */
.tag-toggle { background: none; border: 0; padding: 0 4px; margin: 2px 0; cursor: pointer;
  font: inherit; font-size: 12.5px; color: var(--brand-600); }
.tag-toggle:hover { text-decoration: underline; }
.brand-info.is-long .span-all .block-body { column-count: 2; column-gap: 34px; }
@media (min-width: 1100px) { .brand-info.is-long .span-all .block-body { column-count: 3; } }
@media (max-width: 720px) { .brand-info.is-long .span-all .block-body { column-count: 1; } }
.brand-hero .logo-box {
  width: 128px; height: 128px; border: 1px solid var(--line); border-radius: var(--radius);
  display: grid; place-items: center; background: #fff; padding: 12px; flex: 0 0 auto;
}
.brand-hero .logo-box img { max-width: 100%; max-height: 100%; object-fit: contain; }
.brand-hero h1 { margin: 0 0 8px; font-size: 26px; }
.brand-hero .sub { color: var(--ink-500); margin-bottom: 12px; }

.logo-wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 12px; }
.logo-cell {
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff;
  padding: 10px; text-align: center; transition: .18s;
}
.logo-cell:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
/* 固定框架：logo 框高度固定且图片居中缩放，名字固定两行 —— 各卡片的图标/名字位置尺寸完全一致 */
.logo-cell .lg {
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}
.logo-cell .lg img {
  /* 宽扁 logo（如 407x97）也完整显示：限制最大宽高并保持比例，不裁切 */
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 46px;
  object-fit: contain;
}
.logo-cell .lg .ph {
  color: var(--ink-300);
  font-size: 16px;
  font-weight: 700;
}
.logo-cell .no-logo {
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  color: var(--ink-300);
  font-size: 16px;
  font-weight: 700;
  background: #f6f8fc;
  border-radius: 6px;
}
.logo-cell .nm {
  font-size: 12.5px;
  color: var(--ink-700);
  line-height: 1.35;
  height: 34px;                /* 固定两行高度，名字长短不影响卡片高度 */
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: break-word;
}

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; flex-wrap: wrap; }
.tabs button {
  border: 0; background: transparent; padding: 10px 16px; cursor: pointer;
  font-size: 14px; color: var(--ink-500); border-bottom: 2px solid transparent;
}
.tabs button.active { color: var(--brand-600); border-bottom-color: var(--brand-600); font-weight: 600; }

.panel { display: none; }
.panel.active { display: block; }

/* ---------- datasheet embed ---------- */
.embed-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.embed-card { display: flex; flex-direction: column; overflow: hidden; }
.embed-card .head {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line);
  background: #f8fafd;
}
.embed-card .head .ttl { font-weight: 700; font-size: 14.5px; }
.embed-card .head .tag { font-size: 11.5px; color: var(--ink-500); }
.embed-card .body { padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.embed-card .body .row { display: flex; gap: 8px; }
.embed-card .body input { flex: 1; }
.embed-frame { width: 100%; height: 520px; border: 0; border-top: 1px solid var(--line); background: #fff; }
.embed-placeholder {
  height: 520px; display: grid; place-items: center; text-align: center; color: var(--ink-500);
  background: repeating-linear-gradient(45deg, #fbfdff, #fbfdff 12px, #f4f8fd 12px, #f4f8fd 24px);
  padding: 24px;
}

/* ---------- status pills ---------- */
.status { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; }
.status.pending { color: var(--amber-600); }
.status.approved { color: var(--green-600); }
.status.rejected { color: var(--red-600); }

/* ---------- modal ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(8, 18, 32, .6);
  display: none; align-items: center; justify-content: center; z-index: 100; padding: 20px;
}
.modal-mask.show { display: flex; }
.modal {
  background: #fff; border-radius: var(--radius); max-width: 640px; width: 100%;
  max-height: 86vh; overflow: auto; box-shadow: var(--shadow-lg);
}
.modal .modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal .modal-head h3 { margin: 0; font-size: 16px; }
.modal .modal-body { padding: 18px; }
.modal .modal-foot { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }
.modal img.cert { width: 100%; border: 1px solid var(--line); border-radius: var(--radius-sm); }

/* ---------- 代理证查看（弹窗内图片 + 点击放大） ---------- */
.modal .cert-figure { margin: 0 0 16px; }
.modal .cert-figure figcaption { font-size: 13px; color: var(--ink-600); margin-bottom: 6px; }
.modal img.cert { cursor: zoom-in; display: block; }
.modal img.cert.loading { min-height: 120px; background: #f4f7fc; }

/* ---------- 图片放大（灯箱） ---------- */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 400;
  background: rgba(8, 15, 30, .82);
  padding: 18px;
  overflow: auto;
}
.lightbox.show { display: block; }
.lightbox-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
  color: #dce7f7;
  margin-bottom: 10px;
}
.lightbox-cap { margin-right: auto; font-size: 13.5px; color: #b9cbe6; }
.lightbox-img {
  display: block;
  max-width: min(1100px, 96vw);
  margin: 0 auto 24px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .45);
  cursor: zoom-out;
}

/* ---------- 左侧悬浮分类导航（固定在最左边，鼠标移上去展开，类似半导小芯） ---------- */
.cat-float {
  position: fixed;
  left: 0;
  top: 152px;
  z-index: 60;
  display: flex;
  align-items: flex-start;
}
.cat-float-tab {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 18px;
  height: 118px;
  overflow: hidden;
  background: linear-gradient(135deg, #e8453c, #d1352c);
  color: #fff;
  font-weight: 700;
  font-size: 13.5px;
  font-family: inherit;
  border: 0;
  cursor: pointer;
  padding: 0;
  border-radius: 0 10px 10px 0;
  box-shadow: 0 8px 22px rgba(209, 53, 44, .28);
  transition: width .18s ease;
}
/* 平时只露一条细红条（半隐藏）；悬停展开时才显示文字 */
.cat-float-icon {
  flex: 0 0 18px;
  text-align: center;
  font-size: 11px;
  line-height: 1;
  opacity: .92;
}
.cat-float-text {
  display: none;
  white-space: nowrap;
  padding-right: 14px;
  letter-spacing: .5px;
}
.cat-float.open .cat-float-tab,
.cat-float:hover .cat-float-tab { width: auto; }
.cat-float.open .cat-float-text,
.cat-float:hover .cat-float-text { display: inline; }
.cat-float.open .cat-float-icon,
.cat-float:hover .cat-float-icon {
  transform: rotate(180deg);
  transition: transform .18s ease;
}
.cat-float-panel {
  display: none;
  gap: 8px;
  padding-left: 8px;
  position: relative;
}
.cat-float-close {
  position: absolute; top: -6px; right: -4px; z-index: 3;
  width: 22px; height: 22px; line-height: 1; border-radius: 11px;
  border: 1px solid var(--line); background: #fff; color: var(--ink-500);
  cursor: pointer; box-shadow: var(--shadow-md);
}
.cat-float-close:hover { color: var(--brand-600); border-color: var(--brand-600); }
.cat-float.open .cat-float-panel { display: flex; }
.cat-col {
  display: none;
  width: 168px;
  max-height: 64vh;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 0 10px 10px 0;
  box-shadow: var(--shadow-md);
  padding: 8px;
}
.cat-col.show { display: block; }
.cat-col:first-child { border-radius: 0 10px 10px 0; }
.cat-col + .cat-col { border-radius: 10px; }
.cat-col-head {
  font-size: 12px; color: var(--ink-500);
  padding: 4px 6px 8px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 6px;
}
.cat-kind, .cat-group, .cat-tag {
  display: flex; align-items: center; gap: 6px;
  width: 100%; text-align: left;
  background: transparent; border: 0; cursor: pointer;
  font-family: inherit; font-size: 13px; color: var(--ink-700);
  padding: 7px 8px; border-radius: 6px;
}
.cat-kind { font-size: 13.5px; font-weight: 600; }
.cat-kind:hover, .cat-group:hover, .cat-tag:hover { background: var(--brand-100); color: var(--brand-600); }
.cat-kind.active, .cat-group.active, .cat-tag.active { background: var(--brand-100); color: var(--brand-600); font-weight: 700; }
.cat-kind b, .cat-group b, .cat-tag b { margin-left: auto; font-weight: 500; font-size: 11.5px; color: var(--ink-300); }
/* 新树四层导航：第三列里「二级分组」是可点的整族筛选，三阶缩进排在它下面 */
.cat-sub { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  background: none; border: 0; padding: 7px 8px 3px; font: inherit; font-weight: 700;
  color: var(--ink-700, #374151); cursor: pointer; }
.cat-search-input {
  width: 100%; box-sizing: border-box; padding: 7px 8px;
  border: 1px solid var(--line); border-radius: 6px;
  font-size: 12.5px; font-family: inherit;
}
.cat-search-input:focus { outline: 0; border-color: var(--brand-500); }
.cat-search-results { margin-top: 6px; }
.cat-search-item {
  display: block; width: 100%; text-align: left;
  border: 0; border-bottom: 1px dashed var(--line);
  background: none; padding: 7px 5px; font-size: 12px;
  color: var(--ink-700); cursor: pointer; line-height: 1.45;
}
.cat-search-item:hover { color: var(--brand-600); background: var(--brand-100); }
.cat-search-path { display: block; }
.cat-lv4 { font-size: 12px; }
.cat-sub:hover, .cat-sub.active { color: var(--brand-600); }
.cat-sub b { margin-left: auto; font-weight: 500; font-size: 11.5px; color: var(--ink-300); }
.cat-tag.cat-lv3 { padding-left: 18px; }
/* 三阶列：固定最小高度 + 翻页器钉在底部 —— 翻页时整列高度和翻页条位置都不跳 */
#catf-tags { display: flex; flex-direction: column; min-height: 336px; }
#catf-tags > .cat-col-head, #catf-tags > .cat-sub, #catf-tags > .cat-tag { flex: 0 0 auto; }
#catf-tags > .cat-page { margin-top: auto; }
/* 四阶列：与三阶一样分页，翻页条固定在列底部 */
#catf-level4 { display: none; flex-direction: column; min-height: 336px; }
#catf-level4.show { display: flex; }
#catf-level4 > .cat-col-head, #catf-level4 > .cat-sub, #catf-level4 > .cat-tag { flex: 0 0 auto; }
#catf-level4 > .cat-page { margin-top: auto; }
.cat-page { display: flex; align-items: center; gap: 6px; padding: 6px 8px 8px 18px; }
.cat-page-btn { border: 1px solid #e5e7eb; background: #fff; border-radius: 6px; width: 22px; height: 22px;
  line-height: 1; cursor: pointer; color: #374151; }
.cat-page-btn:hover { border-color: var(--brand-600, #b91c1c); color: var(--brand-600, #b91c1c); }
.cat-page-info { font-size: 11.5px; color: #6b7280; }
.cat-kind i { font-style: normal; color: var(--ink-300); }
.cat-empty { padding: 10px 8px; color: var(--ink-300); font-size: 12.5px; }

/* ---------- 产品品类级联选择器（品牌入驻表单用，和左侧悬浮导航同款样式） ---------- */
.cat-picker { position: relative; }
.cat-picker-field {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; text-align: left; cursor: pointer;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 10px 12px; font-family: inherit; font-size: 14px; color: var(--ink-700);
}
.cat-picker-field:hover { border-color: var(--brand-500); }
.cat-picker.open .cat-picker-field { border-color: var(--brand-500); }
.cat-picker-field i { font-style: normal; color: var(--ink-300); }
.cat-picker-panel {
  display: none;
  position: absolute; left: 0; top: calc(100% + 6px);
  gap: 8px; z-index: 80;
  max-width: 100%;
  overflow-x: auto;
}
.cat-picker.open .cat-picker-panel { display: flex; }
.cat-picker-panel .cat-col { width: 176px; background: #fff; }
.cat-picker-panel .cat-col.show { display: block; }
.cat-tag .tick { flex: 0 0 12px; color: var(--brand-600); font-size: 12px; }
/* 阶梯列底部"新增"输入框 */
.cat-new-inline { margin-top: 8px; padding: 6px 4px 0; border-top: 1px dashed var(--line); }
.cat-new-inline input { width: 100%; font-size: 12.5px; padding: 6px 8px; }

/* 品类申请新增：放在选择框下方（不再挤进左侧分类列） */
.cat-new-apply {
  margin-top: 12px;
  padding: 12px 14px 10px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  background: #fbfdff;
}
.cat-new-apply-head { font-size: 13.5px; color: var(--ink-700); margin-bottom: 10px; }
.cat-new-apply-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1fr auto;
  gap: 10px;
  align-items: end;
}
.cat-new-apply-grid label { display: block; margin-bottom: 4px; }
.cat-new-apply-grid select,
.cat-new-apply-grid input { width: 100%; }
.cat-new-apply-btn { padding-bottom: 1px; }
@media (max-width: 900px) {
  .cat-new-apply-grid { grid-template-columns: 1fr; }
}
/* 窄屏浮标收成一条竖标签，面板贴左侧、可横向滚动 */
@media (max-width: 900px) {
  .cat-float { top: 120px; max-width: 100vw; }
  .cat-float-tab { height: 96px; }
  .cat-float-panel { overflow-x: auto; padding-right: 8px; }
  .cat-col { width: 148px; }
}

/* 代理证缩略图（本地待上传图片）可点击放大 */
.thumb { cursor: zoom-in; }

/* 渠道展示：代理商名称（点击查看其全部代理线） */
.agent-name {
  background: transparent;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
  font-family: inherit;
  font-size: 15.5px;
  font-weight: 700;
  color: var(--brand-600);
  text-align: left;
  border-bottom: 1px dashed rgba(22, 103, 209, .45);
  line-height: 1.5;
}
.agent-name:hover { color: var(--navy-700); border-bottom-color: var(--navy-700); }
.thumb.pdf { cursor: pointer; }
.thumb .file-icon {
  height: 76px; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; color: #b3261e; background: #fdf1f0; letter-spacing: .5px;
}

/* ---------- 代理证 PDF 预览 ---------- */
.modal iframe.cert-pdf {
  width: 100%; height: 560px; display: block;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff;
}
.file-card {
  padding: 18px; border: 1px dashed var(--line); border-radius: var(--radius-sm);
  background: #fbfdff; color: var(--ink-600);
}

/* ---------- footer ---------- */
.site-footer {
  background: var(--navy-900);
  color: #9db4d2;
  padding: 34px 0 26px;
  margin-top: 40px;
  font-size: 13px;
}
.site-footer .cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 22px; }
.site-footer h4 { color: #fff; font-size: 14px; margin: 0 0 10px; }
.site-footer a { color: #9db4d2; display: block; padding: 3px 0; }
.site-footer a:hover { color: #fff; }
.site-footer .copy { border-top: 1px solid rgba(255, 255, 255, .12); margin-top: 24px; padding-top: 16px; color: #7b93b3; }

/* ---------- toast ---------- */
#toast {
  position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%) translateY(20px);
  background: var(--navy-900); color: #fff; padding: 11px 20px; border-radius: 22px;
  box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transition: .24s; z-index: 200; font-size: 13.5px;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.err { background: var(--red-600); }
#toast.ok { background: var(--green-600); }

/* ---------- responsive ---------- */
/* 窄屏兜底：收回求购框右侧 51px 外探，恢复正常两栏 */
@media (max-width: 1360px) {
  .hero-grid { gap: 26px; }
  .hero-main { flex: 1 1 auto; }
  .hero-rfq { flex: 0 1 700px; min-width: 0; margin-top: 0; }
  .rfq-marquee { width: 100%; max-width: 700px; }
  .rfq-all-btn { align-self: center; }
}
@media (max-width: 1080px) {
  .grid.cols-4 { grid-template-columns: repeat(3, 1fr); }
  .embed-grid { grid-template-columns: 1fr; }
  .site-footer .cols { grid-template-columns: 1fr 1fr; }
  /* hero 标语换行：竖排改为横排，整体居中排在内容下方 */
  .hero-grid { flex-direction: column; align-items: center; gap: 26px; }
  .hero-main { width: 100%; }
  .hero-rfq { width: 100%; }
  .hero-brush { font-size: 32px; letter-spacing: 6px; line-height: 1.3; margin-top: 26px; }
  .rfq-marquee { max-width: 100%; }
}
@media (max-width: 820px) {
  .nav { display: none; }
  .header-search input { width: 110px; }
  .grid.cols-3, .grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
  .hero-title { font-size: 25px; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
}
/* 跑马灯在窄屏只保留最关键的三列：品牌 ｜ 型号 ｜ 数量，
   封装与年份点进详情页看，避免五列挤在一起露出框外 */
@media (max-width: 760px) {
  /* 关键：flex 子项默认 min-width:auto 会被内容撑开，
     这里统一放开，避免搜索框和求购框把整页撑出屏幕。 */
  .hero-main,
  .hero-rfq { min-width: 0; max-width: 100%; }
  .hero-search { max-width: 100%; }
  .hero-search input { min-width: 0; }
  .rfq-marquee {
    width: 100%;
    max-width: 100%;
  }
  .rfq-marquee .item {
    grid-template-columns: 100px minmax(0, 1fr) 84px;
    min-width: 0;
    gap: 6px;
    padding: 0 8px;
    font-size: 11.5px;
  }
  .rfq-marquee .item > span:nth-child(3),
  .rfq-marquee .item > span:nth-child(5) { display: none; }
  .rfq-marquee .item .brand .bl { flex: 0 0 18px; width: 18px; height: 18px; }
}
@media (max-width: 560px) {
  .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; }
  .site-footer .cols { grid-template-columns: 1fr; }
  .brand-hero .logo-box { width: 96px; height: 96px; }
}
