/* 规范检索 手机优先样式 */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f2f4f7; color: #1f2733; font-size: 16px;
  max-width: 680px; margin: 0 auto; min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

/* 顶栏 */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: #fff; padding: 10px 12px 8px;
  border-bottom: 1px solid #e4e8ee;
  padding-top: calc(10px + env(safe-area-inset-top));
}
.brand { font-size: 17px; font-weight: 700; color: #14488c; margin-bottom: 8px; display:flex; align-items:center; gap:6px;}
.brand .logo { width:20px;height:20px;border-radius:5px;background:#14488c;color:#fff;display:inline-flex;align-items:center;justify-content:center;font-size:12px; }
.searchrow { display: flex; gap: 8px; }
.searchrow input {
  flex: 1; border: 1.5px solid #c9d3e0; border-radius: 10px;
  padding: 9px 12px; font-size: 16px; outline: none; background: #fafbfc;
}
.searchrow input:focus { border-color: #14488c; background: #fff; }
.searchrow button {
  border: none; background: #14488c; color: #fff; border-radius: 10px;
  padding: 0 18px; font-size: 15px; font-weight: 600;
}
.modes { display: flex; gap: 18px; margin-top: 7px; font-size: 13px; color: #5b6675; }
.modes label { display: flex; align-items: center; gap: 4px; }

.hint { padding: 10px 14px 2px; font-size: 13px; color: #8a93a3; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; padding: 8px 14px 0; }
.chip {
  border: 1px solid #c9d3e0; background: #fff; color: #44506080;
  border-radius: 999px; padding: 3px 12px; font-size: 13px; color: #445060;
}
.chip.on { background: #14488c; color: #fff; border-color: #14488c; }

/* 结果卡片 */
main { padding: 10px 12px 70px; }
main .hint { padding: 0 2px; }
main .chips { padding: 8px 2px 0; }
.pvwrap { display: none; }
.desknav { display: none; }
.card {
  display: block; background: #fff; border-radius: 12px;
  padding: 12px 14px; margin-bottom: 10px;
  box-shadow: 0 1px 2px rgba(20, 40, 80, .06);
  border: 1px solid #eef1f5;
}
.card:active { background: #f6f9fd; }
.card.on { border-color: #14488c; box-shadow: 0 0 0 2px rgba(20, 72, 140, .22); }
.meta { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.clause {
  background: #e8f0fc; color: #14488c; font-weight: 700;
  border-radius: 6px; padding: 1px 8px; font-size: 13px;
}
.docname { font-size: 12.5px; color: #7c8698; }
.sn { font-size: 15px; line-height: 1.65; color: #2a3442; }
.sn mark { background: #ffe58a; border-radius: 2px; padding: 0 1px; }
.ch { margin-top: 6px; font-size: 12.5px; color: #98a1b0; }
.tblflag { font-size: 12px; color: #b07800; background: #fff6df; border-radius: 5px; padding: 0 6px; }

.empty { text-align: center; color: #8a93a3; padding: 60px 20px; font-size: 14px; }

/* 底部导航 */
.tabs {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
  max-width: 680px; margin: 0 auto;
  display: flex; background: #fff; border-top: 1px solid #e4e8ee;
  padding-bottom: env(safe-area-inset-bottom);
}
.tabs a {
  flex: 1; text-align: center; padding: 8px 0 7px; font-size: 12px; color: #8a93a3;
}
.tabs a .ico { font-size: 20px; display: block; line-height: 1.2; }
.tabs a.on { color: #14488c; font-weight: 600; }

/* 目录页 */
.catgrp { margin: 14px 14px 0; }
.catgrp h2 {
  font-size: 14px; color: #5b6675; padding: 4px 0 6px; font-weight: 600;
  cursor: pointer; user-select: none;
}
.catgrp h2 .tri {
  display: inline-block; width: 1.1em; transition: transform .15s;
  font-size: 11px; color: #98a1b0;
}
.catgrp:not(.open) .tri { transform: rotate(-90deg); }
.catgrp h2 .cnt { font-size: 12px; font-weight: 400; color: #98a1b0; }
.catgrp:not(.open) .docrow { display: none; }
.docrow {
  display: block; padding: 9px 6px 9px 2em;   /* 左侧缩进两个字符 */
  border-bottom: 1px solid #e8ecf1;           /* 细分隔线代替白色卡片 */
}
.docrow .code { font-size: 13px; color: #14488c; font-weight: 700; }
.docrow .code .pgn { float: right; font-weight: 400; font-size: 12px; color: #98a1b0; }
.docrow .ti { font-size: 15px; margin-top: 2px; }

/* 阅读页 */
.reader-top {
  position: sticky; top: 0; z-index: 20; background: #fff;
  border-bottom: 1px solid #e4e8ee;
  padding: calc(8px + env(safe-area-inset-top)) 10px 8px;
  display: flex; align-items: center; gap: 8px;
}
.reader-top .back { font-size: 22px; color: #14488c; padding: 0 4px; }
.reader-top .ttl { flex: 1; min-width: 0; }
.reader-top .ttl .t1 { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reader-top .ttl .t2 { font-size: 12px; color: #7c8698; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reader-top .clausechip {
  background: #ffe58a; color: #6b5200; font-size: 12.5px; font-weight: 700;
  padding: 2px 8px; border-radius: 6px; white-space: nowrap;
}
.reader-top .tocbtn {
  border: 1px solid #c9d3e0; background: #fff; border-radius: 8px;
  font-size: 13px; padding: 5px 10px; color: #445060;
}
.pgscroll { overflow: auto; }
.page-wrap { position: relative; margin: 10px auto 6px; width: 100%; }
.page-wrap img { display: block; width: 100%; background: #fff; cursor: zoom-in; }
.page-wrap.zoomed { max-width: none; width: max-content; }
.page-wrap.zoomed img { cursor: zoom-out; }
.hlbox {
  position: absolute; border: none; background: transparent;
  outline: 1.5px solid #ff5b3d; outline-offset: 5px;  /* 细线画在框外侧，不压文字 */
  border-radius: 3px; pointer-events: none;
}
.hlbox.pulse { animation: pulse 1.6s ease-out 2; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 91, 61, .55); }
  100% { box-shadow: 0 0 0 18px rgba(255, 91, 61, 0); }
}
.reader-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
  max-width: 680px; margin: 0 auto;
  display: flex; align-items: center; gap: 6px;
  background: #fff; border-top: 1px solid #e4e8ee;
  padding: 6px 10px calc(6px + env(safe-area-inset-bottom));
}
.reader-bar button {
  flex: 1; border: none; background: #14488c; color: #fff; border-radius: 10px;
  padding: 10px 0; font-size: 15px;
}
.reader-bar button:disabled { background: #c9d3e0; }
.reader-bar .pind { font-size: 13px; color: #5b6675; min-width: 72px; text-align: center; }

/* 目录抽屉 */
.drawer-mask { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 40; display: none; }
.drawer {
  position: fixed; top: 0; bottom: 0; right: 0; width: 78%; max-width: 340px;
  background: #fff; z-index: 41; display: none; flex-direction: column;
  border-radius: 14px 0 0 14px;
}
.drawer.show, .drawer-mask.show { display: flex; }
.drawer h3 { padding: calc(14px + env(safe-area-inset-top)) 16px 10px; font-size: 15px; border-bottom: 1px solid #eef1f5; color:#14488c;}
.drawer .dsearch { padding: 8px 12px; border-bottom: 1px solid #eef1f5; }
.drawer .dsearch input {
  width: 100%; border: 1.5px solid #c9d3e0; border-radius: 8px;
  padding: 7px 10px; font-size: 14px; background: #fafbfc; outline: none;
}
.drawer .dsearch input:focus { border-color: #14488c; background: #fff; }
.drawer .list { overflow-y: auto; padding: 6px 0 20px; flex: 1 1 0; min-height: 0; }
.drawer .it { padding: 9px 16px; font-size: 14px; color: #2a3442; display:flex; gap:8px; }
.drawer .it:active { background: #f2f6fc; }
.drawer .it.l2 { padding-left: 32px; color: #5b6675; }
.drawer .it .pgn { margin-left: auto; color: #98a1b0; font-size: 12px; }
.drawer .dsr { padding: 9px 14px; border-bottom: 1px solid #f2f4f8; font-size: 13.5px; }
.drawer .dsr:active { background: #f2f6fc; }
.drawer .dsr .cl { color: #14488c; font-weight: 700; margin-right: 6px; }
.drawer .dsr .pgn { float: right; color: #98a1b0; font-size: 12px; }
.drawer .dsr .tx {
  color: #2a3442; line-height: 1.5; margin-top: 2px; clear: both;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.drawer .dsr .tx mark { background: #ffe58a; padding: 0 1px; border-radius: 2px; }

/* 登录页 */
.login-body { display: flex; flex-direction: column; justify-content: center; min-height: 100vh; padding: 30px 26px; }
.login-card { background: #fff; border-radius: 16px; padding: 30px 24px; box-shadow: 0 4px 18px rgba(20,40,80,.08); }
.login-card .lg-t { text-align: center; font-size: 20px; font-weight: 700; color: #14488c; margin-bottom: 6px; }
.login-card .lg-s { text-align: center; font-size: 13px; color: #8a93a3; margin-bottom: 22px; }
.login-card input {
  width: 100%; border: 1.5px solid #c9d3e0; border-radius: 10px;
  padding: 11px 12px; font-size: 16px; margin-bottom: 14px; outline: none;
}
.login-card input:focus { border-color: #14488c; }
.login-card button {
  width: 100%; border: none; background: #14488c; color: #fff;
  border-radius: 10px; padding: 12px 0; font-size: 16px; font-weight: 600;
}
.err { color: #d4380d; font-size: 13.5px; text-align: center; margin-bottom: 10px; }

/* ===== 桌面端(≥900px)：规范页居左，目录+搜索面板固定右侧 ===== */
@media (min-width: 900px) {
  body { max-width: none; }
  .drawer {
    display: flex !important;              /* 常驻显示，不再抽屉化 */
    position: fixed; right: 0; top: 0; bottom: 0; left: auto;
    width: 320px; max-width: none;
    border-radius: 0; box-shadow: -2px 0 10px rgba(20,40,80,.08);
  }
  .drawer h3 { padding-top: 14px; }
  .drawer-mask { display: none !important; }
  .reader-top { max-width: none; margin-right: 320px; }
  .readmain { margin-right: 320px; }
  .reader-bar { max-width: none; margin-right: 320px; margin-left: 0; }
  .page-wrap { max-width: 780px; margin: 16px auto; }
}

/* ===== 桌面端检索页：三栏工作台（检索结果 | 原文预览[内含目录面板+页面]） ===== */
@media (min-width: 900px) {
  body.searchpage { overflow: hidden; }
  .topbar { display: flex; align-items: center; gap: 18px; padding: 10px 18px; }
  .topbar .brand { margin-bottom: 0; flex: none; }
  .topbar .searchrow { flex: 1; max-width: 640px; margin: 0; }
  .topbar .modes { margin-top: 0; flex: none; }
  .desknav { display: inline-flex; gap: 16px; margin-left: 14px; font-size: 14px; font-weight: 500; }
  .desknav a { color: #14488c; padding: 4px 2px; }
  .tabs { display: none; }
  .workbench {
    display: flex; height: calc(100vh - 62px);
    border-top: 1px solid #e4e8ee;
  }
  .workbench main {
    width: 470px; min-width: 380px; flex: none;
    height: 100%; overflow-y: auto; padding: 10px 12px 20px;
    border-right: 1px solid #e4e8ee; background: #f2f4f7;
  }
  .pvwrap { display: block; flex: 1; position: relative; background: #fff; }
  .pvwrap iframe { width: 100%; height: 100%; border: 0; display: block; }
  #pvhint {
    position: absolute; inset: 0; display: flex;
    align-items: center; justify-content: center;
    color: #98a1b0; font-size: 16px; line-height: 2.1; text-align: center;
    background: #fff; pointer-events: none;
  }
}
