* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

:root {
  --header: white;
  --fna_green: #009d42;
  --primary: #2c3e50;
  --secondary: #3498db;
  --accent: #e74c3c;
  --light: #ecf0f1;
  --dark: #2c3e50;
  --text: #333;
  --text-light: #7f8c8d;
  --border: #ddd;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s ease;
}

body {
  background-color: #f8f9fa;
  color: var(--text);
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.container {
  display: flex;
  /* width: 100vw; */
  margin: 0 auto;
  position: relative;
  min-height: 100vh;
  flex: 1;
  width: 100%;
}

/* 头部样式 */
header {
  display: flex;
  height: 70px;
  /* background-color: var(--header); */
  color: var(--text);
  padding: 15px 20px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
  backdrop-filter: blur(30px);
}

.mobile-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;

}

.logo {
  font-size: 1.5rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 10px;
  vertical-align: text-top;
}

.logo i {
  color: var(--secondary);
}

/* 侧边栏样式 */
.sidebar {
  width: 280px;
  background-color: white;
  padding: 0px 20px 30px 20px;
  border-right: 1px solid var(--border);
  position: sticky;
  top: 70px;
  height: calc(100vh - 70px);
  z-index: 99;
  overflow-y: auto;
  transition: var(--transition);
  box-shadow: var(--shadow);
  /* overflow:scroll; */
}

.sidebar h2 {
  margin-bottom: 20px;
  padding-top: 10px;
  padding-bottom: 15px;
  padding-left: 10px;
  border-bottom: 2px solid var(--fna_green);
  color: var(--fna);
  font-size: 1.8rem;
  position: sticky;
  top: 0;
  background: white;
  z-index: 10;
}

.toc {
  list-style-type: none;
}

.toc li {
  margin-bottom: 8px;
}

.toc a {
  display: block;
  padding: 12px 15px;
  border-radius: 6px;
  color: var(--text);
  text-decoration: none;
  transition: var(--transition);
  font-weight: 500;
}

.toc a:hover {
  background-color: #f0f8ff;
  color: var(--secondary);
}

.toc a.active {
  background-color: var(--fna_green);
  color: white;
  box-shadow: var(--shadow);
}

.toc a.sub-active {
  background-color: #c4e3ff;
  color: var(--secondary);
}

.toc .sub-items {
  list-style-type: none;
  padding-left: 20px;
  margin-top: 5px;
}

.toc .sub-items a {
  padding: 8px 15px;
  font-size: 0.95rem;
  font-weight: normal;
}

/* 主要内容区域 */
main {
  flex: 1;
  padding: 40px 20px;
  background-color: white;
  display: flex;
  justify-content: center;
}

.main-content {
  max-width: 900px;
  width: 100%;
  padding: 0 20px;
}

.content-section {
  margin-bottom: 60px;
  scroll-margin-top: 20px;
}

.content-section h2 {
  color: var(--fna_green);
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--fna_green);
  font-size: 1.8rem;
}

.content-section h3 {
  color: var(--fna_green);
  margin: 25px 0 15px;
  font-size: 1.4rem;
}

.content-section p {
  margin-bottom: 15px;
  color: var(--text);
}

.content-section ul,
.content-section ol {
  margin: 15px 0;
  padding-left: 30px;
}

.content-section li {
  margin-bottom: 10px;
}

.content-section code {
  background-color: #f5f7fa;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  color: var(--accent);
}

.note {
  background-color: #e8f4fd;
  border-left: 4px solid var(--secondary);
  padding: 15px;
  margin: 20px 0;
  border-radius: 0 4px 4px 0;
}

.warning {
  background-color: #fdf6e8;
  border-left: 4px solid #f39c12;
  padding: 15px;
  margin: 20px 0;
  border-radius: 0 4px 4px 0;
}

/* 语言切换 */
.lang-buttons {
  display: flex;
  gap: 10px;
  margin-left: 10px;
}

.lang-btn {
  flex: 1;
  padding: 10px;
  background-color: #f0f0f0;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
  transition: var(--transition);
  min-width: 80px;
}

.lang-btn:hover {
  background-color: #e0e0e0;
}

.lang-btn.active {
  background-color: var(--fna_green);
  color: white;
}

/* 响应式设计 */
@media (min-width: 721px) {
  .sidebar {
    width: 280px;
    /* padding: 30px 20px; */
  }

  .menu-toggle {
    display: none;
  }

  main {
    padding: 40px;
  }

  .fna-logo {
    display: inline-block;
  }
}

@media (max-width: 720px) {
  /* .logo {
        font-size: 1.2rem;
      } */

  .lang-ja .mobile-header .logo {
    font-size: 1.0rem;
  }

  .lang-zh .mobile-header .logo {
    font-size: 1.2rem;
  }

  .fna-logo {
    display: none;
  }

  .container {
    flex-direction: column;
  }

  .sidebar {
    position: fixed;
    left: -300px;
    top: 70px;
    height: calc(100vh - 70px);
    z-index: 99;
    box-shadow: 5px 0 15px rgba(0, 0, 0, 0.1);
  }

  .sidebar.active {
    left: 0;
  }

  header {
    display: block;
  }

  .menu-toggle {
    display: block;
    margin-right: 10px;
    background: none;
    border: none;
    color: var(--fna_green);
    font-size: 1.5rem;
    cursor: pointer;
  }

  .overlay {
    position: fixed;
    /* width: 100vw;
        height: calc(100vh - 68)px; */
    top: 69px;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 98;
    display: none;
  }

  .overlay.active {
    display: block;
  }
}

/* 页脚样式 */
footer {
  background-color: var(--fna_green);
  color: white;
  text-align: center;
  padding: 20px;
  margin-top: 40px;
  position: relative;
  z-index: 1;
}

/* 动画效果 */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.content-section {
  animation: fadeIn 0.5s ease forwards;
}

/* 语言切换提示 */
.lang-notice {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--fna_green);
  color: white;
  padding: 10px 20px;
  border: white 2px solid;
  border-radius: 30px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease;
  z-index: 1000;
}

.lang-notice.show {
  opacity: 1;
  transform: translateY(0);
}

/* 语言按钮图标 */
.lang-btn i {
  margin-right: 5px;
}

/* 平滑过渡效果 */
.content-section {
  transition: opacity 0.3s ease;
}

.content-section.fade-out {
  opacity: 0;
}

.content-section.fade-in {
  opacity: 1;
}