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

:root {
  color-scheme: light;
}

body {
  font-family: ui-sans-serif, system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  margin: 0;
  padding: 0;
  line-height: 1.6;
  background: #7f53ac;
  color: #fff;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}


/* 页面进入动画 */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.page-enter {
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.page-enter-delay-1 {
  animation-delay: 0.1s;
}

.page-enter-delay-2 {
  animation-delay: 0.2s;
}

.page-enter-delay-3 {
  animation-delay: 0.3s;
}

/* Header */
header {
  position: sticky;
  top: 0;
  z-index: 100;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  padding: 0 32px;
  background: rgba(127, 83, 172, 0.85);
  backdrop-filter: blur(20px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25), 0 2px 8px rgba(80, 40, 120, 0.3);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  object-fit: cover;
  display: block;
}

.brand {
  font-size: 1.5em;
  font-weight: 900;
  color: #fff;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.header-right {
  display: flex;
  align-items: center;
}

.header-right .links {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-icon {
  width: 24px;
  height: 24px;
  cursor: pointer;
  fill: currentColor;
  color: #fff;
  transition: opacity 0.2s, transform 0.2s;
  display: block;
}

.header-icon:hover {
  opacity: 0.8;
  transform: scale(1.1);
}

/* 菜单按钮 */
.menu-toggle {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
}

.menu-icon {
  width: 24px;
  height: 24px;
  color: #fff;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.menu-icon-line {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: center;
}

/* 菜单打开时的图标动画 - 变成叉叉 */
.menu-toggle.active .menu-icon-line-1 {
  transform: translateY(6px) rotate(45deg);
  transform-origin: 12px 6px;
}

.menu-toggle.active .menu-icon-line-2 {
  opacity: 0;
  transform: scaleX(0);
}

.menu-toggle.active .menu-icon-line-3 {
  transform: translateY(-6px) rotate(-45deg);
  transform-origin: 12px 18px;
}

/* 菜单面板 */
.menu-overlay {
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 99;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.3s;
}

@media (max-width: 900px) {
  .menu-overlay {
    top: 60px;
  }
}

@media (max-width: 640px) {
  .menu-overlay {
    top: 56px;
  }
}

.menu-overlay.active {
  opacity: 1;
  visibility: visible;
}

.menu-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: 280px;
  height: 100%;
  background: rgba(127, 83, 172, 0.95);
  backdrop-filter: blur(20px);
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.2);
  padding: 0 0 40px 0;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 101;
}

.menu-overlay.active .menu-panel {
  transform: translateX(0);
}

.menu-link {
  display: block;
  padding: 16px 32px;
  color: #fff;
  font-size: 1.1em;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.2s, transform 0.2s;
  border-left: 3px solid transparent;
}

.menu-link:hover {
  background: rgba(255, 255, 255, 0.1);
  border-left-color: #fff;
  transform: translateX(4px);
}

/* Content */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 32px;
}

.lang-toggle {
  position: fixed;
  top: 80px;
  right: 32px;
  z-index: 99;
  background: transparent;
  color: white;
  border: none;
  padding: 0;
  cursor: pointer;
  perspective: 1000px;
  width: auto;
  height: auto;
}

/* 3D卡片容器 */
.lang-card {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: center;
}

.lang-toggle.flipped .lang-card {
  transform: rotateY(180deg);
}

/* 卡片正面和背面 */
.lang-card-face {
  position: relative;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.2rem;
  border-radius: 999px;
  background: rgba(124, 58, 237, 0.9);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: box-shadow 0.3s;
}

.lang-card-front {
  transform: rotateY(0deg);
}

.lang-card-back {
  position: absolute;
  top: 0;
  left: 0;
  transform: rotateY(180deg);
}

.lang-card-face span {
  display: inline-block;
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
}

/* 悬停效果 */
.lang-toggle:hover .lang-card-face {
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.4);
}

.lang-toggle:hover .lang-card {
  transform: scale(1.05);
}

.lang-toggle.flipped:hover .lang-card {
  transform: rotateY(180deg) scale(1.05);
}

/* 点击效果 */
.lang-toggle:active .lang-card {
  transform: scale(0.95);
}

.lang-toggle.flipped:active .lang-card {
  transform: rotateY(180deg) scale(0.95);
}

/* 语言切换容器 */
.container {
  position: relative;
}

/* 语言切换区域 */
section[id^="en-"],
section[id^="zh-"] {
  margin-top: 2rem;
  opacity: 1;
  transform: translateY(0);
  position: relative;
  transition: none; /* 文字切换无动画 */
}

/* 隐藏的语言区域 - 绝对定位重叠，但不占据布局空间 */
section[id^="en-"].lang-hidden,
section[id^="zh-"].lang-hidden {
  position: absolute;
  top: 2rem;
  left: 0;
  right: 0;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  margin-top: 0;
  transition: none; /* 文字切换无动画 */
}

/* 可见的语言区域 */
section[id^="en-"].lang-visible,
section[id^="zh-"].lang-visible {
  opacity: 1;
  transform: translateY(0);
  position: relative;
  visibility: visible;
  margin-top: 2rem;
  transition: none; /* 文字切换无动画 */
}

section {
  margin-top: 2rem;
}

h1 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
  color: #fff;
  font-weight: 900;
}

h2 {
  font-size: 1.3rem;
  margin-top: 2rem;
  margin-bottom: 1rem;
  color: #fff;
  font-weight: 700;
}

p {
  margin-bottom: 1rem;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.8;
}

a {
  color: rgba(255, 255, 255, 0.95);
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.4);
  transition: text-decoration-color 0.2s;
}

a:hover {
  text-decoration-color: rgba(255, 255, 255, 0.8);
}

ul {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

li {
  margin-bottom: 0.5rem;
  color: rgba(255, 255, 255, 0.9);
}

strong {
  color: #fff;
  font-weight: 700;
}

/* Footer */
footer {
  padding: 36px 0 54px;
  text-align: center;
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
  line-height: 1.8;
  margin-top: 60px;
}

footer p {
  margin: 8px 0;
}

footer a {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  transition: color 0.2s;
}

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

@media (max-width: 640px) {
  .header {
    padding: 0 16px;
    height: 56px;
  }
  .container {
    padding: 32px 20px;
  }
  .lang-toggle {
    top: 72px;
    right: 16px;
  }
  .lang-card-face {
    padding: 0.5rem 1rem;
  }
  .lang-card-face span {
    font-size: 0.85rem;
  }
  h1 {
    font-size: 1.6rem;
  }
  h2 {
    font-size: 1.1rem;
  }
}

