/* Design Tokens - Professional Light Theme */
:root {
  --bg-color: #fbfaf8; /* Soft warm ivory paper background */
  --card-bg: rgba(255, 255, 255, 0.85); /* Translucent bright white */
  --card-border: rgba(226, 225, 220, 0.8); /* Elegant warm light border */
  --text-main: #242429; /* Elegant deep charcoal for high readability */
  --text-muted: #62626e; /* Soft slate grey for subtexts */
  --accent-red: #8c1d1d; /* Crimson accent */
  --accent-gold: #b38f49; /* Antique gold accent */
  --glow-color: rgba(179, 143, 73, 0.04); /* Soft amber/gold ambient glow */
  --font-serif: 'Lora', Georgia, serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Base Reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  position: relative;
}

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: var(--font-sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Ambient Background Light */
.ambient-glow {
  position: absolute;
  width: 600px;
  height: 600px;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  background: radial-gradient(circle, var(--glow-color) 0%, rgba(251, 250, 248, 0) 70%);
  pointer-events: none;
  z-index: 0;
}

/* Container */
.wrapper {
  width: 100%;
  max-width: 800px;
  padding: 40px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 1;
}

/* Header & Logo styling */
header.main-header {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 24px;
}

.logo-container {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 16px;
}

.qnloo-logo {
  width: 76px;
  height: 76px;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(179, 143, 73, 0.15));
  animation: pulse 4s infinite ease-in-out;
  transform: translateY(-8px);
}

.brand-title {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 500;
  color: var(--text-main);
  letter-spacing: 0.5px;
}

/* Global Keyframes */
@keyframes pulse {
  0%, 100% {
    opacity: 0.95;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(0.98);
  }
}

/* Cognitive Index Badges (Section, Sub-item & Sub-sub Numbers) */
.section-num-badge {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-gold);
  background: rgba(179, 143, 73, 0.12);
  border: 1px solid rgba(179, 143, 73, 0.25);
  border-radius: 6px;
  padding: 1px 7px;
  margin-right: 8px;
  line-height: 1.4;
  vertical-align: middle;
  transform: translateY(-2px);
}

html[dir="rtl"] .section-num-badge {
  margin-right: 0;
  margin-left: 8px;
}

.sub-num-badge {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 10.5px;
  font-weight: 700;
  color: var(--accent-red);
  background: rgba(140, 29, 29, 0.08);
  border: 1px solid rgba(140, 29, 29, 0.2);
  border-radius: 6px;
  padding: 1px 6px;
  margin-right: 8px;
  line-height: 1.4;
  vertical-align: middle;
  transform: translateY(-2px);
}

html[dir="rtl"] .sub-num-badge {
  margin-right: 0;
  margin-left: 8px;
}

.sub-sub-num-badge {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 5px;
  padding: 0px 5px;
  margin-right: 6px;
  line-height: 1.4;
  vertical-align: middle;
  transform: translateY(-1.5px);
}

html[dir="rtl"] .sub-sub-num-badge {
  margin-right: 0;
  margin-left: 6px;
}

/* Horizontal Language Selector Bar (Static Header) */
.lang-selector {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-bottom: 32px;
  font-size: 13px;
  z-index: 10;
}

.lang-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 20px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
  backdrop-filter: blur(8px);
}

.lang-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 12px;
  transition: var(--transition);
}

.lang-links a:hover, .lang-links a.active {
  color: var(--accent-red);
  background: rgba(163, 31, 31, 0.06);
}

.lang-divider {
  color: rgba(226, 225, 220, 0.8);
  font-weight: 300;
}

/* Scroll-Triggered Floating Compact Top Navbar */
.sticky-nav-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
  z-index: 1000;
  background: rgba(251, 250, 248, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(226, 225, 220, 0.8);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  transform: translateY(-100%);
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
  pointer-events: none;
  display: flex;
  justify-content: center;
}

.sticky-nav-bar.visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.sticky-nav-inner {
  width: 100%;
  max-width: 1000px;
  padding: 6px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.nav-logo {
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.nav-title {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.nav-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 1;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.nav-controls::-webkit-scrollbar {
  display: none;
}

.nav-controls .lang-selector {
  margin-bottom: 0;
  width: auto;
}

.nav-controls .lang-links {
  padding: 4px 10px;
  gap: 4px;
  border-radius: 16px;
}

.nav-controls .lang-links a {
  padding: 2px 6px;
  font-size: 12px;
}

.nav-controls .lang-divider {
  display: none;
}

.nav-controls .track-selector-container {
  margin-bottom: 0;
  width: auto;
}

.nav-controls .track-selector {
  padding: 2px 4px;
  border-radius: 16px;
}

.nav-controls .track-label {
  padding: 2px 6px;
  font-size: 11px;
  margin-right: 4px;
}

.nav-controls .track-tab {
  padding: 2px 8px;
  font-size: 11px;
  border-radius: 12px;
}

/* Domain Track Switcher Styling */
.track-selector-container {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}

.track-label {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.8px;
  padding: 6px 12px 6px 16px;
  border-right: 1px solid var(--card-border);
  margin-right: 8px;
  display: flex;
  align-items: center;
}

html[dir="rtl"] .track-label {
  padding: 6px 16px 6px 12px;
  border-right: none;
  border-left: 1px solid var(--card-border);
  margin-right: 0;
  margin-left: 8px;
}

.track-selector {
  display: flex;
  align-items: center;
  padding: 4px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
  backdrop-filter: blur(8px);
}

.track-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  padding: 6px 16px;
  border-radius: 16px;
  transition: var(--transition);
}

.track-tab:hover {
  color: var(--text-main);
}

.track-tab.active {
  color: var(--accent-red);
  background: rgba(163, 31, 31, 0.06);
  font-weight: 600;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.03);
  pointer-events: none;
}

.lang-flag {
  display: none;
}

.lang-dropdown-container {
  display: none;
}

.lang-dropdown-select {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  padding: 4px 10px;
  border-radius: 16px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-main);
  outline: none;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
  backdrop-filter: blur(8px);
}

/* Responsive Mobile Adaptations STRICTLY scoped to Floating Compact Navbar */
@media (max-width: 768px) {
  .sticky-nav-bar .nav-title {
    display: inline-block;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
  }
  .sticky-nav-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    padding: 6px 8px;
    gap: 3px 6px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  .sticky-nav-bar .nav-controls {
    display: contents;
  }
  .sticky-nav-bar .nav-brand {
    order: 1;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
  }
  .sticky-nav-bar .lang-selector {
    order: 2;
    margin-bottom: 0;
    width: auto;
  }
  .sticky-nav-bar .lang-links {
    display: none;
  }
  .sticky-nav-bar .lang-dropdown-container {
    display: flex;
    margin: 0;
  }
  .sticky-nav-bar .lang-dropdown-select {
    padding: 2px 6px;
    font-size: 11px;
    max-width: 110px;
  }
  .sticky-nav-bar .track-selector-container {
    order: 3;
    width: 100%;
    max-width: 100%;
    display: flex;
    justify-content: center;
    margin-top: 1px;
    margin-bottom: 0;
    box-sizing: border-box;
  }
  .sticky-nav-bar .track-selector {
    padding: 2px 4px;
    max-width: 100%;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
  }
  .sticky-nav-bar .track-tab {
    padding: 3px 6px;
    font-size: 10.5px;
    max-width: 135px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-sizing: border-box;
  }
  .sticky-nav-bar .track-label {
    display: none;
  }
}

/* Premium Semantic Card Component */
.semantic-card {
  width: 100%;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.92) 0%, rgba(252, 250, 245, 0.78) 100%);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: 48px 40px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.03), 0 1px 3px rgba(0, 0, 0, 0.01);
  backdrop-filter: blur(16px);
  margin-bottom: 32px;
  position: relative;
  overflow: hidden;
}

.semantic-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-gold), transparent);
}

.card-header .meta-tag {
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--accent-gold);
  margin-bottom: 12px;
  font-weight: 600;
}

.term-title {
  font-family: var(--font-serif);
  font-size: 32px;
  font-weight: 500;
  color: var(--text-main);
  line-height: 1.25;
  margin-bottom: 8px;
  word-break: break-word;
  overflow-wrap: break-word;
}

.phonetics-block {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  font-size: 14px;
  margin-bottom: 32px;
  word-break: break-word;
  overflow-wrap: break-word;
  max-width: 100%;
}

.pinyin-totem {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: bold;
  color: var(--text-muted);
  word-break: break-word;
}

.phonetic-guide {
  color: var(--accent-red);
  font-family: var(--font-serif);
  word-break: break-word;
}

.chapter-definitions {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 24px;
}

.chapter-definition-block {
  background: rgba(255, 255, 255, 0.4);
  border-left: 3px solid var(--accent-gold);
  padding: 16px 20px;
  border-radius: 0 12px 12px 0;
  transition: var(--transition);
}

html[dir="rtl"] .chapter-definition-block {
  border-left: none;
  border-right: 3px solid var(--accent-gold);
  border-radius: 12px 0 0 12px;
}

.chapter-definition-block:hover {
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 4px 12px rgba(179, 143, 73, 0.05);
}

.definition-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.system-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-red);
  background: rgba(163, 31, 31, 0.08);
  border: 1px solid rgba(163, 31, 31, 0.15);
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 12px;
  letter-spacing: 0.5px;
}

.chapter-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-gold);
  background: rgba(179, 143, 73, 0.1);
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 12px;
  letter-spacing: 0.5px;
}

.badge-icon {
  margin-right: 6px;
}

html[dir="rtl"] .badge-icon {
  margin-right: 0;
  margin-left: 6px;
}

.term-definition {
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-main);
  font-family: var(--font-sans);
}

.related-chapter-definitions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 12px;
}

.related-definition-block {
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--card-border);
}

.related-definition-block:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.related-chapter-badge {
  font-size: 10px;
  color: var(--text-muted);
  background: rgba(0,0,0,0.03);
  display: inline-block;
  padding: 2px 8px;
  border-radius: 8px;
  margin-bottom: 8px;
}

.term-source {
  font-size: 13px;
  color: var(--text-muted);
  border-left: 2px solid var(--accent-red);
  padding-left: 12px;
  margin-bottom: 12px;
}

html[dir="rtl"] .term-source {
  border-left: none;
  border-right: 2px solid var(--accent-red);
  padding-left: 0;
  padding-right: 12px;
}

.card-footer {
  border-top: 1px solid var(--card-border);
  padding-top: 20px;
  margin-top: 32px;
  display: flex;
  justify-content: flex-end;
}

.footer-badge {
  font-size: 10px;
  letter-spacing: 1.5px;
  color: var(--accent-red);
  border: 1px solid var(--accent-red);
  padding: 4px 10px;
  border-radius: 4px;
  font-weight: 600;
}

/* Related Terms Styling */
.related-terms-section {
  width: 100%;
  margin-top: 16px;
  margin-bottom: 40px;
}

.related-terms-title {
  font-family: var(--font-serif);
  font-size: 18px;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--card-border);
  padding-bottom: 8px;
}

.related-terms-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.related-term-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.88) 0%, rgba(248, 246, 240, 0.68) 100%);
  border: 1px solid var(--card-border);
  border-radius: 18px;
  padding: 24px 28px;
  transition: var(--transition);
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.02);
}

.related-term-card:hover {
  border-color: var(--accent-gold);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 253, 248, 0.88) 100%);
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(179, 143, 73, 0.08);
}

.related-term-name {
  font-family: var(--font-serif);
  font-size: 20px;
  color: var(--accent-gold);
  margin-bottom: 4px;
  font-weight: 500;
}

.related-phonetics {
  font-size: 12px;
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.related-pinyin {
  font-style: italic;
  font-weight: bold;
  color: var(--text-muted);
}

.related-phonetic {
  color: var(--accent-red);
}

.related-term-def {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-main);
  margin-bottom: 12px;
}

.related-term-src {
  font-size: 11px;
  color: var(--text-muted);
  border-left: 2px solid var(--accent-red);
  padding-left: 8px;
}

html[dir="rtl"] .related-term-src {
  border-left: none;
  border-right: 2px solid var(--accent-red);
  padding-left: 0;
  padding-right: 8px;
}

.related-chapter-badge {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--accent-gold);
  background: rgba(179, 143, 73, 0.1);
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 10px;
  letter-spacing: 0.5px;
}

/* Logo Link Styling */
a.logo-link {
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
a.logo-link:hover {
  opacity: 0.85;
  transform: translateY(-1px);
}

/* System Dimension Selector Styling (Academic System Tabs in Detail View) */
.system-dimension-container {
  width: 100%;
  max-width: 800px;
  margin: 0 auto 24px auto;
  display: flex;
  justify-content: center;
}

.system-dimension-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 8px 16px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
  backdrop-filter: blur(12px);
}

.system-dimension-label {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.system-dimension-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 14px;
  border: 1px solid transparent;
  transition: var(--transition);
}

.system-dimension-tab:hover {
  color: var(--text-main);
  background: rgba(0, 0, 0, 0.03);
}

.system-dimension-tab.active {
  color: var(--accent-red);
  background: rgba(140, 29, 29, 0.08);
  border-color: rgba(140, 29, 29, 0.2);
  font-weight: 600;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02);
}

/* Semantic Matrix Portal (Main Homepage System Cards) */
.semantic-matrix-portal {
  width: 100%;
  max-width: 800px;
  margin: 0.5rem auto 2.5rem auto;
}

.matrix-portal-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.matrix-portal-tag {
  display: inline-block;
  background: rgba(140, 29, 29, 0.08);
  color: var(--accent-red);
  padding: 0.3rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1px;
  margin-bottom: 0.85rem;
  border: 1px solid rgba(140, 29, 29, 0.2);
}

.matrix-portal-title {
  font-family: var(--font-serif);
  font-size: 2.2rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.75rem;
}

.matrix-portal-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 620px;
  margin: 0 auto;
  line-height: 1.6;
}

.matrix-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.75rem;
}

.matrix-card-link {
  text-decoration: none;
  display: block;
  height: 100%;
}

.matrix-card {
  height: 100%;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.95) 0%, rgba(252, 250, 245, 0.85) 100%);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 1.85rem;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.03);
  backdrop-filter: blur(16px);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.matrix-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent-red), transparent);
  opacity: 0;
  transition: var(--transition);
}

.matrix-card:hover {
  transform: translateY(-3px);
  border-color: rgba(140, 29, 29, 0.3);
  box-shadow: 0 16px 36px rgba(140, 29, 29, 0.08);
}

.matrix-card:hover::before {
  opacity: 1;
}

.matrix-card .system-badge {
  align-self: flex-start;
  margin-bottom: 1.25rem;
  font-size: 0.8rem;
  padding: 0.35rem 0.85rem;
}

.matrix-card-title {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.4rem;
}

.matrix-card-phonetics {
  font-family: var(--font-serif);
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.matrix-card-desc {
  color: var(--text-main);
  font-size: 0.92rem;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 1.75rem;
  flex-grow: 1;
}

.matrix-card-action {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--accent-red);
  font-weight: 600;
  font-size: 0.9rem;
  margin-top: auto;
  transition: var(--transition);
}

.matrix-card:hover .matrix-card-action {
  gap: 0.75rem;
}

/* Causal Ring Section (SEO Ecosystem Mesh Grid) */
.causal-ring-section {
  width: 100%;
  margin-bottom: 40px;
}

.ring-title {
  font-family: var(--font-serif);
  font-size: 16px;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--card-border);
  padding-bottom: 6px;
}

.ring-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
}

.mesh-categories {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.mesh-category-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mesh-category-title {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-gold);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  margin-bottom: 4px;
  border-left: 2px solid var(--accent-gold);
  padding-left: 8px;
}

html[dir="rtl"] .mesh-category-title {
  border-left: none;
  border-right: 2px solid var(--accent-gold);
  padding-left: 0;
  padding-right: 8px;
}

.ring-node {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.78) 0%, rgba(248, 246, 240, 0.55) 100%);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.01);
  backdrop-filter: blur(8px);
  transition: var(--transition);
  align-items: stretch;
}

.ring-node.has-current {
  border-color: var(--accent-gold);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.96) 0%, rgba(255, 252, 244, 0.88) 100%);
  box-shadow: 0 8px 24px rgba(179, 143, 73, 0.12);
}

.node-details {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.node-term {
  font-family: var(--font-serif);
  font-size: 14px;
  color: var(--text-main);
  font-weight: 500;
  border-bottom: 1px solid rgba(226, 225, 220, 0.5);
  padding-bottom: 6px;
}

.ring-node.has-current .node-term {
  color: var(--accent-gold);
  font-weight: 600;
  border-bottom-color: rgba(179, 143, 73, 0.2);
}

.node-domains {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.node-link {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-size: 11px;
  color: var(--text-muted);
  padding: 5px 8px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid transparent;
  transition: var(--transition);
}

.node-link:hover {
  color: var(--text-main);
  background: rgba(0, 0, 0, 0.04);
}

.node-link.current-active {
  color: var(--accent-red);
  background: rgba(163, 31, 31, 0.05);
  border-color: rgba(163, 31, 31, 0.12);
  font-weight: 600;
  pointer-events: none;
}

.track-badge {
  font-size: 9px;
  font-weight: 600;
  padding: 1px 4px;
  border-radius: 3px;
  text-transform: uppercase;
}

.track-badge.zh-badge {
  background: rgba(179, 143, 73, 0.12);
  color: #8c6b2d;
}

.track-badge.en-badge {
  background: rgba(98, 98, 110, 0.12);
  color: var(--text-muted);
}

.node-link.current-active .track-badge.zh-badge {
  background: rgba(163, 31, 31, 0.12);
  color: var(--accent-red);
}

.node-link.current-active .track-badge.en-badge {
  background: rgba(163, 31, 31, 0.12);
  color: var(--accent-red);
}

/* Patent Notice Section */
.patent-section {
  width: 100%;
  margin-bottom: 40px;
}

.patent-section-title {
  font-family: var(--font-serif);
  font-size: 18px;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--card-border);
  padding-bottom: 8px;
}

.patent-notice {
  width: 100%;
  background: linear-gradient(135deg, rgba(163, 31, 31, 0.07) 0%, rgba(179, 143, 73, 0.04) 100%);
  border: 1px solid rgba(163, 31, 31, 0.2);
  border-radius: 16px;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  gap: 18px;
  backdrop-filter: blur(8px);
}

.patent-icon {
  color: var(--accent-red);
  flex-shrink: 0;
}

.patent-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.patent-codes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.patent-code {
  font-size: 11px;
  font-weight: 600;
  background: rgba(163, 31, 31, 0.15);
  color: var(--accent-gold);
  padding: 2px 8px;
  border-radius: 4px;
}

/* Resources Section */
.resources-section {
  width: 100%;
  margin-bottom: 40px;
}

.resources-title {
  font-family: var(--font-serif);
  font-size: 18px;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--card-border);
  padding-bottom: 8px;
}

.resources-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.resource-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.86) 0%, rgba(248, 246, 240, 0.65) 100%);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 20px 24px;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: var(--transition);
  cursor: pointer;
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.02);
  position: relative;
}

.resource-card:hover {
  border-color: var(--accent-gold);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 253, 248, 0.88) 100%);
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(179, 143, 73, 0.08);
}

.music-platform-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  cursor: default;
}

.music-platform-card:hover {
  transform: none;
  border-color: var(--card-border);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.02);
}

.resource-main {
  display: flex;
  align-items: center;
  gap: 16px;
}

.music-platforms-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  border-top: 1px dashed var(--card-border);
  padding-top: 12px;
  margin-top: 2px;
}

.music-platform-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 5px 10px;
  font-size: 11px;
  color: var(--text-main);
  text-decoration: none;
  transition: var(--transition);
}

.music-platform-badge:hover {
  background: rgba(140, 29, 29, 0.05);
  border-color: var(--accent-red);
  color: var(--accent-red);
  transform: translateY(-1px);
}

.platform-icon-svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
}

.music-card-overlay-link {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  cursor: pointer;
}

.resource-icon {
  color: var(--accent-red);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(140, 29, 29, 0.06);
  border-radius: 12px;
  width: 48px;
  height: 48px;
  transition: var(--transition);
}

.resource-card:hover .resource-icon {
  background: rgba(140, 29, 29, 0.12);
  transform: scale(1.05);
}

.resource-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: hidden;
}

.resource-label {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-weight: 600;
}

.resource-name {
  font-family: var(--font-serif);
  font-size: 15px;
  color: var(--text-main);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Global Footer */
footer.main-footer {
  width: 100%;
  text-align: center;
  padding: 40px 0;
  border-top: 1px solid var(--card-border);
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.footer-links {
  display: flex;
  gap: 16px;
  margin-bottom: 8px;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  transition: var(--transition);
}

.footer-links a:hover {
  color: var(--accent-gold);
}

/* Responsive Overrides for Content Components */
@media (max-width: 768px) {
  .wrapper {
    padding: 20px 16px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
  }
  #content-area, main {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  .ring-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }
  .ring-node {
    padding: 10px 8px;
  }
  .node-term {
    font-size: 12px;
  }
  .node-link {
    padding: 4px 6px;
    font-size: 10px;
  }
  .domain-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .semantic-card {
    padding: 24px 16px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  .term-title {
    font-size: 24px;
  }
  .resources-grid {
    grid-template-columns: 1fr;
  }
  .resource-card {
    padding: 16px 14px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  .resource-name {
    font-size: 14px;
  }
}