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

body {
  font-family: "Helvetica Neue", "Microsoft YaHei", sans-serif;
  background-color: #0a1a3a;
  background-image: url('bg.png');
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center center;
  background-attachment: fixed;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  font-size: 14px; /* 缩小基础字体大小 */
}

/* Navigation */
nav {
  width: 100%;
  background-color: rgba(7, 18, 40, 0.9); /* 半透明背景 */
  background-image: linear-gradient(180deg, rgba(10, 26, 58, 0.95) 0%, rgba(7, 18, 40, 0.92) 100%);
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  padding: 8px 0; /* 减小padding */
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3), 0 0 20px rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid rgba(135, 206, 250, 0.1);
  transform: translateY(-100%);
  transition: transform 0.3s ease;
}

nav:hover, 
nav.visible, 
.nav-trigger-area:hover + nav {
  transform: translateY(0);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  height: 50px; /* 减小高度 */
  max-width: 1200px;
  margin: 0 auto;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-logo img {
  height: 44px;
}

.nav-logo span {
  font-size: 1.2rem;
  font-weight: bold;
  color: #ffffff;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-links {
  display: flex;
  gap: 20px;
}

.nav-links a {
  color: #ffffff;
  text-decoration: none;
  font-size: 15px; /* 缩小导航链接字体 */
  transition: all 0.3s ease;
  position: relative;
}

.nav-links a:hover {
  color: #87cefa;
}

.nav-links a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -5px;
  left: 0;
  background-color: #87cefa;
  transition: width 0.3s ease;
}

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

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
}

/* Language switch */
.language-switch {
  display: flex;
  align-items: center;
  margin-left: 20px;
}

.language-switch button {
  height: 36px;
  min-width: 80px;
  background: transparent;
  border: 1px solid #87cefa;
  color: #ffffff;
  padding: 3px 10px;
  margin-left: 5px;
  cursor: pointer;
  border-radius: 4px;
  font-size: 14px;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.language-switch button.active {
  background: #87cefa;
  color: #071228;
}

.language-switch button:hover {
  background: rgba(135, 206, 250, 0.2);
}

/* Logo and header section */
.logo {
  text-align: center;
  animation: fadeIn 1.5s ease;
  padding-top: 20px; /* 减小内边距 */
}

.logo img {
  width: 250px;
  margin-top: 20px;
  transition: transform 0.3s ease;
}

.logo img:hover {
  transform: scale(1.05);
}

.logo h1 {
  margin: 20px 0 10px;
  font-size: 38px;
  letter-spacing: 3px;
  color: #ffffff;
}

.logo .chinese-name {
  font-size: 24px;
  margin-bottom: 10px;
  color: #e0e0e0;
}

.slogan {
  font-size: 18px;
  color: #87cefa;
  margin-bottom: 60px;
  letter-spacing: 1px;
}

/* Content sections */
.section {
  max-width: 800px;
  width: 90%;
  text-align: center;
  padding: 30px 20px; /* 减小内边距 */
  margin-bottom: 25px; /* 减小间距 */
  background-color: rgba(10, 26, 58, 0.85); /* 半透明背景 */
  background-image: linear-gradient(135deg, rgba(10, 26, 58, 0.85) 0%, rgba(7, 18, 40, 0.95) 100%);
  border: 1px solid rgba(135, 206, 250, 0.1);
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), 0 0 15px rgba(135, 206, 250, 0.05) inset;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  backdrop-filter: blur(5px); /* 背景模糊效果 */
  -webkit-backdrop-filter: blur(5px);
}

.section:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3), 0 0 20px rgba(135, 206, 250, 0.15) inset;
  background-image: linear-gradient(135deg, rgba(10, 26, 58, 0.9) 0%, rgba(7, 18, 40, 0.98) 100%);
}

.section h2 {
  font-size: 24px; /* 缩小标题字体 */
  margin-bottom: 15px;
  color: #87cefa;
  position: relative;
  display: inline-block;
}

.section h2:after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 0;
  right: 0;
  margin: 0 auto;
  width: 60px;
  height: 2px;
  background-color: #87cefa;
}

.section-title {
  min-height: 30px; /* 减小高度 */
  margin-bottom: 15px; /* 减小间距 */
}

.section p {
  font-size: 14px; /* 缩小段落字体 */
  line-height: 1.6;
  margin-top: 20px;
  color: #e0e0e0;
}

/* Products section */
.products-container {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  justify-content: center;
  margin-top: 30px;
}

/* 产品卡片通用样式 */
.product-card {
  width: 340px;
  background-color: rgba(7, 18, 40, 0.9); /* 半透明背景 */
  background-image: linear-gradient(145deg, rgba(10, 26, 58, 0.8) 0%, rgba(5, 15, 35, 0.95) 100%);
  border: 1px solid rgba(135, 206, 250, 0.1);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3), 0 0 10px rgba(135, 206, 250, 0.05) inset;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(5px); /* 背景模糊效果 */
  -webkit-backdrop-filter: blur(5px);
}

.product-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3), 0 0 15px rgba(135, 206, 250, 0.1) inset;
  background-image: linear-gradient(145deg, rgba(12, 30, 65, 0.9) 0%, rgba(5, 15, 35, 0.98) 100%);
}

.product-image {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  overflow: hidden;
  margin: 20px auto;
  background-color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-info {
  background-color: transparent; /* 去掉背景色，让产品卡片背景显示 */
  padding: 25px;
  position: relative;
  min-height: 240px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  flex: 1;
  border-radius: 0 0 12px 12px;
}

.product-info-content {
  margin-bottom: 20px;
}

.product-info h3 {
  font-size: 18px; /* 缩小产品标题字体 */
  margin-bottom: 15px;
  color: #ffffff;
}

.product-info p {
  font-size: 14px; /* 缩小产品描述字体 */
  color: #e0e0e0;
  margin-bottom: 20px;
  line-height: 1.5;
  text-align: center;
}

.product-link {
  display: inline-block;
  padding: 8px 20px; /* 减小内边距 */
  background-color: rgba(135, 206, 250, 0.2);
  color: #87cefa;
  border-radius: 5px;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
  margin-top: 10px;
  font-size: 14px; /* 缩小链接字体 */
}

.product-link:hover {
  background-color: #87cefa;
  color: #071228;
  transform: translateY(-3px);
}

/* Footer */
footer {
  margin-top: auto;
  padding: 30px 0;
  width: 100%;
  text-align: center;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.8);
  background-color: rgba(0, 0, 0, 0.5); /* 半透明背景 */
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

footer a {
  color: #87cefa;
  text-decoration: none;
  margin: 0 10px;
  transition: color 0.3s ease;
}

footer a:hover {
  color: #fff;
  text-decoration: underline;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Language display control */
.en, .zh {
  display: none !important;
}

.lang-en .en {
  display: block !important;
}

.lang-zh .zh {
  display: block !important;
}


/* Responsive adjustments */
@media (max-width: 768px) {
  .nav-container {
    padding: 0 15px;
  }
  
  .menu-toggle {
    display: block;
  }
  
  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background-color: #0a1a3a;
    padding: 20px;
    z-index: 100;
  }
  
  .nav-links.active {
    display: flex;
  }
  
  .language-switch {
    margin-left: 0;
  }
  
  .logo {
    margin-top: 100px;
    padding-top: 20px;
  }
  
  .logo img {
    width: 200px;
  }
  
  .logo h1 {
    font-size: 32px;
  }
  
  .logo .chinese-name {
    font-size: 20px;
  }
  
  .slogan {
    font-size: 16px;
    margin-bottom: 40px;
  }
  
  .section {
    padding: 30px 15px;
  }
  
  .section h2 {
    font-size: 24px;
  }
  
  .section p {
    font-size: 16px;
  }
  
  .products-container {
    flex-direction: column;
    align-items: center;
    gap: 40px;
  }
  
  .product-card {
    width: 100%;
    max-width: 340px;
  }
  
  .product-info {
    min-height: 220px;
  }
}

@media (max-width: 480px) {
  .logo {
    margin-top: 90px;
    padding-top: 15px;
  }
  
  .logo img {
    width: 180px;
  }
  
  .logo h1 {
    font-size: 28px;
    letter-spacing: 2px;
  }
  
  .logo .chinese-name {
    font-size: 18px;
  }
  
  .slogan {
    font-size: 14px;
    margin-bottom: 30px;
  }
  
  .section {
    padding: 25px 15px;
  }
  
  .section h2 {
    font-size: 22px;
  }
  
  .section p {
    font-size: 15px;
    line-height: 1.6;
  }
  
  .product-info {
    min-height: 200px;
    padding: 20px 15px;
  }
  
  .product-info h3 {
    font-size: 22px;
    margin-bottom: 15px;
  }
  
  .product-info p {
    font-size: 15px;
    margin-bottom: 30px;
  }
  
  .product-link {
    padding: 8px 20px;
    font-size: 14px;
  }
}

/* 子页面样式 - 条款和隐私政策页面 */
.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
  margin-top: 40px; /* 为导航栏留出空间 */
}

.content {
  background-color: rgba(10, 26, 58, 0.85); /* 半透明背景 */
  background-image: linear-gradient(135deg, rgba(10, 26, 58, 0.85) 0%, rgba(7, 18, 40, 0.95) 100%);
  border: 1px solid rgba(135, 206, 250, 0.1);
  border-radius: 10px;
  padding: 30px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), 0 0 15px rgba(135, 206, 250, 0.05) inset;
  backdrop-filter: blur(5px); /* 背景模糊效果 */
  -webkit-backdrop-filter: blur(5px);
}

.logo-section {
  text-align: center;
  margin-bottom: 30px;
}

.logo-section img {
  height: 60px;
}

header {
  text-align: center;
  margin-bottom: 30px;
  padding-top: 50px;
}

header h1 {
  font-size: 28px;
  margin-bottom: 15px;
  color: #87cefa;
}

/* 子页面的语言切换按钮 */
.container .language-switch {
  text-align: right;
  margin-bottom: 20px;
  display: flex;
  justify-content: flex-end;
}

section h2 {
  color: #87cefa;
  margin: 20px 0 15px;
  font-size: 20px;
}

section p {
  margin-bottom: 15px;
  color: #e0e0e0;
  font-size: 14px;
  line-height: 1.6;
}

/* 响应式调整 */
@media (max-width: 768px) {
  .container .language-switch button {
    padding: 3px 10px;
    font-size: 14px;
  }
  
  header h1 {
    font-size: 24px;
  }
  
  .content {
    padding: 20px;
  }
  
  section h2 {
    font-size: 18px;
  }
}

@media (max-width: 480px) {
  header {
    padding-top: 40px;
    margin-bottom: 20px;
  }
  
  .content {
    padding: 15px;
  }
}

/* TreeNode产品页面样式 */
.hero {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 40px;
  margin-bottom: 60px;
  background-color: rgba(10, 26, 58, 0.85);
  background-image: linear-gradient(135deg, rgba(10, 26, 58, 0.85) 0%, rgba(7, 18, 40, 0.95) 100%);
  border: 1px solid rgba(135, 206, 250, 0.1);
  border-radius: 10px;
  padding: 40px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), 0 0 15px rgba(135, 206, 250, 0.05) inset;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.hero-image {
  flex: 0 0 200px;
  text-align: center;
}

.hero-image img {
  width: 128px;
  height: 128px;
  object-fit: contain;
  border-radius: 12px;
}

.hero-content {
  flex: 1 1 400px;
}

.hero-content h2 {
  font-size: 24px;
  margin-bottom: 15px;
  color: #87cefa;
}

.hero-content p {
  margin-bottom: 20px;
  color: #e0e0e0;
  font-size: 16px;
}

.cta-button {
  display: inline-block;
  background-color: #87cefa;
  color: #0a1a3a;
  padding: 12px 24px;
  border-radius: 4px;
  text-decoration: none;
  font-weight: bold;
  transition: all 0.3s ease;
}

.cta-button:hover {
  background-color: #a0d6ff;
  transform: translateY(-2px);
}

.features {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 30px;
}

.feature {
  padding: 20px;
  background-color: rgba(0, 0, 0, 0.2);
  background-image: linear-gradient(145deg, rgba(10, 26, 58, 0.5) 0%, rgba(5, 15, 35, 0.7) 100%);
  border: 1px solid rgba(135, 206, 250, 0.05);
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
}

.feature:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.25), 0 0 10px rgba(135, 206, 250, 0.07) inset;
  background-image: linear-gradient(145deg, rgba(12, 30, 65, 0.6) 0%, rgba(5, 15, 35, 0.8) 100%);
}

.feature h3 {
  font-size: 18px;
  margin-bottom: 10px;
  color: #87cefa;
}

.feature p {
  color: #e0e0e0;
  font-size: 15px;
}

.installation-steps, .prerequisites {
  list-style-position: inside;
  margin: 20px 0;
  padding: 0 20px;
}

.installation-steps li, .prerequisites li {
  margin-bottom: 10px;
  color: #e0e0e0;
}

.installation-steps a, .prerequisites a {
  color: #ffffff;
  text-decoration: underline;
  font-weight: bold;
}

.installation-steps a:hover, .prerequisites a:hover {
  color: #a0d6ff;
}

.usage-steps {
  margin: 20px 0;
}

.usage-step {
  margin-bottom: 20px;
}

.usage-step h3 {
  font-size: 18px;
  margin-bottom: 10px;
  color: #87cefa;
}

.prerequisites ul {
  margin-left: 20px;
  margin-top: 5px;
}

.prerequisites ul li {
  margin-bottom: 5px;
}

/* 修复按钮显示问题 */
a.cta-button.en, a.cta-button.zh {
  display: none;
}

.lang-en a.cta-button.en {
  display: inline-block;
}

.lang-zh a.cta-button.zh {
  display: inline-block;
}

.screenshots {
  margin-top: 30px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.screenshot {
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.screenshot img {
  width: 100%;
  height: auto;
  display: block;
}

@media (max-width: 768px) {
  .features {
    grid-template-columns: 1fr;
  }
  
  .screenshots {
    grid-template-columns: 1fr;
  }
}

/* 动态导航栏 */
nav {
  transform: translateY(-100%);
  transition: transform 0.3s ease;
}

nav:hover, 
nav.visible, 
.nav-trigger-area:hover + nav {
  transform: translateY(0);
}

.nav-trigger-area {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 20px;
  z-index: 99;
}

/* Override header padding for the navigation space */
.logo {
  margin-top: 40px;
}

@media (max-width: 768px) {
  nav, nav:hover, .nav-trigger-area:hover + nav {
    transform: translateY(0);
  }
  
  .nav-trigger-area {
    display: none;
  }
}

/* 子页面导航栏 */
.subpage-nav {
  width: 100%;
  background-color: rgba(7, 18, 40, 0.9);
  background-image: linear-gradient(180deg, rgba(10, 26, 58, 0.95) 0%, rgba(7, 18, 40, 0.92) 100%);
  padding: 8px 0;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3), 0 0 20px rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid rgba(135, 206, 250, 0.1);
  transform: translateY(-100%);
  transition: transform 0.3s ease;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
}

.subpage-nav .nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  height: 50px;
  max-width: 1200px;
  margin: 0 auto;
}

.subpage-nav:hover, 
.subpage-nav.visible, 
.nav-trigger-area:hover + .subpage-nav {
  transform: translateY(0);
}

/* 子页面内容容器调整 */
.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
  margin-top: 40px; /* 为导航栏留出空间 */
}

/* 子页面logo部分调整 */
.logo-section {
  text-align: center;
  margin-bottom: 30px;
}

/* 子页面section统一背景 */
.container section {
  background-color: rgba(10, 26, 58, 0.85);
  background-image: linear-gradient(135deg, rgba(10, 26, 58, 0.85) 0%, rgba(7, 18, 40, 0.95) 100%);
  border: 1px solid rgba(135, 206, 250, 0.1);
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), 0 0 15px rgba(135, 206, 250, 0.05) inset;
  padding: 24px 18px;
  margin-bottom: 24px;
  transition: box-shadow 0.3s, background-image 0.3s;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.container section:last-child {
  margin-bottom: 0;
}

/* 新footer横排布局 */
.container footer {
  margin-top: auto;
  padding: 18px 0 12px 0;
  width: 100%;
  text-align: center;
  font-size: 13px;
  color: rgba(220, 230, 255, 0.85);
  background-color: rgba(0, 0, 0, 0.5);
  background-image: linear-gradient(180deg, rgba(10, 26, 58, 0.95) 0%, rgba(7, 18, 40, 0.92) 100%);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  border-radius: 10px;
  margin-top: 40px;
  letter-spacing: 0.01em;
}

.container footer .footer-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.container footer .footer-row a {
  color: #7fd6ff;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s;
  display: inline-block;
  padding: 0 2px;
}

.container footer .footer-row a:hover {
  color: #fff;
  text-decoration: underline;
}

.container footer .footer-row .footer-divider {
  color: #4e6a8a;
  margin: 0 6px;
  font-size: 15px;
  user-select: none;
}

@media (max-width: 600px) {
  .container footer .footer-row {
    flex-direction: column;
    gap: 4px;
  }
  .container footer {
    font-size: 12px;
    padding: 14px 0 8px 0;
  }
}

/* 使子页面和主页的语言切换按钮统一 */
.container .language-switch {
  text-align: right;
  margin-bottom: 20px;
  display: flex;
  justify-content: flex-end;
}

.container .language-switch button {
  height: 36px;
  min-width: 80px;
  background: transparent;
  border: 1px solid #87cefa;
  color: #ffffff;
  padding: 3px 10px;
  margin-left: 5px;
  cursor: pointer;
  border-radius: 4px;
  font-size: 14px;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

button, .cta-button {
  text-align: center !important;
  justify-content: center !important;
}
