/* 标小查 - 商标智能检索系统 样式 */
:root {
  --brand: #1a56a8;
  --brand-2: #2f6fd0;
  --brand-soft: #eaf1fb;
  --ink: #1c2430;
  --ink-2: #4a5563;
  --ink-3: #7c8798;
  --line: #e2e7ef;
  --bg: #f5f7fa;
  --card: #ffffff;
  --ok: #1a7f52;
  --warn: #b7791f;
  --info: #2b6cb0;
  --danger: #c0392b;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(20, 30, 50, .08), 0 6px 18px rgba(20, 30, 50, .05);
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
}

.wrap { max-width: 1280px; margin: 0 auto; padding: 0 20px; }
.hidden { display: none !important; }

/* ---------- 顶栏 ---------- */
.topbar {
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 30;
}
.topbar-inner { display: flex; align-items: center; gap: 24px; height: 62px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 8px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff; font-weight: 700; font-size: 20px;
  display: flex; align-items: center; justify-content: center;
  letter-spacing: 0;
}
.brand-text strong { display: block; font-size: 17px; letter-spacing: .5px; }
.brand-text small { color: var(--ink-3); font-size: 12px; }

.nav { display: flex; gap: 4px; margin-left: auto; }
.nav-btn {
  border: 0; background: transparent; cursor: pointer;
  padding: 8px 14px; border-radius: 8px; font-size: 14px; color: var(--ink-2);
  font-family: inherit;
}
.nav-btn:hover { background: var(--brand-soft); color: var(--brand); }
.nav-btn.active { background: var(--brand); color: #fff; }

/* ---------- 面板 ---------- */
main { padding-top: 22px; padding-bottom: 40px; min-height: 60vh; }
.panel { animation: fade .18s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.search-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: var(--shadow);
}
.row { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 14px; }
.row:last-of-type { margin-bottom: 0; }
.fld { display: flex; flex-direction: column; gap: 5px; min-width: 150px; }
.fld.grow { flex: 1 1 260px; }
.fld.btns { flex-direction: row; align-items: flex-end; gap: 10px; min-width: auto; }
.lbl { font-size: 12px; color: var(--ink-3); }
.lbl b { color: var(--brand); }

input[type=text], input[type=date], select {
  height: 38px; padding: 0 10px; border: 1px solid var(--line);
  border-radius: 8px; background: #fff; color: var(--ink);
  font-size: 14px; font-family: inherit; outline: none; width: 100%;
}
input[type=text]:focus, input[type=date]:focus, select:focus {
  border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(47, 111, 208, .12);
}
input[type=range] { height: 38px; }

.btn {
  height: 38px; padding: 0 20px; border-radius: 8px; border: 1px solid var(--line);
  background: #fff; color: var(--ink-2); cursor: pointer; font-size: 14px;
  font-family: inherit; white-space: nowrap;
}
.btn:hover { border-color: var(--brand-2); color: var(--brand); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-2); color: #fff; }
.btn.ghost { background: #fff; }
.btn.tiny { height: 28px; padding: 0 10px; font-size: 12px; }

.tip { margin: 12px 0 0; font-size: 12px; color: var(--ink-3); line-height: 1.7; }
.tip b { color: var(--ink-2); }
.sec-title { margin: 0 0 12px; font-size: 15px; display: flex; align-items: center; gap: 10px; }

/* ---------- 结果区 ---------- */
.result { margin-top: 18px; }
.res-head {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-bottom: 10px; color: var(--ink-2); font-size: 13px;
}
.res-head .count { font-size: 15px; color: var(--ink); font-weight: 600; }
.res-head .count b { color: var(--brand); }
.res-head .took { color: var(--ink-3); }

.card-box {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.tbl th {
  background: #f8fafc; text-align: left; padding: 10px 12px; font-weight: 600;
  color: var(--ink-2); border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.tbl td { padding: 10px 12px; border-bottom: 1px solid #f0f3f7; vertical-align: top; }
table.tbl tr:last-child td { border-bottom: 0; }
table.tbl tbody tr:hover { background: #fafcff; }

.tm-name { font-weight: 600; color: var(--ink); }
.regno-link { color: var(--brand); cursor: pointer; font-weight: 600; }
.regno-link:hover { text-decoration: underline; }
.muted { color: var(--ink-3); }
.ellip { display: block; max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.chip {
  display: inline-block; padding: 1px 7px; border-radius: 4px; font-size: 12px;
  background: #eef2f7; color: var(--ink-2); margin-right: 4px;
}
.chip.cls { background: var(--brand-soft); color: var(--brand); }
.chip.ok { background: #e6f4ec; color: var(--ok); }
.chip.warn { background: #fdf3e2; color: var(--warn); }
.chip.info { background: #e8f0fb; color: var(--info); }
.chip.muted { background: #eef1f5; color: var(--ink-3); }
.chip.famous { background: #fdecea; color: var(--danger); }

.score { font-weight: 700; font-size: 14px; }
.score.high { color: var(--danger); }
.score.mid { color: var(--warn); }
.score.low { color: var(--info); }

.empty {
  background: var(--card); border: 1px dashed var(--line); border-radius: var(--radius);
  padding: 46px 20px; text-align: center; color: var(--ink-3);
}
.err { color: var(--danger); }

.pager { display: flex; justify-content: center; align-items: center; gap: 8px; padding: 14px; }
.pager button {
  min-width: 34px; height: 32px; padding: 0 10px; border: 1px solid var(--line);
  background: #fff; border-radius: 6px; cursor: pointer; color: var(--ink-2); font-family: inherit;
}
.pager button:hover:not(:disabled) { border-color: var(--brand-2); color: var(--brand); }
.pager button.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.pager button:disabled { opacity: .45; cursor: default; }
.pager .pg-info { color: var(--ink-3); font-size: 13px; margin-left: 6px; }

/* ---------- 机构 / 代理卡片 ---------- */
.list-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; margin-bottom: 10px; box-shadow: var(--shadow);
  display: flex; align-items: flex-start; gap: 14px;
}
.list-card .lc-main { flex: 1; min-width: 0; }
.list-card .lc-title { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.list-card .lc-sub { color: var(--ink-3); font-size: 13px; }
.list-card .lc-num {
  text-align: right; min-width: 90px;
}
.list-card .lc-num b { display: block; font-size: 20px; color: var(--brand); line-height: 1.2; }
.list-card .lc-num span { font-size: 12px; color: var(--ink-3); }
.class-pills { margin-top: 6px; }
.class-pills span {
  display: inline-block; font-size: 12px; padding: 1px 6px; margin: 2px 4px 2px 0;
  background: var(--brand-soft); color: var(--brand); border-radius: 4px;
}

/* ---------- 分类宫格 ---------- */
.class-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 10px; }
.class-cell {
  background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px;
  cursor: pointer; display: flex; align-items: center; gap: 10px; transition: .15s;
}
.class-cell:hover { border-color: var(--brand-2); box-shadow: var(--shadow); transform: translateY(-1px); }
.class-cell .cc-no {
  width: 34px; height: 34px; flex: 0 0 34px; border-radius: 6px; background: var(--brand-soft);
  color: var(--brand); font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.class-cell .cc-name { font-weight: 600; }
.class-cell .cc-cnt { font-size: 12px; color: var(--ink-3); }

.group-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.group-cell {
  background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px;
  cursor: pointer; display: flex; justify-content: space-between; align-items: center;
}
.group-cell:hover { border-color: var(--brand-2); color: var(--brand); }
.group-cell b { font-family: Consolas, monospace; }
.group-cell span { font-size: 12px; color: var(--ink-3); }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(18, 26, 38, .45); z-index: 60;
  display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px;
  overflow: auto;
}
.modal {
  background: #fff; border-radius: 12px; width: 100%; max-width: 940px;
  box-shadow: 0 20px 60px rgba(15, 25, 40, .3); animation: fade .18s ease;
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; border-bottom: 1px solid var(--line);
}
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-close { border: 0; background: transparent; font-size: 26px; cursor: pointer; color: var(--ink-3); line-height: 1; }
.modal-close:hover { color: var(--ink); }
.modal-body { padding: 18px 20px 24px; }

.dt-top { display: flex; gap: 18px; flex-wrap: wrap; }
.dt-img {
  width: 190px; flex: 0 0 190px; border: 1px solid var(--line); border-radius: 8px;
  background: #fafbfc; display: flex; align-items: center; justify-content: center;
  padding: 8px; min-height: 150px;
}
.dt-img img { max-width: 100%; max-height: 190px; display: block; }
.dt-info { flex: 1; min-width: 280px; }
.dt-info h2 { margin: 0 0 6px; font-size: 20px; }
.dt-kv { display: grid; grid-template-columns: 88px 1fr; gap: 4px 10px; font-size: 13.5px; }
.dt-kv .k { color: var(--ink-3); }
.dt-sec { margin-top: 18px; }
.dt-sec h4 { margin: 0 0 8px; font-size: 14px; color: var(--ink-2); border-left: 3px solid var(--brand); padding-left: 8px; }
.goods-group { margin-bottom: 8px; }
.goods-group .gg-t { font-size: 13px; color: var(--brand); font-weight: 600; margin-bottom: 2px; }
.goods-group .gg-c { color: var(--ink-2); font-size: 13px; }
pre.desc {
  white-space: pre-wrap; word-break: break-all; background: #f8fafc;
  border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px;
  font-family: inherit; font-size: 13px; margin: 0; color: var(--ink-2);
}

/* ---------- toast / footer ---------- */
.toast {
  position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%);
  background: rgba(28, 36, 48, .92); color: #fff; padding: 10px 18px; border-radius: 8px;
  z-index: 90; font-size: 13.5px;
}
.foot {
  display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--ink-3);
  font-size: 12.5px; padding: 18px 20px 30px; border-top: 1px solid var(--line);
  margin-top: 20px;
}

@media (max-width: 860px) {
  .topbar-inner { flex-wrap: wrap; height: auto; padding: 10px 20px; gap: 10px; }
  .nav { margin-left: 0; width: 100%; overflow-x: auto; }
  .fld { min-width: 130px; }
  table.tbl { font-size: 12.5px; }
  .dt-img { flex-basis: 140px; width: 140px; }
}
