html {
  --primary: #6d28d9;
  --primary-dark: #4c1d95;
  --primary-soft: rgba(109, 40, 217, 0.08);
  --primary-soft-strong: rgba(109, 40, 217, 0.14);
  --text: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
}

html.theme-dark {
  color-scheme: dark;
  --primary: #7fb8ff;
  --primary-dark: #5aa7f8;
  --primary-soft: rgba(127, 184, 255, 0.14);
  --primary-soft-strong: rgba(127, 184, 255, 0.22);
  --text: #f3f6fb;
  --muted: #aeb8c6;
  --border: rgba(151, 165, 183, 0.22);
  --surface: rgba(36, 48, 61, 0.88);
  --surface-soft: #1d2732;
  --shadow-soft: none;
  --shadow-hover: none;
}

html.theme-light {
  color-scheme: light;
}

body {
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.no-transition *,
.no-transition *::before,
.no-transition *::after {
  transition: none !important;
}

.public-theme-toggle {
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(209, 217, 229, 0.82);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  background: rgba(255, 255, 255, 0.6);
  color: #1f2937;
  box-shadow: none !important;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.public-theme-toggle .material-icons {
  margin: 0 !important;
  font-size: 1.35rem;
  line-height: 1;
}

.public-theme-toggle:hover,
.public-theme-toggle:focus-visible {
  background: rgba(31, 41, 55, 0.85);
  border-color: rgba(31, 41, 55, 0.85);
  color: #fff;
  box-shadow: none !important;
  outline: none !important;
}

.public-theme-toggle:focus {
  box-shadow: none !important;
  outline: none !important;
}

.public-theme-toggle--floating {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 2100;
}

html.theme-dark .public-theme-toggle {
  background: rgba(255, 255, 255, 0.065);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.10);
  box-shadow: none !important;
}

html.theme-dark .public-theme-toggle:hover,
html.theme-dark .public-theme-toggle:focus-visible {
  background: rgba(251, 178, 1, 0.33);
  border-color: rgba(255, 255, 255, 0.22);
  color: #fff;
  box-shadow: none !important;
}

html.theme-dark body {
  color: var(--text);
  background: #1d2732;
}

html.theme-dark .login-page,
html.theme-dark .register-page,
html.theme-dark .reset-page,
html.theme-dark .error-page {
  background:
    radial-gradient(circle at top left, rgba(127, 184, 255, 0.13), transparent 28%),
    radial-gradient(circle at bottom right, rgba(120, 169, 255, 0.10), transparent 26%),
    linear-gradient(180deg, #1d2732 0%, #22303d 52%, #1d2732 100%);
}

html.theme-dark .navbar-custom {
  background: rgba(31, 42, 54, 0.84);
  border-bottom-color: rgba(151, 165, 183, 0.18);
  box-shadow: none;
}

html.theme-dark .navbar-toggler,
html.theme-dark .navbar-toggler i {
  color: #fff !important;
}

html.theme-dark .navbar-brand,
html.theme-dark .navbar-brand span,
html.theme-dark .navbar-toggler,
html.theme-dark .nav-link,
html.theme-dark .section-title,
html.theme-dark .login-title,
html.theme-dark .register-title,
html.theme-dark .reset-title,
html.theme-dark .login-card-title,
html.theme-dark .register-card-title,
html.theme-dark .reset-card-title,
html.theme-dark .invite-card-title,
html.theme-dark .step-pane-title,
html.theme-dark .feature-card h4,
html.theme-dark .support-card h4,
html.theme-dark .article-card h4,
html.theme-dark .price-card h4,
html.theme-dark .protocol-box h4,
html.theme-dark .location-card h5,
html.theme-dark .footer-card-title,
html.theme-dark .footer-status-title {
  color: #f3f6fb !important;
}

html.theme-dark .hero {
  background:
    radial-gradient(circle at top left, rgba(127, 184, 255, 0.16), transparent 30%),
    radial-gradient(circle at bottom right, rgba(120, 169, 255, 0.10), transparent 26%),
    linear-gradient(180deg, #1d2732 0%, #22303d 52%, #1d2732 100%);
}

html.theme-dark .hero::before {
  opacity: 0.12;
  mix-blend-mode: screen;
}

html.theme-dark .surface-soft,
html.theme-dark .footer {
  background: #202b37;
}

html.theme-dark .locations-section {
  background:
    radial-gradient(circle at top left, rgba(127, 184, 255, 0.08), transparent 24%),
    linear-gradient(180deg, #202b37 0%, #1d2732 100%);
}

html.theme-dark .feature-card,
html.theme-dark .price-card,
html.theme-dark .article-card,
html.theme-dark .support-card,
html.theme-dark .location-card,
html.theme-dark .footer-card,
html.theme-dark .mini-price-box,
html.theme-dark .protocol-box,
html.theme-dark .login-card,
html.theme-dark .register-card,
html.theme-dark .invite-card,
html.theme-dark .reset-card,
html.theme-dark .error-card {
  background: rgba(34, 46, 58, 0.96);
  border-color: rgba(151, 165, 183, 0.20);
  box-shadow: none;
  color: #f3f6fb;
}

html.theme-dark .feature-card:hover,
html.theme-dark .price-card:hover,
html.theme-dark .article-card:hover,
html.theme-dark .support-card:hover,
html.theme-dark .location-card:hover,
html.theme-dark .footer-card:hover,
html.theme-dark .mini-price-box:hover {
  border-color: rgba(127, 184, 255, 0.28);
  box-shadow: none;
}

html.theme-dark .login-card-subtitle,
html.theme-dark .register-card-subtitle,
html.theme-dark .reset-card-subtitle,
html.theme-dark .invite-card-subtitle,
html.theme-dark .invite-note,
html.theme-dark .step-pane-subtitle,
html.theme-dark .form-text,
html.theme-dark .reset-subtitle,
html.theme-dark .section-subtitle,
html.theme-dark .feature-card p,
html.theme-dark .support-card p,
html.theme-dark .article-card p,
html.theme-dark .price-card p,
html.theme-dark .protocol-box p,
html.theme-dark .location-card p,
html.theme-dark .price-traffic,
html.theme-dark .price-main small,
html.theme-dark .footer-legal,
html.theme-dark .footer-status-subtitle,
html.theme-dark .footer-status-text,
html.theme-dark .footer-status-fallback-text small,
html.theme-dark .text-muted {
  color: #aeb8c6 !important;
}

html.theme-dark .invite-benefit-item,
html.theme-dark .agreement-box,
html.theme-dark .highlight,
html.theme-dark .footer-status-fallback {
  background: rgba(127, 184, 255, 0.08);
  border-color: rgba(127, 184, 255, 0.16);
  color: #d8e0ea;
}

html.theme-dark .footer-status-fallback:hover {
  background: rgba(127, 184, 255, 0.12);
  border-color: rgba(127, 184, 255, 0.30);
  color: #7fb8ff;
}

html.theme-dark .footer-status-fallback-icon {
  background: rgba(127, 184, 255, 0.14);
  color: #7fb8ff;
}

html.theme-dark .price-list li,
html.theme-dark .footer-link,
html.theme-dark .footer-link-item,
html.theme-dark .text-link-modern,
html.theme-dark .form-label-modern,
html.theme-dark .form-floating > .register-control ~ label {
  color: #d8e0ea !important;
}

html.theme-dark .login-card-icon,
html.theme-dark .register-card-icon,
html.theme-dark .invite-card-icon,
html.theme-dark .reset-card-icon,
html.theme-dark .icon-wrap,
html.theme-dark .location-flag-wrap {
  background: rgba(127, 184, 255, 0.12);
  border-color: rgba(127, 184, 255, 0.16);
  color: #7fb8ff;
  box-shadow: none;
}

html.theme-dark .locations-map-panel,
html.theme-dark .location-detail-card,
html.theme-dark .location-list-button {
  background: rgba(34, 46, 58, 0.96);
  border-color: rgba(151, 165, 183, 0.20);
  color: #f3f6fb;
  box-shadow: none;
}

html.theme-dark .locations-map-visual {
  background:
    linear-gradient(rgba(127, 184, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(127, 184, 255, 0.08) 1px, transparent 1px),
    radial-gradient(circle at 22% 26%, rgba(127, 184, 255, 0.09), transparent 26%),
    radial-gradient(circle at 78% 32%, rgba(25, 118, 210, 0.08), transparent 24%),
    linear-gradient(180deg, #1d2732 0%, #202b37 100%);
  background-size: 96px 72px, 96px 72px, auto, auto, auto;
  border-color: rgba(151, 165, 183, 0.20);
}

html.theme-dark .locations-map-visual.leaflet-container {
  background:
    linear-gradient(rgba(127, 184, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(127, 184, 255, 0.08) 1px, transparent 1px),
    radial-gradient(circle at 22% 26%, rgba(127, 184, 255, 0.09), transparent 26%),
    radial-gradient(circle at 78% 32%, rgba(25, 118, 210, 0.08), transparent 24%),
    linear-gradient(180deg, #1d2732 0%, #202b37 100%);
  background-size: 96px 72px, 96px 72px, auto, auto, auto;
}

html.theme-dark .locations-map-visual .leaflet-control-zoom {
  background: rgba(31, 42, 54, 0.92);
  border-color: rgba(127, 184, 255, 0.24);
  box-shadow: none;
}

html.theme-dark .locations-map-visual .leaflet-control-zoom a {
  border-bottom-color: rgba(127, 184, 255, 0.16);
  color: #f3f6fb;
}

html.theme-dark .locations-map-visual .leaflet-control-zoom a:hover,
html.theme-dark .locations-map-visual .leaflet-control-zoom a:focus-visible {
  background: rgba(127, 184, 255, 0.14);
  color: #7fb8ff;
}

html.theme-dark .locations-map-list {
  scrollbar-color: rgba(127, 184, 255, 0.58) transparent;
}

html.theme-dark .locations-map-list::-webkit-scrollbar-track {
  background: rgba(127, 184, 255, 0.08);
}

html.theme-dark .locations-map-list::-webkit-scrollbar-thumb {
  background: rgba(127, 184, 255, 0.58);
}

html.theme-dark .locations-map-list-wrap::before {
  background: linear-gradient(90deg, #202b37, rgba(32, 43, 55, 0));
}

html.theme-dark .locations-map-list-wrap::after {
  background: linear-gradient(270deg, #202b37, rgba(32, 43, 55, 0));
}

html.theme-dark .location-detail-flag-wrap {
  background: rgba(127, 184, 255, 0.12);
  border-color: rgba(127, 184, 255, 0.16);
  box-shadow: none;
}

html.theme-dark .location-leaflet-marker {
  background: rgba(31, 42, 54, 0.92);
  border-color: rgba(127, 184, 255, 0.24);
  color: #f3f6fb;
  box-shadow: none;
}

html.theme-dark .location-leaflet-marker:hover,
html.theme-dark .location-leaflet-marker:focus-visible,
html.theme-dark .location-leaflet-marker.is-active,
html.theme-dark .location-list-button:hover,
html.theme-dark .location-list-button:focus-visible,
html.theme-dark .location-list-button.is-active {
  background: rgba(47, 68, 88, 0.95);
  border-color: rgba(127, 184, 255, 0.48);
  box-shadow: none;
}

html.theme-dark .location-leaflet-ping,
html.theme-dark .location-list-ping {
  color: #7dd3bf;
}

html.theme-dark .location-leaflet-ping--muted,
html.theme-dark .location-list-ping--muted,
html.theme-dark .location-detail-card p,
html.theme-dark .location-detail-metrics span {
  color: #aeb8c6;
}

html.theme-dark .location-detail-metrics {
  border-top-color: rgba(151, 165, 183, 0.20);
}

html.theme-dark .location-detail-metrics strong {
  color: #f3f6fb;
}

html.theme-dark .form-control-modern,
html.theme-dark .register-control {
  background: rgba(29, 39, 50, 0.88);
  border-color: rgba(151, 165, 183, 0.26);
  color: #f3f6fb;
}

html.theme-dark .form-control-modern::placeholder,
html.theme-dark .register-control::placeholder {
  color: #7f8b9a;
}

html.theme-dark .form-floating > .register-control::placeholder {
  color: transparent !important;
}

html.theme-dark .form-floating > .register-control ~ label::after {
  background: transparent !important;
}

html.theme-dark .form-floating > .register-control:focus ~ label,
html.theme-dark .form-floating > .register-control:not(:placeholder-shown) ~ label {
  color: #7fb8ff !important;
}

html.theme-dark .form-control-modern:focus,
html.theme-dark .register-control:focus {
  background: rgba(31, 42, 54, 0.98);
  border-color: rgba(127, 184, 255, 0.55);
  box-shadow: 0 0 0 0.25rem rgba(127, 184, 255, 0.12);
  color: #fff;
}

html.theme-dark .btn-outline-modern,
html.theme-dark .btn-secondary-modern,
html.theme-dark .btn-outline-custom {
  background: rgba(36, 48, 61, 0.72);
  border-color: rgba(151, 165, 183, 0.28);
  color: #f3f6fb;
}

html.theme-dark .btn-outline-modern:hover,
html.theme-dark .btn-secondary-modern:hover:not(:disabled),
html.theme-dark .btn-outline-custom:hover {
  background: rgba(43, 55, 69, 0.92);
  border-color: rgba(127, 184, 255, 0.44);
  color: #7fb8ff;
}

html.theme-dark .btn-account-title {
  color: #f3f6fb;
}

html.theme-dark .btn-account-username {
  color: #aeb8c6;
}

html.theme-dark .alert {
  background: rgba(43, 55, 69, 0.88);
  border-color: rgba(151, 165, 183, 0.22);
  color: #f3f6fb;
}

html.theme-dark .alert-success {
  background: rgba(25, 55, 39, 0.78);
  border-color: rgba(74, 222, 128, 0.22);
  color: #d8f6e1;
}

html.theme-dark .alert-danger,
html.theme-dark .alert-error {
  background: rgba(69, 34, 38, 0.82);
  border-color: rgba(248, 113, 113, 0.22);
  color: #fee2e2;
}

html.theme-dark .alert-info {
  background: rgba(35, 50, 69, 0.82);
  border-color: rgba(127, 184, 255, 0.22);
  color: #d6ecff;
}

html.theme-dark .btn-close {
  filter: invert(1) grayscale(100%);
}

/* Standalone public pages */
html.theme-dark .legal-page,
html.theme-dark .register-disabled-page,
html.theme-dark .registration-success-page,
html.theme-dark .maintenance-page {
  background:
    radial-gradient(circle at top left, rgba(127, 184, 255, 0.13), transparent 28%),
    radial-gradient(circle at bottom right, rgba(120, 169, 255, 0.10), transparent 26%),
    linear-gradient(180deg, #1d2732 0%, #22303d 52%, #1d2732 100%) !important;
  color: #f3f6fb;
}

html.theme-dark .legal-page h1,
html.theme-dark .legal-page h2,
html.theme-dark .legal-page h3,
html.theme-dark .register-disabled-page h1,
html.theme-dark .register-disabled-page h2,
html.theme-dark .register-disabled-page h3,
html.theme-dark .register-disabled-page h4,
html.theme-dark .register-disabled-page h5,
html.theme-dark .register-disabled-page h6,
html.theme-dark .registration-success-page .title,
html.theme-dark .registration-success-page .next-steps-title,
html.theme-dark .maintenance-page .brand-name,
html.theme-dark .maintenance-page .hero-title,
html.theme-dark .maintenance-page .panel-title,
html.theme-dark .maintenance-page .chip .chip-h,
html.theme-dark .maintenance-page .link-title {
  color: #f3f6fb !important;
}

html.theme-dark .legal-page,
html.theme-dark .legal-page p,
html.theme-dark .legal-page li,
html.theme-dark .registration-success-page .kv-value,
html.theme-dark .registration-success-page .next-steps,
html.theme-dark .maintenance-page .hero-text,
html.theme-dark .maintenance-page .chip .chip-t {
  color: #d8e0ea !important;
}

html.theme-dark .legal-page .content,
html.theme-dark .register-disabled-page .card,
html.theme-dark .registration-success-page .success-card,
html.theme-dark .registration-success-page .kv,
html.theme-dark .registration-success-page .next-steps-card,
html.theme-dark .maintenance-page .shell,
html.theme-dark .maintenance-page .hero,
html.theme-dark .maintenance-page .panel,
html.theme-dark .maintenance-page .link-card {
  background: linear-gradient(180deg, rgba(43, 55, 69, 0.88), rgba(34, 46, 58, 0.92)) !important;
  border-color: rgba(151, 165, 183, 0.20) !important;
  box-shadow: none !important;
  color: #f3f6fb !important;
}

html.theme-dark .register-disabled-page .card-header,
html.theme-dark .registration-success-page .kv-code,
html.theme-dark .registration-success-page code.kv-code,
html.theme-dark .maintenance-page .hero-badge,
html.theme-dark .maintenance-page .brand-logo,
html.theme-dark .maintenance-page .chip,
html.theme-dark .maintenance-page .icon-bubble {
  background: rgba(29, 39, 50, 0.72) !important;
  border-color: rgba(151, 165, 183, 0.22) !important;
  color: #d8e0ea !important;
  box-shadow: none !important;
}

html.theme-dark .register-disabled-page .info-banner,
html.theme-dark .registration-success-page .success-welcome,
html.theme-dark .registration-success-page .promo-badge {
  background: rgba(127, 184, 255, 0.10) !important;
  border-color: rgba(127, 184, 255, 0.20) !important;
  color: #d6ecff !important;
}

html.theme-dark .registration-success-page .success-page {
  background:
    radial-gradient(circle at top left, rgba(127, 184, 255, 0.13), transparent 28%),
    radial-gradient(circle at bottom right, rgba(120, 169, 255, 0.10), transparent 26%),
    linear-gradient(180deg, #1d2732 0%, #22303d 52%, #1d2732 100%) !important;
}

html.theme-dark .registration-success-page .kv-label,
html.theme-dark .registration-success-page .next-steps-subtitle,
html.theme-dark .registration-success-page .promo-subtext,
html.theme-dark .maintenance-page .brand-sub,
html.theme-dark .maintenance-page .link-sub,
html.theme-dark .maintenance-page .footer-note {
  color: #aeb8c6 !important;
}

html.theme-dark .legal-page a,
html.theme-dark .register-disabled-page a,
html.theme-dark .maintenance-page a {
  color: #7fb8ff;
}

/* Articles */
html.theme-dark .articles-page {
  background: #1d2732 !important;
}

html.theme-dark .page-header {
  background: linear-gradient(180deg, #1d2732 0%, #22303d 100%) !important;
  border-bottom-color: rgba(151, 165, 183, 0.18) !important;
}

html.theme-dark .chip,
html.theme-dark .page-link {
  background: rgba(36, 48, 61, 0.86) !important;
  border-color: rgba(151, 165, 183, 0.24) !important;
  color: #d8e0ea !important;
}

html.theme-dark .chip:hover,
html.theme-dark .chip.active,
html.theme-dark .page-link:hover,
html.theme-dark .page-item.active .page-link {
  border-color: rgba(127, 184, 255, 0.42) !important;
  color: #7fb8ff !important;
  background: rgba(127, 184, 255, 0.12) !important;
}

html.theme-dark .search-input,
html.theme-dark .form-control {
  background: rgba(29, 39, 50, 0.88);
  border-color: rgba(151, 165, 183, 0.26);
  color: #f3f6fb;
}

html.theme-dark .search-input::placeholder,
html.theme-dark .form-control::placeholder {
  color: #7f8b9a;
}

html.theme-dark .search-input:focus,
html.theme-dark .form-control:focus {
  background: rgba(31, 42, 54, 0.98);
  border-color: rgba(127, 184, 255, 0.55);
  box-shadow: 0 0 0 0.25rem rgba(127, 184, 255, 0.12);
  color: #fff;
}

html.theme-dark .articles-page .card {
  background: linear-gradient(180deg, rgba(43, 55, 69, 0.88), rgba(34, 46, 58, 0.92));
  border: 1px solid rgba(151, 165, 183, 0.20) !important;
  box-shadow: none !important;
  color: #f3f6fb;
}

html.theme-dark .articles-page .card-body,
html.theme-dark .articles-page .card h1,
html.theme-dark .articles-page .card h2,
html.theme-dark .articles-page .card h3,
html.theme-dark .articles-page .card h4,
html.theme-dark .articles-page .card h5,
html.theme-dark .articles-page .card h6 {
  color: #f3f6fb;
}

html.theme-dark .markdown-body {
  color: #d8e0ea !important;
}

html.theme-dark .markdown-body h1,
html.theme-dark .markdown-body h2,
html.theme-dark .markdown-body h3,
html.theme-dark .markdown-body h4,
html.theme-dark .markdown-body h5,
html.theme-dark .markdown-body h6 {
  color: #f3f6fb !important;
}

html.theme-dark .markdown-body code {
  background: rgba(127, 184, 255, 0.12) !important;
  color: #d6ecff;
}

html.theme-dark .markdown-body pre {
  background: #111827 !important;
  color: #f9fafb;
}

html.theme-dark .markdown-body blockquote {
  color: #c7d0dc !important;
  border-left-color: #7fb8ff !important;
}

html.theme-dark .markdown-body th,
html.theme-dark .markdown-body td {
  border-color: rgba(151, 165, 183, 0.22) !important;
}

html.theme-dark .markdown-body th {
  background: rgba(127, 184, 255, 0.10) !important;
}

/* XKeen Builder */
html.theme-dark {
  --mihomo-border: rgba(151, 165, 183, 0.22);
  --mihomo-border-soft: rgba(151, 165, 183, 0.16);
  --mihomo-bg-card: rgba(34, 46, 58, 0.96);
  --mihomo-bg-soft: rgba(34, 46, 58, 0.86);
  --mihomo-text: #f3f6fb;
  --mihomo-text-soft: #aeb8c6;
  --mihomo-blue: #7fb8ff;
  --mihomo-blue-soft: rgba(127, 184, 255, 0.14);
  --mihomo-shadow: none;
}

html.theme-dark body.mihomo-builder-page {
  background:
    radial-gradient(circle at top, rgba(127, 184, 255, 0.08), transparent 34%),
    linear-gradient(180deg, #1d2732 0%, #202b37 100%) !important;
}

html.theme-dark .mihomo-page {
  color: #f3f6fb;
}

html.theme-dark .mihomo-page .card.shadow,
html.theme-dark .mihomo-subscription-card,
html.theme-dark .mihomo-copy-card,
html.theme-dark .mihomo-routing-card,
html.theme-dark .mihomo-proxy-groups,
html.theme-dark .mihomo-custom-mrs-card,
html.theme-dark .mihomo-skip-card,
html.theme-dark .mihomo-vpn-card,
html.theme-dark .mihomo-block-card,
html.theme-dark .mihomo-direct-card {
  background: var(--mihomo-bg-card) !important;
  border-color: var(--mihomo-border) !important;
  box-shadow: none !important;
  color: #f3f6fb !important;
}

html.theme-dark .mihomo-page .card-header,
html.theme-dark .mihomo-page .card-body {
  background: transparent !important;
  border-color: var(--mihomo-border-soft) !important;
  color: #f3f6fb;
}

html.theme-dark .mihomo-page input,
html.theme-dark .mihomo-page textarea,
html.theme-dark .mihomo-page select {
  background: rgba(29, 39, 50, 0.88) !important;
  border-color: rgba(151, 165, 183, 0.26) !important;
  color: #f3f6fb !important;
  box-shadow: none !important;
}

html.theme-dark .mihomo-page input::placeholder,
html.theme-dark .mihomo-page textarea::placeholder {
  color: #7f8b9a !important;
}

html.theme-dark .mihomo-page input:focus,
html.theme-dark .mihomo-page textarea:focus,
html.theme-dark .mihomo-page select:focus {
  border-color: rgba(127, 184, 255, 0.55) !important;
  box-shadow: 0 0 0 0.25rem rgba(127, 184, 255, 0.12) !important;
}

html.theme-dark .mihomo-page h1,
html.theme-dark .mihomo-page h2,
html.theme-dark .mihomo-page h3,
html.theme-dark .mihomo-page h4,
html.theme-dark .mihomo-page h5,
html.theme-dark .mihomo-page h6,
html.theme-dark .mihomo-page label,
html.theme-dark .mihomo-page .mihomo-field__label,
html.theme-dark .mihomo-page .mihomo-skip-field__label,
html.theme-dark .mihomo-page .mihomo-vpn-field__label {
  color: #f3f6fb !important;
}

html.theme-dark .mihomo-page p,
html.theme-dark .mihomo-page small,
html.theme-dark .mihomo-page .mihomo-field__hint,
html.theme-dark .mihomo-page .mihomo-skip-field__hint,
html.theme-dark .mihomo-page .mihomo-vpn-field__hint,
html.theme-dark .mihomo-page .mihomo-subscription-help,
html.theme-dark .mihomo-page .connections-head-subtitle,
html.theme-dark .mihomo-page .meta-pill {
  color: #aeb8c6 !important;
}

html.theme-dark .mihomo-page .meta-pill,
html.theme-dark .mihomo-page .mihomo-subscription-pill,
html.theme-dark .mihomo-page code {
  background: rgba(29, 39, 50, 0.72) !important;
  border-color: rgba(151, 165, 183, 0.22) !important;
  color: #d8e0ea !important;
}

html.theme-dark .mihomo-page .mihomo-disabled-card {
  opacity: 1;
  filter: none;
}

html.theme-dark .mihomo-page .subscription-box,
html.theme-dark .mihomo-page .mihomo-subscription-box {
  background: var(--mihomo-bg-soft) !important;
  border-color: var(--mihomo-border) !important;
  box-shadow: none !important;
  color: #f3f6fb !important;
}

html.theme-dark .mihomo-page .mihomo-subscription-input-wrap input[type="url"],
html.theme-dark .mihomo-page .mihomo-subscription-input-wrap input[type="text"] {
  background: rgba(29, 39, 50, 0.94) !important;
  border-color: rgba(151, 165, 183, 0.30) !important;
  color: #f3f6fb !important;
}

html.theme-dark .mihomo-page .mihomo-subscription-input-icon {
  color: #7fb8ff !important;
}

html.theme-dark .mihomo-page .mihomo-subscription-btn {
  background: rgba(127, 184, 255, 0.12) !important;
  border-color: rgba(127, 184, 255, 0.26) !important;
  color: #d6ecff !important;
  box-shadow: none !important;
}

html.theme-dark .mihomo-page .mihomo-subscription-btn:hover,
html.theme-dark .mihomo-page .mihomo-subscription-btn:focus {
  background: rgba(127, 184, 255, 0.18) !important;
  border-color: rgba(127, 184, 255, 0.42) !important;
  color: #ffffff !important;
}

html.theme-dark .mihomo-page .mihomo-subscription-reset-btn {
  background: rgba(248, 113, 113, 0.12) !important;
  border-color: rgba(248, 113, 113, 0.30) !important;
  color: #fecaca !important;
}

html.theme-dark .mihomo-page .mihomo-subscription-reset-btn:hover,
html.theme-dark .mihomo-page .mihomo-subscription-reset-btn:focus {
  background: rgba(248, 113, 113, 0.18) !important;
  border-color: rgba(248, 113, 113, 0.44) !important;
  color: #ffffff !important;
}

html.theme-dark .mihomo-page .info-banner {
  --banner-accent: #7fb8ff;
  --banner-bg: rgba(127, 184, 255, 0.12);
  --banner-text: #d6ecff;
  background: linear-gradient(180deg, rgba(127, 184, 255, 0.12), rgba(127, 184, 255, 0.07)) !important;
  border-color: rgba(127, 184, 255, 0.24) !important;
  color: #d6ecff !important;
}

html.theme-dark .mihomo-page .info-banner i.fa-solid,
html.theme-dark .mihomo-page .info-banner .material-icons {
  color: #7fb8ff !important;
}

html.theme-dark .mihomo-page .info-banner--success {
  --banner-accent: #6ee7a8;
  --banner-bg: rgba(34, 197, 94, 0.13);
  --banner-text: #d1fae5;
  background: linear-gradient(180deg, rgba(34, 197, 94, 0.13), rgba(34, 197, 94, 0.08)) !important;
  border-color: rgba(34, 197, 94, 0.28) !important;
  color: #d1fae5 !important;
}

html.theme-dark .mihomo-page .info-banner--danger {
  --banner-accent: #fca5a5;
  --banner-bg: rgba(248, 113, 113, 0.13);
  --banner-text: #fee2e2;
  background: linear-gradient(180deg, rgba(248, 113, 113, 0.13), rgba(248, 113, 113, 0.08)) !important;
  border-color: rgba(248, 113, 113, 0.30) !important;
  color: #fee2e2 !important;
}

html.theme-dark .mihomo-page .mihomo-preview-shell,
html.theme-dark .mihomo-page .mihomo-preview-code,
html.theme-dark .mihomo-page .mihomo-code-box,
html.theme-dark .mihomo-page pre {
  background: #111827 !important;
  border-color: rgba(151, 165, 183, 0.18) !important;
  color: #f9fafb !important;
}

html.theme-dark .mihomo-page .mihomo-code-line-no {
  color: #64748b !important;
}

html.theme-dark .mihomo-page .mihomo-code-line-no::after {
  background: rgba(148, 163, 184, 0.22) !important;
}

html.theme-dark .mihomo-page .mihomo-code-line--section .mihomo-code-line-text {
  color: #f3f6fb !important;
}

html.theme-dark .mihomo-page .mihomo-code-group-inner {
  background-color: rgba(127, 184, 255, 0.04);
}

html.theme-dark .mihomo-page .card.shadow > .card-header {
  border-bottom-color: transparent !important;
}

html.theme-dark .mihomo-page .mihomo-hero > .card-header {
  border-bottom-color: transparent !important;
}

html.theme-dark .mihomo-page .mihomo-preview-card > .card-header {
  border-bottom-color: transparent !important;
}

html.theme-dark .mihomo-page .mihomo-preview-card .mihomo-code-box {
  border-color: rgba(151, 165, 183, 0.12) !important;
  box-shadow: none !important;
}

html.theme-dark .mihomo-page .connections-head-icon,
html.theme-dark .mihomo-page .mihomo-proxy-groups-head__icon,
html.theme-dark .mihomo-page .custom-mrs-head-icon,
html.theme-dark .mihomo-page .mihomo-preset-card-icon {
  background: rgba(127, 184, 255, 0.14) !important;
  border: 1px solid rgba(127, 184, 255, 0.26) !important;
  color: #7fb8ff !important;
  box-shadow: none !important;
}

html.theme-dark .mihomo-page .mihomo-proxy-groups-head__text h6,
html.theme-dark .mihomo-page .mihomo-proxy-groups-item__title,
html.theme-dark .mihomo-page .mihomo-proxy-groups-label,
html.theme-dark .mihomo-page .mihomo-category-card-title,
html.theme-dark .mihomo-page .mihomo-category-section-title,
html.theme-dark .mihomo-page .mihomo-skip-card__title,
html.theme-dark .mihomo-page .mihomo-skip-check-text,
html.theme-dark .mihomo-page .mihomo-skip-manual-block__title,
html.theme-dark .mihomo-page .mihomo-manual-entries-block__title,
html.theme-dark .mihomo-page .mihomo-vpn-manual-block__title,
html.theme-dark .mihomo-page .mihomo-direct-manual-block__title,
html.theme-dark .mihomo-page .mihomo-copy-config-box__title,
html.theme-dark .mihomo-page .custom-mrs-item-title {
  color: #f3f6fb !important;
}

html.theme-dark .mihomo-page .mihomo-proxy-groups-head__subtitle,
html.theme-dark .mihomo-page .mihomo-proxy-groups-item__meta,
html.theme-dark .mihomo-page .mihomo-proxy-groups-hint,
html.theme-dark .mihomo-page .mihomo-category-card-subtitle,
html.theme-dark .mihomo-page .mihomo-category-section-subtitle,
html.theme-dark .mihomo-page .mihomo-skip-card__subtitle,
html.theme-dark .mihomo-page .mihomo-skip-check-hint,
html.theme-dark .mihomo-page .mihomo-skip-field__hint,
html.theme-dark .mihomo-page .mihomo-manual-entries-block__hint,
html.theme-dark .mihomo-page .mihomo-vpn-field__hint,
html.theme-dark .mihomo-page .mihomo-direct-field__hint,
html.theme-dark .mihomo-page .mihomo-copy-config-box__subtitle,
html.theme-dark .mihomo-page .custom-mrs-item-url code {
  color: #aeb8c6 !important;
}

html.theme-dark .mihomo-page .mihomo-section,
html.theme-dark .mihomo-page .mihomo-category-card,
html.theme-dark .mihomo-page .mihomo-category-section,
html.theme-dark .mihomo-page .mihomo-proxy-groups-item,
html.theme-dark .mihomo-page .mihomo-skip-card,
html.theme-dark .mihomo-page .mihomo-skip-manual-block,
html.theme-dark .mihomo-page .mihomo-manual-entries-block,
html.theme-dark .mihomo-page .mihomo-vpn-manual-block,
html.theme-dark .mihomo-page .mihomo-direct-manual-block,
html.theme-dark .mihomo-page .mihomo-copy-config-box,
html.theme-dark .mihomo-page .custom-mrs-item,
html.theme-dark .mihomo-page .custom-mrs-item-url {
  background: var(--mihomo-bg-soft) !important;
  border-color: var(--mihomo-border) !important;
  box-shadow: none !important;
  color: #f3f6fb !important;
}

html.theme-dark .mihomo-page .mihomo-category-card-head,
html.theme-dark .mihomo-page .mihomo-skip-manual-block__content,
html.theme-dark .mihomo-page .mihomo-manual-entries-block__content,
html.theme-dark .mihomo-page .mihomo-vpn-manual-block__content,
html.theme-dark .mihomo-page .mihomo-direct-manual-block__content {
  border-color: var(--mihomo-border-soft) !important;
}

html.theme-dark .mihomo-page .mihomo-check,
html.theme-dark .mihomo-page .mihomo-skip-card__check,
html.theme-dark .mihomo-page .mihomo-vpn-card__check,
html.theme-dark .mihomo-page .mihomo-direct-card__check,
html.theme-dark .mihomo-page .mihomo-proxy-groups-proxy-list,
html.theme-dark .mihomo-page .mihomo-proxy-groups-proxy-chip,
html.theme-dark .mihomo-page .mihomo-preset-card {
  background: rgba(29, 39, 50, 0.78) !important;
  border-color: rgba(151, 165, 183, 0.22) !important;
  color: #f3f6fb !important;
  box-shadow: none !important;
}

html.theme-dark .mihomo-page .mihomo-check:hover,
html.theme-dark .mihomo-page .mihomo-preset-card:hover,
html.theme-dark .mihomo-page .mihomo-proxy-groups-accordion-btn:hover {
  background: rgba(127, 184, 255, 0.10) !important;
  border-color: rgba(127, 184, 255, 0.28) !important;
  box-shadow: none !important;
}

html.theme-dark .mihomo-page .mihomo-preset-card.is-active,
html.theme-dark .mihomo-page .mihomo-vpn-card__check--catch-all:has(input[type="checkbox"]:checked),
html.theme-dark .mihomo-page .mihomo-direct-card__check--catch-all:has(input:checked) {
  background: rgba(127, 184, 255, 0.14) !important;
  border-color: rgba(127, 184, 255, 0.34) !important;
  box-shadow: none !important;
}

html.theme-dark .mihomo-page .mihomo-proxy-groups-input,
html.theme-dark .mihomo-page .mihomo-skip-field textarea,
html.theme-dark .mihomo-page .mihomo-skip-field input[type="text"] {
  background: rgba(29, 39, 50, 0.94) !important;
  border-color: rgba(151, 165, 183, 0.30) !important;
  color: #f3f6fb !important;
  box-shadow: none !important;
}

html.theme-dark .mihomo-page .mihomo-proxy-groups-input:focus,
html.theme-dark .mihomo-page .mihomo-skip-field textarea:focus,
html.theme-dark .mihomo-page .mihomo-skip-field input[type="text"]:focus {
  border-color: rgba(127, 184, 255, 0.55) !important;
  box-shadow: 0 0 0 0.25rem rgba(127, 184, 255, 0.12) !important;
}

html.theme-dark .mihomo-page .mihomo-proxy-groups-count,
html.theme-dark .mihomo-page .mihomo-proxy-groups-item__meta code,
html.theme-dark .mihomo-page .mihomo-proxy-groups-hint code,
html.theme-dark .mihomo-page .mihomo-skip-card__badge,
html.theme-dark .mihomo-page .mihomo-skip-manual-block__subtitle,
html.theme-dark .mihomo-page .mihomo-manual-entries-block__subtitle,
html.theme-dark .mihomo-page .mihomo-vpn-manual-block__subtitle,
html.theme-dark .mihomo-page .mihomo-direct-manual-block__subtitle,
html.theme-dark .mihomo-page .mihomo-skip-field__hint code,
html.theme-dark .mihomo-page .mihomo-manual-entries-block__hint code,
html.theme-dark .mihomo-page .mihomo-vpn-field__hint code,
html.theme-dark .mihomo-page .mihomo-direct-field__hint code,
html.theme-dark .mihomo-page .custom-mrs-type-badge,
html.theme-dark .mihomo-page .custom-mrs-meta-chip {
  background: rgba(29, 39, 50, 0.76) !important;
  border-color: rgba(151, 165, 183, 0.22) !important;
  color: #d8e0ea !important;
}

html.theme-dark .mihomo-page .mihomo-category-card-badge--vpn {
  background: rgba(96, 165, 250, 0.24) !important;
  border: 1px solid rgba(147, 197, 253, 0.34) !important;
  color: #bfdbfe !important;
}

html.theme-dark .mihomo-page .mihomo-category-card-badge--block {
  background: rgba(248, 113, 113, 0.24) !important;
  border: 1px solid rgba(252, 165, 165, 0.34) !important;
  color: #fecaca !important;
}

html.theme-dark .mihomo-page .mihomo-category-card-badge--direct {
  background: rgba(34, 197, 94, 0.24) !important;
  border: 1px solid rgba(134, 239, 172, 0.34) !important;
  color: #bbf7d0 !important;
}

html.theme-dark .mihomo-page .mihomo-proxy-groups-accordion-icon {
  background: rgba(127, 184, 255, 0.12) !important;
  color: #7fb8ff !important;
  box-shadow: none !important;
}

html.theme-dark .mihomo-page .mihomo-skip-manual-block__summary:hover {
  background: rgba(167, 139, 250, 0.10) !important;
}

html.theme-dark .mihomo-page .mihomo-skip-manual-block__chevron {
  background: rgba(167, 139, 250, 0.14) !important;
  color: #c4b5fd !important;
  box-shadow: none !important;
}

html.theme-dark .mihomo-page .mihomo-skip-manual-block__summary:hover .mihomo-skip-manual-block__chevron,
html.theme-dark .mihomo-page .mihomo-skip-manual-block[open] .mihomo-skip-manual-block__chevron {
  background: rgba(167, 139, 250, 0.22) !important;
  color: #ddd6fe !important;
}

html.theme-dark .mihomo-page .mihomo-manual-entries-block__summary:hover {
  background: rgba(248, 113, 113, 0.10) !important;
}

html.theme-dark .mihomo-page .mihomo-manual-entries-block__chevron {
  background: rgba(248, 113, 113, 0.14) !important;
  color: #fca5a5 !important;
  box-shadow: none !important;
}

html.theme-dark .mihomo-page .mihomo-manual-entries-block__summary:hover .mihomo-manual-entries-block__chevron,
html.theme-dark .mihomo-page .mihomo-manual-entries-block[open] .mihomo-manual-entries-block__chevron {
  background: rgba(248, 113, 113, 0.22) !important;
  color: #fecaca !important;
}

html.theme-dark .mihomo-page .mihomo-vpn-manual-block__summary:hover {
  background: rgba(127, 184, 255, 0.10) !important;
}

html.theme-dark .mihomo-page .mihomo-vpn-manual-block__chevron {
  background: rgba(127, 184, 255, 0.14) !important;
  color: #7fb8ff !important;
  box-shadow: none !important;
}

html.theme-dark .mihomo-page .mihomo-vpn-manual-block__summary:hover .mihomo-vpn-manual-block__chevron,
html.theme-dark .mihomo-page .mihomo-vpn-manual-block[open] .mihomo-vpn-manual-block__chevron {
  background: rgba(127, 184, 255, 0.22) !important;
  color: #d6ecff !important;
}

html.theme-dark .mihomo-page .mihomo-direct-manual-block__summary:hover {
  background: rgba(34, 197, 94, 0.10) !important;
}

html.theme-dark .mihomo-page .mihomo-direct-manual-block__chevron {
  background: rgba(34, 197, 94, 0.14) !important;
  color: #86efac !important;
  box-shadow: none !important;
}

html.theme-dark .mihomo-page .mihomo-direct-manual-block__summary:hover .mihomo-direct-manual-block__chevron,
html.theme-dark .mihomo-page .mihomo-direct-manual-block[open] .mihomo-direct-manual-block__chevron {
  background: rgba(34, 197, 94, 0.22) !important;
  color: #bbf7d0 !important;
}

html.theme-dark .mihomo-page .mihomo-proxy-groups-save-btn,
html.theme-dark .mihomo-page .mihomo-copy-config-btn,
html.theme-dark .mihomo-page .custom-mrs-add-btn,
html.theme-dark .mihomo-page .btn.btn-outline-secondary.btn-lg.mihomo-action-btn {
  background: rgba(127, 184, 255, 0.12) !important;
  border-color: rgba(127, 184, 255, 0.26) !important;
  color: #d6ecff !important;
  box-shadow: none !important;
}

html.theme-dark .mihomo-page .mihomo-proxy-groups-save-btn:hover,
html.theme-dark .mihomo-page .mihomo-copy-config-btn:hover,
html.theme-dark .mihomo-page .custom-mrs-add-btn:hover,
html.theme-dark .mihomo-page .custom-mrs-add-btn:focus,
html.theme-dark .mihomo-page .btn.btn-outline-secondary.btn-lg.mihomo-action-btn:hover,
html.theme-dark .mihomo-page .btn.btn-outline-secondary.btn-lg.mihomo-action-btn:focus {
  background: rgba(127, 184, 255, 0.18) !important;
  border-color: rgba(127, 184, 255, 0.42) !important;
  color: #ffffff !important;
}

html.theme-dark .mihomo-page .mihomo-proxy-groups-delete-group-btn,
html.theme-dark .mihomo-page .mihomo-proxy-groups-delete-proxy-btn,
html.theme-dark .mihomo-page .custom-mrs-delete-btn {
  background: rgba(248, 113, 113, 0.12) !important;
  border-color: rgba(248, 113, 113, 0.30) !important;
  color: #fecaca !important;
  box-shadow: none !important;
}

html.theme-dark .mihomo-page .mihomo-proxy-groups-delete-group-btn:hover,
html.theme-dark .mihomo-page .mihomo-proxy-groups-delete-proxy-btn:hover,
html.theme-dark .mihomo-page .custom-mrs-delete-btn:hover,
html.theme-dark .mihomo-page .custom-mrs-delete-btn:focus {
  background: rgba(248, 113, 113, 0.18) !important;
  border-color: rgba(248, 113, 113, 0.44) !important;
  color: #ffffff !important;
}

@media (max-width: 575.98px) {
  .public-theme-toggle--floating {
    top: 12px;
    right: 12px;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
  }
}
