/* ========================================
   ZenTools 暗色主题 — 统一 style.css
   兼容原有 class 名，与 tool-ui.css 配色一致
   ======================================== */

:root {
  --bg:      #06070d;
  --glass:   rgba(255,255,255,0.04);
  --glass-b: rgba(255,255,255,0.08);
  --cyan:    #00e5ff;
  --purple:  #a855f7;
  --pink:    #f43f5e;
  --text:    #f0f4ff;
  --muted:   #6b7a9f;
  --border:  rgba(255,255,255,0.07);
  --border-h:rgba(0,229,255,0.35);
  --r:       20px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
}

a { color: inherit; text-decoration: none; }

/* ===== 导航 ===== */
.site-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px; gap: 20px; flex-wrap: wrap;
  background: rgba(6,7,13,0.75);
  backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid var(--border);
}
.site-header .logo {
  font-size: 22px; font-weight: 900;
  background: linear-gradient(90deg, var(--cyan), var(--purple));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.site-header .logo span { font-weight: 300; font-size: 13px; margin-left: 6px; -webkit-text-fill-color: var(--muted); color: var(--muted); }
.site-header .nav { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.site-header .nav a {
  padding: 8px 16px; border-radius: 10px; font-size: 14px; font-weight: 500;
  color: var(--muted); transition: color 0.2s, background 0.2s;
}
.site-header .nav a:hover, .site-header .nav a.active { color: var(--text); background: var(--glass-b); }

.lang-select {
  border: 1px solid var(--border); background: var(--glass);
  border-radius: 10px; padding: 8px 12px; color: var(--text); font-size: 13px;
  cursor: pointer;
}

/* ===== 主容器 ===== */
main { max-width: 1280px; margin: 0 auto; padding: 24px 24px 60px; }
.section { max-width: 1280px; margin: 0 auto; padding: 40px 24px; }

/* ===== Hero ===== */
.hero {
  min-height: 620px;
  display: grid; grid-template-columns: 1.05fr 0.95fr;
  gap: 42px; align-items: center;
}
.eyebrow {
  display: inline-block;
  padding: 7px 14px; border-radius: 999px;
  background: rgba(0,229,255,0.08);
  color: var(--cyan); font-weight: 700; margin-bottom: 18px;
}
.hero h1 {
  font-size: clamp(42px, 6vw, 76px);
  line-height: 1.08; letter-spacing: -2px; margin-bottom: 24px;
}
.hero-desc { max-width: 680px; font-size: 20px; color: var(--muted); margin-bottom: 30px; }
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }

/* ===== 按钮 ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 13px 22px; border-radius: 999px; font-weight: 700;
  transition: transform 0.2s, opacity 0.2s;
}
.btn.primary {
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  color: #000; box-shadow: 0 15px 32px rgba(0,229,255,0.2);
}
.btn.ghost { background: var(--glass); border: 1px solid var(--border); color: var(--text); }
.btn:hover { transform: translateY(-3px); }

/* ===== 搜索框 ===== */
.search-box { margin-bottom: 30px; }
.search-box input {
  width: 100%; max-width: 560px; padding: 16px 20px;
  border: 1px solid var(--border); border-radius: 18px;
  background: var(--glass); color: var(--text); font-size: 16px; outline: none;
}
.search-box input:focus { border-color: var(--cyan); }

/* ===== 卡片区 ===== */
.hero-card, .category-card, .tool-card, .guide-card, .feature-card {
  background: var(--glass); border: 1px solid var(--border);
  border-radius: 20px; padding: 20px;
  backdrop-filter: blur(4px);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.category-card:hover, .tool-card:hover, .guide-card:hover {
  transform: translateY(-5px); border-color: rgba(0,229,255,0.2);
  box-shadow: 0 18px 35px rgba(0,0,0,0.3);
}
.category-icon, .tool-icon {
  width: 52px; height: 52px; border-radius: 15px;
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 900; margin-bottom: 12px;
}
.category-card h3, .tool-card h3, .guide-card h3 { font-size: 19px; margin-bottom: 8px; }
.category-card p, .tool-card p, .guide-card p, .feature-card p { color: var(--muted); font-size: 14px; }

/* ===== 卡片网格 ===== */
.preview-grid, .tool-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; margin-top: 20px; }
.feature-card strong { display: block; font-size: 19px; margin-bottom: 8px; }
.guide-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.guide-card span, .badge {
  display: inline-block; margin-bottom: 12px;
  padding: 4px 10px; border-radius: 999px;
  background: rgba(0,229,255,0.08); color: var(--cyan); font-size: 12px; font-weight: 700;
}

/* ===== FAQ ===== */
.faq-wrap { max-width: 900px; margin: 0 auto; display: grid; gap: 16px; }
details {
  background: var(--glass); border: 1px solid var(--border);
  border-radius: 18px; padding: 20px 24px;
}
summary { font-size: 18px; font-weight: 700; cursor: pointer; }
details p { margin-top: 12px; color: var(--muted); }

/* ===== 广告占位 ===== */
.ad-box {
  margin-top: 60px; min-height: 90px;
  border: 2px dashed rgba(255,255,255,0.08); border-radius: 22px;
  background: var(--glass);
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-weight: 700;
}

/* ===== 分类页 ===== */
.category-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.category-grid .category-card { text-align: center; }

/* ===== 页脚 ===== */
.footer {
  border-top: 1px solid var(--border);
  padding: 38px 24px; text-align: center;
}
.footer div { display: flex; justify-content: center; gap: 22px; flex-wrap: wrap; margin-bottom: 12px; }
.footer a { color: var(--cyan); font-weight: 700; }
.footer p { color: var(--muted); font-size: 13px; }

/* ===== 工具类 ===== */
.hidden { display: none !important; }

/* ===== 导航栏全局搜索 ===== */
.nav-search { position: relative; margin-left: auto; }
.nav-search-input {
  width: 140px; padding: 6px 12px 6px 32px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--glass); color: var(--text); font-size: 13px;
  outline: none; transition: width 0.3s, border-color 0.2s;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236b7a9f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 10px center;
}
.nav-search-input:focus { width: 220px; border-color: var(--cyan); }
.nav-search-input::placeholder { color: var(--muted); font-size: 12px; }
.nav-search-dropdown {
  display: none; position: absolute; top: calc(100% + 8px); right: 0;
  width: 360px; max-height: 400px; overflow-y: auto;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: 0 12px 40px rgba(0,0,0,0.5);
  z-index: 200;
}
.nav-search-dropdown.show { display: block; }
.nav-search-dropdown .nsd-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
.nav-search-dropdown .nsd-item:last-child { border-bottom: none; }
.nav-search-dropdown .nsd-item:hover,
.nav-search-dropdown .nsd-item.nsd-highlight { background: rgba(0,229,255,0.06); }
.nav-search-dropdown .nsd-icon { font-size: 18px; flex-shrink: 0; }
.nav-search-dropdown .nsd-info { flex: 1; min-width: 0; }
.nav-search-dropdown .nsd-info .nsd-name { font-size: 14px; font-weight: 600; }
.nav-search-dropdown .nsd-info .nsd-desc {
  font-size: 12px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.nav-search-dropdown .nsd-cat {
  font-size: 10px; font-weight: 700; padding: 2px 8px;
  border-radius: 6px; background: rgba(0,229,255,0.08);
  color: var(--cyan); white-space: nowrap; flex-shrink: 0;
}
.nav-search-dropdown .nsd-empty {
  padding: 24px; text-align: center; color: var(--muted); font-size: 13px;
}

@media (max-width: 640px) {
  .nav-search-input { width: 100px; }
  .nav-search-input:focus { width: 140px; }
  .nav-search-dropdown { width: 280px; right: -40px; }
}

/* ===== 回到顶部 ===== */
.zt-backtop {
  position: fixed; bottom: 140px; right: 24px; z-index: 99;
  width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text); font-size: 20px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transform: translateY(20px); pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}
.zt-backtop.show { opacity: 0.8; transform: translateY(0); pointer-events: auto; }
.zt-backtop:hover { opacity: 1; }

/* ===== #10 主题切换 ===== */
.zt-theme-toggle {
  position: fixed; bottom: 140px; right: 76px; z-index: 99;
  width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--surface);
  font-size: 18px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.2s;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}
.zt-theme-toggle:hover { transform: scale(1.1); }

/* ===== #12 骨架屏 ===== */
.skeleton-card {
  background: var(--glass); border: 1px solid var(--border);
  border-radius: var(--r); padding: 20px 16px;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.skeleton-icon { width: 32px; height: 32px; border-radius: 8px; background: var(--glass-b); animation: shimmer 1.5s infinite; }
.skeleton-line { width: 70%; height: 14px; border-radius: 6px; background: var(--glass-b); animation: shimmer 1.5s infinite; }
.skeleton-line.short { width: 45%; }
@keyframes shimmer { 0%{opacity:0.4;} 50%{opacity:0.8;} 100%{opacity:0.4;} }

/* ===== 收藏按钮 ===== */
.fav-btn {
  display: inline-flex; align-items: center; gap: 6px;
  margin-left: 12px; padding: 6px 14px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--glass);
  color: #f59e0b; font-size: 16px; cursor: pointer;
  transition: transform 0.2s, background 0.2s;
}
.fav-btn:hover { background: var(--glass-b); transform: scale(1.05); }

/* ===== 相关工具推荐 ===== */
.related-tools {
  max-width: 1080px; margin: 32px auto 0; padding: 0 24px;
}

/* ===== 响应式 ===== */
@media (max-width: 1024px) {
  .hero { grid-template-columns: 1fr; min-height: auto; }
  .hero-card { order: -1; }
  .preview-grid, .tool-grid, .guide-grid, .features, .category-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .preview-grid, .tool-grid, .guide-grid, .features, .category-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 42px; }
  .hero-desc { font-size: 17px; }
  .site-header .nav { gap: 2px; }
  .site-header .nav a { padding: 6px 10px; font-size: 13px; }
  .lang-select { max-width: 120px; }
  main { padding: 16px 14px 40px; }
  .section { padding: 30px 14px; }
  .ad-box { margin-top: 40px; }
}
