/* ============================================================
 * 工具箱页头页尾样式（抽取自主站 style.css，作用域隔离版 v1）
 * 规则仅在 .site-header / .site-footer 内生效，不污染 Tailwind
 * ============================================================ */
.site-header,
.site-footer {
  --primary: #6C5CE7;
  --primary-light: #A29BFE;
  --primary-dark: #4834D4;
  --accent: #00D2FF;
  --accent2: #7F5AF0;
  --bg-dark: #0A0E27;
  --bg-darker: #060918;
  --bg-card: rgba(255, 255, 255, 0.03);
  --bg-card-hover: rgba(255, 255, 255, 0.06);
  --text-primary: #FFFFFF;
  --text-secondary: rgba(255, 255, 255, 0.7);
  --text-muted: rgba(255, 255, 255, 0.4);
  --border-color: rgba(255, 255, 255, 0.08);
  --gradient-1: linear-gradient(135deg, #6C5CE7, #00D2FF);
  --gradient-2: linear-gradient(135deg, #7F5AF0, #2CB67D);
  --gradient-3: linear-gradient(135deg, #E040FB, #6C5CE7);
  --shadow-glow: 0 0 40px rgba(108, 92, 231, 0.15);
  --radius: 16px;
  --radius-sm: 8px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --max-width: 1200px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
}
.site-header *, .site-header *::before, .site-header *::after,
.site-footer *, .site-footer *::before, .site-footer *::after { box-sizing: border-box; }
.site-header a, .site-footer a { text-decoration: none; color: inherit; transition: var(--transition); }
.site-header ul, .site-footer ul, .site-header ol, .site-footer ol { list-style: none; margin: 0; padding: 0; }
.site-header img, .site-footer img { max-width: 100%; display: block; }
.site-header h1, .site-header h2, .site-header h3, .site-header h4, .site-header h5, .site-header h6,
.site-footer h1, .site-footer h2, .site-footer h3, .site-footer h4, .site-footer h5, .site-footer h6 {
  font-weight: 700; line-height: 1.2; margin: 0;
}
.site-header p, .site-footer p { margin: 0; }
.site-header .container, .site-footer .container {
  max-width: var(--max-width); margin: 0 auto; padding: 0 24px;
}

/* ========== 按钮（仅作用域内） ========== */
.site-header .btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 32px; border-radius: 50px; font-size: 1rem;
  font-weight: 600; cursor: pointer; border: none;
  transition: var(--transition); text-align: center; justify-content: center;
}
.site-header .btn-primary {
  background: var(--gradient-1); color: #fff;
  box-shadow: 0 4px 20px rgba(108, 92, 231, 0.4);
}
.site-header .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(108, 92, 231, 0.6);
}
.site-header .btn-sm { padding: 10px 24px; font-size: 0.9rem; }

/* ========== 页头 ========== */
.site-header .header {
  position: fixed; top: 0; left: 0; width: 100%; z-index: 1000;
  padding: 20px 0; border-bottom: 1px solid transparent;
  transition: var(--transition);
}
.site-header .header.scrolled {
  padding: 12px 0; background: rgba(10, 14, 39, 0.85);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}
.site-header .header .container {
  display: flex; align-items: center; justify-content: space-between;
}
.site-header .logo,
.site-footer .logo {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 1.5rem; font-weight: 800; letter-spacing: -0.5px;
}
.site-header .logo img,
.site-footer .logo img {
  height: 36px; width: auto; max-width: none;
}
.site-header .nav-menu { display: flex; align-items: center; gap: 36px; }
.site-header .nav-menu a {
  font-size: 0.95rem; font-weight: 500; color: var(--text-secondary);
  position: relative; padding: 4px 0;
}
.site-header .nav-menu a::after {
  content: ''; position: absolute; bottom: -2px; left: 0;
  width: 0; height: 2px; background: var(--gradient-1);
  border-radius: 2px; transition: var(--transition);
}
.site-header .nav-menu a:hover, .site-header .nav-menu a.active { color: var(--text-primary); }
.site-header .nav-menu a:hover::after, .site-header .nav-menu a.active::after { width: 100%; }
.site-header .nav-item { position: relative; display: flex; align-items: center; }
.site-header .sub-toggle {
  display: none; align-items: center; justify-content: center;
  width: 32px; height: 32px; padding: 0; margin-left: 4px;
  background: transparent; border: none; color: var(--text-secondary);
  font-size: 0.7rem; cursor: pointer; transition: var(--transition);
}
.site-header .sub-toggle:hover { color: var(--text-primary); }
.site-header .sub-toggle i { transition: transform 0.3s ease; }
.site-header .sub-menu {
  position: absolute; top: calc(100% + 10px); left: 50%;
  transform: translateX(-50%) translateY(8px);
  min-width: 210px; margin: 0; padding: 8px; list-style: none;
  background: rgba(6, 9, 24, 0.98);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-color); border-radius: var(--radius-sm);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
  z-index: 1001;
}
.site-header .sub-menu::before {
  content: ''; position: absolute; top: -10px; left: 0; width: 100%; height: 10px;
}
.site-header .sub-menu li a {
  display: block; width: 100%; padding: 10px 14px; font-size: 0.9rem;
  font-weight: 400; color: var(--text-secondary);
  border-bottom: none; border-radius: 6px; white-space: nowrap;
}
.site-header .sub-menu li a::after { display: none; }
.site-header .sub-menu li a:hover {
  color: var(--text-primary); background: rgba(108, 92, 231, 0.18);
}
.site-header .nav-item.has-child:hover .sub-menu,
.site-header .nav-item.has-child:focus-within .sub-menu {
  opacity: 1; visibility: visible; pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
.site-header .nav-actions { display: flex; align-items: center; gap: 16px; }
.site-header .menu-toggle {
  display: none; flex-direction: column; gap: 5px; cursor: pointer;
  padding: 4px; background: none; border: none;
}
.site-header .menu-toggle span {
  display: block; width: 24px; height: 2px; background: var(--text-primary);
  border-radius: 2px; transition: var(--transition);
}
.site-header .menu-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.site-header .menu-toggle.active span:nth-child(2) { opacity: 0; }
.site-header .menu-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }
.site-header .nav-overlay {
  display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.6); z-index: 998;
  opacity: 0; transition: opacity 0.3s ease;
}
.site-header .nav-overlay.active { display: block; opacity: 1; }
.site-header .nav-close {
  display: none; position: absolute; top: 24px; right: 24px;
  width: 40px; height: 40px; border: 1px solid var(--border-color);
  border-radius: 50%; background: transparent; color: var(--text-secondary);
  font-size: 1.1rem; cursor: pointer; align-items: center; justify-content: center;
  transition: var(--transition); z-index: 10;
}
.site-header .nav-close:hover {
  border-color: var(--primary); color: var(--text-primary);
  background: rgba(108, 92, 231, 0.15);
}
body.menu-open { overflow: hidden; }

/* ========== 页尾 ========== */
.site-footer .footer {
  background: var(--bg-darker); padding: 80px 0 0; position: relative;
}
.site-footer .footer::before {
  content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-color), transparent);
}
.site-footer .footer-grid {
  display: grid; grid-template-columns: 1.6fr 1fr 1fr;
  gap: 48px; padding-bottom: 60px;
}
.site-footer .footer-brand p {
  color: var(--text-secondary); font-size: 0.95rem;
  margin-top: 16px; line-height: 1.7; max-width: 300px;
}
.site-footer .footer-col h4 {
  font-size: 1rem; font-weight: 700; margin-bottom: 24px; color: var(--text-primary);
}
.site-footer .footer-links { display: flex; flex-direction: column; gap: 12px; }
.site-footer .footer-links a {
  color: var(--text-secondary); font-size: 0.9rem; transition: var(--transition);
}
.site-footer .footer-links a:hover { color: var(--accent); padding-left: 4px; }
.site-footer .footer-social { display: flex; gap: 12px; margin-top: 24px; }
.site-footer .footer-social a {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border-color);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary); font-size: 1rem; transition: var(--transition);
}
.site-footer .footer-social a:hover {
  border-color: var(--primary); background: rgba(108, 92, 231, 0.15);
  color: var(--primary-light); transform: translateY(-2px);
}
.site-footer .footer-social .wechat-wrap { position: relative; }
.site-footer .footer-social .wechat-qr {
  position: absolute; bottom: calc(100% + 12px); left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: #fff; border-radius: 12px; padding: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  opacity: 0; visibility: hidden; transition: all 0.3s ease;
  z-index: 10; pointer-events: none; width: 164px; min-width: 164px;
}
.site-footer .footer-social .wechat-qr::after {
  content: ''; position: absolute; bottom: -6px; left: 50%;
  transform: translateX(-50%) rotate(45deg); width: 12px; height: 12px; background: #fff;
}
.site-footer .footer-social .wechat-qr img {
  width: 140px; height: 140px; display: block; border-radius: 6px;
}
.site-footer .footer-social .wechat-qr p {
  text-align: center; font-size: 0.75rem; color: #666;
  margin-top: 8px; max-width: none; line-height: 1.4;
}
.site-footer .footer-social .wechat-wrap:hover .wechat-qr {
  opacity: 1; visibility: visible;
  transform: translateX(-50%) translateY(0); pointer-events: auto;
}
.site-footer .icon-xiaohongshu {
  width: 1em; height: 1em; fill: currentColor; vertical-align: -0.125em;
}
.site-footer .footer-contact { display: flex; flex-direction: column; gap: 12px; }
.site-footer .footer-contact li {
  display: flex; align-items: flex-start; gap: 10px;
  color: var(--text-secondary); font-size: 0.9rem;
}
.site-footer .footer-contact li i { color: var(--accent); margin-top: 4px; }
.site-footer .footer-contact li span {
  min-width: 0; overflow-wrap: anywhere; word-break: break-word;
}
.site-footer .footer-bottom {
  border-top: 1px solid var(--border-color); padding: 24px 0;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 16px;
}
.site-footer .footer-bottom p { color: var(--text-muted); font-size: 0.85rem; }
.site-footer .footer-bottom-links { display: flex; gap: 24px; flex-wrap: wrap; }
.site-footer .footer-bottom-links a { color: var(--text-muted); font-size: 0.85rem; }
.site-footer .footer-bottom-links a:hover { color: var(--accent); }

/* ========== 移动端 ≤768px ========== */
@media (max-width: 768px) {
  .site-header .container, .site-footer .container { padding: 0 16px; }
  .site-header .menu-toggle { display: flex; }
  .site-header .nav-close { display: flex; }
  .site-header .nav-menu {
    position: fixed; top: 0; right: -100%; width: 280px; height: 100vh;
    background: rgba(6, 9, 24, 0.98);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    flex-direction: column; align-items: flex-start; justify-content: flex-start;
    padding: 80px 32px 40px; gap: 0;
    transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999; border-left: 1px solid var(--border-color); overflow-y: auto;
  }
  .site-header .nav-menu.active { right: 0; }
  .site-header .nav-menu a {
    font-size: 1.1rem; padding: 14px 0; width: 100%;
    border-bottom: 1px solid var(--border-color);
  }
  .site-header .nav-actions .btn {
    padding: 8px 14px; font-size: 0.85rem; white-space: nowrap;
  }
  .site-header .nav-item { flex-wrap: wrap; width: 100%; }
  .site-header .nav-item > a { flex: 1; }
  .site-header .sub-toggle {
    display: flex; flex: 0 0 auto; align-self: stretch;
    width: 44px; height: auto; margin-left: 0; color: var(--text-secondary);
  }
  .site-header .sub-menu {
    position: static; flex: 0 0 100%; min-width: 0; width: 100%;
    padding: 0; background: var(--bg-card); border: none; border-radius: 0;
    box-shadow: none; opacity: 1; visibility: visible; pointer-events: auto;
    transform: none; transition: none; display: none;
  }
  .site-header .sub-menu::before { display: none; }
  .site-header .nav-item.open .sub-menu { display: block; }
  .site-header .nav-item.open .sub-toggle i { transform: rotate(180deg); }
  .site-header .sub-menu li a {
    padding: 12px 0 12px 18px; font-size: 1rem; white-space: normal;
    border-bottom: 1px solid var(--border-color); border-radius: 0;
  }
  .site-footer .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .site-footer .footer-bottom { flex-direction: column; text-align: center; }
  .site-footer .footer-bottom-links { justify-content: center; }
}

/* ========== 小屏 ≤480px ========== */
@media (max-width: 480px) {
  .site-header .container, .site-footer .container { padding: 0 12px; }
  .site-header .btn-sm { padding: 8px 18px; font-size: 0.85rem; width: auto; }
  .site-footer .footer { padding: 50px 0 0; }
  .site-footer .footer-grid { gap: 24px; }
  .site-header .nav-menu { width: 100%; right: -100%; }
  .site-header .nav-menu.active { right: 0; }
}

/* ========== 全局背景与主站统一（v3） ==========
 * 主站 body 背景为 var(--bg-dark)=#0A0E27（固定暗色单主题，无渐变背景层）。
 * 工具箱 Tailwind 的 .bg-ink-900 为 #0A0A0F，偏中性黑，与此处不一致。
 * 用 body.bg-ink-900（特异性 0,1,1）覆盖 Tailwind 类 .bg-ink-900（0,1,0），
 * 不依赖加载顺序、无需 !important。仅覆盖背景色，不影响文字/布局与作用域。
 */
body.bg-ink-900 {
  background-color: #0A0E27;
}
