/* Small local-only additions for interactions that were previously supplied
   by opaque third-party scripts. The captured layout remains untouched. */

html[data-theme="dark"] {
  --d-bg: #17212b;
  --d-bg-elevated: #202b36;
  --d-border: #2d3b47;
  --d-text: #eef3f7;
  --d-text-muted: #a8b3bd;
  --d-accent: #168acd;
  --d-accent-bright: #5bbbea;
  --d-accent-soft: rgba(91, 187, 234, 0.12);
  color-scheme: dark;
}

html[data-theme="dark"] body,
html[data-theme="dark"] .tl_page_wrap,
html[data-theme="dark"] .tl_page,
html[data-theme="dark"] .tl_main_wrap {
  background-color: var(--d-bg);
  color: var(--d-text);
}

html[data-theme="dark"] .navbar-tg,
html[data-theme="dark"] .navbar-inner,
html[data-theme="dark"] .footer_wrap,
html[data-theme="dark"] .dev_blog_card_wrap,
html[data-theme="dark"] .dropdown-menu {
  background-color: var(--d-bg-elevated);
  border-color: var(--d-border);
}

html[data-theme="dark"] .navbar-tg .nav > li > a,
html[data-theme="dark"] .footer_wrap,
html[data-theme="dark"] .footer_wrap a,
html[data-theme="dark"] .tl_main_card_lead,
html[data-theme="dark"] .dev_blog_card_lead,
html[data-theme="dark"] .side_blog_title,
html[data-theme="dark"] .side_blog_date {
  color: var(--d-text-muted);
}

html[data-theme="dark"] .tl_main_logo_title_image path {
  fill: var(--d-text);
}

html[data-theme="dark"] .tl_main_logo_lead,
html[data-theme="dark"] .tl_main_card_header,
html[data-theme="dark"] .dev_blog_card_title,
html[data-theme="dark"] .footer_wrap h5,
html[data-theme="dark"] .footer_wrap h5 a {
  color: var(--d-text);
}

html[data-theme="dark"] .tl_main_download_link,
html[data-theme="dark"] .tl_main_download_desktop_link,
html[data-theme="dark"] .side_blog_header,
html[data-theme="dark"] .tl_main_recent_news_header a,
html[data-theme="dark"] .tl_main_body_header {
  color: var(--d-accent-bright);
}

html[data-theme="dark"] .navbar-tg,
html[data-theme="dark"] .tl_main_recent_news_wrap,
html[data-theme="dark"] .footer_wrap {
  border-color: var(--d-border);
}

/* 官方站点/友情链接区域 */
.footer_wrap .official-sites {
  box-sizing: border-box;
  width: calc(100% - 40px);
  max-width: 800px;
  min-width: 0;
  margin: 24px auto 0;
  padding: 20px 0 10px;
  border-top: 1px solid #e6e6e6;
  color: #666;
  font-size: 14px;
  line-height: 1.6;
}

.footer_wrap .official-sites h4 {
  margin: 0 0 20px;
  color: #333;
  font-size: 16px;
  font-weight: 600;
}

.footer_wrap .official-sites-button {
  display: inline-block;
  max-width: 100%;
  padding: 8px 15px;
  border: 0;
  border-radius: 5px;
  background-color: #0088cb;
  color: #fff;
  font: inherit;
  cursor: pointer;
  appearance: none;
  transition: background-color 0.2s ease, transform 0.1s ease;
}

.footer_wrap .official-sites-button:hover {
  background-color: #0077b3;
}

.footer_wrap .official-sites-button:active {
  transform: translateY(1px);
}

.footer_wrap .official-sites-button:focus-visible {
  outline: 2px solid #0088cb;
  outline-offset: 3px;
}

.footer_wrap .official-site-list {
  display: block;
  margin-top: 10px;
}

.footer_wrap .official-site-list[hidden] {
  display: none !important;
}

.footer_wrap .official-site-list p {
  margin: 8px 0;
}

.footer_wrap .official-site-list a {
  color: #666;
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer_wrap .official-site-list a:hover {
  color: #0088cb;
  text-decoration: underline;
}

.footer_wrap .official-sub-sites {
  margin-top: 10px;
  color: #666;
  font-size: 12px;
  line-height: 2;
  overflow-wrap: anywhere;
}

.footer_wrap .official-sub-sites a {
  display: inline-block;
  margin-right: 8px;
  white-space: nowrap;
}

html[data-theme="dark"] .footer_wrap .official-sites {
  border-top-color: var(--d-border, #2d3b47);
  color: var(--d-text-muted, #a8b3bd);
}

html[data-theme="dark"] .footer_wrap .official-sites h4 {
  color: var(--d-text, #eef3f7);
}

html[data-theme="dark"] .footer_wrap .official-site-list a,
html[data-theme="dark"] .footer_wrap .official-sub-sites {
  color: var(--d-text-muted, #a8b3bd);
}

html[data-theme="dark"] .footer_wrap .official-site-list a:hover {
  color: var(--d-accent-bright, #5bbbea);
}

@media (max-width: 767px) {
  .footer_wrap .official-sites {
    width: auto;
    max-width: none;
    margin: 20px;
    padding: 20px 0 10px;
  }

  .footer_wrap .official-sub-sites {
    line-height: 1.9;
  }
}
