/*!
 * iohow.com — 导航站专属样式（v2 全局升级）
 * 依赖 tokens.css + components.css，必须在两者之后引入。
 * 只写"导航页"独有的样式，不覆盖设计系统变量。
 */

/* ===== Header（全站统一：左侧两行 + 右侧按钮顶部对齐）===== */
.ds-header__inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  width: 100%;
  min-height: 64px;
  padding-top: var(--ds-space-2);
  padding-bottom: var(--ds-space-2);
}
.ds-header__brand {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--ds-space-2) var(--ds-space-3);
  text-decoration: none;
  color: var(--ds-text);
  flex-shrink: 1;
  min-width: 0;
  flex: 1;
  padding-right: var(--ds-space-4);
}
.ds-header__brand-text {
  display: inline-flex;
  align-items: center;
  gap: var(--ds-space-2);
  flex-shrink: 0;
}
.ds-header__logo {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: inline-block;
  vertical-align: middle;
  object-fit: cover;
  background: var(--ds-bg-subtle);
}
.ds-header__logo-fallback {
  font-weight: 800;
  color: var(--ds-brand-600);
  font-size: var(--ds-text-base);
}
.ds-header__title {
  font-weight: 800;
  font-size: var(--ds-text-xl);
  letter-spacing: -0.01em;
}
.ds-header__slogan {
  font-size: var(--ds-text-xs);
  color: var(--ds-brand-600);
  font-weight: 500;
  letter-spacing: 0.08em;
  opacity: 0.8;
  flex-basis: 100%;
}
.ds-header__nav {
  display: flex;
  align-items: center;
  gap: var(--ds-space-1);
  flex-shrink: 0;
}
.ds-header__back { display: none; }

/* ===== 语言切换按钮（任务 3） ===== */
.ds-lang-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  min-width: 32px;
  padding: 0 8px;
  border-radius: var(--ds-radius-sm);
  background: transparent;
  border: 1px solid var(--ds-border);
  color: var(--ds-text-muted);
  font-size: var(--ds-text-xs);
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background var(--ds-transition-fast), color var(--ds-transition-fast), border-color var(--ds-transition-fast);
}
.ds-lang-toggle:hover {
  background: var(--ds-bg-subtle);
  color: var(--ds-text);
  border-color: var(--ds-border-strong);
}
.ds-lang-toggle:focus-visible {
  outline: 2px solid var(--ds-focus-ring);
  outline-offset: 2px;
}

/* ===== Hero 区域（全站一致） ===== */
.ds-hero {
  text-align: center;
  padding: var(--ds-space-16) var(--ds-space-4) var(--ds-space-10);
}
.ds-hero__title {
  font-size: clamp(36px, 7vw, 56px);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 var(--ds-space-3);
  color: var(--ds-text);
  line-height: 1.15;
}
.ds-hero__subtitle {
  font-size: var(--ds-text-lg);
  color: var(--ds-text-muted);
  margin: 0 auto var(--ds-space-3);
  max-width: 640px;
  line-height: 1.6;
}
.ds-hero__search {
  max-width: 560px;
  margin-inline: auto;
}
.ds-search__icon {
  flex-shrink: 0;
  font-size: var(--ds-text-base);
}

/* ===== 分类筛选栏（任务 10 最佳实践） =====
 * 桌面端：水平居中 Pill，多行换行
 * 移动端：水平滚动（隐藏滚动条），左右 fade 渐变提示
 */
.ds-category-bar {
  margin-bottom: var(--ds-space-8);
  position: relative;
}
.ds-pill-scroller {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--ds-border-strong) transparent;
  padding-bottom: var(--ds-space-2);
  -ms-overflow-style: none;
}
.ds-pill-scroller::-webkit-scrollbar {
  height: 4px;
}
.ds-pill-scroller::-webkit-scrollbar-thumb {
  background: var(--ds-border);
  border-radius: 2px;
}
.ds-pill-scroller .ds-pill-group {
  flex-wrap: wrap;
  justify-content: center;
  min-width: min-content;
  gap: var(--ds-space-2);
}

/* ===== 工具区（容器约束：宽屏居中 1200px，不铺满；移动端 20px 边距） ===== */
.ds-tools-section {
  position: relative;
  min-height: 200px;
  max-width: var(--ds-container-wide);
  margin: 0 auto;
  padding: 0 var(--ds-gap);
}
@media (max-width: 480px) {
  .ds-tools-section { padding: 0 20px; }
}
.ds-tools-empty {
  text-align: center;
  padding: var(--ds-space-16) var(--ds-space-4);
  color: var(--ds-text-muted);
  font-size: var(--ds-text-base);
}

/* ===== 友情链接（全站统一：左对齐 + 紧贴页脚） ===== */
.ds-friendlinks-wrap {
  max-width: var(--ds-container-wide);
  margin: var(--ds-space-4) auto var(--ds-space-2);
  padding: 0 var(--ds-space-4);
}
.ds-friendlinks {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: var(--ds-space-2) var(--ds-space-3);
  padding: var(--ds-space-2) var(--ds-space-4);
  background: var(--ds-bg-subtle);
  border: 1px solid var(--ds-border);
  border-radius: var(--ds-radius-sm);
  font-size: var(--ds-text-xs);
}
.ds-friendlinks__title {
  color: var(--ds-text-muted);
  font-weight: 600;
  margin-right: var(--ds-space-1);
  white-space: nowrap;
}
.ds-friendlinks__list {
  display: inline-flex;
  flex-wrap: wrap;
  gap: var(--ds-space-2) var(--ds-space-3);
  align-items: center;
}
.ds-friendlinks__item {
  color: var(--ds-brand-600);
  text-decoration: none;
  transition: color var(--ds-transition-fast);
}
.ds-friendlinks__item:hover {
  color: var(--ds-brand-700);
  text-decoration: underline;
}

/* ===== 页脚（全站统一：蓝色链接 + 紧凑布局） ===== */
.ds-footer {
  border-top: 1px solid var(--ds-border);
  padding: var(--ds-space-3) var(--ds-space-4);
  text-align: center;
  color: var(--ds-text-muted);
  font-size: var(--ds-text-xs);
  line-height: 1.5;
}
.ds-footer a {
  color: var(--ds-brand-600);
  text-decoration: none;
  transition: color var(--ds-transition-fast);
}
.ds-footer a:hover {
  color: var(--ds-brand-700);
  text-decoration: underline;
}
.ds-footer__row {
  margin-bottom: var(--ds-space-1);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--ds-space-1);
}
.ds-footer__row:last-child {
  margin-bottom: 0;
}
.ds-footer__sep {
  color: var(--ds-text-muted);
  opacity: 0.5;
  margin: 0 var(--ds-space-1);
}
.ds-footer__copyright {
  color: var(--ds-text-muted);
}
.ds-footer__email-wrap {
  position: relative;
  display: inline-block;
}
.ds-footer__gongan {
  display: inline;
}
.ds-footer__gongan img {
  width: 14px;
  height: 14px;
  vertical-align: -2px;
  margin-right: 4px;
}

/* ===== 全局 Tooltip（任务 9） ===== */
.ds-tooltip {
  position: absolute;
  z-index: 9999;
  background: var(--ds-toast-bg);
  color: var(--ds-toast-text);
  font-size: var(--ds-text-xs);
  padding: 6px 10px;
  border-radius: var(--ds-radius-sm);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.15s, transform 0.15s;
  max-width: 280px;
  white-space: normal;
  line-height: 1.5;
}
.ds-tooltip::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -4px;
  transform: translateX(-50%) rotate(45deg);
  width: 8px;
  height: 8px;
  background: var(--ds-toast-bg);
}
.ds-tooltip.is-show {
  opacity: 1;
  transform: translateY(0);
}

/* ===== 工具页隐私声明（纯前端工具才显示，位于友情链接上方） ===== */
.ds-privacy-notice-wrap {
  max-width: var(--ds-container-width);
  margin: var(--ds-space-6) auto var(--ds-space-2);
  padding: 0 var(--ds-space-4);
}
.ds-privacy-notice {
  margin: 0;
  padding: var(--ds-space-2) var(--ds-space-3);
  background: var(--ds-bg-subtle);
  border: 1px solid var(--ds-border);
  border-radius: var(--ds-radius-sm);
  text-align: center;
  font-size: var(--ds-text-xs);
  color: var(--ds-text-muted);
  line-height: 1.5;
}
.ds-privacy-notice::before {
  content: "🔒 ";
  margin-right: 4px;
}

/* ===== 响应式（任务 11 全站适配） ===== */

/* 平板 */
@media (max-width: 768px) {
  .ds-hero { padding: var(--ds-space-10) var(--ds-space-4) var(--ds-space-6); }
  .ds-hero__title { font-size: clamp(26px, 7vw, 36px); }
  .ds-hero__subtitle { font-size: var(--ds-text-base); }
  .ds-pill-scroller .ds-pill-group {
    justify-content: flex-start;
    flex-wrap: nowrap;
    padding: 0 var(--ds-space-1);
  }
  .ds-pill-scroller .ds-pill {
    flex-shrink: 0;
  }
  .ds-friendlinks { padding: var(--ds-space-2) var(--ds-space-3); font-size: var(--ds-text-xs); }
  .ds-friendlinks__list { gap: var(--ds-space-2); }
}

/* 移动端（窄屏） */
@media (max-width: 480px) {
  .ds-header__inner { min-height: 56px; }
  .ds-header__title { font-size: var(--ds-text-lg); }
  .ds-header__slogan { font-size: 10px; letter-spacing: 0.06em; }
  .ds-hero { padding: var(--ds-space-8) var(--ds-space-4) var(--ds-space-5); }
  .ds-hero__title { font-size: 24px; }
  .ds-hero__subtitle { font-size: var(--ds-text-sm); line-height: 1.6; }
  .ds-footer { padding: var(--ds-space-3) var(--ds-space-3); font-size: 11px; }
  .ds-footer__row { margin-bottom: 2px; }
}

/* 减少动画 */
@media (prefers-reduced-motion: reduce) {
  .ds-lang-toggle, .ds-friendlinks__item, .ds-footer__email, .ds-tooltip { transition: none; }
}

/* ====== 页尾"关于本站"（与"本站推荐"同容器同布局，标题后空格接正文） ====== */
.ds-about-wrap { margin-top: var(--ds-space-1); }
.ds-about { flex-wrap: nowrap; align-items: flex-start; }
.ds-about__title-gap { white-space: normal; }
.ds-about__text {
  color: var(--ds-text-muted);
  font-size: var(--ds-text-xs, 12px);
  line-height: 1.7;
  opacity: 0.75;
  min-width: 0;
  overflow-wrap: break-word;
}

/* 移动端：页尾卡片容器与页面容器对齐，不贴边 */
@media (max-width: 480px) {
  .ds-friendlinks-wrap { padding: 0 20px; }
}
