/* 医药 Query 扩召回审核台 —— 无框架样式 */
:root {
  --bg: #f6f8fa;
  --card: #ffffff;
  --line: #e3e8ee;
  --text: #1f2937;
  --muted: #6b7280;
  --primary: #2563eb;
  --approve: #16a34a;
  --observe: #d97706;
  --block: #dc2626;
  --norewrite: #64748b;
  --failed: #111827;
  --radius: 10px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.55;
}

/* 顶栏 */
.topbar {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  gap: 12px; padding: 14px 24px; background: #0f2a43; color: #fff;
  position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; align-items: center; gap: 12px; }
.logo {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 10px; background: #1d4ed8; font-size: 20px;
}
.brand h1 { font-size: 17px; font-weight: 600; }
.brand .sub { font-size: 12px; color: #93a8c4; }
#nav { display: flex; gap: 4px; flex-wrap: wrap; }
#nav a {
  color: #c6d4e6; text-decoration: none; padding: 7px 14px; border-radius: 8px; font-size: 14px;
}
#nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
#nav a.active { background: #1d4ed8; color: #fff; }

main { max-width: 1280px; margin: 0 auto; padding: 20px 24px 60px; }
.loading { text-align: center; color: var(--muted); padding: 60px 0; }

/* 卡片与栅格 */
.grid { display: grid; gap: 14px; }
.grid.c5 { grid-template-columns: repeat(5, 1fr); }
.grid.c3 { grid-template-columns: repeat(3, 1fr); }
.grid.c2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) { .grid.c5, .grid.c3, .grid.c2 { grid-template-columns: 1fr 1fr; } }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px;
}
.card h3 { font-size: 13px; color: var(--muted); font-weight: 500; margin-bottom: 8px; }
.card .big { font-size: 26px; font-weight: 700; }
.card .hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.sec-title { font-size: 15px; font-weight: 600; margin: 22px 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

/* 徽章 */
.badge {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; color: #fff; white-space: nowrap;
}
.b-approve { background: var(--approve); }
.b-observe { background: var(--observe); }
.b-block { background: var(--block); }
.b-no_rewrite { background: var(--norewrite); }
.b-failed { background: var(--failed); }
.b-keep { background: var(--approve); }
.b-eliminated { background: var(--block); }
.b-unknown { background: var(--observe); }
.b-chip {
  display: inline-block; padding: 1px 8px; border-radius: 6px; font-size: 12px;
  background: #eef2f7; color: #374151; margin: 1px 2px;
}
.b-chip.match { background: #dcfce7; color: #166534; }
.b-chip.conflict { background: #fee2e2; color: #991b1b; }
.b-chip.unknown { background: #fef3c7; color: #92400e; }
.b-chip.not_expressed { background: #f1f5f9; color: #64748b; }

/* 表格 */
table.tbl { width: 100%; border-collapse: collapse; background: var(--card); }
.tbl th, .tbl td {
  border-bottom: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top;
}
.tbl th { font-size: 12px; color: var(--muted); font-weight: 500; background: #fafbfc; position: sticky; top: 0; z-index: 2; box-shadow: inset 0 -1px 0 var(--line); }
.tbl tbody tr:hover { background: #f4f7fb; }
.tbl tr.clickable { cursor: pointer; }
.tbl-wrap {
  overflow: auto; border: 1px solid var(--line); border-radius: var(--radius);
  max-height: calc(100vh - 150px);
}

/* 条形 */
.bar-row { display: flex; align-items: center; gap: 10px; margin: 6px 0; }
.bar-label { width: 220px; font-size: 12px; color: var(--text); text-align: right; flex-shrink: 0; }
.bar-track { flex: 1; background: #eef1f5; border-radius: 6px; height: 18px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 6px; background: var(--primary); min-width: 2px; }
.bar-num { width: 70px; font-size: 12px; color: var(--muted); flex-shrink: 0; }

/* 筛选器 */
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.filters select, .filters input {
  padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff;
  font-size: 13px; color: var(--text);
}
.filters input { width: 220px; }
.pager { display: flex; align-items: center; gap: 10px; justify-content: flex-end; margin-top: 12px; }
.pager button {
  padding: 5px 12px; border: 1px solid var(--line); background: #fff; border-radius: 8px;
  cursor: pointer; font-size: 13px;
}
.pager button:disabled { opacity: .4; cursor: default; }

/* 详情 */
.detail-head { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-bottom: 14px; }
.detail-head .raw { font-size: 17px; font-weight: 600; }
.kv { display: flex; gap: 6px; font-size: 13px; }
.kv .k { color: var(--muted); }
.backlink { font-size: 13px; color: var(--primary); text-decoration: none; display: inline-block; margin-bottom: 10px; }
.elim-group { margin: 8px 0; }
.elim-group .head { font-size: 13px; margin-bottom: 4px; }

/* 人工新建 Query */
.btn {
  padding: 6px 14px; border: 1px solid var(--primary); background: var(--primary); color: #fff;
  border-radius: 8px; cursor: pointer; font-size: 13px;
}
.btn.ghost { background: #fff; color: var(--primary); }
.mq-form {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  margin: 10px 0 14px; padding: 12px 14px;
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
}
.mq-form input, .mq-form select {
  padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; color: var(--text);
}

/* 复核队列 & 测评 */
.queue-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: 8px; margin-bottom: 8px;
}
.tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.tabs button {
  padding: 6px 16px; border: 1px solid var(--line); background: #fff; border-radius: 8px;
  cursor: pointer; font-size: 13px;
}
.tabs button.active { background: var(--primary); border-color: var(--primary); color: #fff; }

.foot { max-width: 1280px; margin: 0 auto; padding: 16px 24px 30px; color: var(--muted); font-size: 12px; }
.scope-ok { color: var(--approve); font-weight: 600; }
.scope-bad { color: var(--block); font-weight: 600; }

/* P0-1 数据时效横幅 */
#banner { max-width: 1280px; margin: 14px auto -6px; padding: 0 24px; }
.banner { padding: 10px 16px; border-radius: 10px; font-size: 13px; line-height: 1.7; }
.banner.alert { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.banner.fresh { background: #dcfce7; color: #166534; border: 1px solid #86efac; }

/* P0-5 商品级判定徽章（独立词表） */
.b-item-approve { background: var(--approve); }
.b-item-block { background: var(--block); }
.b-item-unknown { background: var(--observe); }

/* P0-2 范围校验总状态与结论 chip */
.scope-total { display: inline-block; padding: 6px 14px; border-radius: 8px; font-weight: 600; font-size: 13px; margin-bottom: 10px; }
.scope-total.ok { background: #dcfce7; color: #166534; }
.scope-total.bad { background: #fee2e2; color: #991b1b; }
.scope-total.warn { background: #fef3c7; color: #92400e; }
.b-chip.pass { background: #dcfce7; color: #166534; }
.b-chip.fail { background: #fee2e2; color: #991b1b; }

/* P0-5 概览六卡 */
.grid.c6 { grid-template-columns: repeat(6, 1fr); }
@media (max-width: 1100px) { .grid.c6 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px) { .grid.c6 { grid-template-columns: 1fr 1fr; } }

/* P0-3 复核结论 */
.verdict-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.verdict-form select, .verdict-form input {
  padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; color: var(--text);
}
.linkish { border: none; background: none; color: var(--primary); cursor: pointer; font-size: 12px; padding: 0; }
.linkish:hover { text-decoration: underline; }
.fail-row td, .ev-row td { background: #f8fafc; }
.vd-owner { font-size: 13px; white-space: nowrap; }

/* 复核要点提示 */
.vd-guide {
  background: #f8fafc; border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 14px; font-size: 13px;
}
.vd-guide-title { font-weight: 600; margin-bottom: 4px; }
.vd-guide ol { margin: 0; padding-left: 20px; }
.vd-guide li { margin: 2px 0; }
/* 系统自动校验结果条 */
.vd-auto {
  margin-top: 10px; padding: 8px 12px; border-radius: 8px; font-size: 13px; line-height: 1.7;
}
.vd-auto.warn { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
.vd-auto.ok { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.verdict-form select#vd-issue { min-width: 230px; }

/* 复核页头部（标题 + 功能面板入口） */
.review-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }

/* 复核页功能抽屉（右侧滑出） */
.drawer-mask {
  position: fixed; inset: 0; background: rgba(15, 42, 67, .35); z-index: 40;
  opacity: 0; pointer-events: none; transition: opacity .2s ease;
}
.drawer-mask.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: -420px; width: 400px; max-width: 92vw; height: 100vh;
  background: #fff; box-shadow: -6px 0 24px rgba(0, 0, 0, .14); z-index: 50;
  display: flex; flex-direction: column; transition: right .25s ease;
}
.drawer.open { right: 0; }
.drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--line); font-weight: 600; font-size: 14px;
  flex-shrink: 0;
}
.drawer-close { border: none; background: none; font-size: 16px; cursor: pointer; color: var(--muted); padding: 2px 6px; }
.drawer-close:hover { color: var(--text); }
.drawer-body { padding: 14px 16px 24px; overflow-y: auto; flex: 1; }
.drawer-sec-title { font-size: 13px; font-weight: 600; margin: 16px 0 8px; }
.drawer-body .drawer-sec-title:first-child { margin-top: 0; }
.drawer .mq-form { display: none; flex-direction: column; align-items: stretch; margin: 10px 0; }
.drawer .mq-form input, .drawer .mq-form select { width: 100%; }
.drawer .tbl-wrap.drawer-tbl { max-height: 320px; margin-top: 8px; }
.drawer .tbl th, .drawer .tbl td { padding: 6px 8px; }

/* P1-4 证据片段 */
.ev-grid { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.ev-item { font-size: 12px; }
.ev-item .k { color: var(--muted); }
tr.item-row { cursor: pointer; }
tr.item-row:hover { background: #f4f7fb; }

/* P2-4 淘汰项展开/收起 */
.elim-group .elim-extra { display: none; }
.elim-group.expanded .elim-extra { display: inline-block; }

/* P4-2 移动端断点（窄屏：内容区收紧、条形标签缩窄、表格保持横向滚动） */
@media (max-width: 768px) {
  .topbar { padding: 10px 12px; }
  main { padding: 14px 12px 40px; }
  #banner { padding: 0 12px; }
  .bar-label { width: 120px; }
  .card { padding: 12px 14px; }
  .detail-head .raw { font-size: 15px; }
  .verdict-form input { flex: 1 1 130px; }
  .tbl th, .tbl td { padding: 6px 8px; }
}
