/* ==========================================================================
 * TERENCE 产品比较 —— 前端样式
 * 布局 / 间距 / 交互：对齐 Apple「产品比较」页
 * 字体与品牌色：沿用 terencemusic.com（Sfont / #151515 / #dbbc87 / #6f6f6f）
 * 页面底色：白 #ffffff，分区浅灰 #f5f5f7
 * 说明：所有类名以 tc- 前缀隔离，便于直接嵌入 PbootCMS 模板
 * ========================================================================== */



:root {
  --tc-font: var(--tm-font-body, "Sfont", "Microsoft YaHei", "微软雅黑", "Helvetica Neue", Helvetica, Arial, sans-serif);
  --tc-ink: var(--tm-color-heading, #151515);          /* 品牌主色（标题/正文） */
  --tc-ink-2: var(--tm-color-text, #424245);
  --tc-ink-3: var(--tm-color-muted, #6f6f6f);        /* 品牌次级灰 */
  --tc-gold: var(--tm-color-brand, #dbbc87);         /* 品牌金（链接/CTA/强调） */
  --tc-gold-deep: var(--tm-color-brand, #dbbc87);
  --tc-bg: var(--tm-color-background, #ffffff);
  --tc-bg-alt: #f5f5f7;
  --tc-well: #fafafa;
  --tc-line: var(--tm-color-border, #d2d2d7);
  --tc-line-soft: #e8e8ed;
  --tc-max: var(--tm-container-wide, 1440px);
  --tc-ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ---------- 容器 ---------- */
.tc {
  background: var(--tc-bg);
  color: var(--tc-ink);
  font-family: var(--tc-font);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 80px;
}
.tc *, .tc *::before, .tc *::after { box-sizing: border-box; }
.tc a { color: inherit; text-decoration: none; }
.tc img { max-width: 100%; display: block; }
.tc button { font-family: inherit; cursor: pointer; }

.tc-wrap { box-sizing: border-box; width: 100%; max-width: var(--tc-max); margin: 0 auto; padding: 0 var(--tm-gutter, 16px); }

/* ---------- Hero ---------- */
.tc-hero {
  padding: 54px 0 34px;
  text-align: center;
  border-bottom: 1px solid var(--tc-line);
}
.tc-hero h1 {
  font-size: 40px;
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: 0.2px;
  margin: 0 0 12px;
  color: var(--tc-ink);
}
.tc-hero p { margin: 0 auto; color: var(--tc-ink-3); font-size: 14px; max-width: 620px; }
.tc-hero__meta { margin-top: 14px; font-size: 12px; color: var(--tc-ink-3); letter-spacing: 0.2px; }
.tc-hero__meta b { color: var(--tc-ink-2); font-weight: 600; }

/* ---------- 吸顶产品选择栏（标题 + 下拉选择 + 颜色及颜色配图） ---------- */
.tc-bar {
  position: sticky;
  /* 官网导航栏是 fixed-top，吸顶时要让出它的高度，否则整条选择栏会被页头压住。
     --tc-nav-h 由 compare.js 按实际页头高度实时写入；无页头时为 0。 */
  top: var(--tc-nav-h, 0px);
  z-index: 100;
  background: #ffffff;
  border-bottom: 1px solid var(--tc-line-soft);
}
/* 被 iframe 嵌入时用 transform 模拟吸顶（见 compare.js initIframeSticky），
   此刻加上投影，与后续内容区分开 */
.tc-bar.is-stuck { box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08); }
.tc-bar .tc-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.tc-bar__head {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 0 0 auto;
  padding: 16px 0;
}
.tc-bar__title { font-size: 18px; font-weight: 700; color: var(--tc-ink); letter-spacing: 0.3px; }
.tc-bar__hint { font-size: 12px; color: var(--tc-ink-3); }

.tc-bar__grid {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: repeat(var(--tc-cols, 3), minmax(150px, 1fr));
  gap: 0 18px;
  align-items: start;
}
.tc-bar__col { padding: 14px 0 16px; text-align: center; min-width: 0; }
.tc-bar__col .tc-select { width: 100%; }
/* 颜色及颜色配图随吸顶栏一起吸顶：下拉框 → 色块 → 颜色名 */
.tc-bar__col .tc-select { margin-bottom: 10px; }
.tc-bar__col .tc-colors { margin-bottom: 6px; }
.tc-bar__col .tc-colorname { margin-bottom: 0; }

/* 列选择下拉（Apple 式） */
.tc-select {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  background: #fff url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236f6f6f' stroke-width='2' stroke-linecap='round'><path d='M6 9l6 6 6-6'/></svg>") no-repeat right 9px center / 13px;
  border: 1px solid var(--tc-line);
  border-radius: 8px;
  padding: 7px 28px 7px 11px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.2px;
  color: var(--tc-ink);
  cursor: pointer;
  transition: border-color 0.18s var(--tc-ease);
  text-overflow: ellipsis;
}
.tc-select option, .tc-select optgroup {
  font-family: inherit;
  font-weight: 600;
  color: var(--tc-ink);
}
.tc-select optgroup { font-size: 12px; color: var(--tc-ink-3); }
.tc-select optgroup option { color: var(--tc-ink); padding-left: 4px; }
.tc-select:hover { border-color: var(--tc-gold); }
.tc-select:focus { outline: none; border-color: var(--tc-gold); box-shadow: 0 0 0 3px rgba(219, 188, 135, 0.16); }

/* ---------- 产品卡片区（不吸顶，图片/颜色/价格/CTA） ---------- */
.tc-cards {
  display: grid;
  grid-template-columns: repeat(var(--tc-cols, 3), minmax(150px, 1fr));
  gap: 0 18px;
  align-items: start;
  padding: 18px 0 10px;
}
.tc-card { padding: 0 0 20px; text-align: center; min-width: 0; }
.tc-card.is-empty { padding: 24px 0; }

/* 空列占位 */
.tc-card__placeholder {
  min-height: 250px;
  border: 1px dashed var(--tc-line);
  border-radius: 12px;
  background: var(--tc-bg-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--tc-ink-3);
  font-size: 12px;
  text-align: center;
  padding: 18px 12px;
}

/* 单个产品卡片 */
.tc-card__img {
  height: 190px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px;
  background: #ffffff;
  border-radius: 12px;
  overflow: hidden;
  transition: height 0.3s var(--tc-ease);
}
.tc-card__img img { max-height: 170px; width: auto; max-width: 92%; object-fit: contain; transition: max-height 0.3s var(--tc-ease); }

/* 颜色色块 */
.tc-colors { display: flex; justify-content: center; gap: 9px; margin-bottom: 7px; }
.tc-swatch {
  width: 22px; height: 22px; border-radius: 50%;
  border: 1px solid var(--tc-line);
  padding: 0; background: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  transition: box-shadow 0.2s var(--tc-ease);
}
.tc-swatch i {
  display: block; width: 16px; height: 16px; border-radius: 50%;
  background: var(--sw, #eee);
  background-size: cover; background-position: center;
}
.tc-swatch:hover { box-shadow: 0 0 0 2px rgba(219, 188, 135, 0.35); }
.tc-swatch.is-on { box-shadow: 0 0 0 1.5px var(--tc-gold); }
.tc-swatch.is-on i { box-shadow: inset 0 0 0 1px rgba(0,0,0,0.08); }
.tc-colorname { font-size: 11px; color: var(--tc-ink-3); min-height: 16px; margin-bottom: 12px; }

/* 价格区 */
.tc-card__hr { height: 1px; background: var(--tc-line-soft); margin: 0 0 12px; }
.tc-badge {
  font-size: 11px; color: var(--tc-gold); letter-spacing: 0.3px;
  min-height: 16px; margin-bottom: 4px; font-weight: 600;
}
.tc-price { font-size: 15px; color: var(--tc-ink); font-weight: 600; line-height: 1.4; }
.tc-price small { font-size: 11px; color: var(--tc-ink-3); font-weight: 400; display: block; margin-top: 2px; }
.tc-price__gap { height: 10px; }

/* CTA */
.tc-cta { margin-top: 12px; display: flex; flex-direction: column; align-items: center; gap: 9px; }
.tc-btn-buy {
  position: relative;
  display: inline-block;
  background: var(--tc-gold);
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: 8px 26px;
  font-size: 13px;
  letter-spacing: 0.5px;
  transition: background 0.2s var(--tc-ease), transform 0.2s var(--tc-ease);
}
.tc-btn-buy:hover { background: var(--tc-gold-deep); }
.tc-btn-buy:active { transform: scale(0.97); }

.tc-more { font-size: 12px; color: var(--tc-ink-2); display: inline-flex; align-items: center; gap: 3px; }
.tc-more::after { content: "›"; font-size: 14px; line-height: 1; color: var(--tc-gold-deep); }
.tc-more:hover { color: var(--tc-gold-deep); }

/* 官网商城弹层（复刻官网 .liji_buy > .liji_list） */
.tc-shop {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translate(-50%, 6px);
  background: #fff;
  border: 1px solid var(--tc-line);
  border-radius: 12px;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.14);
  padding: 10px 0;
  min-width: 172px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s var(--tc-ease), transform 0.2s var(--tc-ease);
  z-index: 30;
}
.tc-shop::after {
  content: ""; position: absolute; top: 100%; left: 50%; margin-left: -6px;
  border: 6px solid transparent; border-top-color: #fff;
}
.tc-shop a {
  display: block; padding: 8px 18px; font-size: 12px; color: var(--tc-ink-2);
  white-space: nowrap; transition: color 0.18s, background 0.18s;
}
.tc-shop a:hover { color: var(--tc-gold-deep); background: var(--tc-bg-alt); }
.tc-btn-buy.is-open .tc-shop,
.tc-btn-buy:hover .tc-shop { opacity: 1; pointer-events: auto; transform: translate(-50%, 0); }

/* ---------- 工具条 ---------- */
.tc-tools {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 16px 0;
  border-bottom: 1px solid var(--tc-line-soft);
  margin-bottom: 4px;
}
.tc-switch { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--tc-ink-2); cursor: pointer; user-select: none; }
.tc-switch__track {
  position: relative; width: 38px; height: 22px; border-radius: 999px;
  background: #d8d8dd; transition: 0.24s var(--tc-ease); flex: 0 0 auto;
}
.tc-switch__track::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.2); transition: 0.24s var(--tc-ease);
}
.tc-switch input { display: none; }
.tc-switch input:checked + .tc-switch__track { background: var(--tc-gold); }
.tc-switch input:checked + .tc-switch__track::after { left: 18px; }

.tc-chip {
  border: 1px solid var(--tc-line); background: #fff; color: var(--tc-ink-2);
  border-radius: 999px; padding: 5px 14px; font-size: 12px;
  transition: 0.2s var(--tc-ease);
}
.tc-chip:hover { border-color: var(--tc-gold); color: var(--tc-gold-deep); }
.tc-hint { font-size: 12px; color: var(--tc-ink-3); margin-left: auto; }

/* ---------- 对比表 ---------- */
/* 注意：嵌套的 overflow 滚动容器在 iOS Safari 上会吞掉纵向滑动手势，
   因此手机端（≤767px）完全不套容器，改为让表格自适应宽度换行。 */
.tc-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  scrollbar-color: #c8c8cd transparent;
}
.tc-scroll::-webkit-scrollbar { height: 8px; }
.tc-scroll::-webkit-scrollbar-thumb { background: #c8c8cd; border-radius: 8px; }
/* 桌面端不会横向溢出：用 clip 让元素不成为滚动容器 */
@media (min-width: 992px) { .tc-scroll { overflow-x: clip; overflow-y: visible; } }

table.tc-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  min-width: 640px;
}
.tc-table col.tc-cl { width: 180px; }

.tc-table th, .tc-table td {
  padding: 14px 14px;
  font-size: 13px;
  line-height: 1.6;
  text-align: center;
  vertical-align: middle;
  word-break: break-word;
  border-bottom: 1px solid var(--tc-line-soft);
}

/* 分组标题行 */
.tc-table tr.tc-group th {
  position: sticky; left: 0; z-index: 4;
  background: var(--tc-bg);
  text-align: left;
  padding: 44px 0 12px;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: var(--tc-ink);
  border-bottom: 1px solid var(--tc-line);
}
.tc-table tr.tc-group:first-child th { padding-top: 30px; }

/* 字段名（左列固定） */
.tc-table td.tc-label {
  position: sticky; left: 0; z-index: 3;
  background: var(--tc-bg);
  text-align: left;
  color: var(--tc-ink-3);
  font-size: 12px;
  padding-left: 0;
  width: 180px;
}
.tc-table tr:hover td.tc-label { color: var(--tc-ink); }

.tc-table td.tc-value { color: var(--tc-ink-2); }
.tc-table td.tc-value.is-empty { color: #b8b8bd; }
/* 空值占位符：加粗短横线，明确表示「无此配置」（◉ 与 - 是真实差异） */
.tc-table b.tc-dash{ font-weight:800; color:#333; letter-spacing:1px; }
.tc-table td.tc-value.is-diff { color: var(--tc-ink); font-weight: 600; }
.tc-diff-dot {
  display: inline-block; width: 5px; height: 5px; border-radius: 50%;
  background: var(--tc-gold); margin-right: 6px; vertical-align: 2px;
}
.tc-table td.tc-value.col-hover { background: var(--tc-well); }

/* ---------- 桌面端列对齐 ----------
   对比表是「180px 字段名列 + N 个均分数据列」（table-layout:fixed，border-spacing:0），
   而上方的选择栏 / 产品卡片原本从容器最左开始且列间有 18px 间距，
   导致产品位置比下方数据列偏左。这里让两者同构：
   标题块绝对定位到左侧 180px 区域，选择栏与卡片各加一个 180px 占位首列、
   列间距归零、均分宽度 —— 与表格数据列逐列对齐。 */
@media (min-width: 992px) {
  /* 选择栏本身排成「180px 标题列 + 数据列区」，与表格/卡片的
     「180px 字段名列 + N 个均分数据列」同构，逐列对齐。
     标题块保持在正常文档流里（不再绝对定位），栏高随标题文字撑开，
     吸顶时不会有文字溢出到页头底下或被上下内容压住。 */
  .tc-bar .tc-wrap {
    position: relative;
    display: grid;
    grid-template-columns: 180px 1fr;
    align-items: center;
    gap: 0;
  }
  .tc-bar__head {
    position: static;
    left: auto; top: auto; transform: none;
    width: 180px;
    padding: 16px 14px 16px 0;
    box-sizing: border-box;
  }
  .tc-bar__grid {
    grid-template-columns: repeat(var(--tc-cols, 3), minmax(150px, 1fr));
    gap: 0;
  }
  .tc-cards {
    grid-template-columns: 180px repeat(var(--tc-cols, 3), minmax(150px, 1fr));
    gap: 0;
  }
  .tc-bar__grid::before { content: ""; display: none; }
  .tc-cards::before { content: ""; display: block; }
  /* 卡片内边距与表格单元格一致（14px），内容仍居中于各自列 */
  .tc-card { padding-left: 14px; padding-right: 14px; }
  .tc-bar__col { padding-left: 14px; padding-right: 14px; }
}

/* 空态 / 加载 */
.tc-empty {
  text-align: center; padding: 90px 20px; color: var(--tc-ink-3);
  border: 1px dashed var(--tc-line); border-radius: 14px; margin: 40px 0;
  background: var(--tc-bg-alt);
}
.tc-empty h3 { color: var(--tc-ink); font-size: 18px; margin: 0 0 8px; font-weight: 600; }
.tc-loading { text-align: center; padding: 110px 0; color: var(--tc-ink-3); font-size: 13px; }
.tc-spinner {
  width: 26px; height: 26px; margin: 0 auto 14px;
  border: 2px solid var(--tc-line); border-top-color: var(--tc-gold);
  border-radius: 50%; animation: tc-spin 0.8s linear infinite;
}
@keyframes tc-spin { to { transform: rotate(360deg); } }

/* 字段图标 + 文案 */
.tc-cell { display: inline-flex; align-items: flex-start; gap: 7px; text-align: left; }
.tc-cell img {
  width: 17px; height: 17px; flex: 0 0 auto; margin-top: 2px;
  object-fit: contain; opacity: 0.85;
}

/* 回到顶部 */

/* Toast */
.tc-toast {
  position: fixed; left: 50%; bottom: 40px; transform: translate(-50%, 16px);
  z-index: 2000; background: #1d1d1f; color: #fff;
  padding: 10px 20px; border-radius: 999px; font-size: 12px;
  opacity: 0; pointer-events: none; transition: 0.3s var(--tc-ease);
}
.tc-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 响应式 ---------- */
/* 平板（768–991）：栏位横向滚动，保留 3–4 列 */
@media (max-width: 991px) {
  .tc-bar .tc-wrap { flex-direction: column; align-items: stretch; gap: 0; }
  .tc-bar__head { flex-direction: row; align-items: baseline; gap: 10px; padding: 12px 0 4px; }
  .tc-bar__grid { display: flex; overflow-x: auto; gap: 0; scrollbar-width: none; }
  .tc-bar__grid::-webkit-scrollbar { display: none; }
  .tc-bar__col { flex: 0 0 178px; padding: 8px 8px 12px; }
  .tc-cards { display: flex; overflow-x: auto; gap: 0; scrollbar-width: none; padding-top: 10px; }
  .tc-cards::-webkit-scrollbar { display: none; }
  .tc-card { flex: 0 0 178px; padding: 12px 8px 14px; }
  .tc-card__img { height: 118px; }
  .tc-card__img img { max-height: 104px; }
  .tc-hero { padding: 36px 0 20px; }
  .tc-hero h1 { font-size: 30px; }
  .tc-tools { gap: 10px; }
  .tc-hint { margin-left: 0; width: 100%; }
}

/* 手机（≤767）：只显示两列，标题独立一行居中，表格自适应不横向滚动 */
@media (max-width: 767px) {
  .tc-hero { padding: 30px 0 18px; }
  .tc-hero h1 { font-size: 27px; }
  .tc-hero p { font-size: 13px; }
  .tc-hero__meta { font-size: 11px; }

  .tc-bar__head {
    justify-content: center;
    gap: 2px;
    padding: 10px 0 2px;
    text-align: center;
  }
  .tc-bar__title { font-size: 15px; }
  .tc-bar__hint { font-size: 11px; }
  .tc-bar__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 12px;
    overflow: visible;
  }
  .tc-bar__col { padding: 8px 0 10px; }
  .tc-bar__col .tc-select { padding: 6px 26px 6px 9px; font-size: 12px; }

  .tc-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 12px;
    overflow: visible;
  }
  .tc-card { padding: 12px 0 14px; }
  .tc-card__img { height: 132px; }
  .tc-card__img img { max-height: 118px; }
  .tc-colors { gap: 8px; }
  .tc-swatch { width: 24px; height: 24px; }
  .tc-swatch i { width: 18px; height: 18px; }
  .tc-colorname { font-size: 11px; }
  .tc-price { font-size: 14px; }
  .tc-btn-buy { padding: 7px 22px; font-size: 12px; }
  .tc-card__placeholder { min-height: 200px; }

  /* 购买弹层贴底展示，避免小屏被截断 */
  .tc-shop {
    position: fixed;
    left: 50%; right: auto; bottom: 78px; top: auto;
    transform: translate(-50%, 8px);
    max-height: 60vh; overflow-y: auto;
  }
  .tc-shop::after { display: none; }
  .tc-btn-buy.is-open .tc-shop { transform: translate(-50%, 0); }

  .tc-tools { gap: 8px; padding: 12px 0; }
  .tc-chip { padding: 4px 11px; font-size: 11px; }
  .tc-switch { font-size: 12px; }
  .tc-hint { margin-left: 0; width: 100%; font-size: 11px; }

  /* 表格自适应：手机端不套滚动容器，避免吞掉纵向滑动手势 */
  .tc-scroll {
    overflow: visible;
    -webkit-overflow-scrolling: auto;
  }
  table.tc-table { min-width: 0; table-layout: fixed; }
  .tc-table th, .tc-table td { overflow-wrap: anywhere; word-break: break-word; }
  .tc-table col.tc-cl { width: 88px; }
  .tc-table td.tc-label { width: 88px; min-width: 88px; font-size: 11px; padding-right: 6px; }
  .tc-table th, .tc-table td { padding: 11px 8px; font-size: 12px; }
  .tc-table tr.tc-group th { font-size: 16px; padding: 26px 0 9px; }
  .tc-cell img { width: 15px; height: 15px; }
}

/* 手机端整体兜底：确保根节点自身不会被任何祖先锁死滚动 */
@media (max-width: 767px) {
  html, body {
    overflow-y: visible;
    height: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: auto;
    -webkit-text-size-adjust: 100%;
  }
  .tc { touch-action: pan-y; }
}

/* ---------- 打印 ---------- */
/* ================= 打印 / 存为 PDF =================
   本页由 index.php 引入了官网模板（Bootstrap + comm_head/comm_foot），
   打印会遇到三个障碍，这里逐一解决：

   ① 方向无法选择（横向/竖向）：官网引入的 Bootstrap 里有 `@page{size:a3}`，
      它会强制 A3 纸张并让浏览器打印设置里的方向下拉失效。
      实测（本机 Chromium + CDP preferCSSPageSize）：
        仅 Bootstrap           -> 297x420mm（A3 纵向，方向被锁死）
        追加 @page{size:auto}  -> 216x279mm（恢复默认，方向可选）
      即：后写的 @page 能按级联覆盖前面的 size，用 `size:auto` 解除锁定，
      这样浏览器打印设置页就能自由选择「横向 / 纵向」。

   ② 页头页尾被打出来：官网页头导航 / 商城条 / 页尾属于页面内容，
      浏览器不会自动去掉，必须在打印样式里 display:none —— 只打印正文。

   ③ 内容被挤压换行：解除 table-layout:fixed、固定列宽与最小宽度。
*/

/* ★ 解除 Bootstrap 的 @page{size:a3} 锁定，让方向可选。
   必须写 size:auto（不能省略），否则方向下拉仍然不可用。 */
@page {
  size: auto;
  margin: 10mm;
}

/* ---------- 隐藏官网页头 / 商城条 / 页尾（只打印正文） ---------- */
@media print {
  /* 官网页头导航（Bootstrap navbar + 二级菜单 + 侧边弹层） */
  .navbar,
  .navbar-light,
  nav.navbar,
  .sub_nav_bg,
  .sub_nav,
  .menu-on .menu-pic-list,
  .menu-pic-list,
  .search_top,
  .top_nav,
  .header,
  .top-bar,
  .topbar,
  /* 商城模块（comm_mall.html 引入，class="bg15 new_buy"）与浮层条 */
  .new_buy,
  .liji_buy,
  .liji_list,
  .bg15.new_buy,
  .mall_bar,
  .comm_mall,
  .mall,
  /* 面包屑所在的整行容器 */
  .tc-crumb-wrap,
  .tc-crumb-box,
  /* 页尾 */
  .footer,
  footer,
  .foot_top,
  .comm_foot,
  .back_top,
  .scroll-top,
  .online,
  /* ---------- 面包屑 / 二级导航（index.php 由 lib_crumb.php 注入） ----------
     实际类名：桌面 .sonsort（bgfff d-none d-md-block）
              移动 .container.bgf8.d-block.d-md-none + #accordion
              配套 .sub_menu / .sub_menu_on / .mianbao2
     这些都是导航性质，不是对比正文，打印时全部隐藏。 */
  .tc-crumb,
  .tc-crumb-line,
  .sonsort,
  .sub_menu,
  .sub_menu_on,
  .mianbao2,
  #accordion,
  .crumb,
  .breadcrumb { display: none !important; }

  /* 隐藏后可能残留的固定定位占位，避免出现空白块 */
  .fixed-top { position: static !important; }
  body { padding-top: 0 !important; margin-top: 0 !important; }
}

@media screen {
  /* 官网页头是 fixed-top，打印隐藏后不要影响正文位置 */
  body { padding-top: 0; }
}

/* ---------- 正文骨架：宽度自适应（横向/纵向都不挤压） ---------- */
@media print {
  html, body {
    width: 100% !important; max-width: none !important;
    margin: 0 !important; padding: 0 !important;
    background: #fff !important;
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
  .tc, .tc-hero, .tc-wrap { width: 100% !important; max-width: none !important; }
  .tc-wrap { padding: 0 !important; }
  .container { width: 100% !important; max-width: none !important; padding: 0 !important; }
  /* 官网样式会给容器强制 min-width（桌面断点 992px），打印时会把内容撑出 A4 纸宽
     造成整体横向溢出/错位 —— 一律放开 */
  html, body, .container, .tc, .tc-wrap, .tc-scroll, .tc-cards, .tc-hero {
    min-width: 0 !important;
  }

  /* 隐藏交互元素 */
  .tc-bar, .tc-tools, .tc-toast, .tc-field-help, .tc-online,
  .tc-switch, .tc-chip { display: none !important; }
  .tc-hero { padding: 0 0 10px !important; border-bottom: 1px solid #ddd !important; }

  /* 横向滚动容器必须放开，否则内容被裁切 */
  .tc-scroll { overflow: visible !important; width: 100% !important; max-width: none !important; }

  /* ★ 打印时与屏幕端同构：固定「标签列 + N 均分数据列」，保证上方产品卡片逐列对齐 */
  table.tc-table, .tc-table {
    width: 100% !important; max-width: 100% !important;
    min-width: 0 !important;
    table-layout: fixed !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
  }
  .tc-table colgroup { display: table-column-group !important; }
  .tc-table col { display: table-column !important; }
  .tc-table col.tc-cl { width: 150px !important; }
  .tc-table th, .tc-table td {
    width: auto !important; min-width: 0 !important;
    padding: 5px 8px !important;
    font-size: var(--svc-size-body,14px) !important; line-height: var(--svc-line-body,1.9) !important;
    word-break: normal !important; overflow-wrap: break-word !important;
    white-space: normal !important;
    vertical-align: middle !important;
  }
  /* 第一列（字段名）与屏幕端同宽起点，长字段名允许换行保证行高整齐 */
  .tc-table td.tc-label, .tc-table th.tc-label {
    width: 150px !important; min-width: 150px !important; max-width: none !important;
    position: static !important; left: auto !important; z-index: auto !important;
    text-align: left !important;
    font-size: var(--svc-size-body,14px) !important; color: var(--svc-text,#444) !important;
  }
  .tc-field-icon {
    display: inline-block !important;
    width: 12px !important; height: 12px !important;
    vertical-align: -2px !important; margin-right: 3px !important;
  }
  /* 取消全部 sticky（打印会错位/重复） */
  .tc-table tr.tc-group th, .tc-table thead th {
    position: static !important; left: auto !important;
  }
  .tc-table tr.tc-group th {
    padding: 14px 0 6px !important; font-size: var(--svc-size-section,20px) !important;
    page-break-after: avoid; break-after: avoid;
  }
  /* 表头每页重复 + 行不跨页 */
  .tc-table thead { display: table-header-group !important; }
  .tc-table tfoot { display: table-footer-group !important; }
  .tc-table tr { page-break-inside: avoid; break-inside: avoid; }

  /* 产品卡片：与表格同构的 grid（150px 标签列占位 + N 均分数据列），逐列对齐 */
  .tc-cards {
    display: grid !important;
    grid-template-columns: 150px repeat(var(--tc-cols, 3), 1fr) !important;
    gap: 0 !important;
    align-items: start;
    padding: 0 0 12px !important;
  }
  .tc-cards::before { content: ""; display: block !important; }
  .tc-card {
    display: block !important; width: auto !important; min-width: 0 !important;
    padding: 0 8px 12px !important; vertical-align: top;
    page-break-inside: avoid; break-inside: avoid;
  }
  .tc-card img, .tc-card .tc-card__img { max-width: 100% !important; height: auto !important; }
  .tc-card a[href]::after { content: none !important; }

  /* 色块打印可见 */
  .tc-color, .tc-sw { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

.tc-tagline { font-size: 13px; color: #86868b; margin-top: 4px; line-height: 1.5; text-align: center; padding: 0 8px; }

/* ================= 字段说明「?」浮窗（前台查看） ================= */
.tc-tagline { font-size: 12.5px; color: #86868b; margin: 6px 0 2px; text-align: center; }
.tc-field-icon { width: 16px; height: 16px; object-fit: contain; vertical-align: -3px; margin-right: 5px; }
.tc-field-help {
  width: 16px; height: 16px; margin-left: 6px; vertical-align: 1px;
  border-radius: 50%; border: 1px solid #dfdaef; background: #fff; color: var(--tc-gold);
  font-size: 11px; font-weight: 700; line-height: 14px; text-align: center; padding: 0; cursor: pointer;
  transition: .16s;
}
.tc-field-help:hover, .tc-field-help.is-on { border-color: var(--tc-gold); background: #fbf3df; color: var(--tc-gold); }
.tc-fh-mask {
  position: fixed; inset: 0; z-index: 90; background: rgba(15, 18, 25, .48);
  display: flex; align-items: center; justify-content: center; padding: 18px;
}
.tc-fh-card {
  position: relative; width: min(560px, 94vw); max-height: 84vh; overflow: auto;
  background: #fff; border-radius: 16px; box-shadow: 0 24px 70px rgba(0, 0, 0, .35);
  padding: 16px 18px 18px; color: #1d1d1f; text-align: left;
}
.tc-fh-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; padding-right: 26px; }
.tc-fh-head b { font-size: 17px; }
.tc-fh-head small { font-size: 11px; font-weight: 400; color: #8a8a8e; letter-spacing: .08em; }
.tc-fh-x {
  position: absolute; top: 10px; right: 10px; width: 26px; height: 26px;
  border: 0; border-radius: 50%; background: #f0f0f2; color: #6e6e73; font-size: 12px; cursor: pointer; padding: 0;
}
.tc-fh-x:hover { background: #dcdce1; color: #1d1d1f; }
.tc-fh-imgs { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.tc-fh-imgs img { display: block; width: 100%; max-height: 44vh; object-fit: contain; background: #f6f7f9; border-radius: 10px; cursor: zoom-in; }
.tc-fh-text { font-size: 13.5px; line-height: 1.8; color: #3a3a3c; white-space: pre-line; word-break: break-word; }
.tc-fh-mask--photo { background: rgba(0, 0, 0, .82); }
.tc-fh-photo { position: relative; max-width: 92vw; }
.tc-fh-photo img { display: block; max-width: 92vw; max-height: 88vh; object-fit: contain; background: #fff; border-radius: 10px; }
.tc-fh-photo .tc-fh-x { background: rgba(255, 255, 255, .9); }

/* ================= 字段说明浮窗：移动端居中适配 ================= */
.tc-fh-mask {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 95;
  display: flex; align-items: center; justify-content: center; padding: 16px;
  background: rgba(15, 18, 25, .5);
}
.tc-fh-card {
  position: relative; width: min(560px, 94vw); max-height: 82vh; overflow: auto;
  overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  background: #fff; border-radius: 16px; box-shadow: 0 24px 70px rgba(0, 0, 0, .35);
  padding: 16px 18px 18px; color: #1d1d1f; text-align: left;
}
.tc-fh-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; padding-right: 28px; }
.tc-fh-head b { font-size: 17px; }
.tc-fh-head small { font-size: 11px; font-weight: 400; color: #8a8a8e; letter-spacing: .08em; }
.tc-fh-x {
  position: absolute; top: 10px; right: 10px; width: 28px; height: 28px;
  border: 0; border-radius: 50%; background: #f0f0f2; color: #6e6e73; font-size: 13px; cursor: pointer; padding: 0;
}
.tc-fh-x:hover { background: #dcdce1; color: #1d1d1f; }
.tc-fh-imgs { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.tc-fh-imgs img { display: block; width: 100%; max-height: 44vh; object-fit: contain; background: #f6f7f9; border-radius: 10px; cursor: zoom-in; }
.tc-fh-text { font-size: 13.5px; line-height: 1.8; color: #3a3a3c; white-space: pre-line; word-break: break-word; }
.tc-fh-mask--photo { background: rgba(0, 0, 0, .82); z-index: 96; }
.tc-fh-photo { position: relative; max-width: 92vw; }
.tc-fh-photo img { display: block; max-width: 92vw; max-height: 86vh; object-fit: contain; background: #fff; border-radius: 10px; }
.tc-fh-photo .tc-fh-x { background: rgba(255, 255, 255, .9); }
@media (max-width: 767px) {
  .tc-fh-mask { padding: 12px; align-items: center; }
  .tc-fh-card { width: min(92vw, 560px); max-height: 76vh; border-radius: 14px; padding: 14px 14px 16px; }
  .tc-fh-head b { font-size: 15.5px; }
  .tc-fh-imgs img { max-height: 30vh; }
  .tc-fh-text { font-size: 13px; line-height: 1.75; }
  .tc-fh-photo img { max-height: 74vh; }
}

/* ---------- dialog 顶层浮层（移动端居中修复：不受祖先 transform 影响） ---------- */
.tc-fh-dlg {
  position: fixed; inset: 0; margin: auto auto;
  width: 100%; height: 100%; max-width: 100vw; max-height: 100dvh;
  border: 0; padding: 14px; background: transparent;
  display: flex; align-items: center; justify-content: center;
  overflow: visible; color: inherit;
}
.tc-fh-dlg[open] { display: flex; }
.tc-fh-dlg::backdrop { background: rgba(15, 18, 25, .55); }
.tc-fh-dlg--photo::backdrop { background: rgba(0, 0, 0, .85); }
.tc-fh-dlg .tc-fh-card { width: min(560px, 94vw); max-height: 78dvh; }
.tc-fh-dlg .tc-fh-photo img { max-height: 80dvh; }
@supports not (height: 100dvh) {
  .tc-fh-dlg { max-height: 100vh; }
  .tc-fh-dlg .tc-fh-card { max-height: 78vh; }
}
@media (max-width: 767px) {
  .tc-fh-dlg { padding: 10px; }
  .tc-fh-dlg .tc-fh-card { width: min(92vw, 560px); max-height: 72dvh; }
}

/* ================= 返回顶部（官网同款图标，仅移动端） =================
   图标：assets/img/to-top2.png（白底圆角 + 深色箭头，自带背景）
   尺寸：--tc-top-w 决定，改这一个变量即可缩放

   ★ 移动端「点击后显示异常」的修复：
     官网 zuoan.css 里有两条会干扰本组件的规则——
       .online .scroll-top:hover          { background:#000 }
       .online .scroll-top:hover .topto   { filter:grayscale(100%) brightness(2000%) }
     移动端点按后 :hover 会「粘住」不消失，于是按钮变成黑底 + 图标被反色，
     看起来就是一团黑/白方块。这里把 hover/active 态全部显式复位。
*/
.tc-online { display: none; }
@media (max-width: 991px) {
  .tc-online {
    --tc-top-w: 60px;                 /* 想更小/更大改这里，如 48px / 72px */
    display: block;
    position: fixed; right: 8px;
    bottom: calc(26px + env(safe-area-inset-bottom, 0px));
    /* 必须高于吸顶产品选择栏 .tc-bar 的 z-index:100，
       否则小屏（如 Pixel 5）上滚动后吸顶栏会盖住按钮，
       点击落在 SELECT 上 → 按钮点不到。 */
    z-index: 105;
    width: var(--tc-top-w);
    height: auto;
    line-height: 0;
    text-align: center;
  }
  /* 官网 .scroll-top 默认 display:none（PC 隐藏），必须显式覆盖，
     否则移动端也一起被隐藏 —— 这是「按钮看不见」的直接原因 */
  .tc-online .scroll-top,
  .tc-online dl.scroll-top {
    display: block !important;
    width: 100%; height: auto;
    margin: 0; padding: 0;
    background: none !important;      /* 覆盖官网的 #f5f5f5 */
    border: 0; box-shadow: none;
    border-radius: 0;
    text-align: center;
  }
  .tc-online .scroll-top dd,
  .tc-online dd { display: block; margin: 0; padding: 0; }

  /* 图标：按原比例显示，不拉伸变形。
     官网 aoyun.css 里有 .online .scroll-top .topto{width:30px;margin-top:5px}，
     会把图标压到 30px，必须显式覆盖回我们设定的宽度。 */
  .online.tc-online .scroll-top .topto {
    display: block;
    width: var(--tc-top-w) !important;
    max-width: 100%;
    height: auto !important;
    margin: 0 auto !important;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: transform .18s ease, opacity .18s ease;
  }

  /* ★ 复位官网的 hover 效果：移动端点按后 :hover 会「粘滞」不消失，
     导致按钮变成黑底、图标被 grayscale+brightness 反色成白块。
     官网的规则是：
       .online .scroll-top:hover            { background:#000 }
       .online .scroll-top:hover .topto{ filter:grayscale(100%) brightness(2000%) }
     注意 `.online` 与 `.tc-online` 是同一个元素上的两个 class，
     所以这里必须用 `.online` 前缀 + 同等特异性 + !important 才能压制它。
     hover / active / focus / visited 全覆盖。 */
  .online.tc-online .scroll-top:hover,
  .online.tc-online .scroll-top:focus,
  .online.tc-online .scroll-top:active,
  .online.tc-online .scroll-top:visited,
  .online.tc-online .scroll-top:hover:active,
  .online.tc-online .scroll-top:hover:focus,
  .online.tc-online .scroll-top:hover:visited {
    background: none !important;
    box-shadow: none !important;
  }
  .online.tc-online .scroll-top:hover .topto,
  .online.tc-online .scroll-top:focus .topto,
  .online.tc-online .scroll-top:active .topto,
  .online.tc-online .scroll-top:visited .topto,
  .online.tc-online .scroll-top:hover .topto:hover,
  .online.tc-online .scroll-top:hover .topto:active,
  .online.tc-online .scroll-top:hover .topto:focus {
    filter: none !important;          /* 覆盖官网的 grayscale+brightness 反色 */
    opacity: 1 !important;
    -webkit-filter: none !important;
  }
  /* 只保留一个轻微的按压反馈，不改变配色 */
  .tc-online .scroll-top:active .topto { transform: translateY(2px) scale(.96); }
}
@media print { .tc-online { display: none !important; } }

/* ==========================================================================
   移动端横向溢出修复（影响返回顶部按钮的位置）
   --------------------------------------------------------------------------
   现象：手机端页面被撑到约 707px 宽（视口只有 390px），
        导致 `position:fixed` 的返回顶部按钮以「布局视口」为基准定位，
        被推到屏幕右侧之外，既点不到也看不见。
   原因：官网页头的 `.sub_nav`（二级菜单，桌面展开态）在移动端未收起，
        元素右边缘超出视口 → document.scrollWidth 被撑大。
   修复：
     ① 移动端隐藏 .sub_nav / .sub_nav_bg（官网移动端本来就是汉堡菜单）；
     ② 兜底禁止整页横向滚动；
     ③ 让返回顶部按钮改用 visualViewport 无关的定位方式（见下方 fixed 规则）。
   ========================================================================== */
@media (max-width: 991px) {
  /* ① 官网页头二级菜单：移动端收起 */
  .sub_nav,
  .sub_nav_bg,
  ul.sub_nav,
  .menu-on .sub_nav,
  .menu-on .menu-pic-list,
  .menu-pic-list { display: none !important; }

  /* ② 兜底：整页不横向滚动，同时把超宽元素收敛回视口 */
  html, body {
    max-width: 100%;
    overflow-x: hidden;
  }
  .tc, .tc-wrap, .tc-hero, .tc-bar, .tc-scroll, .tc-cards, .tc-tools {
    max-width: 100%;
  }
  /* 长URL / 长型号串断行，避免撑宽 */
  .tc-table td, .tc-table th,
  .tc-card a, .tc-card__desc, .tc-colorname {
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  /* ③ 返回顶部：官网 .online 用 right:5px;bottom:150px（aoyun.css）+
     zuoan.css 又给了 bottom:100px，多处叠加易错位。
     这里显式覆盖为确定的定位，并加 max-width 兜底，
     确保按钮始终贴在可视区域右下角。 */
  .tc-online {
    position: fixed !important;
    right: 8px !important;
    left: auto !important;
    bottom: calc(26px + env(safe-area-inset-bottom, 0px)) !important;
    top: auto !important;
    width: var(--tc-top-w, 60px);
    max-width: 60px;
    margin: 0 !important;
    padding: 0 !important;
    z-index: 105;
  }
}

@media(max-width:767px){#tc-compare .tc-btn-buy{position:relative}#tc-compare .tc-shop{position:absolute;left:50%;right:auto;top:auto;bottom:calc(100% + 10px);max-width:calc(100vw - 24px);min-width:min(172px,calc(100vw - 24px));overflow-y:auto;transform:translate(-50%,0)}#tc-compare .tc-btn-buy.is-open .tc-shop{transform:translate(-50%,0)}}

html body #tc-compare .tc-select{ text-align:center!important;text-align-last:center!important;padding-left:28px!important;padding-right:28px!important;}

html body #tc-compare .tc-select :is(option,optgroup){text-align:left!important;text-align-last:left!important;}


/* 购买渠道放在视口层，避免被吸顶栏与横向滚动容器裁切。 */
body > .tc-shop.is-open{position:fixed;z-index:1100;right:auto;bottom:auto;min-width:172px;max-width:calc(100vw - 24px);box-sizing:border-box;overflow-y:auto;opacity:1;pointer-events:auto;transform:none;font-family:var(--tm-font-body,"Sfont","Microsoft YaHei",Arial,sans-serif);font-size:14px}
body > .tc-shop.is-open::after{display:none}
