:root {
  --primary-color: #9c2525; /* Imperial Red */
  --secondary-color: #2c2c2c; /* Ink Black */
  --accent-color: #d4af37; /* Metallic Gold */
  --bg-color: #ffffff; /* Pure White */
  --text-color: #333;
  --font-serif: "Noto Serif SC", "Playfair Display", serif;
  --font-sans: "Inter", "Noto Sans SC", sans-serif;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: var(--font-sans);
  line-height: 1.6;
  overflow-x: hidden;
}

h1, h2, h3, .zh-text {
  font-family: var(--font-serif);
}

/* Background Texture */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('https://www.transparenttextures.com/patterns/paper-fibers.png');
  opacity: 0.4;
  pointer-events: none;
  z-index: -1;
}

/* Layout */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding-left: 2rem;
  padding-right: 2rem;
}

main.container {
  padding-top: 60px;
}

/* Header & Nav */

nav {
  position: fixed;
  top: 0;
  width: 100%;
  padding: 0.8rem 0;
  background: #1a1a1a; /* Sleek Dark Gray */
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  z-index: 1000;
  border-bottom: 1px solid #333;
}

.nav-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-right: 1.5rem; /* Moves right-side elements slightly to the left */
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px; /* Reduced from 12px */
  text-decoration: none;
  font-weight: 700;
  font-size: 1.6rem;
  color: #ffffff; /* White text for dark nav */
  letter-spacing: 4px;
  font-family: "Cinzel", serif;
  text-transform: uppercase;
}

.nav-logo-img {
  height: 32px;
  width: auto;
  border-radius: 4px;
}

.logo span {
  font-family: "Noto Serif SC", serif;
  font-weight: 400;
  margin-left: 4px; /* Reduced from 10px */
  font-size: 1.2rem;
  color: #cccccc;
}

.nav-tagline {
  font-family: var(--font-serif);
  font-size: 0.8rem;
  color: #888;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-weight: 500;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

/* Dropdown Menu */
.nav-dropdown {
  position: relative;
  display: inline-block;
  margin-left: 1rem;
}

/* Language Selector */
.lang-switch {
  display: flex;
  gap: 10px;
  margin-left: 2rem;
}

.lang-btn {
  background: none;
  border: 1px solid #444;
  color: #888;
  padding: 4px 10px;
  cursor: pointer;
  border-radius: 4px;
  font-size: 0.75rem;
  transition: var(--transition);
}

.lang-btn.active {
  color: #ffffff;
  border-color: #ffffff;
  background: rgba(255,255,255,0.1);
}

/* Multilingual Visibility */



.dropbtn {
  background: rgba(255,255,255,0.05);
  border: 1px solid #444;
  padding: 0.5rem 1.2rem;
  font-family: var(--font-sans);
  font-weight: 600;
  cursor: pointer;
  border-radius: 4px;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
  color: #ffffff;
}

.dropbtn:hover {
  border-color: #666;
  background: rgba(255,255,255,0.05); /* Minimal light background */
}

.dropdown-content {
  display: none;
  position: absolute;
  right: 0;
  background-color: #242424; /* Dark dropdown */
  min-width: 220px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  z-index: 1001;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #333;
  margin-top: 0; /* Removed gap to prevent flickering */
  top: 100%; /* Align exactly below button */
  padding-top: 5px; /* Visual gap inside the interactive container */
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.dropdown-content a {
  color: #e0e0e0;
  padding: 14px 20px;
  text-decoration: none;
  display: block;
  font-size: 0.85rem;
  transition: var(--transition);
}

.dropdown-content a:hover {
  background-color: #333;
  color: #ffffff;
  padding-left: 25px;
}

.nav-dropdown:hover .dropdown-content {
  display: block;
}

.hero-visual img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.main-titles {
  text-align: center;
  margin: 1.5rem 0 2rem;
}

.main-titles h1 {
  font-size: 2.2rem;
  color: var(--primary-color);
  margin-bottom: 0.25rem;
}

.main-titles .subtitle {
  font-size: 0.9rem;
  color: var(--secondary-color);
  letter-spacing: 2px;
  text-transform: uppercase;
}

.center-logo {
  width: 240px; /* Reverted to standard logo width for white asset */
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto 2rem;
}

.center-logo img {
  width: 100%;
  height: auto;
  object-fit: contain;
  /* Removed mix-blend-mode for white background asset */
}

.hero-visual {
  width: 240px;
  height: 240px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 2rem;
  background: transparent; /* Merge into white body */
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-20px); }
}

/* Sections Grid */
.sections-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  padding: 0;
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  background: url('i/mural-1.png') no-repeat center center;
  background-size: cover;
  box-shadow: 0 20px 50px rgba(0,0,0,0.05);
}

.sections-grid::before {
  content: "";
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(245, 245, 235, 0.60); /* Optimal balance for mural visibility */
  z-index: 0;
}

.section-card {
  background: transparent;
  padding: 1.5rem;
  text-align: center;
  transition: var(--transition);
  border-right: 1px solid rgba(212, 175, 55, 0.1);
  border-bottom: 1px solid rgba(212, 175, 55, 0.1);
  position: relative;
  overflow: hidden;
  text-decoration: none;
  display: block;
  z-index: 1;
}

.section-card:hover {
  background: rgba(212, 175, 55, 0.05); /* Very subtle gold tint only */
  transform: scale(1.02);
  z-index: 2;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.02);
}

.section-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: transparent;
  opacity: 0;
  transition: var(--transition);
  z-index: -1;
}

.section-card > * {
  position: relative;
  z-index: 1;
}

.section-card:hover {
  transform: translateY(-10px);
}

.section-card:hover h3, .section-card:hover p {
  color: #000000 !important;
}

.section-card:hover::after {
  opacity: 1;
}

.section-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: var(--primary-color);
}

.section-card p {
  font-size: 0.8rem;
  color: #666;
  line-height: 1.4;
}

.section-icon {
  font-size: 3rem;
  margin-bottom: 1.5rem;
  display: block;
  color: var(--secondary-color);
}

img.section-icon {
  width: 50px;
  height: 50px;
  object-fit: contain;
  margin: 0 auto 1rem;
  display: block;
  mix-blend-mode: multiply;
  filter: contrast(1.2) brightness(1.15); /* Aggressive whitening for difficult backgrounds */
}

/* Element Preview List */
.element-strip {
  background: var(--secondary-color);
  color: white;
  padding: 4rem 0;
  margin: 4rem 0;
  overflow: hidden;
}

.marquee {
  display: flex;
  white-space: nowrap;
  animation: scroll 60s linear infinite;
}

.marquee span.logo {
  font-family: 'Cinzel', serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: white;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-logo-img {
  height: 32px;
  width: auto;
  border-radius: 4px;
}

.marquee span {
  font-family: var(--font-serif);
  font-size: 2.5rem;
  margin-right: 4rem;
  color: var(--accent-color);
  opacity: 0.8;
}

@keyframes scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* Footer */
footer {
  padding: 4rem 0;
  text-align: center;
  border-top: 1px solid rgba(0,0,0,0.05);
  color: #666;
  background-color: #ffffff; /* pure white to blend with logo */
}

.stamp {
  display: none;
}

/* Section Specifics */
.section-header {
  padding: 8rem 0 4rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.section-header h1 {
  font-size: 4rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.section-page-logo {
  width: 240px;
  height: 240px;
  object-fit: contain;
  margin: 0 auto 1rem;
  display: block;
  mix-blend-mode: multiply;
  filter: contrast(1.1) brightness(1.05); /* Aggressively whiten the light-gray edges for better multiplication */
}

/* Horizontal Element Navigation */
.element-nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 100px auto 1rem;
  padding: 0.25rem;
  max-width: fit-content;
  z-index: 10;
  background: transparent !important;
  border: none !important;
  align-items: center; /* Ensure vertical alignment for divider */
}

.nav-divider {
  width: 1px;
  height: 25px; /* Back to a subtle height */
  background: rgba(212, 175, 55, 0.3);
  margin: 0 0.75rem;
}

.section-home-icon {
  width: 40px !important;  /* Balanced size */
  height: 40px !important;
  border-radius: 6px;
  filter: grayscale(0%) !important;
  opacity: 0.95;
  transition: all 0.3s ease;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08); /* Lighter shadow */
}

.section-home-link:hover .section-home-icon {
  transform: scale(1.1);
  opacity: 1 !important;
}

.section-home-link {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center; /* Precise centering */
  min-width: 70px; 
  text-decoration: none;
  margin-top: 2px; /* Slight nudge for balance */
}

.element-nav-item {
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  opacity: 0.7;
  padding: 0 0.5rem;
}

.element-nav-item:hover {
  opacity: 1;
  transform: translateY(-3px);
}

.element-nav-item .nav-icon {
  width: 32px;
  height: 32px;
  object-fit: contain;
  margin-bottom: 0.25rem;
  filter: grayscale(100%);
  transition: all 0.4s ease;
}

.element-nav-item:hover .nav-icon {
  filter: grayscale(0%);
  transform: scale(1.1);
}

.element-nav-item span {
  font-family: var(--font-serif);
  font-size: 0.7rem;
  color: var(--secondary-color);
  letter-spacing: 0.5px;
}

.element-nav-item .zh-char {
  font-size: 0.9rem;
  margin-top: 0.1rem;
}

/* Active State for Current Element Page */
.element-nav-item.active {
  opacity: 1;
  pointer-events: none;
}

.element-nav-item.active .nav-icon {
  filter: grayscale(0%);
  transform: scale(1.1);
}

.element-nav-item.active::after {
  width: 90%;
  background: var(--accent-color);
  box-shadow: 0 0 12px var(--accent-color);
}

.element-nav-item.active span {
  color: var(--primary-color);
  font-weight: bold;
}

/* Ink Brush Ripple Animation */
.element-nav-item::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--primary-color);
  transform: translateX(-50%);
  transition: width 0.4s ease;
  box-shadow: 0 0 10px var(--primary-color);
}

.element-nav-item:hover::after {
  width: 80%;
}

.section-header .desc {
  max-width: 600px;
  margin: 0 auto;
  font-size: 1.1rem;
  color: #666;
}

.element-table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0 6rem;
  background: white;
  box-shadow: 0 10px 30px rgba(0,0,0,0.05);
  border-radius: 8px;
  overflow: hidden;
}

.element-table th, .element-table td {
  padding: 1.5rem;
  text-align: left;
  border-bottom: 1px solid #eee;
}

.element-table th {
  background: var(--secondary-color);
  color: white;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 1px;
}

.element-table tr:hover {
  background: #fff9f9;
}



.element-table .id-cell {
  color: #888;
  font-family: "JetBrains Mono", monospace, var(--font-sans);
  font-weight: 500;
  font-size: 0.75rem;
  width: 80px;
  letter-spacing: 0.5px;
  opacity: 0.6;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--secondary-color);
  margin-bottom: 2rem;
  font-weight: 500;
  transition: var(--transition);
}

.back-link:hover {
  color: var(--primary-color);
  transform: translateX(-5px);
}

/* Responsive */
@media (max-width: 1024px) {
  .sections-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .hero h1 { font-size: 3rem; }
  .nav-links, .nav-tagline { display: none; }
  
  .sections-grid {
    grid-template-columns: 1fr;
  }
  
  .section-card {
    padding: 2rem;
  }
  
  .section-page-logo {
    width: 160px;
    height: 160px;
  }
  
  .element-nav {
    margin-top: 60px;
    gap: 0.5rem;
  }
  
  .element-nav-item .nav-icon {
    width: 28px;
    height: 28px;
  }
  
  .detail-card {
    padding: 1.5rem;
  }
  
  .element-table th, .element-table td {
    padding: 1rem;
  }
  
  .element-table .zh {
    font-size: 1.2rem;
    width: 100px;
  }
}

/* Element Detail Styles */
.element-link {
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 12px;
}

.element-link:hover {
  color: var(--primary-color);
  transform: translateX(5px);
}

.element-id-badge {
  display: inline-block;
  padding: 0.2rem 1rem;
  background: var(--primary-color);
  color: white;
  font-weight: 700;
  border-radius: 20px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.element-title {
  margin-bottom: 1.5rem !important;
}

.accent-desc {
  font-style: italic;
  font-family: var(--font-serif);
  color: var(--primary-color) !important;
  font-size: 1.25rem !important;
}

.element-details {
  display: grid;
  gap: 3rem;
  margin-bottom: 6rem;
}

.detail-card {
  background: white;
  padding: 3rem;
  border-radius: 8px;
  box-shadow: 0 15px 40px rgba(0,0,0,0.05);
  border-left: 5px solid var(--primary-color);
  position: relative;
}

.content-body p:first-of-type::first-letter {
  float: left;
  font-family: var(--font-serif);
  font-size: 4rem;
  line-height: 1;
  padding-right: 0.5rem;
  color: var(--primary-color);
  font-weight: 700;
}

.detail-card h2 {
  font-size: 1.8rem;
  color: var(--secondary-color);
  margin-bottom: 2rem;
  border-bottom: 1px solid #eee;
  padding-bottom: 1rem;
}

.content-body p {
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
  color: #444;
}

.content-body strong {
  color: var(--primary-color);
  font-family: var(--font-serif);
  font-size: 1.2rem;
}

.element-header-flex {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 1rem;
}

.element-page-icon {
  width: 100px;
  height: 100px;
  object-fit: contain;
}

.element-header-text {
  text-align: left;
}




