/* 全局重置与基础 */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* CSS变量与暗色模式 */
:root {
  --primary: #1a1a2e;
  --secondary: #16213e;
  --accent: #e94560;
  --light: #f5f5f5;
  --dark: #0f0f1a;
  --text: #333;
  --text-light: #fff;
  --shadow: 0 4px 20px rgba(0,0,0,0.08);
  --radius: 12px;
  --transition: 0.3s ease;
  --glass-bg: rgba(255,255,255,0.2);
  --glass-border: rgba(255,255,255,0.3);
  --glass-shadow: 0 8px 32px 0 rgba(31,38,135,0.37);
  --hero-gradient: linear-gradient(135deg, #1a1a2e, #16213e);
  --card-bg: #ffffff;
  --section-bg: var(--light);
  --footer-bg: var(--dark);
  --scrollbar-thumb: var(--accent);
  --scrollbar-track: var(--primary);
  --focus-ring: 0 0 0 3px rgba(233,69,96,0.5);
}

/* 暗色模式 */
@media (prefers-color-scheme: dark) {
  :root {
    --primary: #0d0d1a;
    --secondary: #1a1a2e;
    --light: #121212;
    --text: #e0e0e0;
    --text-light: #ffffff;
    --shadow: 0 4px 20px rgba(0,0,0,0.4);
    --card-bg: #1e1e2f;
    --section-bg: #121212;
    --footer-bg: #0a0a0f;
    --glass-bg: rgba(30,30,47,0.6);
    --glass-border: rgba(255,255,255,0.1);
    --hero-gradient: linear-gradient(135deg, #0d0d1a, #1a1a2e);
  }
}

/* 滚动条美化 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--scrollbar-track); }
::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #d63850; }

/* 基础body */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  color: var(--text);
  background: var(--section-bg);
  overflow-x: hidden;
  scroll-behavior: smooth;
}

/* 容器 */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* 通用动画 */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* 滚动触发动画类 (默认隐藏，通过Intersection Observer添加visible类) */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Header */
header {
  background: var(--primary);
  color: var(--text-light);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 1px;
  transition: transform var(--transition);
}

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

.logo span {
  color: var(--accent);
}

/* 导航 */
nav ul {
  display: flex;
  list-style: none;
  gap: 20px;
}

nav a {
  color: var(--text-light);
  text-decoration: none;
  font-size: 0.95rem;
  padding: 6px 12px;
  border-radius: 6px;
  transition: background var(--transition), transform var(--transition);
  position: relative;
}

nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.3s ease, left 0.3s ease;
}

nav a:hover {
  background: rgba(255,255,255,0.1);
  transform: translateY(-2px);
}

nav a:hover::after {
  width: 100%;
  left: 0;
}

/* Hero 区域 - 渐变Banner + 毛玻璃效果 */
.hero {
  background: var(--hero-gradient);
  color: var(--text-light);
  padding: 80px 0 60px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 50%, rgba(233,69,96,0.15) 0%, transparent 50%),
              radial-gradient(circle at 70% 50%, rgba(22,33,62,0.3) 0%, transparent 50%);
  animation: float 8s ease-in-out infinite;
  pointer-events: none;
}

.hero .container {
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: 2.8rem;
  margin-bottom: 16px;
  line-height: 1.2;
  text-shadow: 0 2px 10px rgba(0,0,0,0.3);
  animation: fadeInUp 0.8s ease;
}

.hero p {
  font-size: 1.2rem;
  max-width: 700px;
  margin: 0 auto 30px;
  opacity: 0.9;
  animation: fadeInUp 0.8s ease 0.2s both;
}

/* 按钮 */
.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 14px 36px;
  border-radius: 30px;
  text-decoration: none;
  font-weight: 600;
  transition: transform var(--transition), box-shadow var(--transition), background 0.3s;
  position: relative;
  overflow: hidden;
  animation: fadeInUp 0.8s ease 0.4s both;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s;
}

.btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(233,69,96,0.5);
  background: #d63850;
}

.btn:hover::before {
  left: 100%;
}

.btn:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

/* 通用Section */
section {
  padding: 60px 0;
}

.section-title {
  font-size: 2rem;
  text-align: center;
  margin-bottom: 40px;
  color: var(--primary);
  position: relative;
  display: inline-block;
  width: 100%;
}

.section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: var(--accent);
  margin: 12px auto 0;
  border-radius: 2px;
}

/* 卡片 - 圆角卡片 + 毛玻璃效果 */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 30px;
  transition: transform var(--transition), box-shadow var(--transition);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  border: 1px solid transparent;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.15);
  border-color: var(--glass-border);
}

/* 玻璃态卡片变体 (用于特殊区域) */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  border-radius: var(--radius);
  padding: 30px;
  transition: transform var(--transition), box-shadow var(--transition);
}

.glass-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 40px rgba(31,38,135,0.5);
}

/* 网格布局 */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 30px; }
.grid-4 { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 20px; }

/* About */
.about-content {
  max-width: 800px;
  margin: 0 auto;
  font-size: 1.05rem;
}

.about-content p {
  margin-bottom: 16px;
  line-height: 1.8;
}

/* Story */
.story {
  background: var(--card-bg);
}

.story-content {
  max-width: 800px;
  margin: 0 auto;
}

.story-content p {
  margin-bottom: 16px;
  line-height: 1.8;
}

/* Products */
.products .card h3 {
  color: var(--accent);
  margin-bottom: 12px;
}

.products .card p {
  font-size: 0.95rem;
}

/* Services */
.services .card {
  text-align: center;
}

.services .card h3 {
  margin-bottom: 10px;
}

/* Advantages */
.advantages {
  background: var(--primary);
  color: var(--text-light);
}

.advantages .section-title {
  color: var(--text-light);
}

.advantages .card {
  background: rgba(255,255,255,0.08);
  color: var(--text-light);
  text-align: center;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  border: 1px solid rgba(255,255,255,0.1);
  transition: transform var(--transition), background 0.3s;
}

.advantages .card:hover {
  background: rgba(255,255,255,0.15);
  transform: translateY(-6px);
}

.advantages .card h3 {
  margin-bottom: 10px;
  font-size: 1.2rem;
}

/* Testimonials */
.testimonials .card {
  text-align: center;
}

.testimonials .card p:first-child {
  font-style: italic;
  margin-bottom: 12px;
  font-size: 1.05rem;
}

.testimonials .card p:last-child {
  font-weight: 600;
  color: var(--accent);
}

/* FAQ */
.faq-item {
  border-bottom: 1px solid rgba(0,0,0,0.1);
  padding: 16px 0;
  cursor: pointer;
  transition: background 0.2s;
}

.faq-item:hover {
  background: rgba(233,69,96,0.05);
}

.faq-question {
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1.05rem;
}

.faq-question span {
  font-size: 1.3rem;
  transition: transform 0.3s;
}

.faq-item.active .faq-question span {
  transform: rotate(180deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.3s ease;
  padding-top: 0;
  color: #666;
  line-height: 1.7;
}

.faq-item.active .faq-answer {
  max-height: 300px;
  padding-top: 12px;
}

/* HowTo */
.howto-step {
  margin-bottom: 24px;
  padding: 16px;
  border-left: 3px solid var(--accent);
  background: rgba(233,69,96,0.03);
  border-radius: 0 8px 8px 0;
  transition: transform var(--transition);
}

.howto-step:hover {
  transform: translateX(5px);
}

.howto-step h4 {
  color: var(--accent);
  margin-bottom: 6px;
  font-size: 1.1rem;
}

/* Articles */
#articles .card h3 {
  font-size: 1.1rem;
  margin-bottom: 8px;
  color: var(--primary);
}

#articles .card p {
  margin-bottom: 8px;
}

#articles .card a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s;
}

#articles .card a:hover {
  text-decoration: underline;
}

/* Contact */
.contact-info {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 30px;
  box-shadow: var(--shadow);
}

.contact-info p {
  margin-bottom: 10px;
  line-height: 1.8;
}

.contact-info p:first-child {
  font-size: 1.2rem;
  margin-bottom: 16px;
}

/* Footer */
footer {
  background: var(--footer-bg);
  color: var(--text-light);
  padding: 40px 0 20px;
}

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

footer h4 {
  margin-bottom: 16px;
  font-size: 1.1rem;
  position: relative;
  display: inline-block;
}

footer h4::after {
  content: '';
  display: block;
  width: 30px;
  height: 2px;
  background: var(--accent);
  margin-top: 6px;
}

footer ul {
  list-style: none;
}

footer li {
  margin-bottom: 8px;
}

footer a {
  color: #aaa;
  text-decoration: none;
  transition: color var(--transition), padding-left 0.3s;
}

footer a:hover {
  color: #fff;
  padding-left: 4px;
}

.footer-bottom {
  border-top: 1px solid #333;
  padding-top: 20px;
  text-align: center;
  font-size: 0.85rem;
  color: #888;
}

/* Back to Top */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: var(--accent);
  color: #fff;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s, background 0.3s;
  box-shadow: 0 4px 12px rgba(233,69,96,0.4);
  z-index: 999;
  font-size: 1.2rem;
}

.back-to-top.visible {
  opacity: 1;
}

.back-to-top:hover {
  transform: scale(1.1);
  background: #d63850;
}

.back-to-top:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

/* 响应式 */
@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }
  
  .hero h1 {
    font-size: 2rem;
  }
  
  nav ul {
    gap: 10px;
  }
  
  nav a {
    font-size: 0.85rem;
    padding: 4px 8px;
  }
  
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
  
  .section-title {
    font-size: 1.6rem;
  }
  
  .hero p {
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .header-inner {
    flex-direction: column;
    gap: 10px;
  }
  
  nav ul {
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .footer-grid {
    grid-template-columns: 1fr;
  }
  
  .hero h1 {
    font-size: 1.6rem;
  }
  
  .btn {
    padding: 12px 28px;
    font-size: 0.9rem;
  }
  
  .card {
    padding: 20px;
  }
}

/* 暗色模式下的细节调整 */
@media (prefers-color-scheme: dark) {
  .faq-item {
    border-bottom-color: rgba(255,255,255,0.1);
  }
  
  .faq-answer {
    color: #bbb;
  }
  
  .howto-step {
    background: rgba(233,69,96,0.08);
  }
  
  #articles .card h3 {
    color: var(--text-light);
  }
  
  .contact-info {
    background: var(--card-bg);
  }
  
  .story {
    background: var(--card-bg);
  }
}

/* 打印样式 (可选) */
@media print {
  .back-to-top, nav, .hero::before {
    display: none;
  }
  
  body {
    background: #fff;
    color: #000;
  }
  
  .card {
    box-shadow: none;
    border: 1px solid #ddd;
  }
}