/* 外贸导航 — 宽屏大气商务门户风格 */
.trade-nav-body {
  background: linear-gradient(180deg, #e4eaf4 0%, #eef1f6 280px, #f0f2f5 520px);
  min-height: 100vh;
}
.dark body.trade-nav-body {
  background: #000;
}

.tn-top-bar {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid #e8eaed;
  box-shadow: 0 1px 10px rgba(15, 23, 42, 0.05);
}
.dark .tn-top-bar {
  background: rgba(0, 0, 0, 0.96);
  border-bottom-color: #1a1a1a;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04);
}

.tn-page {
  width: 100%;
  max-width: 1680px;
  margin: 0 auto;
  padding: calc(var(--topbar-height) + 48px) 28px 64px;
  box-sizing: border-box;
}

/* ===== 顶部搜索 Hero ===== */
.tn-hero {
  position: relative;
  margin: 0 0 28px;
  padding: 48px 56px 36px;
  text-align: center;
  background: linear-gradient(165deg, #fff 0%, #f8fafc 45%, #f1f5f9 100%);
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.07);
  overflow: hidden;
}
.tn-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% -20%, rgba(26, 115, 232, 0.06) 0%, transparent 70%),
    radial-gradient(ellipse 40% 30% at 90% 100%, rgba(26, 115, 232, 0.04) 0%, transparent 60%);
  pointer-events: none;
}
.dark .tn-hero {
  background: linear-gradient(165deg, #0a0a0a 0%, #050505 50%, #000 100%);
  border-color: #1a1a1a;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
}
.dark .tn-hero::after {
  background:
    radial-gradient(ellipse 80% 60% at 50% -20%, rgba(59, 130, 246, 0.08) 0%, transparent 70%),
    radial-gradient(ellipse 40% 30% at 90% 100%, rgba(59, 130, 246, 0.04) 0%, transparent 60%);
}
.tn-hero-title {
  position: relative;
  margin: 0 0 12px;
  font-size: 34px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: 0.1em;
}
.dark .tn-hero-title { color: #f8fafc; }
.tn-hero-desc {
  position: relative;
  margin: 0 0 28px;
  font-size: 15px;
  color: #64748b;
  letter-spacing: 0.04em;
}
.dark .tn-hero-desc { color: #94a3b8; }

.tn-engine-tabs {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 22px;
}
.tn-engine-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 18px;
  font-size: 13px;
  font-weight: 500;
  color: #5f6368;
  background: #f1f3f4;
  border: 1px solid transparent;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.18s;
}
.tn-engine-tab:hover {
  color: #1a73e8;
  background: #e8f0fe;
  border-color: #c2d7f7;
}
.tn-engine-tab.active {
  color: #fff;
  background: linear-gradient(135deg, #1a73e8, #4285f4);
  border-color: transparent;
  box-shadow: 0 3px 10px rgba(26, 115, 232, 0.35);
}
.tn-engine-icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  object-fit: cover;
  background: #fff;
}
.dark .tn-engine-tab { background: #111; color: #94a3b8; border-color: #222; }
.dark .tn-engine-tab:hover { background: #1a1a1a; color: #60a5fa; border-color: #333; }
.dark .tn-engine-tab.active {
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  color: #fff;
  border-color: transparent;
}

.tn-search-form {
  position: relative;
  display: flex;
  align-items: stretch;
  max-width: 860px;
  margin: 0 auto 18px;
  background: #fff;
  border: 2px solid #1a73e8;
  border-radius: 32px;
  overflow: hidden;
  box-shadow: 0 6px 24px rgba(26, 115, 232, 0.12);
}
.dark .tn-search-form {
  background: #0a0a0a;
  border-color: #3b82f6;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
}
.tn-search-input {
  flex: 1;
  min-width: 0;
  padding: 16px 28px;
  font-size: 16px;
  border: none;
  background: transparent;
  color: #202124;
  outline: none;
}
.dark .tn-search-input { color: #f1f5f9; }
.tn-search-input::placeholder { color: #9aa0a6; }
.tn-search-submit {
  flex-shrink: 0;
  padding: 0 40px;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  background: #1a73e8;
  border: none;
  cursor: pointer;
  transition: background 0.2s;
}
.tn-search-submit:hover { background: #1557b0; }

.tn-filter-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  max-width: 480px;
  width: 100%;
  margin: 4px auto 0;
  padding: 0 18px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 28px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.tn-filter-wrap:focus-within {
  border-color: #c2d7f7;
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.08);
}
.dark .tn-filter-wrap { background: #0a0a0a; border-color: #222; }
.dark .tn-filter-wrap:focus-within { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12); }
.tn-filter-icon { display: flex; color: #9aa0a6; margin-right: 8px; }
.tn-filter-input {
  flex: 1;
  width: 100%;
  min-width: 0;
  padding: 10px 0;
  font-size: 13px;
  border: none;
  background: transparent;
  color: #3c4043;
  outline: none;
}
.dark .tn-filter-input { color: #e2e8f0; }

/* ===== 侧栏 + 内容 ===== */
.tn-layout {
  display: grid;
  grid-template-columns: 196px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  transition: grid-template-columns 0.25s;
}
.tn-layout.sidebar-collapsed {
  grid-template-columns: 0 minmax(0, 1fr);
}
.tn-layout.sidebar-collapsed .tn-sidebar {
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
}

.tn-sidebar {
  position: sticky;
  top: calc(var(--topbar-height) + 24px);
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  transition: opacity 0.25s;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05);
}
.dark .tn-sidebar {
  background: #0a0a0a;
  border-color: #1a1a1a;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}
.tn-sidebar-nav {
  display: flex;
  flex-direction: column;
  padding: 8px 0;
}
.tn-sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 500;
  color: #3c4043;
  text-align: left;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
}
.tn-sidebar-item:hover { color: #1a73e8; background: rgba(26, 115, 232, 0.06); }
.tn-sidebar-item.active {
  color: #1a73e8;
  font-weight: 600;
  background: #fff;
  box-shadow: inset 3px 0 0 #1a73e8;
}
.dark .tn-sidebar-item { color: #cbd5e1; }
.dark .tn-sidebar-item.active {
  color: #60a5fa;
  background: #111;
  box-shadow: inset 3px 0 0 #3b82f6;
}
.tn-sidebar-icon {
  display: flex;
  flex-shrink: 0;
  color: var(--cat-color, #1a73e8);
  opacity: 0.85;
}
.tn-sidebar-collapse {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  padding: 10px;
  font-size: 12px;
  color: #9aa0a6;
  background: transparent;
  border: none;
  border-top: 1px solid #e8eaed;
  cursor: pointer;
}
.tn-sidebar-collapse:hover { color: #1a73e8; }
.dark .tn-sidebar-collapse { border-top-color: #1a1a1a; color: #64748b; }

.tn-content { min-width: 0; }

/* ===== 分类区块卡片 ===== */
.tn-section {
  margin-bottom: 20px;
  scroll-margin-top: calc(var(--topbar-height) + 28px);
}
.tn-section.is-empty { display: none; }

.tn-section-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
  overflow: hidden;
}
.dark .tn-section-card {
  background: #0a0a0a;
  border-color: #1a1a1a;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.tn-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  padding: 16px 22px;
  border-bottom: 1px solid #f1f5f9;
  background: linear-gradient(90deg, #f8fafc 0%, #fff 100%);
  border-left: 4px solid #1a73e8;
}
.dark .tn-section-head {
  background: linear-gradient(90deg, #0a0a0a 0%, #050505 100%);
  border-bottom-color: #1a1a1a;
  border-left-color: #3b82f6;
}
.tn-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #202124;
  white-space: nowrap;
}
.dark .tn-section-title { color: #f1f5f9; }
.tn-section-title-icon {
  display: flex;
  color: #1a73e8;
}

.tn-group-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
  justify-content: center;
}
.tn-group-tab {
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 500;
  color: #5f6368;
  background: #f1f3f4;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}
.tn-group-tab:hover { color: #1a73e8; }
.tn-group-tab.active {
  color: #fff;
  background: #1a73e8;
  font-weight: 600;
}
.dark .tn-group-tab { background: #111; color: #94a3b8; }
.dark .tn-group-tab.active { background: #2563eb; color: #fff; }

.tn-group-panel { display: none; padding: 20px 22px 22px; }
.tn-group-panel.active { display: block; }

.tn-links {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

.tn-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  text-decoration: none;
  background: #fff;
  border: 1px solid #eef2f6;
  border-radius: 10px;
  transition: all 0.2s ease;
  min-height: 48px;
}
.tn-link:hover {
  border-color: #bfdbfe;
  background: #f8fbff;
  box-shadow: 0 4px 16px rgba(26, 115, 232, 0.1);
  transform: translateY(-2px);
}
.dark .tn-link {
  background: #050505;
  border-color: #1a1a1a;
}
.dark .tn-link:hover {
  border-color: #3b82f6;
  background: #0a0a0a;
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.15);
}
.tn-link.is-hidden { display: none; }

.tn-link-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  padding: 2px;
  border-radius: 8px;
  object-fit: contain;
  background: #fff;
  border: 1px solid #f1f3f4;
}
.dark .tn-link-icon { background: #111; border-color: #222; }

.tn-link-name {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  color: #3c4043;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tn-link-name b { font-weight: 600; }
.dark .tn-link-name { color: #e2e8f0; }
.tn-link:hover .tn-link-name { color: #1a73e8; }

.tn-credit {
  margin-top: 12px;
  padding: 12px;
  font-size: 12px;
  color: #94a3b8;
  text-align: center;
}
.dark .tn-credit { color: #64748b; }
.tn-credit a { color: #1a73e8; text-decoration: none; }
.dark .tn-credit a { color: #60a5fa; }

.trade-nav-body .footer-note {
  max-width: 1680px;
  margin: 0 auto;
  padding: 0 28px 32px;
}
.dark body.trade-nav-body .footer-note p { color: #64748b; }

/* ===== 宽屏增强 ===== */
@media (min-width: 1600px) {
  .tn-page {
    max-width: 1760px;
    padding-left: 40px;
    padding-right: 40px;
  }
  .tn-hero {
    padding: 52px 72px 40px;
  }
  .tn-hero-title { font-size: 38px; }
  .tn-hero-desc { font-size: 16px; }
  .tn-search-form { max-width: 920px; }
  .tn-layout {
    grid-template-columns: 212px minmax(0, 1fr);
    gap: 28px;
  }
  .tn-links { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .trade-nav-body .footer-note { max-width: 1760px; padding-left: 40px; padding-right: 40px; }
}

@media (min-width: 1920px) {
  .tn-page {
    max-width: 1840px;
    padding-left: 48px;
    padding-right: 48px;
  }
  .tn-links { grid-template-columns: repeat(8, minmax(0, 1fr)); }
  .trade-nav-body .footer-note { max-width: 1840px; padding-left: 48px; padding-right: 48px; }
}

/* ===== 响应式 ===== */
@media (max-width: 1200px) {
  .tn-links { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (max-width: 992px) {
  .tn-links { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .tn-layout { grid-template-columns: 1fr; }
  .tn-sidebar {
    position: static;
  }
  .tn-sidebar-nav {
    flex-direction: row;
    flex-wrap: wrap;
    padding: 8px;
    gap: 6px;
  }
  .tn-sidebar-item {
    width: auto;
    padding: 8px 12px;
    border-radius: 8px;
    background: #fff;
    border: 1px solid #e8eaed;
    box-shadow: none;
  }
  .tn-sidebar-item.active {
    border-color: #1a73e8;
    box-shadow: none;
  }
  .dark .tn-sidebar-item {
    background: #0a0a0a;
    border-color: #1a1a1a;
  }
  .tn-sidebar-collapse { display: none; }
}
@media (max-width: 768px) {
  .tn-page { padding: calc(var(--topbar-height) + 24px) 12px 40px; }
  .tn-hero { padding: 28px 16px 24px; border-radius: 12px; }
  .tn-hero-title { font-size: 22px; margin-bottom: 8px; }
  .tn-hero-desc { font-size: 13px; margin-bottom: 20px; }
  .tn-search-form { border-radius: 12px; flex-direction: column; }
  .tn-search-submit { padding: 12px; border-radius: 0 0 10px 10px; }
  .tn-links { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tn-section-head { flex-direction: column; align-items: flex-start; }
  .tn-group-tabs { justify-content: flex-start; }
}
@media (max-width: 480px) {
  .tn-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
