/* ============ AIWorld Hub · ai-bot.cn 同款布局 ============ */
:root {
  --primary: #3662f0;
  --primary-soft: #eef2fe;
  --border: #e6e8ec;
  --text: #1f2329;
  --text-2: #4a4f57;
  --muted: #8a9099;
  --bg: #f5f6f8;
  --radius: 12px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; }
img { border: 0; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); font-weight: 400; }

/* ---------- 顶栏 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: #fff; border-bottom: 1px solid var(--border);
}
.site-header__inner { display: flex; align-items: center; gap: 14px; height: 56px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; flex: none; }
.brand__logo {
  width: 28px; height: 28px; border-radius: 8px; flex: none;
  background: linear-gradient(135deg, #3662f0, #7a4df0);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
}
.search { flex: 1; max-width: 520px; position: relative; }
.search input {
  width: 100%; height: 36px; border: 1px solid var(--border); border-radius: 18px;
  padding: 0 16px; font-size: 14px; background: var(--bg); outline: none;
  transition: border-color .15s, background .15s;
}
.search input:focus { border-color: var(--primary); background: #fff; }
.nav { display: flex; gap: 2px; margin-left: auto; flex: none; }
.nav__link { padding: 6px 11px; border-radius: 8px; font-size: 14px; color: var(--text-2); white-space: nowrap; }
.nav__link:hover { color: var(--primary); background: var(--primary-soft); }
.nav__link.is-active { color: var(--primary); background: var(--primary-soft); font-weight: 600; }

/* ---------- hero ---------- */
.hero { padding: 26px 4px 16px; }
.hero h1 { font-size: 25px; margin: 0 0 6px; letter-spacing: .5px; }
.hero__sub { color: var(--text-2); margin: 0 0 4px; font-size: 14px; }
.hero__meta { color: var(--muted); font-size: 13px; margin: 0; }
.hero__meta b { color: var(--primary); }

/* ---------- 移动端横向分类条 ---------- */
.catbar { display: none; gap: 8px; overflow-x: auto; padding: 2px 0 12px; -webkit-overflow-scrolling: touch; }
.catbar__chip {
  white-space: nowrap; border: 1px solid var(--border); background: #fff;
  border-radius: 999px; padding: 6px 13px; font-size: 13px; color: var(--text-2); flex: none;
}
.catbar__chip.is-active { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }

/* ---------- 主体布局：侧栏 + 内容 ---------- */
.layout {
  display: grid; grid-template-columns: 216px minmax(0, 1fr);
  gap: 16px; align-items: start; padding-bottom: 36px;
}
.side {
  position: sticky; top: 72px;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 8px; max-height: calc(100vh - 92px); overflow-y: auto;
}
.side__title { font-size: 12px; color: var(--muted); padding: 10px 8px 4px; }
.side__link {
  display: flex; justify-content: space-between; align-items: center; gap: 6px;
  padding: 7px 8px; border-radius: 8px; font-size: 14px; color: var(--text-2);
}
.side__link:hover { background: #f2f4f8; color: var(--text); }
.side__link.is-active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.side__count {
  font-size: 12px; color: #a2a8b3; background: #f2f4f8;
  border-radius: 999px; padding: 0 8px; line-height: 20px; flex: none;
}
.side__link.is-active .side__count { background: #dfe7fd; color: var(--primary); }
.side__subs { padding: 2px 0 6px 10px; display: flex; flex-wrap: wrap; gap: 4px; }
.side__sub {
  font-size: 12px; color: var(--muted); background: #f5f6f8;
  border-radius: 999px; padding: 2px 9px; line-height: 18px;
}
.side__sub:hover { background: var(--primary-soft); color: var(--primary); }
.content { min-width: 0; }

/* ---------- 分类区块 ---------- */
.sec {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px 16px; margin-bottom: 16px;
}
.sec__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.sec__title { font-size: 16px; margin: 0; display: flex; align-items: center; gap: 8px; }
.sec__count { font-size: 12px; color: var(--muted); font-weight: 400; }
.sec__more { font-size: 13px; color: var(--primary); flex: none; }
.sec__more:hover { text-decoration: underline; }

/* ---------- 工具卡片（ai-bot.cn 同款紧凑样式） ---------- */
.url-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.url-card {
  display: flex; align-items: center; gap: 10px; min-width: 0;
  border: 1px solid var(--border); border-radius: 10px; padding: 10px;
  background: #fff; transition: border-color .15s, box-shadow .15s, transform .15s;
}
.url-card:hover {
  border-color: #b9c8f7;
  box-shadow: 0 6px 16px rgba(31, 64, 168, .08);
  transform: translateY(-2px);
}
.url-card.is-off { opacity: .58; }
.ico {
  position: relative; width: 38px; height: 38px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  background: linear-gradient(135deg, #eef2fe, #e9e2fb);
  color: var(--primary); font-weight: 700; font-size: 16px; font-style: normal;
}
.ico img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #fff; }
.url-card__body { min-width: 0; flex: 1; }
.url-card__name {
  font-size: 14px; font-weight: 600; color: var(--text);
  display: flex; align-items: center; gap: 6px; min-width: 0;
}
.url-card__name > :first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.url-card__desc {
  font-size: 12px; color: var(--muted); margin-top: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.price { font-size: 11px; border-radius: 999px; padding: 0 7px; font-weight: 500; flex: none; line-height: 18px; }
.price--free { color: #17864b; background: #e7f7ee; }
.price--pay { color: #9a6a1a; background: #fdf3e2; }
.off-dot { font-size: 11px; color: #d54941; background: #fdecea; border-radius: 999px; padding: 0 7px; line-height: 18px; flex: none; }

/* ---------- 搜索空态 ---------- */
.empty { text-align: center; color: var(--muted); padding: 48px 0 24px; font-size: 14px; }

/* ---------- 分类页二级分组 ---------- */
.subgroup { margin-bottom: 14px; }
.subgroup:last-child { margin-bottom: 0; }
.subgroup__title {
  font-size: 13px; color: var(--text-2); margin: 0 0 8px;
  display: flex; align-items: center; gap: 6px; font-weight: 600;
}
.subgroup__title::before {
  content: ""; width: 3px; height: 12px; border-radius: 2px;
  background: var(--primary); display: inline-block;
}
.subgroup__count { font-size: 12px; color: var(--muted); font-weight: 400; }

/* ---------- 工具详情页 ---------- */
.crumbs { font-size: 13px; color: var(--muted); margin: 4px 0 14px; }
.crumbs a:hover { color: var(--primary); }
.detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.detail-head__main { display: flex; gap: 14px; align-items: center; min-width: 0; }
.detail-head .ico { width: 56px; height: 56px; font-size: 24px; }
.detail-head h1 { font-size: 22px; margin: 0 0 4px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.detail-tagline { margin: 0; color: var(--text-2); }
.detail-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.badge { font-size: 12px; border-radius: 999px; padding: 2px 10px; font-weight: 500; }
.badge.ok { color: #17864b; background: #e7f7ee; }
.badge.off { color: #d54941; background: #fdecea; }
.detail-desc { color: var(--text-2); margin: 14px 0; }
.detail-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.card {
  background: #fafbfc; border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px;
}
.card h3 { margin: 0 0 8px; font-size: 14px; }
.card ul { padding-left: 18px; margin: 0; color: var(--text-2); }
.card li { margin: 3px 0; }
.detail-meta {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px; background: #fafbfc; border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 16px; font-size: 13px; color: var(--text-2);
}
.detail-meta .muted { font-size: 12px; display: block; margin-bottom: 2px; }
.detail-meta a:hover { color: var(--primary); }
.note { font-size: 12px; color: var(--muted); background: #fafbfc; border-left: 3px solid #d9e2fb; padding: 8px 12px; border-radius: 0 8px 8px 0; }
.btn {
  display: inline-block; border: 1px solid var(--border); background: #fff;
  border-radius: 8px; padding: 7px 14px; font-size: 13px; color: var(--text-2);
  cursor: pointer; transition: .15s; white-space: nowrap;
}
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn--primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn--primary:hover { background: #2a51d8; color: #fff; }

/* ---------- 正文页（关于我们 / 广告合作） ---------- */
.prose { color: var(--text-2); }
.prose h2 {
  font-size: 17px; color: var(--text); margin: 22px 0 10px;
  padding-left: 10px; border-left: 4px solid var(--primary);
}
.prose h3 { font-size: 15px; color: var(--text); margin: 16px 0 6px; }
.prose p { margin: 8px 0; }
.prose ul { padding-left: 20px; margin: 8px 0; }
.prose li { margin: 5px 0; }
.prose strong { color: var(--text); }
.prose a { color: var(--primary); }
.prose a:hover { text-decoration: underline; }
.price-table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 13px; }
.price-table th, .price-table td { border: 1px solid var(--border); padding: 8px 12px; text-align: left; }
.price-table th { background: #fafbfc; color: var(--text); font-weight: 600; }
.price-table td:first-child { color: var(--text); font-weight: 500; }

/* ---------- 页脚（含免责声明） ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 26px 0 34px; background: #fff; }
.site-footer__top { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.site-footer__nav { display: flex; gap: 16px; font-size: 13px; color: var(--text-2); flex-wrap: wrap; }
.site-footer__nav a:hover { color: var(--primary); }
.site-footer__desc { margin: 12px 0 16px; font-size: 12.5px; color: var(--muted); }
.site-footer__copy { margin: 14px 0 0; font-size: 12.5px; color: var(--muted); }
.disclaimer-mini {
  background: #fafbfc; border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 14px; font-size: 12px; color: var(--muted); line-height: 1.7;
}
.disclaimer-mini strong { color: var(--text-2); }
.disclaimer-mini a { color: var(--primary); white-space: nowrap; }
.disclaimer-mini a:hover { text-decoration: underline; }

/* ---------- 响应式：平板 / 手机 ---------- */
@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; gap: 12px; }
  .side { display: none; }
  .catbar { display: flex; }
  .brand__name { display: none; }
  .nav__link { padding: 6px 8px; font-size: 13px; }
  .detail-cols { grid-template-columns: 1fr; }
  /* 锚点跳转时避开 sticky 顶栏遮挡 */
  .sec, .subgroup, #hot { scroll-margin-top: 76px; }
}
@media (max-width: 640px) {
  .site-header__inner { height: auto; padding-top: 8px; padding-bottom: 8px; flex-wrap: wrap; gap: 8px; }
  .search { order: 3; max-width: none; flex-basis: 100%; }
  /* 16px 防止 iOS Safari 聚焦输入框时自动放大页面 */
  .search input { height: 38px; font-size: 16px; -webkit-appearance: none; appearance: none; }
  .nav__link { padding: 8px 9px; font-size: 14px; }

  .hero { padding: 16px 2px 10px; }
  .hero h1 { font-size: 20px; }
  .hero__sub { font-size: 13px; }

  .catbar { padding-bottom: 10px; gap: 7px; }
  .catbar__chip { padding: 7px 13px; font-size: 13px; }
  .catbar--sub { padding-top: 0; padding-bottom: 12px; }

  .sec { padding: 12px 12px 14px; margin-bottom: 12px; }
  .sec__title { font-size: 15px; }
  .url-grid { grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 8px; }
  .url-card { padding: 8px; gap: 8px; }
  .ico { width: 34px; height: 34px; font-size: 14px; }
  .url-card__name { font-size: 13px; }
  .url-card__desc { font-size: 11px; }
  .price { font-size: 10px; padding: 0 6px; }

  .detail-head { flex-direction: column; align-items: stretch; gap: 12px; }
  .detail-head .ico { width: 48px; height: 48px; font-size: 20px; }
  .detail-head h1 { font-size: 19px; }
  .detail-actions .btn { flex: 1; text-align: center; padding: 10px 14px; font-size: 14px; }
  .detail-meta { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); font-size: 12.5px; }
  .crumbs { font-size: 12px; }
  .subgroup__title { font-size: 12.5px; }

  .prose h2 { font-size: 16px; }
  .prose h3 { font-size: 14px; }
  .site-footer { padding: 20px 0 28px; }
  .site-footer__top { flex-direction: column; align-items: flex-start; gap: 10px; }
  .empty { padding: 36px 0 18px; }
}
@media (max-width: 380px) {
  .url-grid { grid-template-columns: repeat(auto-fill, minmax(126px, 1fr)); }
  .hero h1 { font-size: 18px; }
  .nav__link { padding: 8px 7px; font-size: 13px; }
  .brand__logo { width: 26px; height: 26px; }
  .sec__count { display: none; }
}

/* 触屏设备：去掉 hover 抬起效果，避免点击后样式粘滞 */
@media (hover: none) {
  .url-card:hover { transform: none; box-shadow: none; border-color: var(--border); }
  .btn:hover { border-color: var(--border); color: var(--text-2); }
  .btn--primary:hover { background: var(--primary); border-color: var(--primary); color: #fff; }
}
