* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: "Segoe UI", "Microsoft YaHei", "PingFang SC", Tahoma, Arial, sans-serif;
  font-size: 14px; color: #333; background: #f5f7fa;
  display: flex; flex-direction: column;
}
#topbar {
  display: flex; align-items: center; gap: 12px;
  background: linear-gradient(135deg, #1e3a5f, #15324f);
  color: #fff; padding: 0 16px; height: 52px; flex: 0 0 52px;
  box-shadow: 0 2px 6px rgba(0,0,0,.25); z-index: 100; position: relative;
}
.brand { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 600; white-space: nowrap; }
.brand img { height: 22px; width: auto; }
#menuBtn {
  display: none; background: rgba(255,255,255,.12); color: #fff; border: none;
  border-radius: 4px; font-size: 18px; width: 36px; height: 32px; cursor: pointer;
}
#menuBtn:hover { background: rgba(255,255,255,.25); }
#searchbox { flex: 1; max-width: 560px; margin-left: auto; position: relative; }
#q {
  width: 100%; padding: 8px 14px; border: none; border-radius: 18px;
  font-size: 14px; outline: none; background: #fff; color: #333;
}
#q:focus { box-shadow: 0 0 0 3px rgba(255,255,255,.35); }
#results {
  position: absolute; top: 42px; left: 0; right: 0; background: #fff; color: #333;
  border-radius: 6px; box-shadow: 0 6px 20px rgba(0,0,0,.22);
  max-height: 70vh; overflow: auto; display: none; z-index: 200;
}
#results .res {
  display: block; padding: 10px 14px; border-bottom: 1px solid #eee; cursor: pointer;
}
#results .res:hover, #results .res.active { background: #eef4fc; }
#results .res .rt { font-size: 15px; font-weight: 600; color: #0b57d0; }
#results .res .rp { font-size: 12px; color: #777; margin: 2px 0 4px; }
#results .res .rc { font-size: 13px; color: #444; line-height: 1.5; }
#results .res .rc mark { background: #ffe08a; color: #333; padding: 0 1px; border-radius: 2px; }
#results .empty { padding: 14px; color: #888; }
#results .head { padding: 8px 14px; background: #f2f4f7; color: #555; font-size: 12px; }
#layout { flex: 1; display: flex; overflow: hidden; }
#tree {
  width: 300px; flex: 0 0 300px; overflow: auto; background: #fff;
  border-right: 1px solid #e2e6ea; padding: 10px 0 40px;
}
#tree ul { list-style: none; }
#tree ul ul { display: none; }
#tree li.open > ul { display: block; }
#tree .node { display: flex; align-items: center; cursor: pointer; user-select: none; }
#tree .node > a {
  flex: 1; display: block; padding: 5px 8px; color: #333; text-decoration: none;
  border-radius: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
#tree .node > a:hover { background: #eef4fc; color: #0b57d0; }
#tree .node > a.active { background: #0b57d0; color: #fff; font-weight: 600; }
#tree .tw { width: 18px; flex: 0 0 18px; text-align: center; color: #8a93a0; font-size: 10px; }
#tree .tw.leaf { visibility: hidden; }
#tree .root > .node > a { font-weight: 700; color: #1e3a5f; }
#tree .root.open > .node > .tw { transform: rotate(90deg); }
#tree .tw { transition: transform .15s; }
#view { flex: 1; display: flex; flex-direction: column; background: #fff; }
#frame { flex: 1; width: 100%; border: none; }
@media (max-width: 860px) {
  #menuBtn { display: block; }
  #tree { position: fixed; top: 52px; bottom: 0; left: 0; z-index: 150;
    transform: translateX(-100%); transition: transform .2s; box-shadow: 2px 0 10px rgba(0,0,0,.2); }
  #tree.show { transform: translateX(0); }
}
