* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: #f6f7fa; color: #2e3745; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif; }
a { color: #536b8b; text-decoration: none; }
a:hover { color: #354b6b; }
a:focus-visible, button:focus-visible, summary:focus-visible, img:focus-visible { outline: 2px solid #536b8b; outline-offset: 4px; }
.site-nav { display: flex; align-items: center; justify-content: space-between; gap: 20px; max-width: 1160px; margin: 0 auto; padding: 25px 24px; border-bottom: 1px solid #e3e7ee; }
.site-brand { color: #3e4c60; font-size: 20px; font-weight: 500; }
.site-nav nav { display: flex; gap: 28px; font-size: 13px; }
.reading-container { max-width: 1160px; margin: 0 auto; padding: 26px 24px 50px; }
.reading-navigation { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; font-size: 13px; color: #657389; }
.reading-layout { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 32px; align-items: start; }
.article-paper, .tutorial-index { min-width: 0; padding: 36px 40px; border: 1px solid #e3e7ee; border-radius: 10px; background: #fff; }
.article-header { padding-bottom: 24px; margin-bottom: 28px; border-bottom: 1px solid #e8ecf2; }
.article-header h1, .tutorial-index h1 { margin: 12px 0 18px; color: #2e3b50; font-size: 27px; font-weight: 500; line-height: 1.55; letter-spacing: -.3px; overflow-wrap: anywhere; }
.article-category { color: #657389; font-size: 12px; }
.article-meta { display: flex; gap: 18px; color: #657389; font-size: 12px; font-variant-numeric: tabular-nums; }
.article-body { color: #485569; font-size: 16px; line-height: 1.9; overflow-wrap: anywhere; }
.article-body > :first-child { margin-top: 0; }
.article-body p { margin: 16px 0; }
.article-body h2, .article-body h3, .article-body h4 { color: #354760; font-weight: 500; line-height: 1.65; margin: 32px 0 14px; scroll-margin-top: 24px; }
.article-body h2 { font-size: 21px; }
.article-body h3 { font-size: 18px; }
.article-body h4 { font-size: 16px; }
.article-body ul, .article-body ol { padding-left: 24px; margin: 18px 0; }
.article-body li { margin: 8px 0; }
.article-body strong { color: #354760; font-weight: 600; }
.article-body a { text-decoration: underline; text-underline-offset: 3px; }
.article-body blockquote { margin: 22px 0; padding: 13px 18px; border-left: 3px solid #a5b4c9; background: #f5f7fa; color: #66778d; }
.article-body blockquote:empty { display: none; }
.article-body img { display: block; max-width: 100%; height: auto; margin: 24px auto; border: 1px solid #e4e9f1; border-radius: 6px; cursor: zoom-in; }
.article-body code { padding: 2px 5px; border-radius: 4px; background: #f0f3f7; color: #456386; font: .88em/1.7 Consolas, 'SFMono-Regular', monospace; }
.article-body pre, .article-body .ql-code-block-container { max-width: 100%; overflow-x: auto; margin: 24px 0; padding: 20px; border: 1px solid #e0e6ef; border-radius: 7px; background: #f4f6fa; color: #354864; font: 13px/1.85 Consolas, 'SFMono-Regular', monospace; white-space: pre; word-break: normal; overflow-wrap: normal; }
.article-body pre code { padding: 0; background: transparent; color: inherit; font: inherit; }
.table-scroll { max-width: 100%; overflow-x: auto; margin: 24px 0; border: 1px solid #e0e6ef; border-radius: 6px; }
.article-body table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.7; }
.article-body th, .article-body td { min-width: 100px; padding: 12px 14px; border: 1px solid #e5eaf1; text-align: left; vertical-align: top; }
.article-body th { background: #f4f6fa; color: #354864; font-weight: 500; }
.article-body td p { margin: 0; }
.article-pagination { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin-top: 44px; padding-top: 24px; border-top: 1px solid #e6ebf2; }
.article-pagination a { font-size: 13px; line-height: 1.8; overflow-wrap: anywhere; }
.article-pagination a:last-child { text-align: right; }
.article-pagination span { display: block; color: #657389; font-size: 12px; margin-bottom: 8px; }
.reading-sidebar { position: sticky; top: 24px; max-height: calc(100vh - 48px); overflow-y: auto; }
.reading-sidebar h2 { margin: 0 0 15px; color: #485569; font-size: 14px; font-weight: 500; }
.desktop-toc a, .related-articles a { display: block; padding: 7px 12px; border-left: 2px solid transparent; color: #657389; font-size: 12px; line-height: 1.7; overflow-wrap: anywhere; }
.desktop-toc a:hover, .related-articles a:hover { color: #354b6b; }
.desktop-toc a.active { border-left-color: #536b8b; color: #354b6b; }
.desktop-toc .toc-subheading { padding-left: 22px; }
.related-articles { margin-top: 28px; padding-top: 24px; border-top: 1px solid #e3e7ee; }
.mobile-toc { display: none; margin-bottom: 26px; border: 1px solid #e3e7ee; border-radius: 6px; background: #fafbfd; }
.mobile-toc summary { cursor: pointer; padding: 13px 16px; color: #536b8b; font-size: 13px; }
.mobile-toc nav { padding: 0 16px 12px; }
.mobile-toc a { display: block; padding: 6px 0; font-size: 12px; line-height: 1.7; }
.tutorial-index h1 { margin: 0 0 24px; font-size: 23px; }
.tutorial-list { list-style: none; padding: 0; margin: 0; }
.tutorial-list li + li { border-top: 1px solid #edf0f5; }
.tutorial-list a { display: flex; justify-content: space-between; gap: 24px; padding: 22px 0; font-size: 15px; line-height: 1.7; }
.tutorial-list .article-category { flex-shrink: 0; }
.site-footer { padding: 0 24px 32px; text-align: center; color: #657389; font-size: 12px; }
.image-dialog { max-width: min(1100px, calc(100vw - 32px)); max-height: calc(100vh - 32px); padding: 20px; border: 1px solid #e3e7ee; border-radius: 8px; }
.image-dialog::backdrop { background: rgba(35, 44, 57, .6); }
.image-dialog img { display: block; max-width: 100%; max-height: calc(100vh - 115px); object-fit: contain; }
.close-preview { display: block; margin: 0 0 16px auto; border: 1px solid #e3e7ee; border-radius: 4px; padding: 6px 12px; background: #fff; color: #536b8b; cursor: pointer; }
@media (max-width: 960px) {
  .reading-layout { grid-template-columns: 1fr; }
  .reading-sidebar { position: static; max-height: none; }
  .desktop-toc { display: none; }
  .mobile-toc { display: block; }
  .related-articles { margin-top: 0; padding-top: 0; border: 0; }
}
@media (max-width: 600px) {
  .site-nav { padding: 20px; }
  .site-nav nav { gap: 18px; }
  .reading-container { padding: 22px 16px 36px; }
  .article-paper, .tutorial-index { padding: 25px 22px; }
  .article-header h1 { font-size: 23px; }
  .article-body { font-size: 15px; }
  .article-body h2 { font-size: 19px; }
  .article-body h3 { font-size: 17px; }
  .article-pagination { gap: 16px; }
  .tutorial-list a { flex-direction: column; gap: 8px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
