:root {
  --bg: #0f172a;
  --bg-soft: #1e293b;
  --panel: #ffffff;
  --ink: #1e293b;
  --ink-soft: #64748b;
  --line: #e2e8f0;
  --brand: #1e6fb8;
  --brand-d: #15487a;
  --accent: #0ea5a4;
  --warn: #d97706;
  --ok: #16a34a;
  --danger: #dc2626;
  --radius: 10px;
  --shadow: 0 2px 10px rgba(15,23,42,.06);
  --maxw: 1240px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", "Hiragino Sans GB", Arial, sans-serif;
  color: var(--ink);
  background: #f1f5f9;
  line-height: 1.55;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--ink-soft); }
.container { max-width: var(--maxw); margin: 0 auto; padding: 20px 18px 60px; }

/* Topbar */
.topbar {
  display: flex; align-items: center; gap: 18px;
  background: linear-gradient(120deg, #14304d, #1e6fb8);
  color: #fff; padding: 0 22px; height: 60px; position: sticky; top: 0; z-index: 50;
  box-shadow: 0 2px 12px rgba(0,0,0,.18);
}
.brand { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.logo {
  width: 38px; height: 38px; border-radius: 9px; background: #fff; color: var(--brand-d);
  display: grid; place-items: center; font-size: 22px; font-weight: 700;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-size: 17px; }
.brand-text small { font-size: 11px; opacity: .8; }
.nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.nav a {
  color: #e6f0fb; padding: 8px 12px; border-radius: 7px; font-size: 14px; font-weight: 500;
}
.nav a:hover { background: rgba(255,255,255,.14); text-decoration: none; }
.nav a.active { background: #fff; color: var(--brand-d); }
.nav-right { margin-left: auto; }
.compare-badge {
  background: rgba(255,255,255,.16); padding: 6px 12px; border-radius: 20px; font-size: 13px; cursor: pointer;
}
.compare-badge b { color: #ffe08a; }

/* Hero */
.hero {
  background: linear-gradient(120deg, #14304d, #1e6fb8 70%, #0ea5a4);
  color: #fff; border-radius: 16px; padding: 34px 30px; margin-bottom: 22px;
  box-shadow: var(--shadow);
}
.hero h1 { margin: 0 0 6px; font-size: 26px; }
.hero p { margin: 0 0 18px; opacity: .9; }
.searchbox { display: flex; gap: 10px; max-width: 760px; }
.searchbox input {
  flex: 1; padding: 13px 16px; border: none; border-radius: 10px; font-size: 15px; outline: none;
}
.searchbox button {
  padding: 0 26px; border: none; border-radius: 10px; background: #ffd166; color: #14304d;
  font-weight: 700; font-size: 15px; cursor: pointer;
}
.searchbox button:hover { background: #ffdd85; }

/* Stat cards */
.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 26px; }
.stat {
  background: var(--panel); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow);
  text-align: center; border-top: 3px solid var(--brand);
}
.stat .num { font-size: 26px; font-weight: 700; color: var(--brand-d); }
.stat .label { font-size: 13px; color: var(--ink-soft); margin-top: 4px; }

/* Section title */
.section-title { display: flex; align-items: center; justify-content: space-between; margin: 26px 0 14px; }
.section-title h2 { font-size: 19px; margin: 0; }
.section-title a { font-size: 13px; }

/* Chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  background: var(--panel); border: 1px solid var(--line); padding: 7px 14px; border-radius: 20px;
  font-size: 13px; cursor: pointer; box-shadow: var(--shadow);
}
.chip:hover { border-color: var(--brand); color: var(--brand); }

/* Material list / table */
.grid-materials { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.mcard {
  background: var(--panel); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow);
  border-left: 3px solid var(--brand); cursor: pointer; transition: .15s;
}
.mcard:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(15,23,42,.12); }
.mcard h3 { margin: 0 0 6px; font-size: 16px; }
.mcard .meta { font-size: 12.5px; color: var(--ink-soft); display: flex; flex-wrap: wrap; gap: 6px 14px; }
.tag { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; padding: 1px 8px; border-radius: 10px; }
.tag.yc { background: #fef3c7; color: #b45309; }
.tag.orig { background: #dbeafe; color: #1d4ed8; }

/* Filters */
.filters { background: var(--panel); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); margin-bottom: 18px; }
.filter-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: 12px; color: var(--ink-soft); }
.field input, .field select {
  padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; min-width: 160px; background: #fff;
}
.btn {
  padding: 9px 18px; border: none; border-radius: 8px; background: var(--brand); color: #fff;
  font-size: 14px; cursor: pointer; font-weight: 600;
}
.btn:hover { background: var(--brand-d); }
.btn.ghost { background: #eef2f7; color: var(--ink); }
.btn.ghost:hover { background: #e2e8f0; }
.btn.accent { background: var(--accent); }
.btn.sm { padding: 5px 11px; font-size: 12.5px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn:disabled:hover { background: var(--accent); }
.btn.ghost:disabled:hover { background: #eef2f7; }
/* 对比工具组：紧跟查询/重置，靠右成组，便于查找 */
.cmp-tools { margin-left: auto; display: inline-flex; gap: 8px; align-items: flex-end;
  padding-left: 12px; border-left: 1px dashed var(--line); }
@media (max-width: 640px) { .cmp-tools { margin-left: 0; border-left: none; padding-left: 0; width: 100%; } }

/* Table */
table.data { width: 100%; border-collapse: collapse; background: var(--panel); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
table.data th, table.data td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--line); font-size: 13.5px; }
table.data th { background: #f8fafc; color: var(--ink-soft); font-weight: 600; white-space: nowrap; }
table.data tr:hover td { background: #f8fbff; }
.name-cell { font-weight: 600; color: var(--brand-d); cursor: pointer; }

/* Pagination */
.pager { display: flex; gap: 8px; align-items: center; justify-content: center; margin: 22px 0; flex-wrap: wrap; }
.pager button { padding: 7px 13px; border: 1px solid var(--line); background: #fff; border-radius: 8px; cursor: pointer; }
.pager button[disabled] { opacity: .4; cursor: not-allowed; }
.pager .cur { background: var(--brand); color: #fff; border-color: var(--brand); }

/* Detail */
.detail-head { background: var(--panel); border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow); margin-bottom: 18px; }
.detail-head h1 { margin: 0 0 8px; font-size: 24px; }
.badges { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.badge { background: #eef2f7; padding: 4px 11px; border-radius: 7px; font-size: 12.5px; }
.detail-desc { color: #475569; margin-top: 10px; font-size: 14px; }

.tabs { display: flex; gap: 6px; border-bottom: 2px solid var(--line); margin-bottom: 16px; flex-wrap: wrap; }
.tab { padding: 9px 16px; cursor: pointer; font-size: 14px; color: var(--ink-soft); border-bottom: 2px solid transparent; margin-bottom: -2px; }
.tab.active { color: var(--brand-d); border-bottom-color: var(--brand); font-weight: 600; }

.prop-section { background: var(--panel); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 14px; box-shadow: var(--shadow); }
.prop-section h3 { margin: 0 0 10px; font-size: 15px; color: var(--brand-d); border-left: 3px solid var(--accent); padding-left: 9px; }
table.props { width: 100%; border-collapse: separate; border-spacing: 0; }
table.props thead { position: sticky; top: 0; z-index: 1; }
table.props thead th { background: linear-gradient(180deg, #2b5ab3, #1c4594); color: #fff; padding: 9px 10px; font-size: 13px; font-weight: 600; text-align: left; border-right: 1px solid rgba(255,255,255,.15); }
table.props thead th:last-child { border-right: 0; }
table.props tbody td { padding: 8px 10px; border-bottom: 1px solid #f1f5f9; font-size: 13px; vertical-align: top; }
table.props tbody tr:nth-child(even) { background: #f8fafc; }
table.props td.pn { width: 36%; color: #334155; }
table.props td.pn strong { font-weight: 600; }
table.props td.pc { padding: 2px 0 0; color: #64748b; font-size: 11.5px; font-weight: 400; line-height: 1.3; }
table.props td.pn .pe { padding: 1px 0 0; color: #94a3b8; font-size: 11px; font-weight: 400; line-height: 1.3; }
table.props td.pv { width: 22%; color: var(--brand-d); font-weight: 600; }
table.props td.pu { width: 14%; color: #334155; }
table.props td.ps { width: 28%; color: #334155; }

@media (max-width: 720px) {
  table.props td.pn { width: 34%; }
  table.props td.pv { width: 22%; }
  table.props td.pu { width: 16%; }
  table.props td.ps { width: 28%; }
  table.props thead th, table.props tbody td { padding: 7px 8px; font-size: 12px; }
}

.file-list { display: flex; flex-wrap: wrap; gap: 10px; }
.file-card {
  display: flex; align-items: center; gap: 8px; background: #f8fafc; border: 1px solid var(--line);
  padding: 10px 14px; border-radius: 9px; cursor: pointer; max-width: 360px;
}
.file-card:hover { border-color: var(--brand); }
.file-card .ic { font-size: 18px; }
.file-card .nm { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Vendors */
.vendor-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px,1fr)); gap: 14px; }
.vcard { background: var(--panel); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); cursor: pointer; text-align: center; border: 1px solid var(--line); }
.vcard:hover { border-color: var(--brand); }
.vcard .vlogo { width: 64px; height: 64px; object-fit: contain; margin: 0 auto 8px; }
.vcard .vname { font-weight: 600; font-size: 14px; }

/* Selection builder */
.cond-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; background: #f8fafc; border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; margin-bottom: 10px; }
.cond-row select, .cond-row input { padding: 7px 9px; border: 1px solid var(--line); border-radius: 7px; font-size: 13px; }
.cond-row .op { width: 90px; }
.cond-row .val { width: 110px; }
.cond-row .unit { width: 90px; }
.cond-row .rm { color: var(--danger); cursor: pointer; font-weight: 700; padding: 4px 8px; }
.cond-row .en-name { font-size: 11px; color: var(--ink-soft); margin-left: 4px; }

/* Compare table */
.cmp-wrap { overflow-x: auto; background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); padding: 4px; }
table.cmp { border-collapse: collapse; width: 100%; min-width: 600px; }
table.cmp th, table.cmp td { border: 1px solid var(--line); padding: 9px 11px; font-size: 12.8px; vertical-align: top; }
table.cmp thead th { background: var(--brand-d); color: #fff; position: sticky; top: 0; }
table.cmp tbody th { background: #f8fafc; text-align: left; color: #334155; font-weight: 600; white-space: nowrap; }
table.cmp td.hl { background: #eff6ff; }

/* Articles */
.article-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px,1fr)); gap: 16px; }
.acard { background: var(--panel); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); cursor: pointer; }
.acard img { width: 100%; height: 150px; object-fit: cover; background: #e2e8f0; }
.acard .body { padding: 12px 14px; }
.acard .body h3 { margin: 0 0 6px; font-size: 15px; }
.acard .body .date { font-size: 12px; color: var(--ink-soft); }
.article-detail { background: var(--panel); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); max-width: 860px; margin: 0 auto; }
.article-detail img.thumb { width: 100%; max-height: 320px; object-fit: cover; border-radius: 10px; margin-bottom: 16px; }
.article-detail h1 { margin: 0 0 8px; }
.article-detail .content { font-size: 14.5px; color: #334155; line-height: 1.8; }
.article-detail .content img { max-width: 100%; }

/* Toast */
.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: #14304d; color: #fff; padding: 11px 20px; border-radius: 10px; font-size: 14px;
  opacity: 0; pointer-events: none; transition: .25s; z-index: 200;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Modal */
.modal-mask { position: fixed; inset: 0; background: rgba(15,23,42,.7); display: grid; place-items: center; z-index: 300; padding: 24px; }
.modal { background: #fff; border-radius: 12px; width: min(960px, 96vw); height: min(88vh, 900px); display: flex; flex-direction: column; overflow: hidden; }
.modal header { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.modal header h3 { margin: 0; font-size: 15px; }
.modal .x { cursor: pointer; font-size: 20px; color: var(--ink-soft); border: none; background: none; }
.modal iframe { flex: 1; width: 100%; border: none; }

.empty { text-align: center; color: var(--ink-soft); padding: 50px 0; }
.center-loading { text-align: center; padding: 60px 0; color: var(--ink-soft); }

.footer { text-align: center; color: var(--ink-soft); font-size: 12.5px; padding: 26px 16px; border-top: 1px solid var(--line); margin-top: 30px; }
.footer .muted { margin-top: 4px; font-size: 11.5px; }
.footer .copyright { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--line); font-size: 11.5px; color: var(--ink-soft); }
.footer .copyright a { color: var(--ink-soft); text-decoration: none; }
.footer .copyright a:hover { text-decoration: underline; }

/* ============ combobox 模糊智能搜索下拉 ============ */
.cbx { position: relative; display: inline-block; width: 200px; }
.field > .cbx { width: 100%; }
.cbx-input { position: relative; }
.cbx-input input { width: 100%; padding: 9px 30px 9px 11px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; background: #fff; box-sizing: border-box; }
.cbx-input input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(30,111,184,.12); }
.cbx-clear { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; display: none; align-items: center; justify-content: center; border-radius: 50%; background: #e2e8f0; color: #64748b; font-size: 13px; line-height: 1; cursor: pointer; }
.cbx-clear:hover { background: #cbd5e1; }
.cbx-panel { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 60; max-height: 264px; overflow: auto; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(15,23,42,.14); text-align: left; }
.cbx-opt { padding: 8px 11px; cursor: pointer; font-size: 14px; display: flex; flex-direction: column; gap: 1px; }
.cbx-opt:hover, .cbx-opt.on { background: #eef6ff; }
.cbx-opt .cbx-sub { font-size: 11.5px; color: var(--ink-soft); }
.cbx-opt.cbx-custom { color: var(--brand); font-style: italic; }
.cbx-empty .cbx-l, .cbx-none { color: var(--ink-soft); font-size: 13px; }
.cbx-none { padding: 8px 11px; }

/* ============ 品牌厂商页检索框 ============ */
.brand-search { display: flex; gap: 12px; align-items: flex-end; background: var(--panel); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); margin-bottom: 22px; }
.brand-search .field { margin: 0; }
.brand-search .btn { height: 40px; }
@media (max-width: 640px) { .brand-search { flex-wrap: wrap; } .brand-search .btn { width: 100%; } }

@media (max-width: 900px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .grid-materials { grid-template-columns: 1fr; }
  .nav { display: none; }
}
