/* ====================================================
 * Clash Client Hub — 公共样式表
 * 所有页面共享的基础样式与组件
 * ==================================================== */

/* --- 基础 --- */
html, body {
  background-color: #fafafa;
  overflow-x: hidden !important;
  width: 100vw;
  position: relative;
  -webkit-text-size-adjust: 100%;
}

/* 强制文字换行保护 */
p, span, code, div {
  word-wrap: break-word;
  word-break: break-word; /* 允许在任何字符间断行 */
}

/* 针对移动端的小屏幕保护 */
@media (max-width: 640px) {
  /* 确保 main 标签不产生溢出 */
  main {
    overflow-x: hidden !important;
    width: 100% !important;
  }
  
  .max-w-7xl, .max-w-4xl {
    padding-left: 16px !important;
    padding-right: 16px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
}

/* --- 补全 tailwind.min.css 中未收录的类（layout.js 动态注入，扫描时漏收） --- */

/* 布局 / z-index */
.z-50 { z-index: 50; }
.opacity-0 { opacity: 0; }
.w-36 { width: 9rem; }

/* 间距 */
.gap-1\.5 { gap: 0.375rem; }
.gap-x-6 { column-gap: 1.5rem; }
.gap-y-2 { row-gap: 0.5rem; }
.space-y-3 > :not([hidden]) ~ :not([hidden]) { margin-top: 0.75rem; }
.pt-8 { padding-top: 2rem; }
.py-2\.5 { padding-top: 0.625rem; padding-bottom: 0.625rem; }

/* 过渡 */
.duration-200 { transition-duration: 200ms; }

/* 移动菜单背景 */
.bg-white\/95 { background-color: rgba(255, 255, 255, 0.95); }
.backdrop-blur-md {
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

/* hover 状态 */
.hover\:bg-slate-800:hover { background-color: rgb(30 41 59); }
.hover\:shadow-lg:hover {
  box-shadow: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1);
}
.hover\:text-clash-600:hover { color: rgb(37 99 235); }
.hover\:text-slate-900:hover { color: rgb(15 23 42); }

/* group-hover: 语言下拉、Logo 缩放 */
.group:hover .group-hover\:opacity-100 { opacity: 1; }
.group:hover .group-hover\:visible { visibility: visible; }
.group:hover .group-hover\:scale-105 {
  --tw-scale-x: 1.05;
  --tw-scale-y: 1.05;
  transform: translate(var(--tw-translate-x), var(--tw-translate-y))
    rotate(var(--tw-rotate))
    scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
}

/* 响应式断点补全 */
@media (min-width: 768px) {
  .md\:flex   { display: flex !important; }
  .md\:hidden { display: none !important; }
  .md\:text-left { text-align: left; }
}

/* --- 导航栏毛玻璃效果 --- */
.glass-nav {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

/* --- 内容卡片毛玻璃效果 --- */
.glass-card {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.02),
    0 10px 15px -3px rgba(0, 0, 0, 0.03);
}

/* --- 品牌渐变文字 --- */
.text-gradient {
  background: linear-gradient(135deg, #1e293b 0%, #3b82f6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* --- 首屏光晕装饰 --- */
.hero-glow {
  position: absolute;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.15) 0%, rgba(255, 255, 255, 0) 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: -1;
  pointer-events: none;
}

/* --- 隐藏滚动条 --- */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* --- FAQ 手风琴动画 --- */
.faq-content {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.3s ease;
  overflow: hidden;
}
.faq-content.open {
  grid-template-rows: 1fr;
}
.faq-inner {
  overflow: hidden;
}

/* --- 应用图标容器（用于替换 lucide 图标的 SVG/img） --- */
.app-icon {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* --- 博客文末产品区：背景图 + 同元素 filter（路径相对本 CSS，不依赖文章目录深度；避免 WebKit 对外链 SVG <img> 的 filter 失效） --- */
.platform-cta-icon-bg {
  display: inline-block;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  vertical-align: middle;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}
.platform-cta-icon-bg--windows {
  background-image: url("../icons/platforms/windows.svg");
}
.platform-cta-icon-bg--macos {
  background-image: url("../icons/platforms/macos.svg");
}
.platform-cta-icon-bg--linux {
  background-image: url("../icons/platforms/linux.svg");
}
/* 对齐 download.html .platform-tab.active .tab-icon */
.platform-cta-icon-bg--light {
  -webkit-filter: invert(31%) sepia(91%) saturate(3020%) hue-rotate(215deg) brightness(97%) contrast(93%);
  filter: invert(31%) sepia(91%) saturate(3020%) hue-rotate(215deg) brightness(97%) contrast(93%);
}
.platform-cta-icon-bg--dark {
  -webkit-filter: brightness(0) invert(1);
  filter: brightness(0) invert(1);
  opacity: 0.92;
}
