/*
 * ============================================================
 * ftf-header.css — 外贸前台 头部 + 底部 布局样式（S2 缺失补齐）
 * 2026-08-08 修复：header/footer 一直无任何布局样式（品牌/导航/按钮纵向堆叠）
 * 类前缀：ft-header / ft-nav / ft-footer / ft-lang-*
 * 依赖：tokens.css（--ft-* 令牌）；模板可覆盖（如 industrial.css 深蓝顶栏）
 * ============================================================
 */

/* ===== 头部 ===== */
.ft-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--ft-header-bg, var(--ft-primary, #1677ff));
  color: var(--ft-header-text, #ffffff);
  box-shadow: 0 1px 4px rgba(15, 42, 74, 0.12);
}
.ft-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  height: var(--ft-header-height, 60px);
}
.ft-header__brand a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}
.ft-header__logo-img { height: 34px; width: auto; display: block; }
.ft-header__logo {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.ft-header__tag {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border: 1px solid currentColor;
  border-radius: 999px;
  opacity: 0.85;
  white-space: nowrap;
}

/* ===== 导航 ===== */
.ft-nav { display: flex; align-items: center; gap: 28px; }
.ft-nav__link {
  color: inherit;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 6px 0;
  white-space: nowrap;
  transition: opacity 0.2s;
}
.ft-nav__link:hover { opacity: 0.75; }

/* ===== 右侧操作区 ===== */
.ft-header__actions { display: flex; align-items: center; gap: 12px; }

/* 语言切换 */
.ft-lang-switch { position: relative; }
.ft-lang-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  min-width: 44px;
  padding: 0 12px;
  background: transparent;
  color: inherit;
  border: 1px solid currentColor;
  border-radius: var(--ft-radius-sm, 4px);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.ft-lang-btn:hover { background: rgba(255, 255, 255, 0.12); }
.ft-lang-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 110;
  min-width: 140px;
  background: #fff;
  color: #1e293b;
  border: 1px solid #e2e8f0;
  border-radius: var(--ft-radius-md, 8px);
  box-shadow: 0 8px 24px rgba(15, 42, 74, 0.15);
  padding: 6px;
  display: none;
}
.ft-lang-menu.is-open { display: block; }
.ft-lang-menu__item {
  display: block;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  color: #1e293b;
  text-decoration: none;
}
.ft-lang-menu__item:hover {
  background: var(--ft-primary-bg, #e6f4ff);
  color: var(--ft-primary, #1677ff);
}
.ft-lang-menu__item.is-active {
  color: var(--ft-primary, #1677ff);
  font-weight: 600;
  background: var(--ft-primary-bg, #e6f4ff);
}

/* ===== 底部 ===== */
.ft-footer {
  background: var(--ft-footer-bg, #0f2a4a);
  color: var(--ft-footer-text, #d7e6f7);
}
.ft-footer__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 20px 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}
.ft-footer__brand {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 320px;
}
.ft-footer__brand strong { font-size: 16px; color: #fff; }
.ft-footer__brand span { font-size: 13px; opacity: 0.75; }
.ft-footer__logo-img { height: 30px; width: auto; }
.ft-footer__links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
}
.ft-footer__links a {
  color: inherit;
  text-decoration: none;
  font-size: 13px;
  opacity: 0.8;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.ft-footer__links a:hover { opacity: 1; color: #fff; }
.ft-footer__links .bi { font-size: 16px; }
.ft-footer__copy {
  flex-basis: 100%;
  text-align: center;
  font-size: 12px;
  opacity: 0.65;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 14px;
  margin-top: 4px;
}

/* ===== 响应式（窄屏折行不破版） ===== */
@media (max-width: 992px) {
  .ft-header__inner { flex-wrap: wrap; height: auto; padding: 10px 16px; gap: 10px; }
  .ft-header__tag { display: none; }
  .ft-header__brand { min-width: 0; }
  .ft-header__logo { font-size: 17px; }
  .ft-nav { gap: 14px; order: 3; flex-basis: 100%; justify-content: space-between; }
  .ft-footer__inner { flex-direction: column; gap: 16px; }
  .ft-footer__copy { text-align: left; }
}
[dir="rtl"] .ft-footer__copy { text-align: right; }

/* v11 移动端触摸目标（视觉模型 P3：≥40px 可点区域） */
@media (max-width: 640px) {
  .ft-header__actions .ft-nav__link,
  .ft-header__actions .ft-lang-btn,
  .ft-header__actions .ft-btn { min-height: 40px; display: inline-flex; align-items: center; }
  .ft-header__actions { gap: 8px; }
}

/* ===== t32 阶段2：页头页脚站点设置渲染（header_config / footer_config） ===== */
/* 顶部公告栏 */
.ft-header__announce {
  background: var(--ft-announce-bg, #0f2a4a);
  color: #fff;
  font-size: 13px;
  text-align: center;
  padding: 6px 16px;
}
/* logo 居中布局：菜单左 / 品牌中 / 操作右 */
.ft-header--center .ft-header__inner { justify-content: center; gap: 32px; }
.ft-header--center .ft-nav { order: 1; }
.ft-header--center .ft-header__brand { order: 2; }
.ft-header--center .ft-header__actions { order: 3; }
@media (max-width: 992px) {
  .ft-header--center .ft-header__inner { flex-wrap: wrap; }
  .ft-header--center .ft-nav { order: 3; flex-basis: 100%; justify-content: center; }
  .ft-header--center .ft-header__brand { order: 1; }
  .ft-header--center .ft-header__actions { order: 2; }
}
/* 页头搜索框 */
.ft-header__search {
  display: inline-flex; align-items: center;
  border: 1px solid currentColor;
  border-radius: 999px;
  overflow: hidden;
}
.ft-header__search-input {
  border: 0; background: transparent; color: inherit;
  font-size: 13px; padding: 6px 4px 6px 12px;
  width: 140px; outline: none;
}
.ft-header__search-input::placeholder { color: inherit; opacity: .7; }
.ft-header__search-btn {
  border: 0; background: transparent; color: inherit;
  padding: 6px 10px; cursor: pointer; font-size: 14px;
}
.ft-header__search-btn:hover { opacity: .7; }
@media (max-width: 640px) {
  .ft-header__search { order: 4; flex-basis: 100%; max-width: 100%; }
  .ft-header__search-input { width: 100%; flex: 1; }
}
/* 页脚三栏 */
.ft-footer__col { max-width: 260px; min-width: 160px; }
.ft-footer__col-title {
  font-size: 14px; font-weight: 600; color: #fff;
  margin: 0 0 10px;
}
.ft-footer__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ft-footer__list a {
  color: inherit; text-decoration: none; font-size: 13px; opacity: .8;
  display: inline-flex; align-items: center; gap: 6px;
}
.ft-footer__list a:hover { opacity: 1; color: #fff; }
.ft-footer__contact li { display: flex; align-items: flex-start; gap: 6px; font-size: 13px; opacity: .85; }
.ft-footer__contact li a { opacity: 1; }
.ft-footer__contact .bi { font-size: 14px; margin-top: 2px; }
/* 页脚社交图标行 */
.ft-footer__social { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.ft-footer__social a {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: inherit; font-size: 15px; text-decoration: none;
}
.ft-footer__social a:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
/* 页脚单栏布局（品牌居中） */
.ft-footer--single .ft-footer__inner { flex-direction: column; align-items: center; text-align: center; }
.ft-footer--single .ft-footer__brand--center { align-items: center; max-width: 560px; }
.ft-footer--single .ft-footer__social { justify-content: center; margin-top: 14px; }
/* 页脚订阅框 */
.ft-footer__newsletter { flex-basis: 100%; margin-top: 8px; }
.ft-footer__newsletter-row { display: flex; gap: 8px; max-width: 420px; }
.ft-footer__newsletter-input {
  flex: 1; min-width: 0; padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.3); border-radius: var(--ft-radius-sm, 4px);
  background: rgba(255, 255, 255, 0.08); color: #fff; font-size: 13px;
}
.ft-footer__newsletter-input::placeholder { color: rgba(255, 255, 255, 0.6); }
/* 版权行扩展（Cookie 偏好入口等） */
.ft-footer__copy-ext { margin-left: 12px; }
@media (max-width: 640px) {
  .ft-footer__copy-ext { display: block; margin: 6px 0 0; }
}
