/* 全局样式重置与基础设置 */
html { scroll-behavior: smooth; }
body { 
  font-family: "Noto Sans SC", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  background-color: #F5F5DC;
  color: #3E2723;
}
.font-title { 
  font-family: "Noto Serif SC", "Ma Shan Zheng", Georgia, serif;
}

/* 武侠风格背景 */
.modern-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(135deg, #F5F5DC 0%, #E8E0C9 100%);
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><rect width="100" height="100" fill="none"/><path d="M0,0 L100,100 M100,0 L0,100" stroke="%23D2B48C" stroke-width="0.5" opacity="0.2"/></svg>');
  overflow: hidden;
  pointer-events: none;
}

/* 水墨风格装饰元素 */
.geometric-shapes {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.geometric-shapes::before,
.geometric-shapes::after {
  content: "";
  position: absolute;
  opacity: 0.1;
  animation: float 25s ease-in-out infinite;
}

.geometric-shapes::before {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(198, 40, 40, 0.8) 0%, rgba(198, 40, 40, 0) 70%);
  top: -150px;
  left: -150px;
  animation-delay: 0s;
}

.geometric-shapes::after {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(255, 215, 0, 0.8) 0%, rgba(255, 215, 0, 0) 70%);
  bottom: -100px;
  right: -100px;
  animation-delay: 12s;
}

/* 浮动动画 */
@keyframes float {
  0%, 100% {
    transform: translate(0, 0) rotate(0deg);
  }
  25% {
    transform: translate(5%, 5%) rotate(2deg);
  }
  50% {
    transform: translate(0, 10%) rotate(0deg);
  }
  75% {
    transform: translate(-5%, 5%) rotate(-2deg);
  }
}

/* 自定义滚动条 */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: rgba(198, 40, 40, 0.1);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb {
  background: rgba(198, 40, 40, 0.6);
  border-radius: 5px;
  border: 2px solid rgba(245, 245, 220, 0.8);
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(198, 40, 40, 0.8);
}

/* 隐藏水平滚动条 */
.hide-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.hide-scrollbar::-webkit-scrollbar {
  display: none;
}

/* 3D翻转卡片效果 */
.flip-scene { perspective: 1200px; }
.flip-card {
  transform-style: preserve-3d;
  transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

.flip-card:hover {
  transform: rotateY(180deg) translateY(-10px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.flip-card .flip-face.p-4 {
  overflow: hidden;
}

.flip-card > .flip-face,
.flip-card > .flip-back {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 0.75rem;
}

.flip-face {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  background: linear-gradient(135deg, #ffffff 0%, #f5f5dc 100%);
  border: 1px solid rgba(198, 40, 40, 0.2);
}

.flip-back {
  transform: rotateY(180deg);
  background: linear-gradient(135deg, #f5f5dc 0%, #e8e0c9 100%);
  border: 1px solid rgba(198, 40, 40, 0.2);
}

/* 卡片悬停效果 */
.shadow-card {
  box-shadow: 0 12px 28px -6px rgba(0, 0, 0, 0.15), 0 4px 12px -2px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  border: 1px solid rgba(198, 40, 40, 0.1);
}

.shadow-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 36px -8px rgba(0, 0, 0, 0.2), 0 8px 16px -4px rgba(0, 0, 0, 0.1);
  border-color: rgba(198, 40, 40, 0.3);
}

/* 轮播图样式 */
.slide { opacity: 0; pointer-events: none; transition: opacity 1s ease-in-out; }
.slide.active { opacity: 1; pointer-events: auto; }
.carousel-dot { 
  transition: all 0.3s ease;
  background-color: rgba(255, 255, 255, 0.6);
}
.carousel-dot:hover { 
  background-color: rgba(255, 255, 255, 0.8);
  transform: scale(1.1);
}
.carousel-dot[aria-current="true"] { 
  transform: scale(1.3);
  background-color: #ffffff;
}

/* 链接和按钮样式 */
a {
  transition: all 0.3s ease;
  position: relative;
}

a:hover {
  color: #C62828;
}

/* 按钮悬停效果 */
button, .btn {
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

button:hover, .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

/* 响应式调整 */
@media (max-width: 768px) {
  .geometric-shapes::before {
    width: 300px;
    height: 300px;
  }
  
  .geometric-shapes::after {
    width: 200px;
    height: 200px;
  }
  
  .flip-card:hover {
    transform: rotateY(180deg) translateY(-5px);
  }
}

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

section {
  animation: fadeIn 1s ease-out forwards;
  position: relative;
}

section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 3px;
  background: linear-gradient(90deg, transparent, #C62828, transparent);
  opacity: 0;
  animation: lineFadeIn 1.5s ease-out forwards;
}

@keyframes lineFadeIn {
  from {
    width: 0;
    opacity: 0;
  }
  to {
    width: 80px;
    opacity: 1;
  }
}

/* 章节动画延迟 */
section:nth-child(1) { animation-delay: 0.1s; }
section:nth-child(2) { animation-delay: 0.2s; }
section:nth-child(3) { animation-delay: 0.3s; }
section:nth-child(4) { animation-delay: 0.4s; }
section:nth-child(5) { animation-delay: 0.5s; }
section:nth-child(6) { animation-delay: 0.6s; }
section:nth-child(7) { animation-delay: 0.7s; }

/* 下载按钮脉冲效果 */
@keyframes pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(198, 40, 40, 0.7);
  }
  50% {
    box-shadow: 0 0 0 12px rgba(198, 40, 40, 0);
  }
}

#downloadCTA {
  background: linear-gradient(135deg, #C62828 0%, #B71C1C 100%);
  border: none;
  position: relative;
  overflow: hidden;
}

#downloadCTA:hover {
  animation: pulse 2s infinite;
  transform: translateY(-2px);
}

/* 导航栏滚动效果 */
header {
  transition: all 0.4s ease;
  background: rgba(245, 245, 220, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(198, 40, 40, 0.2);
}

header.scrolled {
  background: rgba(245, 245, 220, 0.98);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-bottom: 1px solid rgba(198, 40, 40, 0.3);
}

/* 语言切换器样式 */
[data-lang] {
  transition: all 0.2s ease;
  border-radius: 4px;
}

[data-lang]:hover {
  transform: scale(1.05);
  background-color: rgba(198, 40, 40, 0.1);
}

/* FAQ详情动画 */
details {
  transition: all 0.3s ease;
  border: 1px solid rgba(198, 40, 40, 0.1);
  border-radius: 0.5rem;
}

details[open] {
  border-color: rgba(198, 40, 40, 0.2);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

details[open] summary {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  background-color: rgba(198, 40, 40, 0.05);
}

/* 平滑过渡效果 */
button, a, summary, .flip-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 加载动画 */
@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.loading {
  animation: spin 1s linear infinite;
  border: 3px solid rgba(198, 40, 40, 0.2);
  border-top: 3px solid #C62828;
  border-radius: 50%;
  width: 30px;
  height: 30px;
}

/* 移动端菜单动画 */
#mobileNav {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: top;
  background: rgba(245, 245, 220, 0.98);
  border: 1px solid rgba(198, 40, 40, 0.1);
  border-radius: 0 0 0.5rem 0.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

#mobileNav.hidden {
  transform: scaleY(0);
  opacity: 0;
}

#mobileNav:not(.hidden) {
  transform: scaleY(1);
  opacity: 1;
}

/* 武侠风格装饰元素 */
.sword-decoration {
  position: absolute;
  width: 100px;
  height: 2px;
  background: linear-gradient(90deg, transparent, #C62828, transparent);
  opacity: 0.6;
}

/* 卡片边框装饰 */
.card-border {
  position: relative;
  border: 1px solid rgba(198, 40, 40, 0.1);
  border-radius: 0.75rem;
  overflow: hidden;
}

.card-border::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #C62828, #FFD700, #26A69A, transparent);
}

/* 按钮样式 */
.btn-primary {
  background: linear-gradient(135deg, #C62828 0%, #B71C1C 100%);
  color: white;
  border: none;
  border-radius: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-weight: 500;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(198, 40, 40, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(198, 40, 40, 0.4);
}

.btn-secondary {
  background: linear-gradient(135deg, #FFD700 0%, #FFA000 100%);
  color: #3E2723;
  border: none;
  border-radius: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-weight: 500;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3);
}

.btn-secondary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(255, 215, 0, 0.4);
}

/* 标题样式 */
.section-title {
  position: relative;
  display: inline-block;
  margin-bottom: 2rem;
  padding-bottom: 0.5rem;
}

.section-title::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, #C62828, #FFD700);
  border-radius: 2px;
}

/* 页面滚动指示器 */
.scroll-indicator {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: transparent;
  z-index: 9999;
}

.scroll-indicator::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #C62828, #FFD700, #26A69A);
  transition: width 0.1s ease;
}
