:root {
  
  --bg-canvas: #f8fafc;
  --bg-surface: #ffffff;
  --bg-sidebar: #f1f5f9;
  --bg-card: #ffffff;
  --bg-infobox: #f8fafc;
  --bg-infobox-header: #e2e8f0;
  --border-color: #cbd5e1;
  --border-subtle: #e2e8f0;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --accent-blue: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-light: #eff6ff;
  --wiki-link: #1d4ed8;
  --tag-bg: #e2e8f0;
  --success-green: #15803d;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
  --font-serif: 'Linux Libertine', Georgia, 'Times New Roman', serif;
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

[data-theme="dark"] {
  
  --bg-canvas: #0b0f14;
  --bg-surface: #111822;
  --bg-sidebar: #0e141c;
  --bg-card: #151e2a;
  --bg-infobox: #151f2b;
  --bg-infobox-header: #1e2c3d;
  --border-color: #273546;
  --border-subtle: #1e293b;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent-blue: #3b82f6;
  --accent-hover: #60a5fa;
  --accent-light: #1e293b;
  --wiki-link: #60a5fa;
  --tag-bg: #1e293b;
  --success-green: #22c55e;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 10px 20px -3px rgba(0, 0, 0, 0.6);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  line-height: 1.65;
  transition: background-color 0.2s ease, color 0.2s ease;
  min-height: 100vh;
}

a {
  color: var(--wiki-link);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  text-decoration: underline;
}

#app-wrapper {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

#sidebar {
  width: 250px;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 50;
  transition: all 0.2s ease;
}

#app-wrapper.sidebar-collapsed #sidebar {
  display: none;
}

.desktop-sidebar-btn {
  display: inline-flex;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border-color);
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none !important;
  color: var(--text-primary);
}

.brand-logo {
  border-radius: 50%;
  background: #ffffff;
  padding: 2px;
  box-shadow: var(--shadow-sm);
}

.brand-text-block {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  line-height: 1.2;
}

.brand-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.mobile-close-btn {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
}

.sidebar-section {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.sidebar-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.nav-list {
  list-style: none;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-decoration: none !important;
  margin-bottom: 3px;
  transition: all 0.15s ease;
}

.nav-item:hover {
  background-color: var(--accent-light);
  color: var(--accent-blue);
}

.nav-item.active {
  background-color: var(--accent-light);
  color: var(--accent-blue);
  font-weight: 600;
}

.nav-item.developer-nav-item {
  background-color: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.2);
  color: var(--accent-blue);
}

.badge-tag {
  margin-left: auto;
  font-size: 0.68rem;
  background: var(--accent-blue);
  color: #ffffff;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
}

.source-federation-list {
  list-style: none;
}

.source-federation-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 4px;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.status-dot.online {
  background-color: var(--success-green);
  box-shadow: 0 0 6px var(--success-green);
}

.source-name {
  font-weight: 500;
}

.source-tag {
  margin-left: auto;
  font-size: 0.7rem;
  color: var(--text-muted);
  background: var(--tag-bg);
  padding: 2px 6px;
  border-radius: 4px;
}

.sidebar-footer {
  margin-top: auto;
  padding: 16px;
}

.bot-info-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px;
  box-shadow: var(--shadow-sm);
}

.bot-status-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.bot-pulse {
  width: 8px;
  height: 8px;
  background-color: #3b82f6;
  border-radius: 50%;
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.bot-status-text {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-blue);
}

.bot-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.4;
}

#main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background-color: var(--bg-surface);
}

#topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 28px;
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 40;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-brand {
  display: none;
  align-items: center;
  gap: 8px;
  text-decoration: none !important;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  white-space: nowrap;
  user-select: none;
}

.topbar-brand:hover {
  text-decoration: none !important;
  opacity: 0.9;
}

.topbar-brand-logo {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #ffffff;
  padding: 1px;
  flex-shrink: 0;
  display: block;
}

.topbar-brand-title {
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1;
}

.mobile-search-toggle-btn {
  display: none;
}

.mobile-search-back-btn {
  display: none;
}

.breadcrumbs {
  font-size: 0.85rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.breadcrumbs strong {
  color: var(--text-primary);
}

.search-container {
  position: relative;
  flex: 1;
  max-width: 600px;
  display: flex;
  gap: 8px;
}

.search-input-wrapper {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
  pointer-events: none;
}

#searchInput {
  width: 100%;
  height: 38px;
  padding: 0 34px 0 38px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

#searchInput:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.search-clear-btn {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
}

.btn-primary {
  height: 38px;
  padding: 0 16px;
  background-color: var(--accent-blue);
  color: #ffffff;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s ease;
}

.btn-primary:hover {
  background-color: var(--accent-hover);
}

.suggestions-dropdown {
  position: absolute;
  top: 46px;
  left: 0;
  right: 0;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 12px 30px -4px rgba(0, 0, 0, 0.18), 0 8px 12px -6px rgba(0, 0, 0, 0.12);
  max-height: 420px;
  overflow-y: auto;
  z-index: 250;
}

.suggestion-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.suggestion-item:last-child {
  border-bottom: none;
}

.suggestion-item:hover,
.suggestion-item.highlighted {
  background-color: var(--accent-light);
}

.suggestion-thumb-wrapper {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-subtle);
}

.suggestion-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.suggestion-thumb.fallback-thumb {
  width: 24px;
  height: 24px;
  object-fit: contain;
  opacity: 0.75;
}

.suggestion-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.suggestion-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.suggestion-title {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.suggestion-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  background-color: var(--accent-subtle);
  color: var(--accent-blue);
  white-space: nowrap;
  flex-shrink: 0;
}

.suggestion-snippet {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.suggestion-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 1px;
}

.suggestion-status-indicator {
  color: #10b981;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.suggestion-sources {
  color: var(--text-muted);
  opacity: 0.85;
}

.ai-bot-daily-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 12px 18px;
  margin: 16px 0 24px 0;
  box-shadow: var(--shadow-sm);
  gap: 16px;
  flex-wrap: wrap;
}

.bot-card-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.bot-status-pulse {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
}

.pulse-dot {
  width: 9px;
  height: 9px;
  background-color: #10b981;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulseGreen 2s infinite;
}

@keyframes pulseGreen {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

.bot-sync-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.bot-info-divider {
  opacity: 0.5;
}

.bot-card-right {
  display: flex;
  align-items: center;
}

.bot-sync-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-subtle);
  color: var(--accent-blue);
  border: 1px solid var(--accent-blue);
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.bot-sync-btn:hover {
  background: var(--accent-blue);
  color: #ffffff;
}

.bot-sync-btn.syncing .sync-icon {
  animation: spinSync 1s linear infinite;
}

@keyframes spinSync {
  100% {
    transform: rotate(360deg);
  }
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.icon-button {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background-color: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.icon-button:hover {
  background-color: var(--accent-light);
  color: var(--accent-blue);
  border-color: var(--accent-blue);
}

#mobileMenuBtn {
  display: none;
}

#article-subbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
}

.article-tabs {
  display: flex;
  gap: 2px;
}

.tab-btn {
  padding: 10px 16px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tab-btn:hover {
  color: var(--accent-blue);
}

.tab-btn.active {
  color: var(--accent-blue);
  border-bottom-color: var(--accent-blue);
  font-weight: 600;
}

.article-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tool-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: none;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.tool-btn:hover {
  background-color: var(--accent-light);
  color: var(--accent-blue);
}

#content-container {
  flex: 1;
  padding: 28px;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  text-align: center;
}

.spinner {
  width: 44px;
  height: 44px;
  border: 3px solid var(--border-color);
  border-top-color: var(--accent-blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 20px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text h3 {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.loading-text p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.error-state {
  text-align: center;
  padding: 60px 20px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  max-width: 600px;
  margin: 40px auto;
}

.error-icon {
  font-size: 3rem;
  margin-bottom: 12px;
}

.error-state h2 {
  font-family: var(--font-serif);
  margin-bottom: 8px;
}

.error-state p {
  color: var(--text-muted);
  margin-bottom: 20px;
}

.article-header {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 16px;
  margin-bottom: 24px;
}

.article-title-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 10px;
}

.wiki-h1 {
  font-family: var(--font-serif);
  font-size: 2.3rem;
  font-weight: 500;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.blue-verified-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.blue-verified-badge:hover {
  transform: scale(1.1);
  filter: brightness(1.08);
}

.blue-verified-icon {
  width: 26px;
  height: 26px;
  display: block;
  filter: drop-shadow(0 1px 2px rgba(29, 155, 240, 0.3));
}

.article-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.article-meta-bar,
.verified-seal {
  display: none !important;
}

.article-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 32px;
  align-items: start;
}

.article-main-column {
  min-width: 0;
}

.lead-section {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--text-primary);
  margin-bottom: 24px;
}

.lead-section p {
  margin-bottom: 14px;
}

.toc-card {
  display: table;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 12px 18px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-sm);
  min-width: 260px;
}

.toc-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.toc-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.toc-toggle-btn {
  background: none;
  border: none;
  color: var(--wiki-link);
  font-size: 0.8rem;
  cursor: pointer;
}

.toc-list {
  list-style-position: inside;
  padding-left: 4px;
}

.toc-list li {
  margin-bottom: 6px;
  font-size: 0.9rem;
}

.toc-list a {
  color: var(--wiki-link);
}

.wiki-section {
  margin-bottom: 36px;
  scroll-margin-top: 80px;
}

.section-heading {
  font-family: var(--font-serif);
  font-size: 1.55rem;
  font-weight: 500;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 6px;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.wiki-section p {
  margin-bottom: 14px;
  font-size: 1rem;
  line-height: 1.7;
}

.wiki-section ul, 
.wiki-section ol {
  padding-left: 24px;
  margin-bottom: 16px;
}

.wiki-section li {
  margin-bottom: 8px;
  line-height: 1.6;
}

.wiki-section blockquote {
  border-left: 4px solid var(--accent-blue);
  background-color: var(--bg-card);
  padding: 14px 18px;
  margin: 18px 0;
  font-style: italic;
  color: var(--text-secondary);
  border-radius: 0 6px 6px 0;
}

.citation-sup {
  font-size: 0.75rem;
  font-weight: 600;
  margin-left: 2px;
  white-space: nowrap;
}

.citation-sup a {
  color: var(--wiki-link);
}

.article-infobox-column {
  position: sticky;
  top: 75px;
}

.infobox-card {
  background-color: var(--bg-infobox);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  font-size: 0.88rem;
}

.infobox-title {
  background-color: var(--bg-infobox-header);
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1.05rem;
  text-align: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-color);
}

.infobox-media {
  padding: 14px 12px;
  text-align: center;
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.infobox-media img {
  max-width: 100%;
  max-height: 290px;
  object-fit: contain;
  margin: 0 auto;
  display: block;
  border-radius: 4px;
  cursor: zoom-in;
  transition: transform 0.2s ease;
}

.infobox-media img:hover {
  transform: scale(1.02);
}

.infobox-caption {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 8px;
  line-height: 1.4;
  text-align: center;
  width: 100%;
}

.infobox-photo-source {
  display: none !important;
}

.infobox-table {
  width: 100%;
  border-collapse: collapse;
}

.infobox-table th {
  text-align: left;
  vertical-align: top;
  width: 38%;
  padding: 8px 12px;
  font-weight: 600;
  color: var(--text-secondary);
  border-top: 1px solid var(--border-subtle);
  background-color: rgba(0, 0, 0, 0.02);
  font-size: 0.82rem;
}

.infobox-table td {
  padding: 8px 12px;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 0.85rem;
  line-height: 1.45;
  word-break: break-word;
}

.infobox-footer {
  text-align: center;
  padding: 8px;
  font-size: 0.72rem;
  color: var(--text-muted);
  background-color: var(--bg-infobox-header);
  border-top: 1px solid var(--border-color);
}

.gallery-subtext {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.gallery-item {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.gallery-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.gallery-thumb-container {
  height: 160px;
  background-color: var(--bg-canvas);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.gallery-thumb-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-caption {
  padding: 10px;
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.35;
}

.ref-subtext {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.references-list {
  padding-left: 20px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.references-list li {
  margin-bottom: 10px;
  line-height: 1.5;
  padding-left: 6px;
}

.ref-pill {
  font-size: 0.7rem;
  background-color: var(--tag-bg);
  color: var(--text-secondary);
  padding: 2px 6px;
  border-radius: 3px;
  font-weight: 600;
  margin-right: 6px;
}

.ref-verified-check {
  color: var(--success-green);
  margin-left: 4px;
}

.external-links-list {
  list-style: square;
  padding-left: 22px;
  font-size: 0.9rem;
}

.external-links-list li {
  margin-bottom: 6px;
}

.categories-container {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  margin-top: 30px;
  flex-wrap: wrap;
}

.categories-label {
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.categories-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.category-chip {
  font-size: 0.78rem;
  background-color: var(--tag-bg);
  color: var(--wiki-link);
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.category-chip:hover {
  background-color: var(--accent-light);
}

.lightbox-modal {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
}

.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
}

.lightbox-caption {
  margin-top: 12px;
  color: #f1f5f9;
  font-size: 0.9rem;
  text-align: center;
  max-width: 600px;
}

.lightbox-close {
  position: absolute;
  top: -40px;
  right: -10px;
  background: none;
  border: none;
  color: #ffffff;
  font-size: 2rem;
  cursor: pointer;
}

.toast-notification {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background-color: var(--text-primary);
  color: var(--bg-surface);
  padding: 10px 18px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: all 0.25s ease;
  z-index: 150;
}

.toast-notification.show {
  opacity: 1;
  transform: translateY(0);
}

#site-footer {
  background-color: var(--bg-sidebar);
  border-top: 1px solid var(--border-color);
  padding: 40px 28px 24px;
  margin-top: auto;
}

.footer-content {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 28px;
}

.footer-content.footer-single-brand {
  display: block;
  max-width: 860px;
  margin: 0 auto 20px auto;
  text-align: center;
}

.footer-single-brand .footer-logo-row {
  justify-content: center;
}

.footer-single-brand .footer-desc {
  max-width: 680px;
  margin: 0 auto 10px auto;
}

.footer-col h4 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.footer-col ul {
  list-style: none;
}

.footer-col li {
  margin-bottom: 8px;
  font-size: 0.85rem;
}

.footer-logo-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-serif);
  font-size: 1.2rem;
  margin-bottom: 8px;
}

.footer-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 12px;
}

.footer-creator {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.footer-creator a {
  color: var(--accent-blue);
}

.footer-bottom {
  max-width: 1400px;
  margin: 0 auto;
  border-top: 1px solid var(--border-subtle);
  padding-top: 16px;
  font-size: 0.76rem;
  color: var(--text-muted);
  text-align: center;
}

@media (max-width: 1024px) {
  .article-grid {
    grid-template-columns: 1fr;
  }
  .article-infobox-column {
    position: static;
    order: -1;
    margin-bottom: 24px;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
  }
  .footer-content {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  #sidebar {
    position: fixed;
    transform: translateX(-100%);
  }
  #sidebar.mobile-open {
    transform: translateX(0);
  }
  #mobileMenuBtn {
    display: flex;
  }
  .desktop-sidebar-btn {
    display: none !important;
  }
  .mobile-close-btn {
    display: block;
  }

  #topbar {
    padding: 8px 12px;
    gap: 8px;
    min-height: 54px;
    position: sticky;
    top: 0;
    z-index: 50;
  }

  .breadcrumbs {
    display: none;
  }

  .topbar-brand {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .topbar-brand-title {
    font-size: 1.05rem;
  }

  .topbar-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
  }

  .topbar-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
  }

  .mobile-search-toggle-btn {
    display: flex;
    color: var(--text-primary);
  }

  .mobile-search-back-btn {
    display: none;
  }

  #topbar:not(.mobile-search-active) .search-container {
    display: none !important;
  }

  #topbar.mobile-search-active {
    padding: 6px 10px;
    background-color: var(--bg-surface);
  }

  #topbar.mobile-search-active .topbar-left,
  #topbar.mobile-search-active .topbar-actions {
    display: none !important;
  }

  #topbar.mobile-search-active .search-container {
    display: flex !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    align-items: center;
    gap: 6px;
    flex: 1;
    animation: fadeInSearch 0.16s ease-out;
  }

  #topbar.mobile-search-active .mobile-search-back-btn {
    display: flex !important;
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 6px;
  }

  #topbar.mobile-search-active .search-input-wrapper {
    flex: 1;
    min-width: 0;
  }

  #topbar.mobile-search-active #searchInput {
    height: 38px;
    font-size: 0.95rem;
    padding: 0 32px 0 34px;
    border-radius: 6px;
  }

  #topbar.mobile-search-active .btn-primary {
    height: 38px;
    padding: 0 12px;
    font-size: 0.84rem;
    flex-shrink: 0;
  }

  #topbar.mobile-search-active .suggestions-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    width: 100%;
    max-height: 70vh;
    border-radius: 8px;
  }

  #content-container {
    padding: 16px;
  }
  .wiki-h1 {
    font-size: 1.8rem;
  }
  .footer-content {
    grid-template-columns: 1fr;
  }
  .article-tabs {
    overflow-x: auto;
  }
}

@keyframes fadeInSearch {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.welcome-banner-section {
  background: #1a2538;
  border: 1px solid #263852;
  border-radius: 16px;
  padding: 48px 36px 40px;
  margin-bottom: 36px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  transition: all 0.3s ease;
}

[data-theme="dark"] .welcome-banner-section {
  background: #141c2c;
  border-color: #1f2e46;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5);
}

.welcome-container {
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}

.welcome-title {
  font-family: var(--font-serif);
  font-size: 2.5rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
  line-height: 1.25;
}

.welcome-desc {
  font-size: 1.02rem;
  line-height: 1.75;
  color: #94a3b8;
  max-width: 840px;
  margin: 0 auto 36px;
  font-weight: 400;
}

.creator-featured-card {
  background: #101726;
  border: 1px solid #22344f;
  border-radius: 14px;
  padding: 24px 34px;
  max-width: 740px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 32px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  text-align: left;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.creator-featured-card:hover,
.creator-featured-card:focus {
  border-color: #38bdf8;
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5);
  outline: none;
}

.creator-avatar-wrap {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.creator-avatar-img {
  width: 125px;
  height: 125px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #38bdf8;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45);
  display: block;
}

.creator-info-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.creator-card-name {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 4px;
  letter-spacing: -0.01em;
}

.creator-meta-item {
  font-size: 0.98rem;
  display: flex;
  gap: 8px;
  align-items: baseline;
  color: #e2e8f0;
}

.creator-meta-item .meta-label {
  font-weight: 600;
  color: #94a3b8;
}

.creator-meta-item .meta-val {
  color: #f1f5f9;
  font-weight: 500;
}

@media (max-width: 680px) {
  .welcome-banner-section {
    padding: 32px 18px 26px;
    margin-bottom: 24px;
  }
  .welcome-title {
    font-size: 1.85rem;
    margin-bottom: 16px;
  }
  .welcome-desc {
    font-size: 0.94rem;
    line-height: 1.65;
    margin-bottom: 24px;
  }
  .creator-featured-card {
    flex-direction: column;
    padding: 20px 16px;
    gap: 18px;
    text-align: center;
  }
  .creator-info-wrap {
    align-items: center;
    text-align: center;
  }
  .creator-avatar-img {
    width: 105px;
    height: 105px;
  }
  .creator-card-name {
    font-size: 1.45rem;
  }
}

.home-federated-bar {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.fed-bar-title {
  font-size: 0.88rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
}

.fed-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.fed-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  padding: 6px 12px;
  border-radius: 9999px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #f1f5f9;
  white-space: nowrap;
  backdrop-filter: blur(4px);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.fed-pill:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: #38bdf8;
}

.home-showcase-section {
  margin-top: 36px;
}

.showcase-heading {
  font-family: var(--font-serif);
  font-size: 1.45rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 18px;
  letter-spacing: -0.01em;
}

.showcase-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.showcase-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  text-align: left;
}

.showcase-card:hover,
.showcase-card:focus {
  transform: translateY(-2px);
  border-color: #38bdf8;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
  outline: none;
}

.showcase-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.showcase-badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  padding: 3px 8px;
  border-radius: 4px;
}

.showcase-icon {
  font-size: 1.25rem;
}

.showcase-card-title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
}

.showcase-card-desc {
  font-size: 0.85rem;
  color: #cbd5e1;
  line-height: 1.45;
  margin: 0;
  flex-grow: 1;
}

.showcase-card-link {
  font-size: 0.82rem;
  font-weight: 600;
  color: #38bdf8;
  margin-top: 6px;
  display: inline-block;
}

.infobox-caption-title {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 0.95rem;
  display: block;
}

.infobox-caption-tagline {
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 400;
  display: block;
  margin-top: 2px;
}

.wiki-body img,
.article-content img,
.lead-section img,
.wiki-figure img,
.thumbinner img,
.thumbimage {
  display: block !important;
  margin: 14px auto !important;
  text-align: center !important;
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  float: none !important;
}

.wiki-figure,
.thumb,
.thumbinner {
  margin: 14px auto !important;
  text-align: center !important;
  display: block !important;
  float: none !important;
}

.wiki-link,
.article-content a:not(.brand-link):not(.nav-item):not(.citation-sup a),
.lead-section a:not(.citation-sup a),
.section-body a:not(.citation-sup a),
.infobox-table a {
  color: #1a73e8 !important;
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s ease, text-decoration 0.15s ease;
}

.wiki-link:hover,
.article-content a:not(.brand-link):not(.nav-item):not(.citation-sup a):hover,
.lead-section a:not(.citation-sup a):hover,
.section-body a:not(.citation-sup a):hover,
.infobox-table a:hover {
  color: #0b57d0 !important;
  text-decoration: underline !important;
}

[data-theme="dark"] .wiki-link,
[data-theme="dark"] .article-content a:not(.brand-link):not(.nav-item):not(.citation-sup a),
[data-theme="dark"] .lead-section a:not(.citation-sup a),
[data-theme="dark"] .section-body a:not(.citation-sup a),
[data-theme="dark"] .infobox-table a {
  color: #8ab4f8 !important;
}

[data-theme="dark"] .wiki-link:hover,
[data-theme="dark"] .article-content a:not(.brand-link):not(.nav-item):not(.citation-sup a):hover,
[data-theme="dark"] .lead-section a:not(.citation-sup a):hover,
[data-theme="dark"] .section-body a:not(.citation-sup a):hover,
[data-theme="dark"] .infobox-table a:hover {
  color: #aecbfa !important;
  text-decoration: underline !important;
}

.infobox-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.infobox-header-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  flex-shrink: 0;
}

.infobox-verified-row {
  background-color: rgba(29, 155, 240, 0.08);
  border-bottom: 1px solid var(--border-color);
}

.infobox-verified-cell {
  padding: 8px 12px !important;
  text-align: center !important;
}

.infobox-verified-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: rgba(29, 155, 240, 0.12);
  border: 1px solid rgba(29, 155, 240, 0.35);
  padding: 4px 14px;
  border-radius: 9999px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #1d9bf0;
  letter-spacing: 0.01em;
}

.infobox-verified-pill svg {
  width: 16px;
  height: 16px;
  display: block;
  flex-shrink: 0;
}

[data-theme="dark"] .infobox-verified-row {
  background-color: rgba(29, 155, 240, 0.1);
}

[data-theme="dark"] .infobox-verified-pill {
  background: rgba(29, 155, 240, 0.2);
  border-color: rgba(29, 155, 240, 0.45);
  color: #70bbfb;
}

/* ==========================================================================
   404 NOT FOUND VIEW
   ========================================================================== */
.not-found-container {
  max-width: 860px;
  margin: 36px auto;
  padding: 0 16px;
}

.not-found-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.not-found-header {
  padding: 32px 32px 22px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-sidebar);
}

.not-found-badge {
  display: inline-block;
  padding: 4px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background-color: rgba(220, 38, 38, 0.12);
  color: #dc2626;
  border: 1px solid rgba(220, 38, 38, 0.25);
  border-radius: 9999px;
  margin-bottom: 12px;
}

[data-theme="dark"] .not-found-badge {
  background-color: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.35);
}

.not-found-h1 {
  font-family: var(--font-serif);
  font-size: 2.2rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 8px 0;
  line-height: 1.2;
}

.not-found-subtitle {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin: 0;
}

.not-found-body {
  padding: 28px 32px 32px;
}

.not-found-notice {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px;
  background-color: var(--bg-sidebar);
  border-left: 4px solid #eab308;
  border-radius: 6px;
  margin-bottom: 24px;
  color: var(--text-primary);
  font-size: 0.95rem;
  line-height: 1.6;
}

.not-found-notice svg {
  color: #ca8a04;
  flex-shrink: 0;
  margin-top: 2px;
}

.not-found-actions-box {
  margin-bottom: 28px;
}

.not-found-actions-box h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 14px 0;
}

.not-found-search-row {
  display: flex;
  gap: 10px;
  margin-bottom: 22px;
}

.not-found-input {
  flex: 1;
  padding: 10px 16px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background-color: var(--bg-main);
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: border-color 0.2s;
}

.not-found-input:focus {
  outline: none;
  border-color: var(--accent-color);
}

.not-found-explore {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.explore-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
}

.not-found-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.wiki-tag {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  background-color: var(--bg-sidebar);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  color: var(--accent-color);
  font-size: 0.88rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s;
}

.wiki-tag:hover {
  background-color: var(--accent-color);
  color: #ffffff;
  border-color: var(--accent-color);
}

.not-found-footer-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 24px;
  border-top: 1px solid var(--border-color);
}


