/* Mục "Đọc sách online" (/sach-online/) — dùng chung biến màu của sgk.css nên tự đổi theo Sáng / Đêm / Đọc sách. */
.so-page .so-main { padding: 22px 0 40px; }
.so-page .so-lead { font-size: 1.05rem; max-width: 70ch; margin-bottom: 18px; }

/* bố cục bài: nội dung + mục lục sách bên phải */
.so-grid { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 24px; align-items: start; }
.so-article { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 26px; box-shadow: var(--shadow); min-width: 0; }
.so-side { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow: auto; }
.so-book { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 14px 10px; font-size: .9rem; }
.so-book ol { list-style: none; margin-top: 8px; }
.so-book li { padding: 3px 0; line-height: 1.35; }
.so-book li.cur a { font-weight: 700; color: var(--accent); }
.so-book a { text-decoration: none; }
.so-book a:hover { text-decoration: underline; }
@media (max-width: 900px) {
  .so-grid { grid-template-columns: minmax(0, 1fr); }
  .so-side { position: static; max-height: none; }
  .so-article { padding: 16px 14px; }
}

/* nội dung */
.so-content { font-size: 1.04rem; line-height: 1.75; }
.so-content p, .so-content ul, .so-content ol { margin: 0 0 .85em; }
.so-content ul, .so-article ul { padding-left: 1.3em; }
.so-content h2 { font-size: 1.28rem; margin: 1.6em 0 .6em; padding-bottom: .25em; border-bottom: 2px solid var(--border); scroll-margin-top: 12px; }
.so-content h3 { font-size: 1.06rem; margin: 1.2em 0 .5em; color: var(--brand); scroll-margin-top: 12px; }
.so-content h4 { font-size: 1rem; margin: 1em 0 .4em; color: var(--text); }
.tw { overflow-x: auto; margin: 12px 0; }
.tw table { border-collapse: collapse; min-width: 60%; font-size: .95rem; }
.tw th, .tw td { border: 1px solid var(--border); padding: 6px 10px; text-align: left; vertical-align: top; }
.tw th { background: color-mix(in srgb, var(--brand) 10%, var(--card)); }
.so-req { background: color-mix(in srgb, var(--brand) 8%, var(--card)); border-left: 4px solid var(--brand); border-radius: 10px; padding: 12px 16px; margin-bottom: 16px; }
.so-req h2 { font-size: 1.05rem; margin-bottom: 6px; }
.so-terms { color: var(--muted); font-size: .95rem; margin-bottom: 14px; }
.so-toc { border: 1px dashed var(--border); border-radius: 10px; padding: 10px 16px; margin-bottom: 16px; font-size: .95rem; }
.so-toc ol { list-style: none; margin: 6px 0 0; padding: 0; }
.so-toc li { padding: 1px 0; }
.lab { color: var(--accent); margin-right: .4em; }

.blk { border: 1px solid var(--border); border-left: 5px solid var(--brand-2); border-radius: 12px; padding: 12px 16px; margin: 14px 0; background: var(--card); }
.blk.ex { border-left-color: var(--brand); }
.blk.pr { border-left-color: var(--accent); }
.blk.ac { border-left-color: #f59e0b; }
.blk .blk-h { margin: 0 0 6px; font-size: 1.02rem; color: var(--text); }
.blk-meta, .blk-fig { color: var(--muted); font-size: .88rem; margin-bottom: .5em; }
.def, .thm, .note { border-radius: 10px; padding: 10px 16px; margin: 12px 0; }
.def { background: color-mix(in srgb, var(--brand-2) 12%, var(--card)); border: 1px solid var(--border); }
.thm { background: color-mix(in srgb, var(--accent) 8%, var(--card)); border: 1px solid var(--border); }
.note { background: color-mix(in srgb, #f59e0b 12%, var(--card)); font-size: .97rem; }
.def p:last-child, .thm p:last-child, .note p:last-child, .blk p:last-child { margin-bottom: 0; }
.formula { overflow-x: auto; padding: 6px 0; text-align: center; margin: 10px 0; }
details.sol { margin-top: 8px; border-top: 1px dashed var(--border); padding-top: 8px; }
details.sol summary { cursor: pointer; font-weight: 700; color: var(--brand); }
.poem { font-style: italic; margin: 12px 0 12px 1.2em; border-left: 3px solid var(--border); padding-left: 12px; }
.fig { margin: 14px 0; padding: 10px 14px; border: 1px dashed var(--border); border-radius: 10px; color: var(--muted); font-size: .94rem; }
.ans { margin-top: 6px; }
math { font-size: 1.12em; }
.mw { display: inline-block; max-width: 100%; overflow-x: auto; overflow-y: hidden; vertical-align: middle; }
math[display="block"] { display: block; overflow-x: auto; max-width: 100%; }
code.tex { font-size: .92em; background: var(--bg); padding: 1px 5px; border-radius: 4px; }

.so-pdf { margin: 20px 0 12px; font-size: .95rem; color: var(--muted); }
.so-pn { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.so-pn a { display: block; border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; text-decoration: none; background: var(--card); }
.so-pn a span { display: block; font-size: .8rem; color: var(--muted); }
.so-pn .next { text-align: right; }
.so-pn a:hover { border-color: var(--brand); }

/* trang sách / lớp / hub */
.so-intro { display: flex; gap: 20px; align-items: flex-start; margin-bottom: 20px; }
.so-intro p { margin-bottom: 10px; max-width: 70ch; }
.so-cover { border-radius: 10px; border: 1px solid var(--border); box-shadow: var(--shadow); flex: none; object-fit: cover; }
@media (max-width: 600px) { .so-intro { flex-direction: column; } }
.so-main > h2, .so-chap { font-size: 1.15rem; margin: 22px 0 8px; }
.so-chap { color: var(--brand); }
.so-lessons { list-style: none; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 6px 18px; margin-bottom: 8px; }
.so-lessons li { padding: 10px 0; border-bottom: 1px solid var(--border); }
.so-lessons li:last-child { border-bottom: 0; }
.so-lessons a { text-decoration: none; }
.so-lessons a:hover strong { text-decoration: underline; }
.so-lessons .pg, .so-cards .pg { color: var(--muted); font-size: .85rem; margin-left: 6px; }
.so-lessons .snip { display: block; color: var(--muted); font-size: .9rem; margin-top: 2px; }
.so-cards, .so-grades { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.so-card, .so-grades li { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 18px; box-shadow: var(--shadow); }
.so-card h2 { font-size: 1.08rem; margin-bottom: 8px; }
.so-card ul { list-style: none; padding: 0; }
.so-card li { padding: 3px 0; }
.so-grades a { display: block; text-decoration: none; color: var(--text); }
.so-grades strong { display: block; font-size: 1.15rem; color: var(--brand); }
.so-grades span { color: var(--muted); font-size: .9rem; }
.so-foot { padding: 18px 0 28px; font-size: .88rem; color: var(--muted); }
.so-foot p { margin-bottom: 6px; max-width: 80ch; }

@media print { .site-header .ui-bar, .so-side, .so-pn, .so-foot { display: none; } .so-article { border: 0; box-shadow: none; } details.sol { display: block; } }
