/* Scoped fixes; the active theme remains untouched. */

/* Keep the original legal text, contacts, attribution and filing intact. */
body .site-footer { background: #17232c !important; }
body .site-footer .widget-footer { padding-top: 32px; padding-bottom: 24px; }
body .site-footer .widget-footer .site-info { font-size: 13px; line-height: 1.85; color: #c1cdd1; text-align: left; }
body .site-footer .widget-title { color: #edf4f5; font-size: 14px; margin-bottom: 16px; }
body .site-footer .widget-footer .widget ul li > a { color: #dbe9e9; font-size: 13px; }
body .site-footer .widget-footer .widget ul li > a:hover { color: #78dcc9; }
body .site-footer > .site-info { padding: 18px 20px !important; border-top-color: #36464d !important; color: #bfccd1; line-height: 1.8; font-size: 12px; }
body .site-footer > .site-info a { color: #dbe9e9; }
body .site-footer .widget-footer .logo img { max-width: 150px; height: auto; max-height: 54px; }
body.qd-footer-compact .widget-footer > .row > .col-md-5 { flex-basis: 68%; max-width: 68%; }
body.qd-footer-compact .widget-footer > .row > .col-md-7 { display: block; flex-basis: 32%; max-width: 32%; }
body.qd-footer-compact .widget-footer .col-md-7 .col-md-4 { flex-basis: 100%; max-width: 100%; }
body.qd-footer-compact .widget-footer .col-md-7 .col-md-4:nth-child(n+2) { display: none; }
body.qd-footer-compact .widget-footer .widget ul { display: flex; flex-wrap: wrap; gap: 12px 18px; }
body.qd-footer-compact .widget-footer .widget ul li { margin: 0; }
@media (max-width: 767px) {
    body.qd-footer-compact .widget-footer > .row > .col-md-5,
    body.qd-footer-compact .widget-footer > .row > .col-md-7 { display: block; flex-basis: 100%; max-width: 100%; }
    body .site-footer .widget-footer { padding-top: 26px; padding-bottom: 16px; }
    body .site-footer .widget-footer .widget { margin-top: 24px; margin-bottom: 0; }
    body .site-footer .widget-title { text-align: left; margin-bottom: 12px; }
}


/* Reading-first visual system, using system fonts only. */
:root { --qd-accent: #087f79; --qd-text: #23343b; --qd-muted: #617078; --qd-bg: #f4f7f8; --qd-card: #fff; --qd-border: #e2e9eb; --qd-soft: #eff7f5; }
body { background: var(--qd-bg); color: var(--qd-text); font-family: system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif; }
body.dark-mode { --qd-accent: #78dcc9; --qd-text: #e0eaec; --qd-muted: #a4b5ba; --qd-bg: #142027; --qd-card: #1b2b33; --qd-border: #35464e; --qd-soft: #203a40; background: var(--qd-bg); color: var(--qd-text); }
.site-header { border-bottom: 1px solid var(--qd-border); box-shadow: none; background: var(--qd-card); }
body.dark-mode .site-header { background: var(--qd-card); }
.site-header .navbar { min-height: 72px; }
.site-header .main-menu a { font-size: 15px; font-weight: 500; }
.site-header .main-menu a:hover, .site-header .current-menu-item > a { color: var(--qd-accent); }
.site-header .dark-switch, .site-header .navbar-button .show-modal { min-width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; margin: 0 3px; color: var(--qd-text); }
.site-header .dark-switch:hover, .site-header .navbar-button .show-modal:hover { background: var(--qd-soft); }
.site-content { padding-top: 28px; }
.posts-wrapper, .single-post article.post, .site-content .widget { border: 1px solid var(--qd-border); border-radius: 12px; box-shadow: none; background: var(--qd-card); }
.posts-wrapper { padding: 28px !important; }
.qd-guide { margin-bottom: 30px; padding-bottom: 26px; border-bottom: 1px solid var(--qd-border); }
.qd-eyebrow { color: var(--qd-accent); font-size: 13px; font-weight: 600; letter-spacing: .08em; margin: 0 0 12px; }
.qd-guide h1 { font-size: clamp(24px, 2.4vw, 32px); font-weight: 650; line-height: 1.4; letter-spacing: -.025em; margin: 0 0 12px; color: var(--qd-text); }
.qd-guide-description { font-size: 15px; line-height: 1.8; color: var(--qd-muted); margin: 0 0 20px; }
.qd-guide-search { display: flex; gap: 8px; max-width: 560px; margin: 0; }
.qd-guide-search input[type=search] { min-width: 0; flex: 1; height: 46px; padding: 0 14px; border: 1px solid var(--qd-border); border-radius: 8px; background: var(--qd-bg); color: var(--qd-text); font-size: 15px; }
.qd-guide-search button { flex: 0 0 auto; padding: 0 22px; min-height: 46px; border: 0; border-radius: 8px; background: #087f79; color: #fff; font-size: 15px; cursor: pointer; }
.qd-guide-search button:hover { background: #066b66; }
.qd-topics { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.qd-topics a { display: inline-flex; align-items: center; gap: 16px; padding: 8px 12px; border-radius: 6px; background: var(--qd-soft); color: var(--qd-accent); font-size: 13px; text-decoration: none; }
.qd-section-title, .qd-archive-heading h1 { color: var(--qd-text); font-size: 19px; font-weight: 600; margin: 0 0 22px; }
.qd-archive-heading p, .qd-category-description { font-size: 15px; line-height: 1.8; color: var(--qd-muted); }
.qd-category-description { padding-bottom: 18px; margin-bottom: 20px; border-bottom: 1px solid var(--qd-border); }
.qd-category-description p { margin: 0; }
.post-list .entry-title { margin: 8px 0 0; line-height: 1.6; }
.post-list .entry-title a { font-size: 19px; line-height: 1.55; font-weight: 600; color: var(--qd-text); }
.post-list .entry-title a:hover { color: var(--qd-accent); }
.post-list + .post-list { border-color: var(--qd-border); padding-top: 22px; margin-top: 22px; }
.post-list .entry-meta { font-size: 12px; line-height: 1.6; color: var(--qd-muted); }
.post-list .meta-category a { color: var(--qd-accent); }
.post-list .entry-excerpt { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 14px; line-height: 1.8; color: var(--qd-muted); margin-top: 10px; }
.post-list .entry-excerpt p { margin: 0; }
.site-content .widget { padding: 20px; }
.site-content .widget-title { font-size: 15px; color: var(--qd-text); border-color: var(--qd-border); }
.site-content .widget_tag_cloud .tagcloud { display: flex; flex-wrap: wrap; gap: 7px; }
.site-content .widget_tag_cloud .tagcloud > a { margin: 0; padding: 6px 9px; border: 1px solid var(--qd-border); background: var(--qd-card); color: var(--qd-muted); border-radius: 6px; font-size: 13px !important; line-height: 1.5; }
.site-content .widget_tag_cloud .tagcloud > a:hover { color: var(--qd-accent); border-color: var(--qd-accent); }
body.dark-mode .site-content .widget a { color: var(--qd-muted); }
body.dark-mode .site-content .qd-sidebar-toc a { color: #dce8eb; }
.single-post article.post { padding: 32px; }
.single-post .entry-header .entry-title { font-size: 28px; font-weight: 650; line-height: 1.5; color: var(--qd-text); }
.single-post .entry-action { color: var(--qd-muted); border-color: var(--qd-border); margin-top: 18px; }
.single-post .entry-action a, .single-post .breadcrumbs a { color: var(--qd-muted); }
.single-post .entry-content { font-size: 17px; line-height: 1.9; color: var(--qd-text); }
.single-post .entry-content p { font-size: 17px; line-height: 1.9; }
.single-post .entry-content h2, .single-post .entry-content h3 { color: var(--qd-text) !important; line-height: 1.55 !important; border-color: var(--qd-border) !important; scroll-margin-top: 100px; }
.single-post .entry-content h2 { font-size: 23px !important; margin-top: 32px; }
.single-post .entry-content h3 { font-size: 19px !important; margin-top: 26px; }
.single-post .entry-content table { display: block; max-width: 100%; overflow-x: auto; }
.single-post .entry-content pre { max-width: 100%; overflow-x: auto; }
.entry-content #toc { border: 1px solid var(--qd-border); border-radius: 8px; background: var(--qd-soft); color: var(--qd-text); }
.entry-content #toc summary { cursor: pointer; }
.entry-content #toc a { color: var(--qd-text); }
.site-main .page-numbers:not(ul) { float: none; margin: 0; background: var(--qd-card); color: var(--qd-muted); border: 1px solid var(--qd-border); }
.site-main .page-numbers.current, .site-main a.page-numbers:hover { background: #087f79; color: #fff; border-color: #087f79; }
body a:focus-visible, body button:focus-visible, body summary:focus-visible, body input:focus-visible, body [role=button]:focus-visible { outline: 2px solid var(--qd-accent); outline-offset: 3px; }
@media (min-width: 992px) {
  .single-post .site-content > .row > .col-lg-9 { flex-basis: 72%; max-width: 72%; }
  .single-post .site-content > .row > .col-lg-3 { flex-basis: 28%; max-width: 28%; }
  body.qd-toc-layout .site-content .qd-toc-widget { padding: 0; border: 0; }
}
@media (max-width: 767px) {
  .site-header .navbar { min-height: 64px; }
  .site-content, .single-post .site-content { padding-top: 16px; }
  .posts-wrapper { padding: 20px !important; }
  .qd-guide { margin-bottom: 24px; padding-bottom: 22px; }
  .qd-eyebrow { margin-bottom: 8px; font-size: 12px; }
  .qd-guide-description { font-size: 14px; margin-bottom: 16px; }
  .qd-guide-search input[type=search] { padding: 0 10px; font-size: 14px; }
  .qd-guide-search button { padding: 0 16px; }
  .post-list .entry-title a { font-size: 17px; }
  .post-list + .post-list { padding-top: 20px; margin-top: 20px; }
  .single-post article.post { padding: 20px; }
  .single-post .entry-header .entry-title { font-size: 23px; line-height: 1.5; }
  .single-post .entry-content p { font-size: 16px; line-height: 1.9; }
  .single-post .entry-content h2 { font-size: 21px !important; }
  .site-main .page-numbers:not(ul) { min-width: 38px; padding: 0 10px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .site-header, .off-canvas, .site { transition: none !important; } }


.qd-toc-widget { display: none; }
.qd-sidebar-toc {
    background: #f5f9f9; color: #30444c; border: 1px solid #dce8e6;
    border-radius: 10px; padding: 18px; margin: 0;
    max-height: calc(100vh - 120px); overflow-y: auto;
    font-size: 14px; line-height: 1.7; overflow-wrap: anywhere;
}
.qd-sidebar-toc summary { cursor: pointer; font-weight: 600; font-size: 15px; }
.qd-sidebar-toc ul, .qd-sidebar-toc ol { padding-left: 18px; margin: 12px 0 0; }
.qd-sidebar-toc li { margin: 8px 0; }
.qd-sidebar-toc a { color: #30444c; text-decoration: none; }
.qd-sidebar-toc a:hover { color: #087f79; text-decoration: underline; }
body.dark-mode .qd-sidebar-toc { background: #172a32; border-color: #3a525a; color: #dce8eb; }
body.dark-mode .qd-sidebar-toc summary, body.dark-mode .qd-sidebar-toc li, body.dark-mode .qd-sidebar-toc a { color: #dce8eb; }
@media (min-width: 992px) {
    body.qd-toc-layout .entry-content #toc { display: none; }
    body.qd-toc-layout .qd-toc-widget { display: block; padding: 0; }
}
@media (max-width: 991.98px) {
    .entry-content #toc { float: none !important; width: 100% !important; max-width: 100% !important; }
}

body.dark-mode .entry-content #toc {
    background: #172a32;
    border-color: #3a525a;
    color: #dce8eb;
}
body.dark-mode .entry-content #toc summary,
body.dark-mode .entry-content #toc li,
body.dark-mode .entry-content #toc a { color: #dce8eb; }
body.dark-mode .entry-content #toc a:hover { color: #83decb; }
/* Numeric page labels must stay intact at any page count. */
.site-main .page-numbers:not(ul), .numeric-pagination .page-numbers:not(ul) {
    width: auto;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    white-space: nowrap;
    border-radius: 6px;
}
.pagenavi, .numeric-pagination, .numeric-pagination > ul, .navigation.pagination .nav-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
}


/* Final sizing overrides for theme input margins and excerpt blockification. */
.qd-guide-search input[type=search] { margin: 0; }
.qd-guide-search button { height: 46px; align-self: flex-start; }
.post-list .entry-excerpt > p { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; margin: 0; }
.post-list .entry-meta .meta-time { font-weight: 400; color: var(--qd-muted); }
body.qd-footer-compact .widget-footer .widget ul li { padding: 0; align-self: center; }
.site-footer a[href*="beian.miit.gov.cn"] { display: inline-block; white-space: nowrap; }

/* Search and share stay readable in both schemes. */
.search-box.modal-wrap { width: calc(100% - 32px); max-width: 600px; max-height: calc(100dvh - 32px); overflow: auto; padding: 24px; border: 1px solid var(--qd-border); border-radius: 12px; background: var(--qd-card); color: var(--qd-text); }
.search-box.modal-wrap h6 { font-size: 19px; color: var(--qd-text); padding-right: 42px; margin: 0 0 20px; }
.search-box.modal-wrap form { gap: 10px; margin: 0 0 16px; }
.search-box.modal-wrap form input { min-width: 0; flex: 1; height: 44px; line-height: 44px; padding: 0 12px; margin: 0; color: var(--qd-text); background: var(--qd-bg); border: 1px solid var(--qd-border); border-radius: 6px; }
.search-box.modal-wrap form button { flex: 0 0 auto; min-height: 44px; height: 44px; line-height: 44px; margin: 0; padding: 0 18px; color: #fff; background: #087f79; border-radius: 6px; }
.search-box .search-terms, .search-box .search-history { font-size: 13px; line-height: 2; overflow-wrap: anywhere; color: var(--qd-muted); }
.search-box .search-terms a, .search-box .search-history a { color: var(--qd-accent); display: inline-block; }
.share-box.modal-wrap { width: calc(100% - 32px); max-width: 390px; max-height: calc(100dvh - 32px); overflow: auto; background: var(--qd-card); color: var(--qd-text); border: 1px solid var(--qd-border); border-radius: 12px; }
.share-box .share-box-title { padding-right: 30px; color: var(--qd-text); }
.share-box .share-box-icons a, .share-box .share-box-copy input, .share-box .share-box-copy button { color: var(--qd-text); }
.search-box .modal-close, .share-box .modal-close { top: 8px; right: 8px; width: 44px; height: 44px; line-height: 44px; transform: none; border-radius: 8px; background: var(--qd-soft); color: var(--qd-text); }
.search-box .modal-close i, .share-box .modal-close i { color: var(--qd-text); }

@media (min-width:768px) and (max-width:991.98px) { body .container { padding-left:15px; padding-right:15px; } }

body .site-content .qd-sidebar-toc a, body .site-content .widget_recent_entries a { color:var(--qd-text); }
body .site-content .qd-sidebar-toc a:hover, body .site-content .widget_recent_entries a:hover { color:var(--qd-accent); }
