html, body { width: 100%; height: 100%; margin: 0 !important; padding: 0 !important; overflow: hidden; background: #090e20 !important; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
#reader { position: relative; display: flex; width: 100%; height: 100%; flex-direction: column; color: #eee8fa; font: 16px/1.65 system-ui, "Microsoft YaHei", sans-serif; }
#reader button, #reader input { font: inherit; }
#reader button { min-height: 44px; padding: 8px 12px; color: #eee8fa; background: #a881e91a; border: 1px solid #bd99f640; border-radius: 8px; cursor: pointer; }
#reader button:hover { background: #a881e936; }
#reader button:focus-visible, #reader a:focus-visible, #reader input:focus-visible, #reader-canvas:focus-visible { outline: 2px solid #d7b8ff; outline-offset: -2px; }
#reader-toolbar { position: relative; z-index: 2; flex-shrink: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 12px; padding: 12px 16px; background: #19203a; font-size: 14px; }
#reader-toolbar strong { width: 100%; font-size: 18px; }
#reader-toolbar nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
#reader-search-label { display: flex; align-items: center; gap: 8px; }
#reader-search { min-width: 0; max-width: 100%; min-height: 44px; padding: 8px; color: #eee8fa; background: #090e20; border: 1px solid #bd99f640; border-radius: 8px; font-size: 16px; }
html[data-reader-embed="true"] #reader-toolbar { display: none; }
#reader-canvas { position: relative; flex: 1; min-height: 0; overflow: hidden; cursor: grab; touch-action: pan-y; background-image: radial-gradient(#adb0cb22 1px, transparent 1px); background-size: 24px 24px; }
html[data-reader-expanded="true"] #reader-canvas { touch-action: none; }
#reader-canvas[data-dragging="true"] { cursor: grabbing; }
#reader-stage { position: absolute; inset: 0 auto auto 0; transform-origin: 0 0; will-change: transform; }
#reader-stage > svg { display: block; margin: 0 !important; padding: 0 !important; max-width: none !important; min-width: 0 !important; overflow: visible; }
#reader-stage svg [data-node-id] { cursor: pointer; }
#reader-stage svg [data-node-id]:focus-visible > rect, #reader-stage svg [data-node-id][aria-pressed="true"] > rect { stroke: #f0d9ff; stroke-width: 2.5; }
#reader-detail { position: absolute; z-index: 5; top: 16px; right: 16px; bottom: 16px; width: min(360px, calc(100% - 32px)); overflow-y: auto; padding: 20px; color: #eee8fa; background: #151a2df5; border: 1px solid #b994ed66; border-radius: 14px; box-shadow: 0 12px 40px #0007; font-size: 16px; }
#reader-detail-head { display: flex; align-items: flex-start; gap: 12px; justify-content: space-between; }
#reader-detail h2 { margin: 0; font: 600 20px/1.4 system-ui, sans-serif; overflow-wrap: anywhere; }
#reader-detail h3 { margin: 20px 0 8px; font-size: 16px; }
#reader-detail p { margin: 12px 0; }
#reader-detail-close { flex-shrink: 0; min-width: 44px; }
#reader-detail ul { padding-left: 20px; }
#reader-detail li { margin-top: 8px; }
#reader-detail a { color: #d7b8ff; overflow-wrap: anywhere; }
#reader-detail .reader-neighbor { display: block; width: 100%; margin-top: 8px; text-align: left; }
#reader-results { position: absolute; z-index: 6; top: 12px; left: 12px; width: min(400px, calc(100% - 24px)); max-height: 220px; overflow-y: auto; padding: 8px; background: #151a2df5; border: 1px solid #b994ed66; border-radius: 12px; }
#reader-results button { display: block; width: 100%; margin-top: 4px; text-align: left; font-size: 16px; }
#reader-results p { margin: 8px; font-size: 16px; }
.reader-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
@media (max-width: 720px) {
  #reader-detail { inset: auto 0 0; width: 100%; max-height: 64%; padding: 16px; border-radius: 16px 16px 0 0; }
  #reader-toolbar { padding: 10px; }
  #reader-toolbar strong { font-size: 16px; }
}
