/* =========================================================
 * BEACON · 国内电商平台 Tabs（设计文档规范化 · 双模深度优化）
 * ---------------------------------------------------------
 * 本文件自包含全部皮肤。beacon-tokens.css 中旧插件皮肤已移除，
 * 不再存在“同特异性后加载覆盖”的隐患（此前暗色分隔线被旧规则
 * 改成 dashed + rgba 浅白，就是该隐患的直接表现）。
 *
 * 设计依据（design-doc-full.md）：
 *  - 分段控件 toggle-pill-group：轨道 = canvas-soft，未选 pill = canvas，
 *    选中 pill = 主色；轨道 padding xs、圆角 4px。
 *  - 徽标：hairline 底 + 1px hairline 描边 + 4px 圆角；
 *    暗面 hairline-on-dark = #26263a（同时也是暗底徽标底色）。
 *  - 卡片：1px hairline + 4px 圆角 + 无投影；层级靠留白与分隔线，
 *    不叠投影、不叠灰底。
 *  - 文字：标题与正文 ink（#000 / #fff）；次级与 mono 眉题 body（#999）。
 * ======================================================= */

html #wem-brand-tabs{
  --wem-canvas: #ffffff;
  --wem-ink: #000000;
  --wem-body: #666666;
  --wem-muted: #999999;
  --wem-hairline: #ebebeb;
  --wem-rail: #ebebeb;
  --wem-pill: #ffffff;
  --wem-pill-hover: #f6f6f6;
  --wem-badge-bg: #ebebeb;
  --wem-badge-line: #ebebeb;
  --wem-btn-line: #ebebeb;
  --wem-accent: #fc4c02;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  margin: 0 0 20px;
  padding: 24px;
  font-family: var(--bc-font-sans, Inter, sans-serif) !important;
  color: var(--wem-ink) !important;
  background: var(--wem-canvas) !important;
  border: 1px solid var(--wem-hairline) !important;
  border-radius: 4px !important;
  box-shadow: none !important;
}

html #wem-brand-tabs,
html #wem-brand-tabs *{
  box-sizing: border-box;
}

html #wem-brand-tabs [hidden]{
  display: none !important;
}

/* ---- 分段 Tab 轨道：桌面单行 10 段，平板 5+5，手机横向滚动 ---- */
html #wem-brand-tabs .wem-tabs-header{
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 4px;
  margin: 0 0 24px;
  padding: 4px;
  background: var(--wem-rail);
  border: 0;
  border-radius: 4px;
}

html #wem-brand-tabs .wem-tab-btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  min-height: 48px;
  margin: 0;
  padding: 12px 6px;
  overflow: hidden;
  font-family: var(--bc-font-sans, Inter, sans-serif);
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  letter-spacing: -0.01em;
  white-space: nowrap;
  color: var(--wem-ink) !important;
  background: var(--wem-pill) !important;
  border: 1px solid transparent !important;
  border-radius: 3.25px !important;
  box-shadow: none !important;
  cursor: pointer;
  transition: background-color 120ms ease-out, color 120ms ease-out, border-color 120ms ease-out;
}

html #wem-brand-tabs .wem-tab-btn > span{
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

html #wem-brand-tabs .wem-tab-btn:hover{
  color: var(--wem-ink) !important;
  background: var(--wem-pill-hover) !important;
  border-color: transparent !important;
  box-shadow: none !important;
}

html #wem-brand-tabs .wem-tab-btn:focus-visible{
  outline: 2px solid var(--wem-accent);
  outline-offset: 2px;
  box-shadow: none !important;
}

html #wem-brand-tabs .wem-tab-btn.is-active,
html #wem-brand-tabs .wem-tab-btn.is-active:hover{
  color: #ffffff !important;
  background: #000000 !important;
  border-color: #000000 !important;
  box-shadow: none !important;
}

/* 图标：深底 pill 上反转亮度、浅底 pill 上保持灰度 —— 两种极性都可辨 */
html #wem-brand-tabs .wem-tab-btn img{
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  object-fit: contain;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  filter: grayscale(1);
  opacity: 0.66;
}

html #wem-brand-tabs .wem-tab-btn:hover img,
html #wem-brand-tabs .wem-tab-btn.is-active img{
  opacity: 1;
}

html #wem-brand-tabs .wem-tab-btn.is-active img{
  filter: grayscale(1) invert(1);
}

/* ---- 平台资料头：mono 眉题 / 显示型标题 + 内联适用人群徽标 ---- */
html #wem-brand-tabs .wem-tabs-body{
  margin: 0;
  padding: 0;
  color: var(--wem-ink) !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

html #wem-brand-tabs .wem-panel-head{
  display: block;
  margin: 0 0 20px;
  padding: 0 0 20px;
  border-bottom: 1px solid var(--wem-hairline);
}

html #wem-brand-tabs .wem-eyebrow{
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-family: var(--bc-font-mono, "JetBrains Mono", monospace);
  font-size: 11px;
  font-weight: 500;
  line-height: 15px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--wem-muted);
}

html #wem-brand-tabs .wem-eyebrow::before{
  content: "";
  flex: 0 0 6px;
  width: 6px;
  height: 6px;
  background: var(--wem-accent);
}

html #wem-brand-tabs .wem-title-row{
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin: 8px 0 0;
}

html #wem-brand-tabs .wem-current-name{
  margin: 0;
  padding: 0;
  font-family: var(--bc-font-sans, Inter, sans-serif);
  font-size: 28px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: var(--wem-ink);
}

html #wem-brand-tabs .wem-fit{
  flex: 0 1 auto;
  margin: 0;
  padding: 0;
}

html #wem-brand-tabs .wem-fit span{
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin: 0;
  padding: 4px 8px;
  font-family: var(--bc-font-sans, Inter, sans-serif);
  font-size: 13px;
  font-weight: 400;
  line-height: 20px;
  letter-spacing: 0;
  white-space: nowrap;
  color: var(--wem-ink) !important;
  background: var(--wem-badge-bg) !important;
  border: 1px solid var(--wem-badge-line) !important;
  border-radius: 4px !important;
}

html #wem-brand-tabs .wem-desc{
  max-width: 78ch;
  margin: 0 0 24px;
  padding: 0;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.7;
  letter-spacing: -0.01em;
  color: var(--wem-ink) !important;
}

/* ---- 数据表式信息区：仅 hairline 上下边 + 列间竖线，无灰底 ---- */
html #wem-brand-tabs .wem-meta{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin: 0 0 24px;
  padding: 0;
  background: transparent;
  border-top: 1px solid var(--wem-hairline);
  border-bottom: 1px solid var(--wem-hairline);
}

html #wem-brand-tabs .wem-meta-item{
  min-width: 0;
  margin: 0;
  padding: 20px 24px 20px 0;
  color: var(--wem-ink) !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

html #wem-brand-tabs .wem-meta-item + .wem-meta-item{
  padding-left: 24px;
  border-left: 1px solid var(--wem-hairline) !important;
}

html #wem-brand-tabs .wem-meta-label{
  margin: 0 0 6px;
  padding: 0;
  font-family: var(--bc-font-mono, "JetBrains Mono", monospace);
  font-size: 11px;
  font-weight: 500;
  line-height: 15px;
  letter-spacing: 0.04em;
  color: var(--wem-muted) !important;
}

html #wem-brand-tabs .wem-meta-value{
  margin: 0;
  padding: 0;
  overflow: visible;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.65;
  letter-spacing: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  text-overflow: clip;
  color: var(--wem-ink) !important;
}

/* ---- 操作区：一个主按钮 + 中性描边次级按钮 ---- */
html #wem-brand-tabs .wem-links{
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0;
  padding: 0;
}

html #wem-brand-tabs .wem-links a{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  margin: 0;
  padding: 10px 16px;
  font-family: var(--bc-font-mono, "JetBrains Mono", monospace);
  font-size: 14px;
  font-weight: 500;
  line-height: 18px;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: var(--wem-ink) !important;
  background: var(--wem-canvas) !important;
  border: 1px solid var(--wem-btn-line) !important;
  border-radius: 4px !important;
  box-shadow: none !important;
  transition: border-color 120ms ease-out, color 120ms ease-out, background-color 120ms ease-out;
}

html #wem-brand-tabs .wem-links a::after{
  content: "↗";
  font-family: var(--bc-font-sans, Inter, sans-serif);
  font-size: 14px;
  font-weight: 400;
  line-height: 1;
  opacity: 0.55;
}

html #wem-brand-tabs .wem-links a:hover{
  color: var(--wem-ink) !important;
  border-color: #999999 !important;
  box-shadow: none !important;
}

html #wem-brand-tabs .wem-links a[data-wem-link="site"],
html #wem-brand-tabs .wem-links a[data-wem-link="site"]:hover{
  color: #ffffff !important;
  background: #000000 !important;
  border-color: #000000 !important;
}

html #wem-brand-tabs .wem-links a[data-wem-link="site"]::after{
  opacity: 1;
}

html #wem-brand-tabs .wem-links a:focus-visible,
html #wem-brand-tabs .wem-extra-links a:focus-visible{
  outline: 2px solid var(--wem-accent);
  outline-offset: 3px;
}

/* ---- 次级资源与客服：纯文本 + 实线分隔（不用虚线） ---- */
html #wem-brand-tabs .wem-extra{
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 24px;
  margin: 20px 0 0;
  padding: 16px 0 0;
  font-size: 14px;
  border-top: 1px solid var(--wem-hairline) !important;
}

html #wem-brand-tabs .wem-extra-links{
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: 0;
  padding: 0;
}

html #wem-brand-tabs .wem-extra-links a{
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  margin: 0;
  padding: 0;
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  letter-spacing: 0;
  text-decoration: none;
  color: var(--wem-body) !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

html #wem-brand-tabs .wem-extra-links a:hover{
  color: var(--wem-ink) !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

html #wem-brand-tabs .wem-service{
  margin-left: auto;
  font-size: 14px;
  line-height: 20px;
  white-space: nowrap;
  color: var(--wem-muted) !important;
}

html #wem-brand-tabs .wem-service strong{
  font-weight: 400;
}

html #wem-brand-tabs .wem-service span{
  margin-left: 4px;
  font-family: var(--bc-font-mono, "JetBrains Mono", monospace);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--wem-ink) !important;
}

html #wem-brand-tabs .wem-link-disabled{
  opacity: 0.45;
  cursor: default;
  pointer-events: none;
}

/* =========================================================
 * 暗色：轨道 #26263a（hairline-on-dark 兼徽标底）；
 * 未选 pill 透明，避免 10 个深块浮在轨道上形成棋格；
 * 选中 pill 白底深字；结构线统一 #26263a，交互描边 #313641。
 * ======================================================= */
html.io-black-mode:not(#_) #wem-brand-tabs{
  --wem-canvas: #010120;
  --wem-ink: #ffffff;
  --wem-body: rgba(255, 255, 255, 0.62);
  --wem-muted: rgba(255, 255, 255, 0.55);
  --wem-hairline: #26263a;
  --wem-rail: #26263a;
  --wem-pill: transparent;
  --wem-pill-hover: #313641;
  --wem-badge-bg: #26263a;
  --wem-badge-line: #313641;
  --wem-btn-line: #313641;
  color: #ffffff !important;
  background: #010120 !important;
  border-color: #26263a !important;
  box-shadow: none !important;
}

html.io-black-mode:not(#_) #wem-brand-tabs .wem-tab-btn{
  color: rgba(255, 255, 255, 0.62) !important;
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
}

html.io-black-mode:not(#_) #wem-brand-tabs .wem-tab-btn:hover{
  color: #ffffff !important;
  background: #313641 !important;
  border-color: transparent !important;
}

html.io-black-mode:not(#_) #wem-brand-tabs .wem-tab-btn.is-active,
html.io-black-mode:not(#_) #wem-brand-tabs .wem-tab-btn.is-active:hover{
  color: #010120 !important;
  background: #ffffff !important;
  border-color: #ffffff !important;
}

/* 暗色未选 pill 落在 #26263a 底上，图标反转亮度才可见 */
html.io-black-mode:not(#_) #wem-brand-tabs .wem-tab-btn img{
  filter: grayscale(1) invert(1);
  opacity: 0.62;
}

/* 选中 pill 为白底，图标回归正常灰度 */
html.io-black-mode:not(#_) #wem-brand-tabs .wem-tab-btn.is-active img{
  filter: grayscale(1);
  opacity: 0.9;
}

html.io-black-mode:not(#_) #wem-brand-tabs .wem-tabs-body,
html.io-black-mode:not(#_) #wem-brand-tabs .wem-meta-item{
  color: #ffffff !important;
  background: transparent !important;
  border-color: #26263a !important;
}

html.io-black-mode:not(#_) #wem-brand-tabs .wem-panel-head,
html.io-black-mode:not(#_) #wem-brand-tabs .wem-meta,
html.io-black-mode:not(#_) #wem-brand-tabs .wem-extra{
  border-color: #26263a !important;
}

html.io-black-mode:not(#_) #wem-brand-tabs .wem-fit span{
  color: rgba(255, 255, 255, 0.9) !important;
  background: #26263a !important;
  border-color: #313641 !important;
}

html.io-black-mode:not(#_) #wem-brand-tabs .wem-desc,
html.io-black-mode:not(#_) #wem-brand-tabs .wem-meta-value{
  color: #ffffff !important;
}

html.io-black-mode:not(#_) #wem-brand-tabs .wem-meta-label,
html.io-black-mode:not(#_) #wem-brand-tabs .wem-service{
  color: rgba(255, 255, 255, 0.55) !important;
}

html.io-black-mode:not(#_) #wem-brand-tabs .wem-links a{
  color: #ffffff !important;
  background: transparent !important;
  border-color: #313641 !important;
}

html.io-black-mode:not(#_) #wem-brand-tabs .wem-links a:hover{
  color: #ffffff !important;
  background: #313641 !important;
  border-color: #313641 !important;
}

html.io-black-mode:not(#_) #wem-brand-tabs .wem-links a[data-wem-link="site"],
html.io-black-mode:not(#_) #wem-brand-tabs .wem-links a[data-wem-link="site"]:hover{
  color: #010120 !important;
  background: #ffffff !important;
  border-color: #ffffff !important;
}

html.io-black-mode:not(#_) #wem-brand-tabs .wem-extra-links a{
  color: rgba(255, 255, 255, 0.62) !important;
  background: transparent !important;
  border: 0 !important;
}

html.io-black-mode:not(#_) #wem-brand-tabs .wem-extra-links a:hover{
  color: #ffffff !important;
  background: transparent !important;
}

html.io-black-mode:not(#_) #wem-brand-tabs .wem-service span{
  color: #ffffff !important;
}

/* ---- 响应式 ---- */
@media (max-width: 1199px){
  html #wem-brand-tabs .wem-tabs-header{
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (max-width: 767px){
  html #wem-brand-tabs .wem-tabs-header{
    display: flex;
    gap: 4px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
  }

  html #wem-brand-tabs .wem-tab-btn{
    flex: 0 0 124px;
    min-height: 46px;
    scroll-snap-align: start;
  }

  html #wem-brand-tabs .wem-title-row{
    gap: 8px 12px;
  }

  html #wem-brand-tabs .wem-current-name{
    font-size: 24px;
  }

  html #wem-brand-tabs .wem-fit span{
    font-size: 12px;
    white-space: normal;
  }

  html #wem-brand-tabs .wem-meta{
    grid-template-columns: 1fr;
  }

  html #wem-brand-tabs .wem-meta-item,
  html #wem-brand-tabs .wem-meta-item + .wem-meta-item{
    padding: 14px 0;
    border-left: 0 !important;
  }

  html #wem-brand-tabs .wem-meta-item + .wem-meta-item{
    border-top: 1px solid var(--wem-hairline) !important;
  }

  html #wem-brand-tabs .wem-links a{
    flex: 1 1 auto;
    min-height: 44px;
  }

  html #wem-brand-tabs .wem-extra{
    align-items: flex-start;
  }

  html #wem-brand-tabs .wem-service{
    width: 100%;
    margin-left: 0;
    white-space: normal;
  }
}

@media (max-width: 640px){
  html #wem-brand-tabs{
    margin-bottom: 16px;
    padding: 16px;
  }

  html #wem-brand-tabs .wem-tabs-header{
    margin-bottom: 18px;
  }

  html #wem-brand-tabs .wem-panel-head{
    margin-bottom: 16px;
    padding-bottom: 16px;
  }

  html #wem-brand-tabs .wem-desc{
    margin-bottom: 18px;
    font-size: 15px;
  }

  html #wem-brand-tabs .wem-meta{
    margin-bottom: 18px;
  }

  html #wem-brand-tabs .wem-extra-links{
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    gap: 8px 16px;
  }
}

@media (prefers-reduced-motion: reduce){
  html #wem-brand-tabs,
  html #wem-brand-tabs *{
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}
