:root{color-scheme:light;--bg:#fff;--surface:#f7f7f5;--surface2:#ecece8;--line:#e4e4df;--ink:#1c1e1e;--muted:#626969;--accent:#323636;--on:#fff;--hl:#e3e8e6}
:root.dark{color-scheme:dark;--bg:#181e1e;--surface:#202727;--surface2:#2a3333;--line:#394343;--ink:#f1f4f4;--muted:#aab4b4;--accent:#eef2f2;--on:#161b1b;--hl:#41504c}
*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--ink);font:15px/1.65 "PingFang SC","Microsoft YaHei",sans-serif}header{position:sticky;top:0;background:var(--bg);z-index:2;border-bottom:1px solid var(--line)}.bar,main,footer{max-width:1100px;margin:auto;padding:0 26px}.bar,.row,nav,.right,.options{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.bar{min-height:65px;justify-content:space-between}.brand{font-size:18px;font-weight:750;display:flex;align-items:center;gap:10px}.brand img{width:37px;border-radius:9px;border:1px solid var(--line)}a{color:inherit;text-decoration:none}nav a,.pill,button,select,input{font:inherit;color:inherit}nav a,.pill,button,select{border-radius:9px;padding:6px 12px}button,select,input,.pill{background:var(--bg);border:1px solid var(--line)}button,.pill,select,summary{cursor:pointer}button:disabled{opacity:.55;cursor:default}button:hover:not(:disabled),.pill:hover,nav a:hover,nav .current{background:var(--surface2)}.primary,.pill.selected,button.selected,.primary:hover:not(:disabled){background:var(--accent);color:var(--on)}main{min-height:77vh;padding-top:30px;padding-bottom:50px}.reader{max-width:740px;margin:auto}section+section{margin-top:30px}h1,h2,h3,p{margin:0 0 .6em}h1{font-size:clamp(22px,3vw,30px);line-height:1.4}h2{font-size:20px}h3{font-size:16px}.muted,small,rt{color:var(--muted)}small{font-size:12px}.spread{justify-content:space-between}.panel,.card,.para,.question{border:1px solid var(--line);border-radius:16px;padding:18px;margin:14px 0}.card{display:flex;align-items:center;gap:20px;background:var(--surface);overflow:hidden;padding:0}.card div{padding:14px 10px}.card:hover h2{text-decoration:underline}.panel,.question,.studybox{background:var(--surface)}.para{scroll-margin-top:115px}.studybox{border-radius:10px;padding:12px;margin-top:15px}.studybox>*+*{margin-top:10px}.jp{line-height:2.2;font-family:"Hiragino Sans","Yu Gothic",sans-serif;overflow-wrap:anywhere}.jp [data-word]{cursor:pointer;border-bottom:1.5px solid var(--word-line,#8f9393);padding-bottom:1px;transition:background-color .15s ease}.jp [data-word]:is(:hover,:focus-visible){background:var(--word-hover,#e8eae9);border-bottom-color:var(--word-active,#323636)}:root.dark{--word-line:#7c8c8c;--word-hover:#313d3d;--word-active:#cbd5d5}.jp rt{font-size:.56em}.hide-ruby rt{display:none}.line.active,.line.located{background:var(--hl);border-radius:4px}.translation{color:var(--muted);font-size:14px}.toolbar{border-bottom:1px solid var(--line);padding-bottom:12px;margin-bottom:18px}.options{gap:6px}.options button,.options a{font-size:13px}.studybox summary{font-size:14px}.studybox .pill{display:inline-block;margin:3px}.empty{color:var(--muted);padding:18px 0}.question label,dialog label{display:block;margin:8px 0}.question input{margin-right:7px}dialog{color:var(--ink);background:var(--bg);border:1px solid var(--line);border-radius:16px;width:min(440px,94vw);max-height:85vh;padding:22px}dialog::backdrop{background:#1118}dialog form[method=dialog]{float:right}dialog input:not([type=checkbox]){padding:8px;width:100%;border-radius:8px}#notice:not(:empty){position:fixed;bottom:22px;left:50%;transform:translateX(-50%);background:var(--accent);color:var(--on);padding:8px 16px;border-radius:9px;z-index:5}footer{border-top:1px solid var(--line);padding-top:18px;padding-bottom:20px;color:var(--muted)}.review{font-size:12px;color:var(--muted)}.noterow{padding:12px 0;border-bottom:1px solid var(--line)}.noterow a{text-decoration:underline}.question a{text-decoration:underline}dialog hr{border:0;border-top:1px solid var(--line)}
@media(max-width:650px){.bar,main,footer{padding-left:15px;padding-right:15px}.bar{gap:3px;padding-top:8px}.bar nav{order:3;width:100%;justify-content:space-around;font-size:13px}.bar nav a{padding:5px}.brand{font-size:16px}.brand img{width:30px}.right{font-size:12px}main{padding-top:18px}.card{gap:0}.card h2{font-size:16px}.card img{width:32%;align-self:stretch}.para,.question{padding:13px}.row{gap:7px}}

.search-hit{display:block;border-bottom:1px solid var(--line);padding:8px 0}

/* Website frame and single-row navigation from the V4 layout. */
body{padding:24px;background:var(--surface);font-size:14px}
.frame{max-width:1100px;margin:auto;background:var(--bg);border:1px solid var(--line);border-radius:14px;box-shadow:0 18px 50px #00000024}
header{border-radius:14px 14px 0 0}
.bar{min-height:64px;padding:0 28px;flex-wrap:nowrap;gap:12px}
.brand{font-size:17px;letter-spacing:.025em;white-space:nowrap}
.brand img{width:36px;height:36px}
nav{gap:4px;font-size:13px}nav a{white-space:nowrap}
#nbCount{font-size:11px;background:var(--surface2);color:var(--muted);border-radius:12px;padding:2px 6px}
#search,.mobile-book,#theme{display:flex;align-items:center;justify-content:center;gap:8px;background:var(--surface);border:1px solid var(--line);border-radius:8px;height:32px}
#search{flex:1;max-width:230px;justify-content:flex-start;color:var(--muted);font-size:12px}
.mobile-book,#theme{width:32px;padding:0}.mobile-book{display:none}.right{flex-wrap:nowrap;gap:8px;font-size:12px}
main{min-height:580px;padding:28px}footer{display:flex;justify-content:space-between;background:var(--surface);font-size:12px;border-radius:0 0 14px 14px}footer strong{color:var(--ink)}
.home section+section{margin-top:36px}.section-head,.bridge{display:flex;align-items:center;gap:10px}
.section-head{margin-bottom:14px}.section-head h1,.section-head h2,main[data-page=notebook] h1,main[data-page=series] h1{font-size:18px;margin:0}
.section-head>a,.section-head>small{margin-left:auto;color:var(--muted);font-size:12px}
.segments{display:inline-flex;background:var(--surface);border:1px solid var(--line);border-radius:40px;padding:2px}
.segments button{border:0;border-radius:40px;background:transparent;color:var(--muted);padding:2px 10px;font-size:11px}
.segments button[aria-pressed=true]{background:var(--accent);color:var(--on);font-weight:600}
.home .catalog{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:20px}
.card{display:block;padding:0;margin:0;background:transparent;border:0;border-radius:0}
.thumb{position:relative;overflow:hidden;border-radius:12px;aspect-ratio:3/2;background:var(--surface)}
.thumb img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:center}
.reader-cover{margin:16px 0 20px}.reader-cover .thumb{aspect-ratio:auto;border-radius:18px}.reader-cover img{display:block;position:static;height:auto}.reader-cover figcaption{text-align:center;color:var(--muted);font-size:11px;margin-top:5px}
.card img{width:100%;height:100%;max-width:none;display:block;object-fit:cover;transition:transform .3s}.card:hover img{transform:scale(1.03)}
.card .thumb{padding:0}.card .caption{padding:10px 0 0}.caption h3{font-size:14px;line-height:1.4;margin:0}.caption small{display:flex;justify-content:space-between;font-size:11px;margin-top:6px}
.bridge,.empty{border:1px solid var(--line);background:var(--surface);border-radius:16px;padding:16px}
.bridge{justify-content:space-between;font-size:12px}.bridge small{display:block;font-size:11px}.bridge a{padding:6px 14px;border-radius:8px}
.archive,main[data-page=series],main[data-page=notebook]{max-width:820px;margin:auto}.archive{max-width:764px}
.archive .section-head,.noterow{border-bottom:1px solid var(--line);padding-bottom:12px}
.archive .card{display:flex;flex-direction:row-reverse;justify-content:space-between;gap:16px;padding:12px 0;border-bottom:1px solid var(--line)}
.archive .thumb{width:clamp(84px,22vw,112px);border-radius:10px;flex:none}
.archive .caption{padding:0;min-width:0;flex:1}
.archive .caption small{justify-content:flex-start;gap:10px}
.archive .section-head{margin-bottom:0}
.article-intro{margin:4px 0 0;color:var(--muted);font-size:12px;line-height:1.5;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}
.reader{max-width:692px}.reader h1{font-size:24px}.reader .toolbar{font-size:12px}
.para{border:0;border-radius:0;padding:0;margin:20px 0 32px}.jp{line-height:2.45;margin:12px 0}.translation{font-size:15px}
.studybox{background:var(--surface);border:1px solid var(--line);border-radius:12px;padding:10px 16px}
.studybox{padding:20px;border-radius:16px}.studybox>*+*{margin-top:16px}.studybox [data-detail]{border:0;background:none;padding:3px 0;margin-right:12px;text-align:left}.studybox b{font-size:12px;color:var(--muted)}
main[data-page=notebook] .options{margin:14px 0}main[data-page=notebook] .options button{border-radius:32px;font-size:12px}
@media(max-width:800px){body{padding:0}.frame{border:0;border-radius:0;box-shadow:none}header{border-radius:0}.bar{height:56px;min-height:56px;gap:6px;padding:0 16px}.brand{font-size:15px}.brand img{width:32px;height:32px}.bar nav,#search span,#theme{display:none}.mobile-book{display:flex}#search{flex:none;width:32px;padding:0;justify-content:center;margin-left:auto}.right{gap:6px}.home .catalog{display:flex;overflow-x:auto;gap:12px}.home .card{flex:0 0 162px}.home .thumb{width:100%}.home .caption{padding-top:8px}.caption h3{font-size:13px}main{padding:16px}.section-head h1,.section-head h2{font-size:15px}.home section+section{margin-top:24px}.reader h1{font-size:20px}.studybox{padding:16px}.section-head{flex-wrap:wrap}}

.study-notes{margin-top:10px}.study-notes h3{font-size:14px;margin:5px 0 6px}
.notes-toggle,.lesson-button{border:0;background:var(--surface);font-size:13px;font-weight:500;padding:9px 12px}.lesson-button{float:right}
.notes-panel{padding:8px 10px 6px;border-radius:12px;background:var(--surface)}
.note-group+.note-group{margin-top:10px}.note-group h4{font-size:12px;color:var(--muted);margin:2px 0}
.note-row{position:relative;display:flex;align-items:center}.note-row+.note-row{border-top:1px solid var(--line)}
.note-entry,.note-sound{border:0;background:transparent}.note-entry{width:100%;min-height:44px;text-align:left;padding:6px 26px 6px 0;font-size:14px;line-height:1.3;overflow-wrap:anywhere}
.note-row:has(.note-sound) .note-entry{padding-right:68px}
.note-entry small{font-size:10px}.note-entry span{display:block;font-size:13px;margin-top:2px}
.note-entry::after{content:'›';position:absolute;right:6px;top:50%;transform:translateY(-50%);font-size:18px;color:var(--muted)}
.note-sound{position:absolute;right:22px;width:44px;height:44px;padding:0;display:grid;place-items:center;color:var(--muted)}

.editorial-reader body{padding:0;background:var(--bg)}
.editorial-reader .frame{border:0;box-shadow:none;border-radius:0}
.editorial-reader .frame>header,.editorial-reader footer,.editorial-reader .reader .toolbar>a{display:none}
.editorial-reader .reader .toolbar{justify-content:flex-end}

.word-title{display:flex;align-items:center;gap:8px}.word-title h2{margin:0}.word-title button{display:grid;place-items:center;min-width:36px;min-height:36px;padding:4px;color:var(--muted)}#wordSoundStatus:not(:empty){display:block;margin:6px 0}

.para-heading{display:flex;align-items:center;gap:.35rem}
.para-heading .para-sound{display:inline-grid;place-items:center;width:44px;height:44px;padding:0;border:0;background:transparent;color:var(--muted)}
.para-sound[aria-pressed="true"]{color:var(--ink);background:var(--surface)}
.practice-text{line-height:1.85;font-size:1.15rem}
.practice-actions{margin-block:1rem}
#practiceStatus{min-height:1.5em}
.reading-dock{position:fixed;z-index:5;bottom:0;left:50%;transform:translateX(-50%);box-sizing:border-box;width:min(100%,720px);border:1px solid var(--line);border-radius:12px 12px 0 0;background:var(--bg);padding:8px 16px max(8px,env(safe-area-inset-bottom))}
.reading-dock .options{display:flex;flex-wrap:wrap;align-items:center;gap:6px}
.reading-dock button{padding:4px 9px;font-size:.85rem}
.reading-dock input{width:100%;accent-color:var(--accent);margin:4px 0}
#modal:has(.practice-text) .segments{margin-bottom:8px}
#modal:has(.practice-text) .muted{border-top:1px solid var(--line);margin:0;padding-top:8px;font-size:.9rem}
#modal .practice-text{margin:0 0 10px}
.practice-actions{border-top:1px solid var(--line);padding-top:8px;margin:.5rem 0}
.practice-actions #practiceStatus{margin:0 0 8px}

footer:has(.icp-filing){flex-wrap:wrap}
footer .icp-filing{flex:0 0 100%;width:100%;grid-column:1/-1;text-align:center}
