/* =========================================================
   前台查询页 —— 蓝色调 · 精致结果页
   ========================================================= */

body.query-page {
  background:
    radial-gradient(1100px 460px at 50% -180px, #dbeafe 0%, rgba(219,234,254,0) 68%),
    radial-gradient(900px 420px at 100% 0%, #e0f2fe 0%, rgba(224,242,254,0) 60%),
    linear-gradient(180deg, #f3f8ff 0%, #f1f5fd 340px);
  min-height: 100vh;
}

/* 首页与查询页共用同一底色 */
body.home-page {
  background:
    radial-gradient(1100px 460px at 50% -180px, #dbeafe 0%, rgba(219,234,254,0) 68%),
    radial-gradient(900px 420px at 100% 0%, #e0f2fe 0%, rgba(224,242,254,0) 60%),
    linear-gradient(180deg, #f3f8ff 0%, #f1f5fd 340px);
  min-height: 100vh;
}

.q-wrap { max-width: 1180px; margin: 0 auto; padding: 0 18px; }

/* ---------------- 顶栏 ---------------- */
.q-header {
  position: sticky; top: 0; z-index: 80;
  background: rgba(255, 255, 255, .86);
  backdrop-filter: saturate(1.7) blur(12px);
  border-bottom: 1px solid rgba(37, 99, 235, .10);
}
.q-header .q-wrap {
  height: 62px; display: flex; align-items: center; justify-content: space-between; gap: 14px;
}
.q-brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.q-brand .logo {
  width: 38px; height: 38px; border-radius: 11px; flex: 0 0 auto;
  background: var(--brand-grad); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700;
  box-shadow: var(--shadow-brand);
}
.q-brand .nm { font-size: 16px; font-weight: 700; color: var(--text); letter-spacing: -.2px; line-height: 1.25; }
.q-brand .sub { font-size: 10.5px; color: var(--primary); letter-spacing: 1.4px; font-weight: 600; opacity: .82; }
.q-header .acts { display: flex; align-items: center; gap: 8px; }

.q-user {
  display: flex; align-items: center; gap: 9px;
  padding: 4px 12px 4px 5px; border-radius: 30px;
  border: 1px solid var(--line); background: #fff;
  transition: all .15s; text-decoration: none;
}
.q-user:hover { border-color: #c3d0ea; box-shadow: var(--shadow-xs); text-decoration: none; }
.q-user .nm { font-size: 13px; color: var(--text); font-weight: 500; max-width: 96px; }

/* ---------------- 数据集切换 ---------------- */
.ds-tabs {
  display: flex; gap: 8px; flex-wrap: wrap;
  padding: 20px 0 0;
}
.ds-tab {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 15px; border-radius: 30px;
  font-size: 13.5px; color: var(--text-2);
  background: #fff; border: 1px solid var(--line);
  transition: all .16s; text-decoration: none; white-space: nowrap;
}
.ds-tab:hover { border-color: #bed2f7; color: var(--primary); text-decoration: none; }
.ds-tab.on {
  background: var(--brand-grad); border-color: transparent; color: #fff; font-weight: 600;
  box-shadow: var(--shadow-brand);
}
.ds-tab .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .5; }
.ds-tab.on .dot { opacity: .9; }

/* ---------------- Hero ---------------- */
.q-hero {
  position: relative; overflow: hidden;
  margin: 22px 0 18px;
  padding: 30px 32px;
  border-radius: 20px;
  background: var(--brand-grad);
  color: #fff;
  box-shadow: 0 18px 40px -18px rgba(37, 99, 235, .65);
}
.q-hero::after {
  content: ''; position: absolute; right: -60px; top: -90px;
  width: 300px; height: 300px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.22) 0%, rgba(255,255,255,0) 68%);
}
.q-hero::before {
  content: ''; position: absolute; right: 90px; bottom: -120px;
  width: 230px; height: 230px; border-radius: 50%;
  background: radial-gradient(circle, rgba(6,182,212,.4) 0%, rgba(6,182,212,0) 70%);
}
.q-hero h1 { font-size: 24px; color: #fff; letter-spacing: -.4px; position: relative; }
.q-hero p { margin: 8px 0 0; font-size: 13.5px; color: rgba(255,255,255,.88); position: relative; max-width: 720px; }
.q-hero .chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 15px; position: relative; }
.q-hero .chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 11px; border-radius: 20px; font-size: 12px;
  background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.26);
  color: #fff;
}

/* ---------------- 查询区 ---------------- */
.q-search { padding: 20px 22px; margin-bottom: 18px; }
.q-kw { display: flex; gap: 12px; align-items: stretch; }
.kw-box { flex: 1; min-width: 0; position: relative; display: flex; align-items: center; }
.kw-box .ic { position: absolute; left: 14px; font-size: 15px; opacity: .55; pointer-events: none; }
.kw-box input {
  width: 100%; height: 46px;
  padding: 0 16px 0 40px;
  font-size: 14.5px; font-family: inherit; color: var(--text);
  background: #f7faff; border: 1.6px solid var(--line);
  border-radius: 12px; outline: none;
  transition: all .16s;
}
.kw-box input:hover { border-color: #c3d0ea; }
.kw-box input:focus { background: #fff; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-ring); }
.q-kw .btn-primary { height: 46px; padding: 0 26px; font-size: 15px; border-radius: 12px; }

.q-toggle {
  display: flex; align-items: center; gap: 7px;
  margin-top: 14px; padding: 0; border: 0; background: transparent;
  font-size: 13px; color: var(--primary); cursor: pointer; font-family: inherit;
}
.q-toggle .ar { font-size: 10px; transition: transform .18s; color: var(--muted); }
.q-toggle.open .ar { transform: rotate(180deg); }

.q-conds {
  margin-top: 14px; padding-top: 16px;
  border-top: 1px dashed var(--line);
  display: grid; grid-template-columns: repeat(auto-fit, minmax(272px, 1fr)); gap: 13px;
}
.q-cond { display: flex; flex-direction: column; gap: 6px; }
.q-cond > label { font-size: 12.5px; color: var(--text-2); font-weight: 500; }
.q-cond .ops { display: flex; gap: 7px; }
.q-cond .ops .op { width: 106px; flex: 0 0 auto; font-size: 13px; }
.q-cond .ops .inp { flex: 1; min-width: 0; }

.q-actions {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 18px; padding-top: 16px;
  border-top: 1px solid var(--line-2);
}
.q-actions .hint { font-size: 12.5px; color: var(--muted); margin-left: auto; }

/* 查询须知 */
.q-notice {
  display: flex; gap: 10px; align-items: flex-start;
  margin-bottom: 16px; padding: 12px 16px;
  background: var(--primary-soft); border: 1px solid #d5e5fd;
  border-radius: 12px; font-size: 13px; color: #1b4bb5; line-height: 1.7;
}
.q-notice .ic { font-size: 15px; line-height: 1.45; }

/* ---------------- 结果区 ---------------- */
.q-result { margin-bottom: 22px; overflow: hidden; }
.q-result-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 15px 20px;
  background: linear-gradient(180deg, #fbfdff 0%, #f5faff 100%);
  border-bottom: 1px solid var(--line-2);
  flex-wrap: wrap;
}
.q-result-head .ttl {
  font-size: 15px; font-weight: 600; color: var(--text);
  display: flex; align-items: center; gap: 9px;
}
.q-result-head .ttl::before {
  content: ''; width: 3px; height: 15px; border-radius: 2px; background: var(--brand-grad);
}
.q-result-head .cnt {
  font-size: 12.5px; font-weight: 600; color: var(--primary-dark);
  background: var(--primary-light); padding: 2px 10px; border-radius: 20px;
}
.q-result-head .sp { display: flex; align-items: center; gap: 8px; }

/* 联动提示条 */
.q-tip {
  margin: 16px 20px 0; padding: 12px 16px;
  display: flex; gap: 10px; align-items: flex-start;
  background: linear-gradient(135deg, #ecfdf5 0%, #e7f7ef 100%);
  border: 1px solid #c8ebd7; border-radius: 12px;
  font-size: 13.5px; color: #0b6b36; line-height: 1.7;
}
.q-tip .i {
  width: 19px; height: 19px; border-radius: 50%; flex: 0 0 auto;
  background: var(--suc); color: #fff; font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; margin-top: 2px;
}
.q-tip.warn { background: linear-gradient(135deg, #fffaf0 0%, #fef6e7 100%); border-color: #f7ddb0; color: #8a5605; }
.q-tip.warn .i { background: var(--warn); }
.q-tip b { font-weight: 600; }

/* 占位 / 空状态 */
.q-placeholder { padding: 56px 24px; text-align: center; }
.q-placeholder .ic { font-size: 44px; line-height: 1; margin-bottom: 14px; opacity: .6; }
.q-placeholder .t { font-size: 16px; font-weight: 600; color: var(--text-2); margin-bottom: 7px; }
.q-placeholder .d { font-size: 13.5px; color: var(--muted); line-height: 1.85; }

.q-causes {
  max-width: 560px; margin: 20px auto 0; text-align: left;
  background: #f9fbff; border: 1px solid var(--line); border-radius: 14px;
  padding: 16px 20px;
}
.q-causes .h {
  font-size: 12.5px; font-weight: 700; color: var(--primary-dark);
  letter-spacing: .4px; margin-bottom: 9px;
}
.q-causes ol { margin: 0; padding-left: 20px; }
.q-causes li { font-size: 13px; color: var(--text-2); line-height: 1.95; }
.q-causes li b { color: var(--text); }

/* ---------------- 结果表格 ---------------- */
.q-table-wrap { width: 100%; overflow-x: auto; }
table.q-tb { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
table.q-tb thead th {
  position: sticky; top: 0; z-index: 2;
  padding: 12px 16px; text-align: left; white-space: nowrap;
  background: #f4f9ff;
  color: var(--primary-deep); font-weight: 600; font-size: 12.5px;
  border-bottom: 1px solid #dfe9fb;
}
table.q-tb thead th.idx { width: 58px; text-align: center; color: var(--muted); font-weight: 500; }
table.q-tb tbody td {
  padding: 13px 16px; vertical-align: middle;
  color: var(--text); border-bottom: 1px solid var(--line-2);
  position: relative;
}
table.q-tb tbody tr { transition: background .14s; }
table.q-tb tbody tr:nth-child(even) { background: #fcfdff; }
table.q-tb tbody tr:hover { background: #f2f7ff; }
table.q-tb tbody tr:hover td:first-child { box-shadow: inset 3px 0 0 var(--primary); }
table.q-tb tbody tr:last-child td { border-bottom: 0; }
table.q-tb td.idx { text-align: center; color: var(--muted); font-size: 12.5px; font-weight: 500; }
table.q-tb .muted { color: #c3cbdb; }

/* 关键词高亮 */
.q-em {
  background: linear-gradient(180deg, rgba(255,255,255,0) 56%, #ffe08a 56%);
  color: #92400e; font-weight: 600; padding: 0 1px; border-radius: 2px;
}

/* 结果单元格特殊渲染 */
.cell-img img {
  width: 42px; height: 42px; object-fit: cover; border-radius: 8px;
  border: 1px solid var(--line); cursor: zoom-in; display: block;
}
.cell-color { display: inline-flex; align-items: center; gap: 7px; }
.cell-color .sw { width: 15px; height: 15px; border-radius: 5px; border: 1px solid rgba(0,0,0,.12); }
.cell-bar { display: flex; align-items: center; gap: 9px; min-width: 118px; }
.cell-bar .track { flex: 1; height: 7px; border-radius: 4px; background: #e8eefb; overflow: hidden; }
.cell-bar .fill { height: 100%; border-radius: 4px; background: var(--brand-grad); }
.cell-bar .n { font-size: 12.5px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.cell-stars { color: #f59e0b; letter-spacing: 1px; white-space: nowrap; }
.cell-bool.on { color: var(--suc); font-weight: 600; }
.cell-bool.off { color: var(--muted); }
.cell-link { color: var(--primary); max-width: 220px; display: inline-block; vertical-align: bottom; }
.cell-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.cell-tags .tg {
  font-size: 11.5px; padding: 1px 8px; border-radius: 20px;
  background: var(--primary-soft); color: var(--primary-dark); border: 1px solid #dbe7fd;
}
.mono-cell { font-family: var(--mono); font-size: 12.5px; letter-spacing: .2px; }

/* 结果卡片（窄屏） */
.q-cards { display: none; }

/* 分页 */
.q-pager .pager { padding: 14px 20px; }

/* ---------------- 页脚 ---------------- */
.q-foot {
  padding: 26px 0 40px; text-align: center;
  color: var(--muted); font-size: 12.5px; line-height: 2;
}
.q-foot a { color: var(--primary); }

/* =========================================================
   AI 助手（默认收起）
   ========================================================= */
.ai-fab {
  position: fixed; right: 24px; bottom: 26px; z-index: 700;
  width: 56px; height: 56px; border-radius: 50%;
  border: 0; cursor: pointer;
  background: var(--brand-grad); color: #fff;
  font-size: 23px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 12px 28px -6px rgba(37, 99, 235, .6);
  transition: transform .18s, box-shadow .18s;
}
.ai-fab:hover { transform: translateY(-3px) scale(1.04); box-shadow: 0 16px 34px -6px rgba(37, 99, 235, .7); }
.ai-fab .dot {
  position: absolute; top: 4px; right: 4px;
  width: 11px; height: 11px; border-radius: 50%;
  background: #ef4444; border: 2px solid #fff;
  display: none;
}
.ai-fab.open { background: #fff; color: var(--primary); box-shadow: var(--shadow-lg); }

.ai-panel {
  position: fixed; right: 24px; bottom: 94px; z-index: 701;
  /* 宽度用「含滚动条的视口宽度」算最稳：
     calc(100% - 48px) 的 100% 是初始包含块（已扣掉竖向滚动条），
     比 100vw 更可靠——100vw 会把滚动条宽度也算进去，窄屏时容易顶出屏幕右边。 */
  box-sizing: border-box;
  width: min(372px, calc(100% - 48px));
  height: 540px; max-height: calc(100vh - 140px);
  background: #fff; border: 1px solid var(--line);
  border-radius: 18px; overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: 0 26px 60px -18px rgba(23, 43, 92, .38);
  animation: aiIn .22s cubic-bezier(.22,1,.36,1);
}
@keyframes aiIn { from { opacity: 0; transform: translateY(18px) scale(.97) } to { opacity: 1; transform: none } }
.ai-panel.hidden { display: none; }

.ai-head {
  display: flex; align-items: center; gap: 11px;
  padding: 14px 16px;
  background: var(--brand-grad); color: #fff;
}
.ai-head .av {
  width: 36px; height: 36px; border-radius: 11px; flex: 0 0 auto;
  background: rgba(255,255,255,.2); border: 1px solid rgba(255,255,255,.28);
  display: flex; align-items: center; justify-content: center; font-size: 17px;
}
.ai-head .nm { font-size: 14.5px; font-weight: 600; }
.ai-head .st { font-size: 11.5px; opacity: .86; display: flex; align-items: center; gap: 5px; }
.ai-head .st::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%; background: #4ade80;
  box-shadow: 0 0 0 3px rgba(74, 222, 128, .28);
}
.ai-head .x {
  margin-left: auto; border: 0; background: rgba(255,255,255,.16);
  color: #fff; width: 28px; height: 28px; border-radius: 9px;
  font-size: 18px; line-height: 1; cursor: pointer;
}
.ai-head .x:hover { background: rgba(255,255,255,.3); }

.ai-body {
  flex: 1; overflow-y: auto; padding: 16px;
  background: linear-gradient(180deg, #fbfdff 0%, #ffffff 240px);
}
.ai-msg { display: flex; gap: 9px; margin-bottom: 14px; align-items: flex-start; }
.ai-msg .mini-av {
  width: 29px; height: 29px; border-radius: 9px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; background: var(--primary-light); color: var(--primary-dark);
}
.ai-msg .b {
  padding: 10px 13px; border-radius: 13px; font-size: 13.5px; line-height: 1.78;
  background: #fff; border: 1px solid var(--line);
  box-shadow: var(--shadow-xs); max-width: 268px;
  /* 长链接 / 长数字串也要能断行，否则会把气泡顶出面板右边 */
  word-break: break-word; overflow-wrap: anywhere; color: var(--text);
}
.ai-msg .b b { color: var(--primary-dark); }
.ai-msg.me { flex-direction: row-reverse; }
.ai-msg.me .mini-av { background: var(--brand-grad); color: #fff; }
.ai-msg.me .b {
  background: var(--brand-grad); color: #fff; border-color: transparent;
  box-shadow: 0 6px 16px -6px rgba(37, 99, 235, .55);
}

.ai-typing { display: flex; gap: 4px; padding: 5px 3px; }
.ai-typing i {
  width: 6px; height: 6px; border-radius: 50%; background: #b9c6dd;
  animation: aiBounce 1.1s infinite ease-in-out;
}
.ai-typing i:nth-child(2) { animation-delay: .16s; }
.ai-typing i:nth-child(3) { animation-delay: .32s; }
@keyframes aiBounce { 0%,60%,100% { transform: translateY(0); opacity: .55 } 30% { transform: translateY(-5px); opacity: 1 } }

.ai-suggests { display: flex; gap: 7px; flex-wrap: wrap; padding: 0 16px 12px; background: #fff; }
.ai-suggests button {
  border: 1px solid #dbe7fd; background: var(--primary-soft); color: var(--primary-dark);
  font-size: 12.5px; font-family: inherit; padding: 5px 11px;
  border-radius: 20px; cursor: pointer; transition: all .15s;
}
.ai-suggests button:hover { background: var(--primary-light); border-color: #c3d8fb; }

.ai-foot {
  display: flex; gap: 9px; align-items: flex-end;
  padding: 12px 16px 14px; border-top: 1px solid var(--line-2); background: #fff;
}
.ai-foot textarea {
  flex: 1; min-height: 40px; max-height: 90px; resize: none;
  padding: 10px 13px; font-size: 13.5px; font-family: inherit; color: var(--text);
  border: 1px solid var(--line); border-radius: 11px; outline: none;
  transition: all .15s; line-height: 1.5;
}
.ai-foot textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }
.ai-foot .send {
  width: 40px; height: 40px; flex: 0 0 auto; border: 0; border-radius: 11px;
  background: var(--brand-grad); color: #fff; font-size: 15px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px -3px rgba(37, 99, 235, .6);
}
.ai-foot .send:disabled { opacity: .5; cursor: not-allowed; }
.ai-foot .send:hover:not(:disabled) { filter: brightness(1.06); }

/* ---------------- 响应式 ---------------- */
@media (max-width: 860px) {
  .q-hero { padding: 24px 22px; border-radius: 16px; }
  .q-hero h1 { font-size: 20px; }
  .q-kw { flex-direction: column; }
  .q-kw .btn-primary { width: 100%; }
  .q-actions .hint { margin-left: 0; width: 100%; }
  /* 窄屏：固定右对齐 + 明确宽度，保证任何时候都不会超出屏幕右边 */
  .ai-panel { right: 12px; left: auto; width: calc(100% - 24px); max-width: none; bottom: 88px; height: 70vh; }
  .ai-fab { right: 16px; bottom: 18px; }
  .q-search { padding: 16px; }
  .q-conds { grid-template-columns: 1fr; }
}

/* 窄屏：表格转卡片 */
@media (max-width: 640px) {
  .q-table-wrap { display: none; }
  .q-cards { display: block; padding: 14px; }
  .res-card {
    border: 1px solid var(--line); border-radius: 14px;
    padding: 14px 15px; margin-bottom: 12px; background: #fff;
    box-shadow: var(--shadow-xs);
  }
  .res-card .rc-head {
    display: flex; align-items: center; gap: 8px; margin-bottom: 10px;
    padding-bottom: 9px; border-bottom: 1px dashed var(--line);
  }
  .res-card .rc-no {
    width: 22px; height: 22px; border-radius: 7px; flex: 0 0 auto;
    background: var(--primary-light); color: var(--primary-dark);
    font-size: 11.5px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
  }
  .res-card .rc-title { font-size: 14px; font-weight: 600; }
  .res-card .rc-row { display: flex; gap: 10px; padding: 5px 0; font-size: 13px; line-height: 1.7; }
  .res-card .rc-k { width: 82px; flex: 0 0 auto; color: var(--muted); font-size: 12.5px; }
  .res-card .rc-v { flex: 1; min-width: 0; word-break: break-word; }
}

/* =========================================================
   首页（和小程序的探索页同一套内容）
   ========================================================= */

.h-hero {
  position: relative; overflow: hidden;
  margin: 22px 0 18px;
  padding: 34px 36px 30px;
  border-radius: 22px;
  background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 48%, #0ea5e9 100%);
  color: #fff;
  box-shadow: 0 20px 44px -18px rgba(37, 99, 235, .55);
}
.h-hero::after {
  content: ''; position: absolute; right: -70px; top: -110px;
  width: 300px; height: 300px; border-radius: 50%;
  background: rgba(255, 255, 255, .12);
}
.h-hero h1 { margin: 0; font-size: 27px; font-weight: 700; letter-spacing: -.4px; position: relative; z-index: 2; }
.h-hero p { margin: 9px 0 0; font-size: 13.5px; opacity: .88; line-height: 1.7; position: relative; z-index: 2; }

.h-search {
  position: relative; z-index: 2;
  display: flex; align-items: center; gap: 10px;
  margin-top: 20px; padding: 6px 6px 6px 16px;
  background: #fff; border-radius: 16px;
  box-shadow: 0 10px 26px -12px rgba(10, 30, 80, .45);
}
.h-search .ic { font-size: 15px; opacity: .65; }
.h-search input {
  flex: 1; min-width: 0; border: 0; outline: none; background: transparent;
  font-size: 14.5px; font-family: inherit; color: var(--text); padding: 9px 0;
}
.h-search input::placeholder { color: #9aa8bd; }
.h-search #h-kw-clear {
  width: 34px; height: 34px; flex: 0 0 auto; border: 0; border-radius: 10px;
  background: #f1f5fd; color: #6b7c96; font-size: 14px; cursor: pointer;
}
.btn-white {
  background: #fff; border: 1px solid var(--line); color: var(--primary-dark);
}
.btn-white:hover { border-color: #bed2f7; }

.h-pills { position: relative; z-index: 2; display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.h-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 30px;
  background: rgba(255, 255, 255, .18);
  border: 1px solid rgba(255, 255, 255, .3);
  color: #fff; font-size: 12.5px; text-decoration: none;
}
.h-pill b { font-size: 15px; font-weight: 700; }
.h-pill:hover { background: rgba(255, 255, 255, .28); color: #fff; text-decoration: none; }

/* 两个快捷入口 */
.h-quick { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 20px; }
.h-qcard {
  display: flex; align-items: center; gap: 13px;
  padding: 18px 20px; border-radius: 18px;
  color: #fff; text-decoration: none;
  box-shadow: 0 12px 26px -14px rgba(23, 43, 92, .5);
  transition: transform .16s;
}
.h-qcard:hover { transform: translateY(-2px); color: #fff; text-decoration: none; }
.h-qcard.q-blue { background: linear-gradient(135deg, #1d4ed8, #2563eb 60%, #0ea5e9); }
.h-qcard.q-teal { background: linear-gradient(135deg, #0f766e, #0d9488 58%, #14b8a6); }
.h-qcard .qc-ico {
  width: 42px; height: 42px; flex: 0 0 auto; border-radius: 13px;
  background: rgba(255, 255, 255, .22);
  display: flex; align-items: center; justify-content: center; font-size: 19px;
}
.h-qcard .grow { flex: 1; min-width: 0; }
.h-qcard .qc-t { display: block; font-size: 15px; font-weight: 700; }
.h-qcard .qc-d { display: block; font-size: 12px; opacity: .86; margin-top: 3px; }
.h-qcard .qc-n {
  font-size: 20px; font-weight: 700; flex: 0 0 auto;
  background: rgba(255, 255, 255, .2); padding: 2px 12px; border-radius: 20px;
}
.h-qcard .qc-arrow { font-size: 22px; opacity: .8; }

/* 分类胶囊 */
.h-chips { display: flex; gap: 9px; flex-wrap: wrap; margin: 0 0 18px; }
.h-chips .chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 30px; cursor: pointer;
  background: #fff; border: 1px solid var(--line);
  font-size: 13px; color: var(--text-2); user-select: none;
  transition: all .15s;
}
.h-chips .chip:hover { border-color: #bed2f7; color: var(--primary); }
.h-chips .chip.on {
  background: var(--brand-grad); border-color: transparent; color: #fff; font-weight: 600;
  box-shadow: var(--shadow-brand);
}
.h-chips .chip .n {
  font-style: normal; font-size: 11.5px; opacity: .8;
  background: rgba(0, 0, 0, .06); padding: 0 7px; border-radius: 20px;
}
.h-chips .chip.on .n { background: rgba(255, 255, 255, .24); }

/* 区块标题 */
.h-sec { display: flex; align-items: center; gap: 9px; margin: 6px 0 14px; }
.h-sec .bar { width: 4px; height: 17px; border-radius: 3px; background: var(--brand-grad); }
.h-sec .t { font-size: 16px; font-weight: 700; color: var(--text); }
.h-sec .n { font-size: 12.5px; color: var(--muted); }

/* 项目卡片 */
.ds-cards { display: flex; flex-direction: column; gap: 12px; }
.ds-card {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px; border-radius: 18px;
  background: #fff; border: 1px solid var(--line);
  box-shadow: var(--shadow-xs);
  text-decoration: none; color: inherit;
  transition: all .16s;
}
.ds-card:hover {
  border-color: #bed2f7; transform: translateY(-1px);
  box-shadow: 0 12px 26px -16px rgba(37, 99, 235, .55);
  text-decoration: none; color: inherit;
}
.ds-card .icon-chip {
  width: 46px; height: 46px; flex: 0 0 auto; border-radius: 14px;
  display: flex; align-items: center; justify-content: center; font-size: 22px;
}
.ds-card .ds-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.ds-card .ds-name { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; color: var(--text); }
.ds-card .ds-name .ellipsis { max-width: 100%; }
.ds-card .ds-name .badge {
  flex: 0 0 auto; font-size: 11px; font-weight: 500;
  padding: 2px 9px; border-radius: 20px;
  background: var(--primary-soft, #eff6ff); color: var(--primary-dark);
}
.ds-card .ds-desc { font-size: 12.5px; color: #6b7c96; }
.ds-card .ds-meta { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--muted); }
.ds-card .ds-acts { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.ds-card .mini-act {
  width: 34px; height: 34px; border-radius: 11px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; color: #9aa8bd;
  background: #f7faff; border: 1px solid var(--line);
  transition: all .15s;
}
.ds-card .mini-act:hover { border-color: #bed2f7; color: var(--primary); }
.ds-card .mini-act.on { color: #f59e0b; border-color: #fde68a; background: #fffbeb; }
.ds-card .mini-act.on-follow { color: var(--primary); border-color: #c3d8fb; background: #eff6ff; }

/* 首页骨架屏（搜索/筛选时的占位） */
.h-sk {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid var(--line);
}
.h-sk .sk-ico {
  width: 46px; height: 46px; border-radius: 14px; flex: 0 0 auto;
  background: linear-gradient(90deg, #eef3fb 25%, #e4ecf9 37%, #eef3fb 63%);
  background-size: 400% 100%;
  animation: hSk 1.3s ease infinite;
}
.h-sk .sk-lines { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 9px; }
.h-sk .sk-line {
  display: block; height: 12px; border-radius: 8px;
  background: linear-gradient(90deg, #eef3fb 25%, #e4ecf9 37%, #eef3fb 63%);
  background-size: 400% 100%;
  animation: hSk 1.3s ease infinite;
}
@keyframes hSk {
  0%   { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

/* 最近查询过 */
.h-recent { margin-bottom: 20px; }
.h-recent-list {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.h-recent-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 8px 14px 8px 8px;
  border-radius: 30px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-xs);
  text-decoration: none;
  color: var(--text);
  transition: all .15s;
}
.h-recent-item:hover { border-color: #bed2f7; color: var(--primary); text-decoration: none; transform: translateY(-1px); }
.h-recent-item .icon-chip {
  width: 30px; height: 30px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; font-size: 15px;
  flex: 0 0 auto;
}
.h-recent-item .hri-t { font-size: 13px; font-weight: 500; max-width: 150px; }
.h-recent-item .hri-n { font-size: 11.5px; color: var(--muted); }

/* 未登录时的扫码登录小气泡（常驻右下角） */
.h-scan-bubble {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 60;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 16px;
  border-radius: 30px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 12px 30px -12px rgba(23, 43, 92, .45);
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  animation: hBubbleIn .4s cubic-bezier(.22, 1, .36, 1) both;
}
.h-scan-bubble:hover { text-decoration: none; color: #fff; background: var(--primary); border-color: var(--primary); }
.h-scan-bubble .sb-b-ico { font-size: 16px; line-height: 1; }
@keyframes hBubbleIn { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }
@media (max-width: 640px) { .h-scan-bubble .sb-b-t { display: none; } }

.h-empty {
  padding: 46px 20px; text-align: center;
  background: #fff; border: 1px dashed var(--line); border-radius: 18px;
}
.h-empty .ic { font-size: 34px; }
.h-empty .t { margin-top: 12px; font-size: 15.5px; font-weight: 600; color: var(--text); }
.h-empty .d { margin-top: 7px; font-size: 13px; color: var(--muted); line-height: 1.8; }

.h-more { margin: 16px 0 4px; }

@media (max-width: 760px) {
  .h-hero { padding: 24px 20px; border-radius: 18px; }
  .h-hero h1 { font-size: 21px; }
  .h-quick { grid-template-columns: 1fr; }
  .ds-card .ds-acts { display: none; }
}

/* =========================================================
   结果页：彩色图标 / 复制按钮 / 分享海报 / 动态背景
   ========================================================= */

/* ---------------- 动态背景（纯装饰层，pointer-events:none） ---------------- */
.q-bg {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
/* 动态斜线：缓慢流动，像数据在跑 */
.q-bg .qb-line {
  position: absolute;
  inset: -30% -30%;
  background-image: repeating-linear-gradient(115deg,
    rgba(37, 99, 235, .055) 0 2px, rgba(37, 99, 235, 0) 2px 36px);
  animation: qLines 24s linear infinite;
  will-change: transform;
}
@keyframes qLines {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-72px, 36px, 0); }
}
/* 水波纹：从左上 / 右上慢慢扩散 */
.q-bg .qb-ripple {
  position: absolute;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  border: 2px solid rgba(37, 99, 235, .18);
  opacity: 0;
  animation: qRipple 9s ease-out infinite;
}
.q-bg .qb-ripple.r1 { left: -60px; top: -40px; }
.q-bg .qb-ripple.r2 { left: -60px; top: -40px; animation-delay: 3s; }
.q-bg .qb-ripple.r3 { right: -60px; top: 80px; animation-delay: 1.6s; border-color: rgba(14, 165, 233, .2); }
@keyframes qRipple {
  0%   { transform: scale(.35); opacity: .75; }
  70%  { opacity: .18; }
  100% { transform: scale(2.6); opacity: 0; }
}

/* 内容层压在背景之上 */
main.q-wrap { position: relative; z-index: 1; }

/* 查询页顶部光晕呼吸（水感） */
body.query-page .q-hero { animation: qHeroGlow 9s ease-in-out infinite; }
@keyframes qHeroGlow {
  0%, 100% { box-shadow: 0 18px 40px -18px rgba(37, 99, 235, .65); }
  50%      { box-shadow: 0 22px 52px -18px rgba(37, 99, 235, .85); }
}

/* 无障碍：系统开了"减少动态效果"就全部静止 */
@media (prefers-reduced-motion: reduce) {
  .q-bg .qb-line,
  .q-bg .qb-ripple,
  body.query-page .q-hero { animation: none !important; }
  .q-bg .qb-ripple { opacity: .25; }
}

/* ---------------- 字段类型彩色小图标 ---------------- */
.th-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 19px;
  height: 19px;
  margin-right: 5px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  vertical-align: -3px;
  flex: 0 0 auto;
}
.q-tb th .th-ico { margin-right: 6px; }
.rc-k .th-ico { width: 17px; height: 17px; font-size: 10px; vertical-align: -3px; }

/* 行号彩色徽标 */
.idx-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
}
.res-card .rc-no {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
}

/* ---------------- 每行「复制」按钮（放大 + 图标） ---------------- */
.q-tb td.act, .q-tb th.act { width: 96px; text-align: center; }
.row-copy {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 32px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid #c9dbfb;
  background: #f2f7ff;
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.row-copy:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 14px -6px rgba(37, 99, 235, .7);
}
.row-copy:active { transform: scale(.96); }
.row-copy .rc-i { font-size: 14px; line-height: 1; }
.row-copy.sm { height: 28px; padding: 0 10px; font-size: 12px; margin-left: auto; }
.res-card .rc-head { gap: 8px; }

/* ---------------- 结果操作条：分享 / 海报 / 复制 ---------------- */
.q-share-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}
.q-share-bar .btn { display: inline-flex; align-items: center; gap: 6px; }
.q-share-bar .sb-i { font-size: 14px; line-height: 1; }
.q-share-bar .sb-hint {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--muted);
}
@media (max-width: 760px) {
  .q-share-bar .btn { flex: 1 1 auto; justify-content: center; }
  .q-share-bar .sb-hint { margin-left: 0; width: 100%; }
}

/* ---------------- 数据更新提醒条 ---------------- */
.q-updated {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 12px;
  padding: 11px 14px;
  border-radius: 12px;
  background: #eff6ff;
  border: 1px solid #c9dbfb;
  color: var(--primary-dark);
  font-size: 13.5px;
  animation: qUpdatedIn .3s cubic-bezier(.22, 1, .36, 1) both;
}
.q-updated .qu-i { font-size: 15px; line-height: 1; }
.q-updated .btn { margin-left: auto; }
.q-updated .btn + .btn { margin-left: 0; }
@keyframes qUpdatedIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ---------------- 海报画布 ---------------- */
.poster-wrap {
  display: flex;
  justify-content: center;
  padding: 4px 0 8px;
  background: linear-gradient(180deg, #f4f8ff, #eef4ff);
  border-radius: 14px;
}
.poster-wrap canvas {
  width: 100%;
  max-width: 380px;
  height: auto;
  border-radius: 14px;
  box-shadow: 0 16px 36px -16px rgba(23, 43, 92, .5);
}
