:root {
  --tea-green: #1E493B;
  --cloud-white: #F5EDE0;
  --gold: #D4AF37;
  --dark-ink: #101418;
  --light-tea: #2d6a4f;
  --soft-gold: #f4e4bc;
  --gradient-dark: linear-gradient(135deg, #101418 0%, #1a1f26 100%);
  --gradient-tea: linear-gradient(135deg, #1E493B 0%, #2d6a4f 100%);
  --gradient-gold: linear-gradient(135deg, #D4AF37 0%, #f4e4bc 100%);
  --shadow-soft: 0 10px 40px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 30px rgba(212, 175, 55, 0.3);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: var(--dark-ink);
  color: var(--cloud-white);
  overflow-x: hidden;
  line-height: 1.6;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

.section {
  padding: 120px 0;
  position: relative;
}

.title-main {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 700;
  background: var(--gradient-gold);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-align: center;
  margin-bottom: 20px;
  letter-spacing: 8px;
}

.subtitle {
  font-size: clamp(1rem, 2vw, 1.3rem);
  color: rgba(245, 237, 224, 0.7);
  text-align: center;
  font-weight: 300;
  letter-spacing: 4px;
}

.btn-primary {
  display: inline-block;
  padding: 16px 48px;
  background: var(--gradient-tea);
  color: var(--cloud-white);
  text-decoration: none;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 2px;
  transition: all 0.3s ease;
  border: 2px solid transparent;
  position: relative;
  overflow: hidden;
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-glow);
  border-color: var(--gold);
}

.btn-secondary {
  display: inline-block;
  padding: 16px 48px;
  background: transparent;
  color: var(--gold);
  text-decoration: none;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 2px;
  transition: all 0.3s ease;
  border: 2px solid var(--gold);
}

.btn-secondary:hover {
  background: var(--gold);
  color: var(--dark-ink);
  transform: translateY(-3px);
}

.particles-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--gold);
  border-radius: 50%;
  opacity: 0.3;
  animation: float-particle 15s infinite ease-in-out;
}

@keyframes float-particle {
  0%, 100% {
    transform: translateY(0) translateX(0);
    opacity: 0.3;
  }
  25% {
    transform: translateY(-100px) translateX(50px);
    opacity: 0.6;
  }
  50% {
    transform: translateY(-200px) translateX(-30px);
    opacity: 0.3;
  }
  75% {
    transform: translateY(-150px) translateX(70px);
    opacity: 0.5;
  }
}

.fade-in {
  opacity: 0;
  transform: translateY(40px);
  transition: all 0.8s ease-out;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

.glow-text {
  text-shadow: 0 0 20px rgba(212, 175, 55, 0.5),
               0 0 40px rgba(212, 175, 55, 0.3);
}

@media (max-width: 768px) {
  .section {
    padding: 80px 0;
  }
  
  .btn-primary,
  .btn-secondary {
    padding: 12px 32px;
    font-size: 0.9rem;
  }
}

/* Language Selector */
.language-selector {
  position: relative;
  margin-left: auto;
}

.lang-current {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(30, 73, 59, 0.2);
  border: 1px solid rgba(212, 175, 55, 0.25);
  border-radius: 25px;
  color: var(--cloud-white);
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.9rem;
  white-space: nowrap;
}

.lang-current:hover,
.lang-current.active {
  background: rgba(30, 73, 59, 0.35);
  border-color: var(--gold);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.lang-flag {
  font-size: 1.2rem;
}

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

.lang-arrow {
  font-size: 0.7rem;
  opacity: 0.7;
  transition: transform 0.3s ease;
}

.lang-current.active .lang-arrow {
  transform: rotate(180deg);
}

.lang-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  background: rgba(16, 20, 24, 0.98);
  border: 1px solid rgba(212, 175, 55, 0.25);
  border-radius: 14px;
  padding: 10px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  z-index: 10000;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
  max-height: 400px;
  overflow-y: auto;
}

.lang-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.lang-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  background: transparent;
  border: none;
  border-radius: 10px;
  color: var(--cloud-white);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  font-size: 0.92rem;
}

.lang-option:hover {
  background: rgba(30, 73, 59, 0.35);
  transform: translateX(4px);
}

.lang-option.active {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.2), rgba(30, 73, 59, 0.3));
  border: 1px solid rgba(212, 175, 55, 0.4);
  color: var(--gold);
  font-weight: 600;
}

.lang-option .lang-flag {
  font-size: 1.4rem;
}

/* RTL Layout Support */
body.rtl-layout {
  direction: rtl;
}

.rtl-layout .nav-container {
  flex-direction: row-reverse;
}

.rtl-layout .nav-links {
  flex-direction: row-reverse;
}

.rtl-layout .language-selector {
  margin-left: 0;
  margin-right: auto;
}

.rtl-layout .lang-dropdown {
  right: auto;
  left: 0;
}

.rtl-layout .lang-option:hover {
  transform: translateX(-4px);
}

.rtl-layout .hero-buttons,
.rtl-layout .action-buttons,
.rtl-layout .realm-actions,
.rtl-layout .cta-buttons {
  flex-direction: row-reverse;
}

.rtl-layout .timeline::before {
  left: auto;
  right: 80px;
}

.rtl-layout .era-marker {
  text-align: left;
  padding-left: 0;
  padding-right: 45px;
}

.rtl-layout .era-dot {
  left: auto;
  right: -28px;
}

.rtl-layout .realm-showcase.reverse {
  direction: rtl;
}

.rtl-layout .footer-content {
  grid-template-columns: 1fr 2fr;
}

.rtl-layout .footer-links {
  direction: rtl;
}

.rtl-layout .comparison-table th,
.rtl-layout .comparison-table td {
  text-align: right;
}

@media (max-width: 1024px) {
  .language-selector {
    position: static;
    margin-top: 12px;
  }

  .lang-dropdown {
    right: 0;
    left: 0;
    width: 100%;
  }

  body.rtl-layout .lang-dropdown {
    right: 0;
    left: 0;
  }
}

/* Navigation - Common Styles */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 20px 0;
  z-index: 1000;
  transition: all 0.3s ease;
  backdrop-filter: blur(0);
}

.nav.scrolled {
  background: rgba(16, 20, 24, 0.95);
  backdrop-filter: blur(20px);
  padding: 12px 0;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gold);
  text-decoration: none;
  letter-spacing: 4px;
  transition: all 0.3s ease;
}

.logo:hover {
  text-shadow: 0 0 20px rgba(212, 175, 55, 0.5);
}

.nav-links {
  display: flex;
  gap: 40px;
  align-items: center;
}

.nav-links a {
  color: var(--cloud-white);
  text-decoration: none;
  font-size: 0.95rem;
  letter-spacing: 1px;
  transition: all 0.3s ease;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gold);
  transition: width 0.3s ease;
}

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

.nav-links a:hover::after {
  width: 100%;
}

.nav-links a.active {
  color: var(--gold);
}

.nav-links a.active::after {
  width: 100%;
}

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 5px;
}

.menu-toggle span {
  width: 25px;
  height: 2px;
  background: var(--cloud-white);
  transition: all 0.3s ease;
}

.menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

@media (max-width: 1024px) {
  .menu-toggle {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: 80px;
    left: 0;
    width: 100%;
    background: rgba(16, 20, 24, 0.98);
    flex-direction: column;
    gap: 0;
    padding: 20px 0;
    transform: translateY(-150%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(20px);
  }

  .nav-links.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .nav-links a {
    padding: 15px 30px;
    width: 100%;
    text-align: center;
    border-bottom: 1px solid rgba(212, 175, 55, 0.1);
  }

  .nav-links a::after {
    display: none;
  }
}

/* Footer - Common Styles */
.footer {
  background: rgba(16, 20, 24, 0.98);
  border-top: 1px solid rgba(212, 175, 55, 0.1);
  padding: 80px 0 40px;
}

.footer-content {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 60px;
  margin-bottom: 60px;
}

.footer-brand h3 {
  font-size: 2rem;
  color: var(--gold);
  margin-bottom: 16px;
  letter-spacing: 4px;
}

.footer-brand p {
  color: rgba(245, 237, 224, 0.6);
  line-height: 1.8;
}

.footer-links {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
}

.footer-column h4 {
  color: var(--cloud-white);
  font-size: 1.1rem;
  margin-bottom: 20px;
  font-weight: 600;
}

.footer-column a {
  display: block;
  color: rgba(245, 237, 224, 0.6);
  text-decoration: none;
  margin-bottom: 12px;
  transition: all 0.3s ease;
  font-size: 0.95rem;
}

.footer-column a:hover {
  color: var(--gold);
  padding-left: 8px;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 40px;
  border-top: 1px solid rgba(212, 175, 55, 0.1);
}

.footer-bottom p {
  color: rgba(245, 237, 224, 0.4);
  font-size: 0.9rem;
}

.social-links {
  display: flex;
  gap: 24px;
}

.social-links a {
  color: rgba(245, 237, 224, 0.6);
  text-decoration: none;
  font-size: 0.95rem;
  transition: all 0.3s ease;
}

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

/* Footer Responsive */
@media (max-width: 1024px) {
  .footer-content {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .footer-links {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-bottom {
    flex-direction: column;
    gap: 20px;
    text-align: center;
  }
}

@media (max-width: 768px) {
  .footer {
    padding: 60px 0 30px;
  }

  .footer-links {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .social-links {
    justify-content: center;
    flex-wrap: wrap;
  }
}

/* Language Switcher */
.lang-switcher {
  position: relative;
  margin-left: auto;
  margin-right: 20px;
}

.lang-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: rgba(212, 175, 55, 0.1);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 6px;
  color: #d4af37;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.lang-toggle:hover {
  background: rgba(212, 175, 55, 0.2);
  border-color: rgba(212, 175, 55, 0.5);
}

.arrow {
  font-size: 10px;
  transition: transform 0.3s ease;
}

.lang-switcher.open .arrow {
  transform: rotate(180deg);
}

.lang-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  background: rgba(16, 20, 24, 0.98);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 8px;
  padding: 8px 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  z-index: 1001;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.lang-switcher.open .lang-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.lang-option {
  display: block;
  padding: 10px 18px;
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  font-size: 13px;
  transition: all 0.2s ease;
}

.lang-option:hover,
.lang-option.active {
  background: rgba(212, 175, 55, 0.15);
  color: #d4af37;
}
