/* ===== 全局布局：页脚固定底部 ===== */
html {
  height: 100%;
}
body {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

/* ===== 全局变量 ===== */
:root {
  --bg: #f5f7fa;
  --text: #333;
  --primary: #f53f3f;
}
[data-theme="dark"] {
  --bg: #121212;
  --text: #e5e5e5;
  --primary: #f53f3f;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  background: var(--bg);
  color: var(--text);
  transition: 0.3s;
}

/* =========================
   页眉
========================= */
.header {
  background: #ffffff !important;
  padding: 20px 0;
  border: none !important;
  box-shadow: none !important;
}
.header-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  background: transparent !important;
  box-shadow: none !important;
  border: none !important;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.logo a {
  font-size: 22px;
  font-weight: bold;
  color: var(--primary);
  text-decoration: none;
}
.nav ul {
  display: flex;
  gap: 28px;
  list-style: none;
}
.nav a {
  color: var(--text);
  font-size: 16px;
  text-decoration: none;
}
.nav a:hover {
  color: var(--primary);
}

/* 主题切换按钮 */
.theme-switch {
  background: transparent !important;
  border: none !important;
  outline: none !important;
  cursor: pointer !important;
  padding: 0 6px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 20px;
  color: var(--text);
  position: relative;
  z-index: 999 !important;
  pointer-events: auto !important;
}
.theme-switch img {
  width: 22px !important;
  height: 22px !important;
  object-fit: contain !important;
  display: block !important;
}

/* =========================
   页脚
========================= */
.footer {
  background: #ffffff !important;
  padding: 50px 0;
  margin-top: auto;
  border: none !important;
  box-shadow: none !important;
}
.footer-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  background: transparent !important;
  box-shadow: none !important;
  border: none !important;
}
.footer-links {
  display: flex;
  justify-content: center;
  gap: 25px;
  margin-bottom: 15px;
}
.footer-links a {
  color: var(--text);
  font-size: 15px;
  text-decoration: none;
}
.footer-links a:hover {
  color: var(--primary);
}
.copyright {
  text-align: center;
  font-size: 14px;
  color: var(--text);
  opacity: 0.9;
  line-height: 1.6;
  white-space: nowrap;
}
.copyright a {
  color: var(--text);
  text-decoration: none;
}
.copyright a:hover {
  color: var(--primary);
}

/* =========================
   手机端
========================= */
@media (max-width: 768px) {
  .header {
    padding: 10px 0;
  }
  .logo a {
    font-size: 16px;
  }
  .nav a {
    font-size: 12px;
  }
  .nav ul {
    gap: 10px;
  }

  .header-wrap {
    padding: 0 15px;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
  }

  .footer {
    padding: 10px 0;
  }
  .footer-links {
    gap: 6px;
    margin-bottom: 5px;
  }
  .footer-links a {
    font-size: 9px;
  }
  .copyright {
    font-size: 9px;
    white-space: normal;
    line-height: 1.5;
  }
  .footer-wrap {
    padding: 0 10px;
  }
}

/* =========================
   深色模式（只保留 1 次，干净无重复）
========================= */
[data-theme="dark"] .header {
  background: #1a1a1a !important;
}
[data-theme="dark"] .footer {
  background: #1a1a1a !important;
}
[data-theme="dark"] .nav a {
  color: #e5e5e5;
}
[data-theme="dark"] .footer-links a {
  color: #e5e5e5;
}
[data-theme="dark"] .copyright {
  color: #e5e5e5;
}
