/* 完整记录在独立原生弹层内阅读；桌面原网格保持固定一屏。 */
.mod-expand {
  display:inline-flex; flex:none; align-items:center; justify-content:center;
  min-width:34px; min-height:24px; padding:0 4px; border:1px solid var(--line2);
  border-radius:0; background:transparent; color:var(--mut); font:10px var(--sans); cursor:pointer;
}
.mod-expand:hover { border-color:var(--cyan); background:var(--bg3); color:var(--ink); }
.mod-expand:focus-visible { outline:2px solid var(--cyan); outline-offset:2px; }
body.editing .mod-expand { display:none!important; }
dialog.module-reader {
  position:fixed; inset:0;
  width:min(1180px,calc(100vw - 40px)); max-width:calc(100vw - 40px);
  height:min(860px,calc(100vh - 40px)); height:min(860px,calc(100dvh - 40px));
  max-height:calc(100dvh - 40px); margin:auto; padding:0; overflow:hidden;
  border:1px solid var(--frame); border-radius:0; background:var(--bg1); color:var(--ink); box-shadow:none;
}
dialog.module-reader[open] { display:flex; flex-direction:column; }
dialog.module-reader::backdrop { background:oklch(.12 .002 90 / .88); }
.module-reader-head { display:flex; flex:none; align-items:center; justify-content:space-between; gap:16px; padding:14px 18px; border-bottom:1px solid var(--line2); }
.module-reader-heading { min-width:0; }
.module-reader-heading h2 { margin:0; color:var(--ink); font:650 18px/1.4 var(--sans); overflow-wrap:anywhere; }
.module-reader-heading p { margin:4px 0 0; color:var(--dim); font:12px/1.4 var(--mono); }
.module-reader-close { display:inline-flex; flex:none; align-items:center; justify-content:center; min-width:60px; min-height:44px; padding:0 12px; border:1px solid var(--line2); background:transparent; color:var(--mut); font:13px var(--sans); cursor:pointer; }
.module-reader-close:hover { border-color:var(--cyan); background:var(--bg3); color:var(--ink); }
.module-reader-content { display:flex; flex:1 1 auto; min-width:0; min-height:0; padding:14px; overflow:hidden; }
#module-reader .module-reader-source {
  position:relative!important; inset:auto!important; grid-area:auto!important; transform:none!important;
  display:flex!important; flex:1 1 auto!important; width:100%!important; height:auto!important;
  min-width:0!important; min-height:0!important; max-width:100%!important; max-height:none!important;
  margin:0!important; overflow:hidden!important; animation:none!important;
}
#module-reader .module-reader-source>.mod-hd { position:relative; flex:none; min-width:0; min-height:44px; padding:7px 11px; clip:auto; clip-path:none; width:auto; height:auto; margin:0; overflow:visible; white-space:normal; pointer-events:auto; }
#module-reader .module-reader-source>.mod-hd h3 { min-width:0; max-width:none; white-space:normal; overflow:visible; text-overflow:clip; overflow-wrap:anywhere; }
#module-reader .module-reader-source>.mod-hd .r { white-space:normal; overflow:visible; text-overflow:clip; }
#module-reader .module-reader-source .mod-expand,#module-reader .module-reader-source .mod-rz { display:none!important; }
#module-reader .module-reader-source>.mod-body {
  flex:1 1 auto!important; height:auto!important; min-height:0!important; max-height:none!important;
  overflow:auto!important; overscroll-behavior:contain; scrollbar-gutter:stable;
}
#module-reader :is(.qwrap,.dwrap,.fillwrap) { height:auto; min-height:0; max-height:none; }
#module-reader :is(.qwrap.fill .pitq,.dwrap.fill .drow) { flex:0 0 auto; max-height:none; }
#module-reader :is(.frow>div,.fnm,.fsub,.pitq>div,.qnm,.qsub,.pteam,.pdrv,.plag) { white-space:normal; overflow:visible; text-overflow:clip; overflow-wrap:anywhere; }
#module-reader .prow .l1 { flex-wrap:wrap; row-gap:4px; }
#module-reader .prow .pteam { flex:1 1 180px; min-width:min(100%,180px); }
#module-reader .prow .pdrv { flex:0 1 auto; max-width:100%; }
#module-reader .prow:not(.pflag) .l2,#module-reader .prow .pdetail { display:block; -webkit-line-clamp:unset; line-clamp:unset; overflow:visible; }
#module-reader .frow { grid-template-columns:62px 36px minmax(0,1fr) 74px 74px; }
#module-reader .pitq { grid-template-columns:36px minmax(0,1fr) 78px 74px; }
#module-reader .frow,#module-reader .pitq { padding:8px 10px; font-size:13px; line-height:1.4; }
#module-reader :is(.frow .ft,.frow .fv,.pitq .qd) { font-size:12px; }
#module-reader .pitq .qnm { line-height:1.4; }
#module-reader .pitq .qnm b { font-size:15px; }
#module-reader .pitq .qsub { font-size:12px; line-height:1.4; }
#module-reader .prow:not(.pflag) .l2 { font-size:13px; line-height:1.6; }
body.mob .mod-expand { min-width:44px; min-height:44px; }
@media (max-width:640px) {
  dialog.module-reader { width:calc(100vw - 16px); max-width:calc(100vw - 16px); height:calc(100vh - 16px); height:calc(100dvh - 16px); max-height:calc(100dvh - 16px); }
  .module-reader-head { gap:10px; padding:10px 12px; }
  .module-reader-heading h2 { font-size:16px; }
  .module-reader-heading p { font-size:11px; }
  .module-reader-content { padding:8px; }
  #module-reader .module-reader-source>.mod-hd { flex-wrap:wrap; gap:6px; }
  #module-reader .frow { grid-template-columns:36px 22px minmax(0,1fr) 38px 40px; gap:4px; }
  #module-reader .pitq { grid-template-columns:28px minmax(0,1fr) 56px 44px; gap:5px; }
  #module-reader .prow .pteam { flex-basis:120px; min-width:min(100%,120px); }
}
