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

html {
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: #f4f4f9;
  color: #222;
  line-height: 1.7;
  transition: background 0.3s, color 0.3s;
  overflow-x: hidden;
}

body.dark {
  background: #121212;
  color: #e0e0e0;
}

a {
  color: #004d99;
  text-decoration: none;
  transition: color 0.2s;
}

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

body.dark a {
  color: #80bfff;
}

body.dark a:hover {
  color: #ff6b81;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ===== 滚动条美化 ===== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

body.dark ::-webkit-scrollbar-track {
  background: #2a2a3d;
}

::-webkit-scrollbar-thumb {
  background: #e94560;
  border-radius: 4px;
  transition: background 0.3s;
}

::-webkit-scrollbar-thumb:hover {
  background: #c73e54;
}

/* ===== Header / 导航 ===== */
.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  color: #fff;
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: background 0.3s, box-shadow 0.3s;
}

body.dark .header {
  background: linear-gradient(135deg, #0d0d1a 0%, #1a1a2e 100%);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
}

.header .logo {
  font-size: 1.6rem;
  font-weight: 800;
  color: #e94560;
  letter-spacing: 1px;
  text-shadow: 0 2px 8px rgba(233, 69, 96, 0.3);
  cursor: default;
  transition: transform 0.3s;
}

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

.header nav {
  display: flex;
  gap: 18px;
  align-items: center;
  flex-wrap: wrap;
}

.header nav a {
  color: #fff;
  font-size: 0.95rem;
  padding: 6px 10px;
  border-radius: 6px;
  transition: background 0.3s, color 0.3s, transform 0.2s;
  position: relative;
}

.header nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 60%;
  height: 2px;
  background: #e94560;
  transition: transform 0.3s ease;
}

.header nav a:hover {
  background: rgba(233, 69, 96, 0.15);
  color: #e94560;
  transform: translateY(-2px);
  text-decoration: none;
}

.header nav a:hover::after {
  transform: translateX(-50%) scaleX(1);
}

body.dark .header nav a {
  color: #e0e0e0;
}

body.dark .header nav a:hover {
  color: #e94560;
  background: rgba(233, 69, 96, 0.2);
}

.nav-toggle {
  display: none;
  background: none;
  border: 2px solid #e94560;
  color: #e94560;
  font-size: 1.4rem;
  padding: 6px 14px;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.3s, color 0.3s, transform 0.2s;
}

.nav-toggle:hover {
  background: #e94560;
  color: #fff;
  transform: scale(1.05);
}

.dark-toggle {
  background: none;
  border: 2px solid #e94560;
  color: #e94560;
  padding: 6px 18px;
  border-radius: 30px;
  cursor: pointer;
  font-size: 0.9rem;
  margin-left: 10px;
  transition: background 0.3s, color 0.3s, box-shadow 0.3s, transform 0.2s;
  white-space: nowrap;
}

.dark-toggle:hover {
  background: #e94560;
  color: #fff;
  box-shadow: 0 4px 15px rgba(233, 69, 96, 0.4);
  transform: scale(1.05);
}

/* ===== 响应式导航 ===== */
@media (max-width: 768px) {
  .header {
    padding: 10px 16px;
  }

  .header .logo {
    font-size: 1.3rem;
  }

  .nav-toggle {
    display: block;
  }

  .header nav {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    right: 16px;
    left: 16px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    padding: 18px;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    gap: 10px;
    z-index: 999;
    max-height: 70vh;
    overflow-y: auto;
    animation: slideDown 0.3s ease;
  }

  body.dark .header nav {
    background: linear-gradient(135deg, #0d0d1a 0%, #1a1a2e 100%);
  }

  .header nav.open {
    display: flex;
  }

  .header nav a {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .header nav a:last-child {
    border-bottom: none;
  }

  .dark-toggle {
    margin-left: 0;
    margin-top: 6px;
    width: 100%;
    text-align: center;
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== 面包屑 ===== */
.breadcrumb {
  background: linear-gradient(90deg, #eee 0%, #f8f8f8 100%);
  padding: 12px 24px;
  font-size: 0.9rem;
  color: #555;
  border-bottom: 1px solid #ddd;
}

body.dark .breadcrumb {
  background: linear-gradient(90deg, #2a2a3d 0%, #1e1e2f 100%);
  color: #aaa;
  border-bottom-color: #333;
}

.breadcrumb a {
  color: #004d99;
  font-weight: 500;
}

body.dark .breadcrumb a {
  color: #80bfff;
}

.breadcrumb a:hover {
  color: #e94560;
}

.breadcrumb span {
  color: #888;
}

body.dark .breadcrumb span {
  color: #ccc;
}

/* ===== Hero 区域 ===== */
.hero {
  background: linear-gradient(135deg, #0f3460 0%, #1a1a2e 50%, #16213e 100%);
  color: #fff;
  text-align: center;
  padding: 100px 24px 80px;
  position: relative;
  overflow: hidden;
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 40%, rgba(233, 69, 96, 0.08) 0%, transparent 60%),
              radial-gradient(circle at 70% 60%, rgba(15, 52, 96, 0.1) 0%, transparent 50%);
  animation: heroGlow 8s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes heroGlow {
  0% {
    transform: translate(0, 0) scale(1);
  }
  100% {
    transform: translate(5%, 5%) scale(1.1);
  }
}

.hero h1 {
  font-size: clamp(1.8rem, 5vw, 3.2rem);
  margin-bottom: 18px;
  color: #e94560;
  text-shadow: 0 4px 20px rgba(233, 69, 96, 0.3);
  position: relative;
  z-index: 1;
  animation: fadeInUp 0.8s ease;
}

.hero p {
  font-size: clamp(1rem, 2.5vw, 1.35rem);
  max-width: 720px;
  margin: 0 auto 32px;
  opacity: 0.9;
  line-height: 1.8;
  position: relative;
  z-index: 1;
  animation: fadeInUp 0.8s ease 0.15s both;
}

.hero .cta {
  background: linear-gradient(135deg, #e94560 0%, #c73e54 100%);
  color: #fff;
  padding: 14px 36px;
  border: none;
  border-radius: 50px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  z-index: 1;
  box-shadow: 0 6px 25px rgba(233, 69, 96, 0.35);
  animation: fadeInUp 0.8s ease 0.3s both;
  letter-spacing: 0.5px;
}

.hero .cta:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 10px 35px rgba(233, 69, 96, 0.5);
  background: linear-gradient(135deg, #ff5a7a 0%, #d94a60 100%);
}

.hero .cta:active {
  transform: translateY(0) scale(0.98);
}

/* ===== 轮播 ===== */
.carousel {
  display: flex;
  gap: 24px;
  justify-content: center;
  margin-top: 50px;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1000px;
}

.carousel-item {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 24px 20px;
  border-radius: 16px;
  width: 280px;
  text-align: left;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: transform 0.4s ease, box-shadow 0.4s ease, background 0.3s;
  animation: fadeInUp 0.8s ease 0.5s both;
}

.carousel-item:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(233, 69, 96, 0.3);
}

.carousel-item h3 {
  color: #e94560;
  margin-bottom: 10px;
  font-size: 1.15rem;
  font-weight: 700;
}

.carousel-item p {
  font-size: 0.95rem;
  opacity: 0.85;
  line-height: 1.6;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== 容器 & 通用布局 ===== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 24px;
}

.section-title {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  margin: 50px 0 28px;
  border-left: 5px solid #e94560;
  padding-left: 18px;
  color: #1a1a2e;
  font-weight: 700;
  transition: color 0.3s;
}

body.dark .section-title {
  color: #e0e0e0;
}

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

@media (max-width: 768px) {
  .grid-2 {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

/* ===== 卡片 ===== */
.card {
  background: #fff;
  border-radius: 16px;
  padding: 28px 24px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  transition: transform 0.4s ease, box-shadow 0.4s ease, background 0.3s;
  border: 1px solid rgba(0, 0, 0, 0.04);
  position: relative;
  overflow: hidden;
}

body.dark .card {
  background: #1e1e2f;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  border-color: rgba(255, 255, 255, 0.05);
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #e94560, #0f3460);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s ease;
}

.card:hover::before {
  transform: scaleX(1);
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.12);
}

body.dark .card:hover {
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.5);
}

.card h3 {
  font-size: 1.2rem;
  margin-bottom: 12px;
  color: #1a1a2e;
  font-weight: 700;
}

body.dark .card h3 {
  color: #e0e0e0;
}

.card p {
  font-size: 0.95rem;
  color: #555;
  line-height: 1.7;
}

body.dark .card p {
  color: #aaa;
}

/* ===== 文章列表 ===== */
.article-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
  margin-top: 24px;
}

.article-item {
  background: #fff;
  border-radius: 12px;
  padding: 20px 22px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s;
  border: 1px solid rgba(0, 0, 0, 0.04);
}

body.dark .article-item {
  background: #1e1e2f;
  border-color: rgba(255, 255, 255, 0.05);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

.article-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

body.dark .article-item:hover {
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.article-item h3 {
  font-size: 1.15rem;
  margin-bottom: 6px;
  color: #1a1a2e;
  font-weight: 700;
  transition: color 0.2s;
}

body.dark .article-item h3 {
  color: #e0e0e0;
}

.article-item h3:hover {
  color: #e94560;
}

.article-item .date {
  color: #888;
  font-size: 0.85rem;
  margin-bottom: 4px;
}

body.dark .article-item .date {
  color: #999;
}

.article-item .summary {
  color: #555;
  margin: 8px 0 12px;
  font-size: 0.92rem;
  line-height: 1.6;
}

body.dark .article-item .summary {
  color: #aaa;
}

.article-item a {
  color: #e94560;
  font-weight: 600;
  font-size: 0.9rem;
  transition: color 0.2s;
}

.article-item a:hover {
  color: #c73e54;
  text-decoration: underline;
}

/* ===== FAQ ===== */
.faq-item {
  background: #fff;
  border-radius: 12px;
  padding: 18px 22px;
  margin-bottom: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
  transition: background 0.3s, box-shadow 0.3s;
  border: 1px solid rgba(0, 0, 0, 0.04);
  cursor: pointer;
}

body.dark .faq-item {
  background: #1e1e2f;
  border-color: rgba(255, 255, 255, 0.05);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.faq-item:hover {
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
}

body.dark .faq-item:hover {
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.3);
}

.faq-question {
  font-weight: 700;
  font-size: 1.05rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #1a1a2e;
  transition: color 0.2s;
}

body.dark .faq-question {
  color: #e0e0e0;
}

.faq-question span {
  font-size: 1.4rem;
  color: #e94560;
  transition: transform 0.3s;
  flex-shrink: 0;
  margin-left: 12px;
}

.faq-item:hover .faq-question span {
  transform: rotate(90deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s ease, padding 0.3s ease;
  padding-top: 0;
  color: #555;
  font-size: 0.95rem;
  line-height: 1.7;
}

body.dark .faq-answer {
  color: #aaa;
}

.faq-answer.open {
  max-height: 600px;
  padding-top: 14px;
}

/* ===== HowTo 步骤 ===== */
.howto-step {
  background: linear-gradient(135deg, #f9f9f9 0%, #f0f0f5 100%);
  border-left: 4px solid #e94560;
  padding: 18px 22px;
  margin: 16px 0;
  border-radius: 0 12px 12px 0;
  transition: transform 0.3s, box-shadow 0.3s, background 0.3s;
}

body.dark .howto-step {
  background: linear-gradient(135deg, #2a2a3d 0%, #222235 100%);
}

.howto-step:hover {
  transform: translateX(6px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
}

body.dark .howto-step:hover {
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.howto-step h4 {
  font-size: 1.05rem;
  color: #e94560;
  margin-bottom: 8px;
  font-weight: 700;
}

.howto-step p {
  color: #555;
  font-size: 0.95rem;
  line-height: 1.7;
}

body.dark .howto-step p {
  color: #aaa;
}

/* ===== Footer ===== */
.footer {
  background: linear-gradient(135deg, #1a1a2e 0%, #0d0d1a 100%);
  color: #ccc;
  padding: 50px 24px 30px;
  margin-top: 60px;
  font-size: 0.9rem;
}

.footer a {
  color: #80bfff;
  transition: color 0.2s;
}

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

.footer .links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  margin-bottom: 24px;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.footer .links a {
  padding: 4px 8px;
  font-size: 0.9rem;
}

.footer .copyright {
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 24px;
  margin-top: 24px;
  color: #999;
}

.footer .copyright p {
  margin: 4px 0;
}

/* ===== 返回顶部 ===== */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: linear-gradient(135deg, #e94560 0%, #c73e54 100%);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 52px;
  height: 52px;
  font-size: 1.6rem;
  cursor: pointer;
  display: none;
  z-index: 999;
  box-shadow: 0 6px 25px rgba(233, 69, 96, 0.35);
  transition: all 0.3s ease;
  line-height: 52px;
  text-align: center;
}

.back-to-top.show {
  display: block;
  animation: fadeInUp 0.4s ease;
}

.back-to-top:hover {
  transform: translateY(-4px) scale(1.08);
  box-shadow: 0 10px 35px rgba(233, 69, 96, 0.5);
}

.back-to-top:active {
  transform: translateY(0) scale(0.95);
}

/* ===== 搜索框 ===== */
.search-box {
  display: flex;
  gap: 10px;
  margin: 24px 0;
  justify-content: center;
}

.search-box input {
  flex: 1;
  max-width: 420px;
  padding: 12px 20px;
  border: 2px solid #ddd;
  border-radius: 50px;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.3s, box-shadow 0.3s, background 0.3s;
  background: #fff;
}

body.dark .search-box input {
  background: #2a2a3d;
  border-color: #555;
  color: #e0e0e0;
}

.search-box input:focus {
  border-color: #e94560;
  box-shadow: 0 0 0 3px rgba(233, 69, 96, 0.15);
}

body.dark .search-box input:focus {
  border-color: #e94560;
  box-shadow: 0 0 0 3px rgba(233, 69, 96, 0.2);
}

.search-box button {
  background: linear-gradient(135deg, #e94560 0%, #c73e54 100%);
  color: #fff;
  border: none;
  padding: 12px 30px;
  border-radius: 50px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(233, 69, 96, 0.25);
}

.search-box button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(233, 69, 96, 0.4);
}

/* ===== 滚动动画 ===== */
.scroll-animate {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

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

/* ===== SVG 图标占位 ===== */
.svg-icon {
  width: 60px;
  height: 60px;
  margin-bottom: 15px;
  fill: none;
  stroke: #e94560;
  stroke-width: 2;
}

/* ===== 响应式微调 ===== */
@media (max-width: 480px) {
  .hero {
    padding: 60px 16px 50px;
    min-height: 50vh;
  }

  .carousel-item {
    width: 100%;
    max-width: 320px;
  }

  .container {
    padding: 12px 16px;
  }

  .card {
    padding: 20px 16px;
  }

  .article-list {
    grid-template-columns: 1fr;
  }

  .back-to-top {
    bottom: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    font-size: 1.3rem;
    line-height: 44px;
  }

  .search-box {
    flex-direction: column;
    align-items: center;
  }

  .search-box input {
    max-width: 100%;
    width: 100%;
  }

  .search-box button {
    width: 100%;
  }
}

/* ===== 打印样式 ===== */
@media print {
  .header,
  .footer,
  .back-to-top,
  .nav-toggle,
  .dark-toggle,
  .search-box {
    display: none !important;
  }

  .hero {
    padding: 40px 20px;
    background: #fff !important;
    color: #222 !important;
    min-height: auto;
  }

  .hero h1 {
    color: #e94560 !important;
  }

  .card,
  .article-item,
  .faq-item {
    box-shadow: none !important;
    border: 1px solid #ddd !important;
    break-inside: avoid;
  }

  body {
    background: #fff !important;
    color: #222 !important;
  }

  .scroll-animate {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ===== 暗黑模式额外优化 ===== */
body.dark .hero::before {
  opacity: 0.3;
}

body.dark .carousel-item {
  border-color: rgba(255, 255, 255, 0.08);
}

body.dark .carousel-item:hover {
  border-color: rgba(233, 69, 96, 0.3);
}

/* ===== 选中文字颜色 ===== */
::selection {
  background: #e94560;
  color: #fff;
}

body.dark ::selection {
  background: #e94560;
  color: #fff;
}

/* ===== 焦点样式 ===== */
:focus-visible {
  outline: 2px solid #e94560;
  outline-offset: 2px;
}

/* ===== 动画减速偏好 ===== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .scroll-animate {
    opacity: 1 !important;
    transform: none !important;
  }
}