/* 初中教材閱讀 (junior.html): textbook text above, sun's page images below, conversation beside. Tokens come from dialogue.css. */
#junior-root .bar{grid-template-columns:32px auto 1fr auto auto}
#junior-root .bar .junior-tag{grid-column:3;font-size:12px;color:var(--muted);letter-spacing:.08em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#theme-cycle{grid-column:4;display:inline-flex;align-items:center;gap:6px;min-height:36px;padding:6px 8px;font-size:12px;border:0;white-space:nowrap;color:var(--ink)}#theme-cycle span[aria-hidden]{font-size:18px;line-height:1}
#junior-root .account-actions{grid-column:5;margin-left:0}
#catalog-results .catalog-senior{display:block;padding:10px 6px;margin-bottom:6px;border-bottom:1px solid var(--line);font-size:13px;text-decoration:none}
#catalog-results .book-lessons a{display:flex;align-items:center;gap:10px;width:100%;min-height:40px;padding:9px 8px;font-size:13px;line-height:1.5;border-radius:4px;color:inherit;text-decoration:none}
#catalog-results .book-lessons a:hover{background:var(--wash)}
#catalog-results .book-lessons a[aria-current]{background:var(--wash);color:var(--ink);font-weight:600}
#catalog-results .book-lessons a small{flex:none;min-width:1.6em}
.junior-crumb{font-size:12px;color:var(--muted);letter-spacing:.08em;margin:0}
#lesson-meta{font-size:13px;color:var(--muted);margin:4px 0 0}
#junior-root #title:focus{outline:none}
#title-notes .inline-note{display:block;font-size:14px;font-weight:400;margin:6px 0 0;max-width:40em}
#title-notes .annotation-toggle{vertical-align:super}
#parts{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 18px}
#parts[hidden]{display:none}
#parts button{min-height:40px;font-size:13px;padding:6px 12px}

/* text: the textbook's own typefaces, indents and verse lines */
#junior-reading #reading{font-family:"Songti SC","Noto Serif SC","Songti TC","Noto Serif TC",serif}
#junior-reading .jp{margin:0 0 .35em;padding-left:min(calc(var(--left,0) * 1em),40%);text-indent:calc(var(--indent,0) * 1em);line-height:2;overflow-wrap:anywhere}
#junior-reading .jp.center{text-align:center;padding-left:0;text-indent:0}
#junior-reading .jp.kai,#junior-reading .jr-side,#junior-reading .jr-prep .jp{font-family:"Kaiti SC","STKaiti","KaiTi","Kaiti TC",serif}
#junior-reading .jp.fs{font-family:"STFangsong","FangSong","Songti SC",serif}
#junior-reading .jp.hei{font-family:system-ui,-apple-system,"PingFang SC",sans-serif;font-weight:600}
#junior-reading .jp.small{font-size:.86em}
#junior-reading .jp.large{font-size:1.06em}
#junior-reading .jp.tint{color:var(--accent)}
#junior-reading .jh{font-family:"Songti SC","Noto Serif SC",serif;font-weight:600;line-height:1.5;margin:1.4em 0 .6em}
#junior-reading .jh1{font-size:1.25em;text-align:center}
#junior-reading .jh2{font-size:1.1em;text-align:center}
#junior-reading .jh3{font-size:1em;font-family:"Kaiti SC","STKaiti","KaiTi",serif}
#junior-reading .jh.tint{color:var(--accent)}
#junior-reading em.dot{font-style:normal;text-emphasis:filled dot;-webkit-text-emphasis:filled dot;text-emphasis-position:under right;-webkit-text-emphasis-position:under}
#junior-reading .jr-side{display:block;margin:.2em 0 .8em 2em;padding:.2em 0 .2em .8em;border-left:2px solid var(--accent);color:var(--muted);font-size:.86em;line-height:1.8}
.jr-prep{margin:0 0 1.4em;padding:.6em 1em .4em;border:1px solid var(--line);border-radius:10px;background:var(--wash)}
.jr-prep[hidden]{display:none}
.jr-prep .jh{margin:.2em 0 .4em}
.jr-section{margin:2.2em 0 0;padding-top:.6em;border-top:1px solid var(--line)}
.jr-loading{color:var(--muted);font-size:15px}

/* pictures: crops of sun's page image, never a separate copy */
.jr-figure{margin:1em auto 1.2em;text-align:center}
.jr-crop{position:relative;display:block;width:100%;margin:0 auto;padding:0;border:1px solid var(--line);border-radius:4px;overflow:hidden;background:var(--surface);cursor:zoom-in}
.jr-crop img{position:absolute;max-width:none;height:auto;display:block}
.jr-figure figcaption{font:13px/1.6 "Kaiti SC","STKaiti","KaiTi",serif;color:var(--muted);margin-top:6px}
.jr-figure.text-image .jr-crop{border-style:dashed}
.jr-figure.failed .jr-crop{min-height:60px}

/* page images */
.jr-plates{margin-top:2.6em;padding-top:1em;border-top:2px solid var(--line)}
.jr-plates-head{display:flex;flex-wrap:wrap;align-items:center;gap:8px 16px;margin-bottom:14px;font:14px system-ui,-apple-system,"PingFang TC",sans-serif}
.jr-plates-head h2{font-size:17px;margin:0 auto 0 0;font-family:"Songti TC","Noto Serif TC",serif}
.jr-plates-head a,.jr-plates-head button{display:inline-flex;align-items:center;min-height:36px;font-size:13px}
.jr-plates-head a[hidden]{display:none}
#plates-list{display:grid;gap:22px;max-width:860px}
.junior-page{margin:0;position:relative;scroll-margin-top:12px}
.junior-page .plate-open{display:block;width:100%;padding:0;border:0;background:none;cursor:zoom-in}
.junior-page img{display:block;width:100%;height:auto;background:var(--surface);border:1px solid var(--line);border-radius:4px;box-shadow:0 2px 10px #0000000d}
.junior-page .plate-message{position:absolute;inset:40% 0 auto;margin:0;text-align:center;font-size:13px;color:var(--muted)}
.junior-page figcaption{display:flex;flex-wrap:wrap;gap:6px 16px;align-items:center;font:12px system-ui,-apple-system,"PingFang TC",sans-serif;color:var(--muted);margin-top:6px}
.junior-page figcaption span{color:var(--ink)}
.junior-page figcaption a{display:inline-flex;align-items:center;min-height:36px}
.junior-page figcaption button{min-height:36px;padding:4px 10px;font-size:12px}
.junior-pager{display:flex;flex-wrap:wrap;justify-content:space-between;gap:12px;max-width:860px;margin:28px 0 8px;font:14px system-ui,-apple-system,"PingFang TC",sans-serif}
.junior-pager a{display:inline-flex;align-items:center;min-height:44px;overflow-wrap:anywhere}

/* full-screen page viewer */
#plate-viewer{width:min(96vw,1100px);max-height:96dvh;padding:0;border:1px solid var(--line);border-radius:10px;background:var(--paper);color:var(--ink)}
#plate-viewer::backdrop{background:#000a}
#plate-viewer .viewer-bar{position:sticky;top:0;display:flex;flex-wrap:wrap;align-items:center;gap:8px 12px;padding:8px 12px;background:var(--paper);border-bottom:1px solid var(--line);font:13px system-ui,-apple-system,"PingFang TC",sans-serif}
#plate-viewer .viewer-bar button,#plate-viewer .viewer-bar a{min-height:36px;display:inline-flex;align-items:center}
#plate-viewer #viewer-label{margin-right:auto}
#plate-viewer #viewer-image{display:block;width:100%;height:auto;background:#fff}

#junior-root .conversation .turn small{font-family:system-ui,-apple-system,"PingFang TC",sans-serif}
@media(max-width:899px){#plates-list{gap:16px}.junior-page img{border-radius:2px}.junior-pager{margin-top:20px}#junior-reading .jp{padding-left:min(calc(var(--left,0) * 1em),24%)}#junior-reading .jr-side{margin-left:1em}#junior-root .bar .junior-tag{display:none}}
