/* ===== 全局基础样式 ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  background: #f8f9fa;
  color: #222;
  line-height: 1.8;
  transition: background 0.4s, color 0.4s;
}

a {
  color: #1a73e8;
  text-decoration: none;
  transition: color 0.3s;
}

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

ul, ol {
  padding-left: 1.5em;
}

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

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

/* ===== 导航吸顶 ===== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #1a1a2e;
  color: #fff;
  padding: 12px 0;
  box-shadow: 0 2px 20px rgba(0,0,0,0.3);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  background: rgba(26,26,46,0.95);
}

.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.navbar .logo {
  font-size: 1.8rem;
  font-weight: 700;
  color: #e94560;
  letter-spacing: 2px;
  text-shadow: 0 2px 8px rgba(233,69,96,0.3);
}

.navbar .nav-links {
  display: flex;
  gap: 24px;
  list-style: none;
  align-items: center;
}

.navbar .nav-links a {
  color: #ddd;
  font-size: 1rem;
  transition: color 0.3s, transform 0.2s;
  position: relative;
}

.navbar .nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: #e94560;
  transition: width 0.3s;
}

.navbar .nav-links a:hover {
  color: #e94560;
  transform: translateY(-2px);
}

.navbar .nav-links a:hover::after {
  width: 100%;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.8rem;
  cursor: pointer;
  padding: 4px 8px;
  transition: transform 0.2s;
}

.menu-toggle:hover {
  transform: scale(1.1);
}

.dark-toggle {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.3);
  color: #fff;
  padding: 6px 16px;
  border-radius: 30px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.3s, border-color 0.3s;
  backdrop-filter: blur(4px);
}

.dark-toggle:hover {
  background: rgba(233,69,96,0.3);
  border-color: #e94560;
}

@media (max-width: 768px) {
  .navbar .nav-links {
    display: none;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    padding: 16px 0;
    background: rgba(26,26,46,0.98);
    border-radius: 12px;
    margin-top: 8px;
  }
  .navbar .nav-links.open {
    display: flex;
  }
  .menu-toggle {
    display: block;
  }
}

/* ===== 面包屑 ===== */
.breadcrumb {
  background: #fff;
  padding: 12px 0;
  border-bottom: 1px solid #e0e0e0;
  font-size: 0.95rem;
  transition: background 0.3s;
}

.breadcrumb a {
  color: #555;
}

.breadcrumb span {
  color: #999;
}

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

/* ===== 通用标题 ===== */
h1 {
  font-size: 2.6rem;
  color: #1a1a2e;
  margin: 20px 0;
  text-align: center;
  line-height: 1.3;
}

h2 {
  font-size: 2rem;
  color: #1a1a2e;
  margin: 40px 0 20px;
  border-left: 6px solid #e94560;
  padding-left: 16px;
  position: relative;
}

h2::before {
  content: '';
  position: absolute;
  left: -6px;
  top: 0;
  height: 100%;
  width: 6px;
  background: linear-gradient(180deg, #e94560, #ff6b81);
  border-radius: 4px;
}

h3 {
  font-size: 1.5rem;
  color: #333;
  margin: 30px 0 15px;
}

h4 {
  font-size: 1.2rem;
  color: #555;
  margin: 20px 0 10px;
}

p {
  margin-bottom: 16px;
}

/* ===== 首屏Banner (渐变) ===== */
.hero {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  color: #fff;
  padding: 80px 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

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

@keyframes heroGlow {
  0% { transform: translate(0, 0); }
  100% { transform: translate(30px, 30px); }
}

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

.hero h1 {
  color: #fff;
  margin: 0 0 16px;
  font-size: 3rem;
  text-shadow: 0 4px 20px rgba(0,0,0,0.3);
  background: linear-gradient(90deg, #fff, #e94560, #fff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.2rem;
  max-width: 800px;
  margin: 0 auto 24px;
  opacity: 0.9;
  text-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.hero .highlight {
  color: #e94560;
  font-weight: 600;
}

.hero .tags span {
  display: inline-block;
  padding: 6px 20px;
  border-radius: 30px;
  font-weight: 600;
  margin: 4px;
  backdrop-filter: blur(4px);
  transition: transform 0.3s, box-shadow 0.3s;
}

.hero .tags span:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

/* ===== 通用模块 ===== */
.section {
  background: #fff;
  padding: 40px 0;
  margin-bottom: 20px;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.04);
  transition: background 0.4s, box-shadow 0.4s;
}

.section-alt {
  background: #f1f3f5;
  padding: 40px 0;
  margin-bottom: 20px;
  border-radius: 16px;
  transition: background 0.4s;
}

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

.grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 24px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

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

/* ===== 卡片 ===== */
.card {
  background: #fafafa;
  padding: 28px 24px;
  border-radius: 16px;
  border: 1px solid #eaeaea;
  transition: transform 0.3s, box-shadow 0.3s, background 0.3s;
  backdrop-filter: blur(4px);
  background: rgba(255,255,255,0.9);
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 32px rgba(0,0,0,0.08);
  border-color: #e94560;
}

.card h3 {
  margin-top: 0;
}

.card svg {
  display: block;
  margin: 0 auto 12px;
  transition: transform 0.3s;
}

.card:hover svg {
  transform: scale(1.1);
}

/* ===== 文章列表 ===== */
.article-item {
  padding: 16px 0;
  border-bottom: 1px solid #eee;
  transition: background 0.3s, padding-left 0.3s;
  border-radius: 8px;
  padding-left: 8px;
}

.article-item:last-child {
  border-bottom: none;
}

.article-item:hover {
  background: rgba(233,69,96,0.04);
  padding-left: 16px;
}

.article-item .title {
  font-size: 1.2rem;
  font-weight: 600;
  color: #1a1a2e;
}

.article-item .meta {
  color: #888;
  font-size: 0.9rem;
}

.article-item .summary {
  color: #555;
  margin: 6px 0;
}

.read-more {
  color: #e94560;
  font-weight: 500;
  transition: letter-spacing 0.3s;
}

.read-more:hover {
  letter-spacing: 1px;
}

/* ===== FAQ ===== */
.faq-item {
  margin-bottom: 16px;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  overflow: hidden;
  transition: box-shadow 0.3s;
}

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

.faq-question {
  background: #f7f7f7;
  padding: 16px 20px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.3s;
}

.faq-question:hover {
  background: #eee;
}

.faq-question::after {
  content: "+";
  font-size: 1.4rem;
  transition: transform 0.3s;
  color: #e94560;
}

.faq-item.open .faq-question::after {
  content: "−";
  transform: rotate(180deg);
}

.faq-answer {
  padding: 0 20px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s ease, padding 0.3s;
  background: #fff;
}

.faq-item.open .faq-answer {
  max-height: 600px;
  padding: 16px 20px;
}

/* ===== 返回顶部 ===== */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: #e94560;
  color: #fff;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(233,69,96,0.3);
  opacity: 0;
  transition: opacity 0.4s, transform 0.3s, background 0.3s;
  border: none;
  z-index: 999;
}

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

.back-to-top:hover {
  background: #d63851;
  transform: translateY(-4px) scale(1.05);
}

/* ===== 暗黑模式 ===== */
body.dark-mode {
  background: #121212;
  color: #e0e0e0;
}

body.dark-mode .navbar {
  background: rgba(13,13,26,0.95);
}

body.dark-mode .section {
  background: #1e1e2e;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

body.dark-mode .section-alt {
  background: #1a1a2a;
}

body.dark-mode .card {
  background: #2a2a3e;
  border-color: #3a3a5e;
}

body.dark-mode .card:hover {
  border-color: #e94560;
}

body.dark-mode .breadcrumb {
  background: #1a1a2a;
  border-bottom-color: #333;
}

body.dark-mode .breadcrumb a {
  color: #aaa;
}

body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode h4 {
  color: #eee;
}

body.dark-mode .article-item {
  border-bottom-color: #333;
}

body.dark-mode .article-item:hover {
  background: rgba(233,69,96,0.08);
}

body.dark-mode .faq-item {
  border-color: #333;
}

body.dark-mode .faq-question {
  background: #2a2a3e;
  color: #ddd;
}

body.dark-mode .faq-question:hover {
  background: #333;
}

body.dark-mode .faq-answer {
  background: #1e1e2e;
}

body.dark-mode .back-to-top {
  box-shadow: 0 4px 16px rgba(233,69,96,0.4);
}

/* ===== 搜索框 ===== */
.search-box {
  display: flex;
  gap: 8px;
  margin: 20px 0;
}

.search-box input {
  flex: 1;
  padding: 12px 20px;
  border: 1px solid #ccc;
  border-radius: 30px;
  font-size: 1rem;
  transition: border-color 0.3s, box-shadow 0.3s;
  outline: none;
}

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

.search-box button {
  padding: 12px 28px;
  background: #e94560;
  color: #fff;
  border: none;
  border-radius: 30px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  transition: background 0.3s, transform 0.2s;
}

.search-box button:hover {
  background: #d63851;
  transform: scale(1.02);
}

/* ===== 页脚 ===== */
.footer {
  background: #1a1a2e;
  color: #ccc;
  padding: 40px 0;
  margin-top: 40px;
}

.footer .container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
}

@media (max-width: 768px) {
  .footer .container {
    grid-template-columns: 1fr 1fr;
  }
}

.footer h4 {
  color: #fff;
  margin-bottom: 12px;
  font-size: 1.1rem;
}

.footer a {
  color: #aaa;
  display: block;
  margin-bottom: 6px;
  transition: color 0.3s, padding-left 0.3s;
}

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

.footer .copyright {
  grid-column: 1 / -1;
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid #333;
  margin-top: 20px;
  font-size: 0.9rem;
  color: #888;
}

/* ===== 数字动画 ===== */
.stat-number {
  font-size: 2rem;
  font-weight: 700;
  color: #e94560;
  display: inline-block;
}

/* ===== 滚动动画 (淡入) ===== */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== 响应式微调 ===== */
@media (max-width: 480px) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.5rem; }
  .hero { padding: 50px 0; }
  .hero h1 { font-size: 2.2rem; }
  .navbar .logo { font-size: 1.4rem; }
  .card { padding: 20px; }
  .search-box { flex-direction: column; }
  .search-box button { width: 100%; }
}

/* ===== 毛玻璃效果通用 ===== */
.glass {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
}

body.dark-mode .glass {
  background: rgba(0, 0, 0, 0.2);
  border-color: rgba(255, 255, 255, 0.1);
}

/* ===== 列表样式增强 ===== */
ul li, ol li {
  margin-bottom: 8px;
}

/* ===== 按钮通用 ===== */
button {
  font-family: inherit;
}

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

/* ===== 平滑过渡 ===== */
* {
  transition-property: background-color, color, border-color, box-shadow, transform, opacity;
  transition-duration: 0.3s;
  transition-timing-function: ease;
}