/* DocCrawler · paper in, answers out */
:root { --bg: #0b0d0a; --bg2: #13160f; --bg3: #1a1e15; --ink: #eef0e6; --dim: #a3aa95; --mute: #6d745f; --line: rgba(238,240,230,.1); --acc: #d6c45a; --acc2: #9bd36a; color-scheme: dark; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font: 15.5px/1.5 ui-sans-serif, -apple-system, "Segoe UI", Roboto, sans-serif; }
body { display: flex; flex-direction: column; }
button, input { font: inherit; color: inherit; }
.top { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; padding: calc(10px + env(safe-area-inset-top)) 16px 10px; border-bottom: 1px solid var(--line); }
.logo { font-size: 19px; } .logo span { color: var(--acc); }
.q { flex: 1; min-width: 220px; } .q input { width: 100%; height: 42px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg2); padding: 0 14px; outline: none; } .q input:focus { border-color: var(--acc); }
.btn { display: inline-flex; align-items: center; height: 42px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg2); cursor: pointer; font-weight: 600; white-space: nowrap; }
.btn.pri { background: linear-gradient(135deg, #e6d77a, #a8c75a); color: #141608; border-color: transparent; }
.link { border: 0; background: none; color: var(--acc); cursor: pointer; padding: 0; font-size: 13.5px; } .link.danger { color: #e98a7a; }
main { flex: 1; min-height: 0; display: grid; grid-template-columns: 320px minmax(0, 1fr); }
.lib { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; padding: 12px; gap: 10px; }
.libhead { display: flex; justify-content: space-between; align-items: center; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; } .tags button { border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: 3px 10px; font-size: 12.5px; color: var(--dim); cursor: pointer; } .tags button.on { border-color: var(--acc); color: var(--ink); }
.docs { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; display: grid; gap: 4px; align-content: start; }
.docs li { display: grid; grid-template-columns: 26px 1fr; gap: 2px 8px; padding: 8px 10px; border-radius: 10px; cursor: pointer; } .docs li:hover { background: var(--bg2); }
.docs li i { font-style: normal; grid-row: 1 / 3; font-size: 18px; } .docs li small { color: var(--mute); font-size: 12px; }
.drop { border: 1.5px dashed var(--line); border-radius: 14px; padding: 14px; text-align: center; color: var(--mute); font-size: 13px; } body.dragging .drop { border-color: var(--acc); color: var(--ink); background: rgba(214,196,90,.06); }
.libfoot { display: flex; gap: 14px; }
.pane { min-height: 0; display: flex; flex-direction: column; padding: 12px 18px; }
.tabs { display: flex; gap: 6px; margin-bottom: 10px; } .tabs button { border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: 7px 14px; color: var(--dim); cursor: pointer; } .tabs button.on { color: var(--ink); border-color: var(--acc); }
#p-lib, #p-ask { flex: 1; min-height: 0; display: flex; flex-direction: column; } #p-lib { overflow-y: auto; } [hidden] { display: none !important; }
.hit { padding: 12px 14px; border-radius: 14px; background: var(--bg2); border: 1px solid transparent; margin-bottom: 8px; cursor: pointer; } .hit:hover { border-color: var(--line); }
.hit b { display: block; } .hit small { color: var(--mute); } .hit p { margin: 6px 0 0; color: var(--dim); font-size: 14px; } mark { background: rgba(214,196,90,.3); color: var(--ink); border-radius: 3px; padding: 0 2px; }
.empty { color: var(--dim); padding: 30px 6px; } .empty b { color: var(--ink); }
.chat { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 4px 0 12px; }
.msg { max-width: 92%; padding: 10px 14px; border-radius: 14px; background: var(--bg2); } .msg.me { align-self: flex-end; background: rgba(214,196,90,.12); }
.msg .cites { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; } .msg .cites button { border: 1px solid var(--line); background: var(--bg3); border-radius: 8px; padding: 3px 8px; font-size: 12px; cursor: pointer; color: var(--acc2); }
.msg .src { color: var(--mute); font-size: 12.5px; margin-top: 6px; }
.ask { display: flex; gap: 8px; } .ask input { flex: 1; min-width: 0; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg2); padding: 0 14px; outline: none; }
.mode { display: flex; gap: 8px; align-items: flex-start; color: var(--mute); font-size: 12.5px; margin-top: 8px; padding-bottom: env(safe-area-inset-bottom); }
.view { position: fixed; inset: 0; z-index: 20; background: rgba(0,0,0,.6); display: grid; place-items: center; padding: 16px; }
.vcard { width: min(820px, 100%); max-height: 88vh; display: flex; flex-direction: column; border-radius: 18px; background: var(--bg2); border: 1px solid var(--line); overflow: hidden; }
.vcard header { display: flex; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.vtags { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 16px 0; } .vtags span { background: var(--bg3); border-radius: 999px; padding: 3px 10px; font-size: 12.5px; } .vtags span button { border: 0; background: none; color: var(--mute); cursor: pointer; } .vtags input { width: 120px; background: transparent; border: 1px dashed var(--line); border-radius: 999px; padding: 3px 10px; font-size: 12.5px; outline: none; }
.vcard pre { margin: 0; padding: 16px; overflow: auto; white-space: pre-wrap; font: 14px/1.6 ui-monospace, Menlo, Consolas, monospace; color: var(--dim); }
.toast { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: #22261b; border: 1px solid var(--line); padding: 10px 16px; border-radius: 999px; opacity: 0; transition: opacity .3s; pointer-events: none; } .toast.on { opacity: 1; }
@media (max-width: 820px) { main { grid-template-columns: 1fr; grid-template-rows: auto 1fr; } .lib { border-right: 0; border-bottom: 1px solid var(--line); max-height: 42vh; } }
