:root {
  --bg: #f7f6f3; --panel: #fff; --ink: #1c1917; --muted: #78716c; --line: #e7e5e4;
  --amber: #b45309; --amber-soft: #fef3c7; --blue: #1d4ed8; --warn: #b91c1c;
  font-family: -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  color: var(--ink); background: var(--bg); font-size: 15px; line-height: 1.6;
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.err { color: var(--warn); }
.pad { padding: 24px; }

.top { position: sticky; top: 0; z-index: 5; display: flex; gap: 20px; align-items: center; padding: 10px 24px;
  background: rgba(255,255,255,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; font-size: 18px; white-space: nowrap; }
.brand img { width: 26px; height: 26px; }
.brand b { color: var(--amber); }
.search { flex: 1; display: flex; max-width: 760px; }
.search input { flex: 1; padding: 9px 14px; border: 1px solid var(--line); border-radius: 10px 0 0 10px; font: inherit; background: #fafaf9; }
.search input:focus { outline: 2px solid var(--amber-soft); border-color: #f59e0b; background: #fff; }
.search button { padding: 0 18px; border: 0; border-radius: 0 10px 10px 0; background: var(--amber); color: #fff; }

.layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 24px; max-width: 1240px; margin: 0 auto; padding: 20px 24px 60px; }
.filters { position: sticky; top: 70px; align-self: start; max-height: calc(100vh - 90px); overflow: auto; padding-right: 4px; }
.total { font-size: 14px; margin-bottom: 10px; }
.total b { font-size: 22px; color: var(--amber); margin-right: 2px; }
.active { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.tag { background: var(--amber-soft); color: var(--amber); border-radius: 6px; padding: 1px 8px; font-size: 12px; }
.facet h3 { font-size: 12px; color: var(--muted); font-weight: 600; margin: 16px 0 4px; letter-spacing: .05em; }
.facet ul { list-style: none; margin: 0; padding: 0; }
.facet li a { display: flex; justify-content: space-between; gap: 8px; padding: 3px 8px; border-radius: 6px; font-size: 13px; }
.facet li a:hover { background: #f5f5f4; }
.facet li a.on { background: var(--amber-soft); color: var(--amber); font-weight: 600; }
.facet li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.facet li em { font-style: normal; color: var(--muted); font-size: 12px; }
.facet .more { border: 0; background: none; color: var(--blue); font-size: 12px; padding: 2px 8px; }

.bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; color: var(--muted); font-size: 13px; }
.sort a { margin-left: 12px; }
.sort a.on { color: var(--amber); font-weight: 600; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; margin-bottom: 12px; }
.card:hover { border-color: #d6d3d1; box-shadow: 0 1px 6px rgba(0,0,0,.04); }
.card .title { display: block; font-size: 16px; font-weight: 600; line-height: 1.45; }
.card .title:hover { color: var(--amber); }
.summary { margin: 6px 0 0; color: #44403c; font-size: 14px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chip { font-size: 12px; padding: 0 7px; border-radius: 5px; background: #f5f5f4; color: #57534e; line-height: 20px; }
.chip.broker { background: #eef2ff; color: #3730a3; }
.chip.type { background: var(--amber-soft); color: var(--amber); }
.chip.soft { background: none; border: 1px solid var(--line); }
.chip.warn { background: #fef2f2; color: var(--warn); }
.tickers { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tickers > * { font-size: 12px; color: var(--blue); background: #eff6ff; border-radius: 5px; padding: 0 7px; }
.passages { margin-top: 8px; display: grid; gap: 6px; }
.passage { display: block; font-size: 13.5px; color: #44403c; background: #fafaf9; border-left: 3px solid #fcd34d; padding: 6px 10px; border-radius: 0 8px 8px 0; }
.passage:hover { background: #fffbeb; }
.passage .pg { color: var(--amber); font-weight: 600; margin-right: 8px; font-size: 12px; }
.empty { color: var(--muted); padding: 40px 0; text-align: center; }
.loadmore { display: block; margin: 16px auto; padding: 8px 28px; border: 1px solid var(--line); background: #fff; border-radius: 10px; }

.detail { display: grid; grid-template-columns: minmax(320px, 420px) minmax(0, 1fr); gap: 20px; max-width: 1500px; margin: 0 auto; padding: 16px 24px 40px; }
.info { align-self: start; position: sticky; top: 66px; max-height: calc(100vh - 82px); overflow: auto; padding-right: 6px; }
.info h1 { font-size: 20px; line-height: 1.45; margin: 8px 0 4px; }
.back { color: var(--muted); font-size: 13px; }
.block h2 { font-size: 13px; color: var(--muted); margin: 18px 0 6px; letter-spacing: .05em; }
.block p { margin: 0; }
.block ul { margin: 0; padding-left: 18px; }
.block li { margin: 3px 0; }
.nums { width: 100%; border-collapse: collapse; font-size: 13px; }
.nums td { border-top: 1px solid var(--line); padding: 5px 6px 5px 0; vertical-align: top; }
.nums td.v { font-weight: 600; white-space: nowrap; color: var(--amber); }
.src { list-style: none; padding: 0 !important; font-size: 13px; }
.src li { margin-bottom: 6px; }
.read { min-width: 0; }
.tabs { display: flex; gap: 6px; margin-bottom: 8px; align-items: center; }
.tabs button { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 3px 14px; }
.tabs button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.tabs .dl { margin-left: auto; color: var(--blue); font-size: 13px; }
.viewer iframe { width: 100%; height: calc(100vh - 120px); border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.nofile { padding: 60px; text-align: center; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.btn { display: inline-block; background: var(--amber); color: #fff; padding: 6px 18px; border-radius: 8px; }
.pages .page { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; margin-bottom: 10px; }
.pages .page.hit { border-color: #f59e0b; box-shadow: 0 0 0 3px var(--amber-soft); }
.pno { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.pages pre { white-space: pre-wrap; word-break: break-word; font: inherit; font-size: 14px; margin: 0; }

.login { max-width: 320px; margin: 18vh auto; display: grid; gap: 10px; text-align: center; }
.login h1 { color: var(--amber); margin: 0; }
.login input { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit; }
.login button { padding: 10px; border: 0; border-radius: 10px; background: var(--amber); color: #fff; }

@media (max-width: 860px) {
  .top { flex-wrap: wrap; padding: 8px 12px; gap: 8px; }
  .search { max-width: none; width: 100%; }
  .layout { grid-template-columns: 1fr; padding: 12px; }
  .filters { position: static; max-height: none; display: none; }
  .detail { grid-template-columns: 1fr; padding: 12px; }
  .info { position: static; max-height: none; }
  .viewer iframe { height: 75vh; }
}
