/* =========================================================
   外观专利查询页签（2026-10-26 m89）
   配合 index.html 的 #view-patent 与 patent-view.js 使用
   ========================================================= */

/* ---------- 上区：主图框 + 参数 ---------- */
/* m87：商品图缩略图条移到左栏主图框下方（grid 铺满），两栏底部各有一条虚线操作栏上下齐平；
   右栏 = ASIN 行 + 参数三列 + 虚线操作栏，底部由 margin-top:auto 贴底 */
.pat-stage { display: grid; grid-template-columns: minmax(290px, 380px) minmax(0, 1fr); gap: 18px; align-items: stretch; }

.pat-main { display: flex; flex-direction: column; gap: 8px; }
.pat-main-hd { display: flex; align-items: center; gap: 6px; height: 17px; font-size: 11px; color: var(--text-3); }
.pat-main-hd .grow { flex: 1; }
.pat-btn-xs { padding: 3px 9px; font-size: 11.5px; line-height: 1.5; }
.pat-main-box {
  position: relative; display: flex; align-items: center; justify-content: center;
  min-height: 200px; flex: 1 1 200px; overflow: hidden; cursor: pointer; outline: none;
  background: #fff; border: 2px dashed var(--border-strong); border-radius: 10px; transition: .15s;
}
.pat-main-box:hover { border-color: var(--primary); }
.pat-main-box:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.pat-main-box.filled { border-style: solid; border-color: var(--border); }
.pat-main-box.drop { border-color: var(--primary); background: var(--primary-soft); }
.pat-main-box img { max-width: 100%; max-height: 100%; object-fit: contain; padding: 6px; }
.pat-main-ph { display: flex; flex-direction: column; gap: 5px; padding: 12px; text-align: center; color: var(--text-3); }
.pat-main-ph b { font-size: 13px; color: var(--text-2); }
.pat-main-ph span { font-size: 11.5px; line-height: 1.6; }
.pat-main-ft {
  display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap;
  margin-top: auto; padding-top: 12px; min-height: 52px;
  border-top: 1px dashed var(--border);
}
.pat-main-ft .btn { padding: 4px 12px; font-size: 12px; }

/* m94：右栏整块下移（m95 由 20px 加到 36px）—— 原来「商品链接/ASIN」贴着 panel 标题，和左侧「查询主图」、
   主图框挤在一条线上；下移后右栏从主图框顶部往里起势，上方留出呼吸，底部操作栏仍由 margin-top:auto 贴底。
   上限：右栏内容 = padding + 63 + 14 + 63 + 52，超过 stage 高度（285）才会把 stage 撑高 */
.pat-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; padding-top: 36px; }
.pat-inline { display: flex; gap: 8px; }
.pat-inline .pat-input { flex: 1; min-width: 0; }

.pat-input {
  width: 100%; padding: 8px 10px; font: inherit; font-size: 13px; color: var(--text);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: #fff; outline: none;
}
.pat-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.pat-sel { width: auto; padding: 5px 8px; font-size: 12.5px; }

.pat-imgwrap { margin: 0; }
/* 缩略图条：等宽格子铺满整行，7 张刚好一行，不留右侧空白 */
.pat-imgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(47px, 1fr)); gap: 6px; }
.pat-pick {
  position: relative; width: auto; height: auto; aspect-ratio: 1 / 1; overflow: hidden; cursor: pointer;
  border: 1.5px solid var(--border); border-radius: 7px; background: #fff; transition: .15s;
}
.pat-pick:hover { border-color: var(--border-strong); }
.pat-pick.on { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.pat-pick img { width: 100%; height: 100%; object-fit: contain; padding: 2px; }
.pat-pick .pat-picktag {
  position: absolute; left: 0; bottom: 0; padding: 0 3px; font-size: 9px; line-height: 1.6;
  color: #fff; background: rgba(17, 24, 39, .72);
}
/* 每张缩略图右上角的删除按钮（m92）：深色半透明小圆点，hover 变红 */
.pat-pick .pat-pick-x {
  position: absolute; top: 1px; right: 1px; z-index: 2;
  width: 14px; height: 14px; padding: 0; font: inherit; font-size: 8.5px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  color: #fff; background: rgba(17, 24, 39, .5);
  border: 0; border-radius: 50%;
  cursor: pointer; opacity: .82; transition: .12s;
}
.pat-pick .pat-pick-x:hover {
  background: #dc2626; opacity: 1; transform: scale(1.12);
}
/* 主图框右上角的删除按钮：只在有图时出现 */
.pat-main-x {
  position: absolute; top: 8px; right: 8px; z-index: 3;
  width: 26px; height: 26px; padding: 0; font: inherit; font-size: 12px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-2); background: rgba(255, 255, 255, .95);
  border: 1px solid var(--border); border-radius: 50%;
  cursor: pointer; box-shadow: 0 1px 4px rgba(17, 24, 39, .12); transition: .12s;
}
.pat-main-x:hover { color: #fff; background: #dc2626; border-color: #dc2626; }
.pat-main-x.hidden { display: none; }
.pat-imgnote { margin-top: 4px; font-size: 11px; line-height: 1.4; color: var(--text-3); }

.pat-opts { display: grid; grid-template-columns: minmax(0, 1fr) 148px minmax(0, 1fr); gap: 12px; }
.pat-actions {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 11px;
  margin-top: auto; padding-top: 12px; min-height: 52px;
  border-top: 1px dashed var(--border);
  /* m96：向左跨过左栏（左栏 380 + 栏间距 18），让「开始查询专利」居中于**整张卡片**，
     而不是只居中于右栏——查询后左栏铺满图片时，按钮偏右就很扎眼。
     跨过来会盖住左栏底部操作栏那一块 ⇒ pointer-events:none，让「粘贴截图/上传图片」照常可点；
     border-top 与左栏 .pat-main-ft 的虚线同起点、同高度，视觉上仍是一条完整的分隔线 */
  margin-left: calc(-380px - 18px);
  pointer-events: none;
}
.pat-actions > * { pointer-events: auto; }
.pat-actions .btn-primary { padding: 9px 26px; font-size: 13.5px; }
.pat-actions .check { font-size: 12px; color: var(--text-2); }
/* 空提示不占 gap，否则居中会整体偏右半个 gap */
.pat-actions #patMsg:empty { display: none; }
/* 长提示单行省略，避免把居中的按钮行撑歪 */
.pat-actions #patMsg { max-width: 300px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 11.5px; }

/* ---------- 折叠下拉（地区 / LOC / 结果筛选共用） ---------- */
.pat-dd { position: relative; }
.pat-dd-btn {
  display: flex; align-items: center; gap: 6px; width: 100%; padding: 8px 10px;
  font: inherit; font-size: 13px; color: var(--text); text-align: left; cursor: pointer;
  background: #fff; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); outline: none;
}
.pat-dd-btn:hover { border-color: var(--text-3); }
.pat-dd.open .pat-dd-btn, .pat-dd-btn:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.pat-dd-btn .txt { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pat-dd-btn .txt.ph { color: var(--text-3); }
.pat-dd-btn .cnt {
  flex: none; padding: 0 5px; font-size: 10.5px; font-weight: 700; color: #fff;
  background: var(--primary); border-radius: 999px;
}
.pat-dd-btn .car { flex: none; width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid var(--text-3); }
.pat-dd.pat-dd-sm .pat-dd-btn { padding: 5px 8px; font-size: 12.5px; }

.pat-dd-pan {
  position: absolute; z-index: 90; top: calc(100% + 4px); left: 0; min-width: 100%; width: max-content; max-width: 320px;
  display: none; padding: 5px; background: #fff;
  border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 12px 32px rgba(17, 24, 39, .16);
}
.pat-dd.open .pat-dd-pan { display: block; }
/* 下方空间不够时翻到按钮上方（JS 里按实际高度加 .up） */
.pat-dd.up .pat-dd-pan { top: auto; bottom: calc(100% + 4px); }
.pat-dd-search { width: 100%; margin-bottom: 4px; padding: 5px 8px; font: inherit; font-size: 12px; border: 1px solid var(--border); border-radius: 6px; outline: none; }
.pat-dd-search:focus { border-color: var(--primary); }
.pat-dd-list { max-height: 268px; overflow: auto; }
.pat-dd-hd { padding: 5px 7px 3px; font-size: 10.5px; font-weight: 700; color: var(--text-3); letter-spacing: .3px; }
.pat-dd-opt {
  display: flex; align-items: center; gap: 7px; padding: 5px 8px; font-size: 12.5px;
  color: var(--text-2); cursor: pointer; border-radius: 6px; white-space: nowrap;
}
.pat-dd-opt:hover { background: #f4f6fa; }
.pat-dd-opt.on { color: var(--primary); background: var(--primary-soft); font-weight: 600; }
.pat-dd-opt .pd-box {
  flex: none; width: 13px; height: 13px; border: 1px solid var(--border-strong); border-radius: 3px;
  display: flex; align-items: center; justify-content: center; font-size: 9px; color: #fff;
}
.pat-dd-opt.on .pd-box { background: var(--primary); border-color: var(--primary); }
.pat-dd-opt .pd-code { font-family: ui-monospace, Menlo, monospace; font-size: 11.5px; }
.pat-dd-opt .pd-nm { color: var(--text-3); font-size: 11.5px; }
.pat-dd-ft { display: flex; gap: 6px; padding: 5px 3px 1px; border-top: 1px solid var(--border); margin-top: 3px; }
.pat-dd-ft button { flex: 1; padding: 4px 0; font: inherit; font-size: 11.5px; cursor: pointer; background: #fff; border: 1px solid var(--border-strong); border-radius: 6px; color: var(--text-2); }
.pat-dd-ft button:hover { border-color: var(--primary); color: var(--primary); }

/* ---------- LOC 详细版下拉（m93）：32 大类可展开小类 + 官方注释 ---------- */
/* 面板向左展开（LOC 是右栏最右一列，向右会顶出窗口） */
.pat-dd .pat-dd-pan.pat-dd-wide {
  /* min-width:0 必须留：基础规则里的 min-width:100% 会盖掉 max-width（min 优先于 max），
     否则面板被父容器宽度撑到 900+ px，注释全跑一行 */
  left: auto; right: 0; width: 520px; min-width: 0; max-width: 520px; padding: 7px;
}
.pat-dd-wide .pat-dd-list.pat-dd-tree { max-height: 398px; }
.pat-dd-tree .pat-dd-hd { padding: 6px 8px 3px; }
.pat-dd-tree .pat-dd-opt { white-space: normal; gap: 6px; line-height: 1.5; }
.pat-dd-tree .pat-dd-grp + .pat-dd-grp { margin-top: 1px; }
/* 大类那条：可缩进小类，箭头独占一格 */
.pat-dd-tree .pat-dd-parent { padding-left: 4px; }
/* 展开箭头用 CSS 三角形画（字体里的 ▸ 在 10px 下几乎看不见） */
.pat-dd-tree .pat-dd-parent .pd-arw {
  flex: none; position: relative; width: 13px; height: 15px; cursor: pointer; user-select: none;
}
.pat-dd-tree .pat-dd-parent .pd-arw::before {
  content: ''; position: absolute; left: 4px; top: 5px; width: 0; height: 0;
  border-left: 5px solid var(--text-2); border-top: 4px solid transparent; border-bottom: 4px solid transparent;
}
.pat-dd-tree .pat-dd-parent .pd-arw[data-open="1"]::before {
  left: 3px; top: 6px; border-left: 5px solid transparent; border-right: 5px solid transparent;
  border-top: 5px solid var(--text-2); border-bottom: 0;
}
.pat-dd-tree .pat-dd-parent .pd-arw.is-empty { cursor: default; }
.pat-dd-tree .pat-dd-parent .pd-arw.is-empty::before { display: none; }
.pat-dd-tree .pat-dd-parent .pd-arw:hover::before { border-left-color: var(--primary); }
.pat-dd-tree .pat-dd-parent .pd-arw[data-open="1"]:hover::before { border-top-color: var(--primary); border-left-color: transparent; }
.pat-dd-tree .pat-dd-parent .pd-code { flex: none; min-width: 34px; color: var(--text-2); }
.pat-dd-tree .pat-dd-parent .pd-nm { flex: none; max-width: 196px; color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 大类注释：跟在类名后面，单行省略，悬停看全文 */
.pat-dd-tree .pat-dd-parent .pd-nt {
  flex: 1; min-width: 0; font-size: 11.5px; color: var(--text-3); font-weight: 400;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pat-dd-tree .pat-dd-sub { padding-left: 32px; font-size: 12px; }
.pat-dd-tree .pat-dd-sub .pd-code { flex: none; color: var(--text-2); }
.pat-dd-tree .pat-dd-sub .pd-nm { color: var(--text-2); }
.pat-dd-tree .pat-dd-sub.on .pd-nm, .pat-dd-tree .pat-dd-sub.on .pd-code { color: var(--primary); }
.pat-dd-tree .pat-dd-parent.on .pd-nm { color: var(--primary); }

/* ---------- 汇总条 ---------- */
.pat-summary {
  display: flex; gap: 10px; align-items: flex-start; margin-bottom: 12px; padding: 11px 14px;
  font-size: 12.5px; color: var(--text-2);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.pat-summary .dot { width: 8px; height: 8px; margin-top: 6px; flex: none; border-radius: 50%; background: var(--text-3); }
.pat-summary.high .dot { background: #dc2626; }
.pat-summary.medium .dot { background: var(--amber); }
.pat-summary.low .dot { background: var(--green); }
.pat-summary .risk { font-weight: 700; }
.pat-summary.high .risk { color: #dc2626; }
.pat-summary.medium .risk { color: var(--amber); }
.pat-summary.low .risk { color: var(--green); }
.pat-summary .cost { color: var(--text-3); }

/* ---------- AI 研判 ---------- */
.pat-ai {
  margin-bottom: 12px; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.pat-ai-hd {
  display: flex; align-items: center; gap: 8px; padding: 9px 13px; font-size: 13px;
  border-bottom: 1px solid var(--border); background: linear-gradient(180deg, #fbfcfe, #f7f9fc);
}
.pat-verdict { padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; color: #fff; }
.pat-verdict.high { background: #dc2626; }
.pat-verdict.medium { background: var(--amber); }
.pat-verdict.low { background: var(--green); }
.pat-aimeta { margin-right: 4px; font-size: 11.5px; color: var(--text-3); }
.pat-ai-bd { padding: 11px 14px 13px; font-size: 12.5px; color: var(--text-2); line-height: 1.75; }
/* m119：折叠态 —— 正文藏起来，头部（标题 + 结论 + 用量）保留 */
.pat-ai.folded .pat-ai-bd { display: none; }
.pat-ai.folded .pat-ai-hd { border-bottom: none; }
.pat-ai-bd .pat-sec { margin: 8px 0 2px; font-weight: 650; color: var(--text); }
.pat-ai-bd .pat-sec:first-child { margin-top: 0; }
.pat-ai-bd .pat-li { position: relative; padding-left: 13px; }
.pat-ai-bd .pat-li::before { content: '·'; position: absolute; left: 3px; color: var(--primary); font-weight: 700; }
.pat-ph { color: var(--text-3); }
.pat-sk {
  height: 11px; margin: 7px 0; border-radius: 5px;
  background: linear-gradient(90deg, #eef1f5, #f7f9fc, #eef1f5);
  background-size: 200% 100%; animation: patsk 1.1s linear infinite;
}
@keyframes patsk { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ---------- 结果头 ---------- */
.pat-reshead { display: flex; align-items: center; gap: 8px; margin: 0 2px 9px; font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.pat-reshead .btn { padding: 4px 10px; font-size: 12px; font-weight: 500; }
.pat-filtered { font-size: 11.5px; font-weight: 500; color: var(--primary); }
.pat-zoom { display: flex; gap: 0; margin-left: auto; overflow: hidden; border: 1px solid var(--border-strong); border-radius: 999px; }
.pat-zoom button {
  padding: 3px 11px; font: inherit; font-size: 12px; color: var(--text-2); cursor: pointer;
  background: #fff; border: 0;
}
.pat-zoom button + button { border-left: 1px solid var(--border); }
.pat-zoom button.on { color: #fff; background: var(--primary); }

/* ---------- 结果筛选条 ---------- */
.pat-filter {
  margin-bottom: 11px; padding: 10px 12px 9px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
}
.pat-filter-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.pat-f { display: flex; flex-direction: column; gap: 4px; min-width: 148px; }
.pat-f-grow { flex: 1 1 210px; min-width: 190px; }
.pat-f-label { font-size: 11px; color: var(--text-3); }
.pat-f-go { height: 31px; padding: 0 14px; }
.pat-cats { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; padding-top: 9px; border-top: 1px dashed var(--border); }
.pat-cat {
  display: flex; align-items: center; gap: 5px; padding: 3px 10px; font-size: 12px;
  color: var(--text-2); cursor: pointer; user-select: none;
  background: #fff; border: 1px solid var(--border); border-radius: 999px;
}
.pat-cat:hover { border-color: var(--primary); color: var(--primary); }
.pat-cat.on { color: #fff; background: var(--primary); border-color: var(--primary); }
.pat-cat .ico { font-size: 11.5px; opacity: .85; }
/* m90：标签不再写死，数量跟着结果走，标签里的数字用小字 */
.pat-cat .n { font-size: 10.5px; opacity: .6; margin-left: -1px; }
.pat-cat.on .n { opacity: .95; }
.pat-cat-note { display: flex; align-items: center; padding: 3px 4px; font-size: 12px; color: var(--text-2); opacity: .65; }

/* ---------- 结果卡片 ---------- */
/* 默认大图：minmax 250 ⇒ 1200px 宽下一行约 4 张，专利线稿看得清轮廓细节 */
.pat-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
/* 紧凑模式（结果头右侧「紧凑」按钮）用于 100 条快速扫一遍 */
.pat-cards.compact { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.pat-cards.compact .pat-thumb { height: 150px; }
.pat-cards.compact .pat-thumb img { padding: 4px; }
.pat-card {
  position: relative; overflow: hidden; cursor: pointer; transition: .15s;
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.pat-card:hover { border-color: var(--primary); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.pat-thumb { height: 250px; display: flex; align-items: center; justify-content: center; overflow: hidden; background: #fff; border-bottom: 1px solid var(--border); }
.pat-thumb img { width: 100%; height: 100%; object-fit: contain; padding: 8px; }
.pat-noimg { font-size: 11.5px; color: var(--text-3); }
.pat-badge { position: absolute; top: 7px; left: 7px; z-index: 2; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; color: #fff; }
.pat-badge.high { background: #dc2626; }
.pat-badge.medium { background: var(--amber); }
.pat-badge.low { background: var(--green); }
.pat-flag { position: absolute; top: 7px; right: 7px; z-index: 2; padding: 2px 6px; border-radius: 6px; font-size: 10.5px; font-weight: 700; color: #fff; background: #111827; }
.pat-meta { flex: 1; display: flex; flex-direction: column; padding: 9px 11px 11px; }
.pat-pn { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; font-weight: 650; letter-spacing: .2px; color: var(--text-3); }
.pat-ttl { margin-top: 3px; font-size: 13px; font-weight: 600; line-height: 1.4; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pat-ttl-cn { margin-top: 2px; font-size: 12px; line-height: 1.45; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pat-ttl-cn:empty { display: none; }
/* 关键信息（受理局 / 法律状态 / 预估到期日）—— margin-top:auto 让它贴卡片底部，同行卡片对齐 */
.pat-kv { margin-top: auto; padding-top: 7px; border-top: 1px dashed var(--border); display: grid; gap: 1px; }
.pat-kv-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 11.5px; line-height: 1.6; }
.pat-kv-k { flex: none; color: var(--text-3); }
.pat-kv-v { min-width: 0; text-align: right; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pat-kv-v.ok { color: #047857; font-weight: 650; }
.pat-kv-v.off { color: var(--text-3); }
.pat-own { margin-top: 6px; font-size: 11px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.pat-cards.compact .pat-own { display: none; }
.pat-cards.compact .pat-meta { padding: 7px 9px 9px; }
.pat-cards.compact .pat-pn { font-size: 11px; }
.pat-cards.compact .pat-ttl { font-size: 12px; }
.pat-cards.compact .pat-ttl-cn { font-size: 11px; }
.pat-cards.compact .pat-kv-row { font-size: 10.5px; gap: 6px; }
.pat-cards.compact .pat-kv-k { white-space: nowrap; }
.pat-empty { padding: 52px 20px; font-size: 12.5px; line-height: 1.9; text-align: center; color: var(--text-3); }
.pat-loading { padding: 44px 20px; font-size: 13px; text-align: center; color: var(--text-2); }
.pat-spin {
  width: 26px; height: 26px; margin: 0 auto 12px; border-radius: 50%;
  border: 3px solid var(--border-strong); border-top-color: var(--primary);
  animation: patspin .8s linear infinite;
}
@keyframes patspin { to { transform: rotate(360deg); } }

/* ---------- 详情浮层（左边信息表 / 右边专利附图 / 下方说明书） ---------- */
.pat-mask { position: fixed; inset: 0; z-index: 130; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(17, 24, 39, .55); }
.pat-dlg {
  display: flex; flex-direction: column; overflow: hidden;
  width: min(1180px, 96vw); max-height: 90vh;
  background: var(--surface); border-radius: 14px; box-shadow: 0 24px 60px rgba(0, 0, 0, .32);
}
.pat-dlg-hd { display: flex; align-items: flex-start; gap: 10px; flex: none; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.pat-dlg-ttl { flex: 1; min-width: 0; }
.pat-dlg-ttl b { display: block; font-size: 16px; line-height: 1.35; }
.pat-dlg-ttl .pat-dlg-sub { margin-top: 3px; font-size: 11.5px; color: var(--text-3); }
.pat-dlg-sim { flex: none; text-align: right; font-size: 11.5px; color: var(--text-3); }
.pat-dlg-sim b { display: block; font-size: 20px; line-height: 1.2; color: var(--primary); font-family: ui-sans-serif, system-ui; }
.pat-dlg-x { flex: none; width: 26px; height: 26px; padding: 0; font-size: 15px; line-height: 1; cursor: pointer; color: var(--text-3); background: transparent; border: 0; }
.pat-dlg-x:hover { color: var(--text); }
.pat-dlg-bd { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 16px; padding: 14px 16px 16px; overflow: auto; }

.pat-info { align-self: start; padding: 9px 12px; border-radius: 10px; background: #f7f9fc; border: 1px solid var(--border); }
.pat-info-hd { margin: 2px 0 6px; font-size: 12px; font-weight: 700; color: var(--text-2); }
.pat-info-row { display: flex; gap: 10px; padding: 4px 0; font-size: 12.5px; line-height: 1.55; }
.pat-info-k { width: 88px; flex: none; color: var(--text-3); }
.pat-info-v { flex: 1; min-width: 0; color: var(--text); word-break: break-word; }
.pat-info-v .pin { display: inline-block; margin: 1px 4px 1px 0; padding: 1px 7px; font-size: 11.5px; border-radius: 999px; background: #e8f5ee; color: #047857; }
.pat-info-v .pin.off { background: #f1f3f7; color: var(--text-3); }
.pat-warn { margin-top: 6px; padding: 7px 9px; font-size: 12px; line-height: 1.6; color: #b91c1c; background: #fef2f2; border: 1px solid #fecaca; border-radius: 8px; }

.pat-right { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.pat-sec-hd { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; color: var(--text-2); }
.pat-sec-hd .tip { font-weight: 500; font-size: 11px; color: var(--text-3); }
.pat-figs { display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); gap: 9px; }
.pat-fig {
  position: relative; display: flex; align-items: center; justify-content: center;
  height: 186px; overflow: hidden; cursor: zoom-in;
  background: #fff; border: 1px solid var(--border); border-radius: 9px;
}
.pat-fig:hover { border-color: var(--primary); }
.pat-fig img { max-width: 100%; max-height: 100%; object-fit: contain; padding: 6px; }
.pat-fig .pat-fig-idx {
  position: absolute; left: 5px; bottom: 4px; padding: 0 5px; font-size: 10px;
  color: var(--text-3); background: rgba(255, 255, 255, .85); border-radius: 4px;
}
.pat-fig.ph { cursor: default; border-style: dashed; }
.pat-desc { font-size: 12.5px; line-height: 1.75; color: var(--text-2); white-space: pre-wrap; word-break: break-word; }
.pat-desc-box { padding: 10px 12px; background: #fbfcfe; border: 1px solid var(--border); border-radius: 9px; }
.pat-dlg-ft { display: flex; align-items: center; gap: 9px; padding-top: 2px; }
.pat-dlg-ft .grow { flex: 1; }
.pat-loading-in { padding: 20px; font-size: 12px; color: var(--text-3); text-align: center; }

/* 附图放大 */
.pat-lightbox { position: fixed; inset: 0; z-index: 140; display: flex; align-items: center; justify-content: center; padding: 24px; background: rgba(17, 24, 39, .82); cursor: zoom-out; }
.pat-lightbox img { max-width: 100%; max-height: 100%; background: #fff; border-radius: 8px; }

@media (max-width: 980px) {
  .pat-stage { grid-template-columns: 1fr; }
  /* 单列时右栏已另起一行，m94 的下移留白去掉，免得和左栏 footer 之间空两块 */
  .pat-side { padding-top: 0; }
  /* m96 的跨列负 margin 在单列里会顶出卡片左边，必须复位 */
  .pat-actions { margin-left: 0; pointer-events: auto; }
  .pat-main-box { min-height: 190px; flex: none; }
  .pat-opts { grid-template-columns: 1fr 1fr; }
  .pat-dlg-bd { grid-template-columns: 1fr; }
  .pat-info { order: 2; }
}

/* 2026-11-26 m115：专利号查询并入右侧参数区（复用 .field / .pat-inline），
   这里只补两条：输入框在窄栏里别被按钮挤没、错误提示不撑高行高。 */
.pat-side .pat-inline #patStatInput { min-width: 0; }
.pat-side #patStatMsg { margin-top: 2px; font-size: 11.5px; }
.pat-side #patStatMsg:empty { display: none; }

/* =========================================================
   AI 引导框（2026-11-26 m117）
   ---------------------------------------------------------
   出结果后常驻在「AI 深度分析」按钮下方，一句话说清点它能得到什么。
   整框可点（等同于点按钮），hover 时轻微抬起 + 主色描边，暗示「这是入口」。
   ========================================================= */
.pat-aicta {
  display: flex; align-items: center; gap: 12px;
  margin: 0 0 10px; padding: 10px 14px;
  background: linear-gradient(92deg, var(--primary-soft), var(--surface) 62%);
  border: 1px solid var(--border); border-left: 3px solid var(--primary);
  border-radius: var(--radius-sm);
}
/* 按钮贴在框右侧，不参与拉伸 */
.pat-aicta > .btn { flex: none; white-space: nowrap; }
.pat-aicta-ico {
  flex: none; width: 30px; height: 30px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11.5px; font-weight: 800; letter-spacing: .3px;
  color: #fff; background: var(--primary);
}
.pat-aicta-tx { flex: 1; min-width: 0; font-size: 12.5px; line-height: 1.65; color: var(--text-2); }
.pat-aicta-tx b { color: var(--text); font-weight: 700; margin-right: 4px; }
@media (max-width: 720px) {
  .pat-aicta { flex-wrap: wrap; align-items: flex-start; }
  .pat-aicta-tx { flex: 1 1 100%; order: 2; }
  .pat-aicta > .btn { order: 3; margin-left: auto; }
}
