/*
Theme Name: CustomPack Tech
Theme URI: https://www.custompacktech.com/
Author: CustomPack Tech
Author URI: https://www.custompacktech.com/
Description: 外贸独立站主题 —— 定制塑料包装袋。内置 10 语（含阿拉伯语 RTL 与 /zh/ /ar/ 目录路由）、产品 CPT、询盘表单、canonical 与 hreflang、Product/FAQ/Breadcrumb 结构化数据、Google Ads 转化埋点。多语言无需安装任何插件。
Version: 1.1.0
Requires PHP: 7.4
Requires at least: 5.9
Text Domain: custompacktech
Tags: custom-background, custom-logo, translation-ready, rtl-language-support, block-patterns
*/

/* ============================================================
   外贸独立站 样式系统
   浅色主题 · 响应式 · 支持 RTL（阿拉伯语）
   ============================================================ */

:root {
  --brand: #0b4f6c;
  --brand-600: #0d6288;
  --brand-dark: #073348;
  --brand-50: #eef6fa;
  /* accent 三档分工：
     --accent      只做装饰（图标、浅底、渐变），不承载正文
     --accent-cta  按钮底色 + 白字      → 5.2:1（WCAG AA 达标）
     --accent-text 橙系正文/小字         → 7.1:1（WCAG AA 达标） */
  --accent: #e8822c;
  --accent-cta: #a8540e;
  --accent-text: #8a4309;
  --accent-dark: #a8540e;
  --accent-50: #fdf1e3;

  --ink: #16232b;
  --ink-2: #33454f;
  --muted: #5b6e77;
  --line: #e2e9ee;
  --line-2: #cfdae1;
  --bg: #ffffff;
  --bg-soft: #f5f8fa;
  --bg-dark: #0a3547;

  --ok: #1f7a4c;
  --wa: #25d366;

  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 24px;
  --shadow: 0 1px 2px rgba(16,35,43,.05), 0 8px 24px -12px rgba(16,35,43,.14);
  --shadow-lg: 0 4px 12px rgba(16,35,43,.07), 0 24px 48px -20px rgba(16,35,43,.22);
  --maxw: 1200px;
  --header-h: 72px;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
          'Helvetica Neue', Arial, 'Noto Sans', 'Noto Sans Arabic', sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

/* 首屏通栏用了 100vw，Windows 的垂直滚动条约 15px 会让 100vw 比可视区宽，
   横向就会多出一条滚动条。这里只裁掉超出的那点横向量，不影响纵向滚动。 */
body { overflow-x: clip; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--brand-600); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.22; margin: 0 0 .5em; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 4.4vw, 3.2rem); }
h2 { font-size: clamp(1.5rem, 2.8vw, 2.25rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
ul { margin: 0 0 1em; padding-inline-start: 1.2em; }

.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 24px; }
.section { padding: 80px 0; }
.section--soft { background: var(--bg-soft); }
.section--tight { padding: 48px 0; }

.eyebrow {
  display: inline-block; font-size: .78rem; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--accent-text); margin-bottom: 12px;
}
.section-head { max-width: 720px; margin-bottom: 40px; }
.section-head p { color: var(--muted); font-size: 1.05rem; margin: 0; }
.center { text-align: center; margin-inline: auto; }

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 24px; border-radius: var(--radius-sm); border: 1px solid transparent;
  font: inherit; font-weight: 600; font-size: .95rem; cursor: pointer;
  text-decoration: none !important; transition: .18s ease; white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn--primary { background: var(--accent-cta); color: #fff; box-shadow: 0 6px 18px -8px rgba(168,84,14,.75); }
.btn--primary:hover { background: var(--accent-text); }
.btn--brand { background: var(--brand); color: #fff; }
.btn--brand:hover { background: var(--brand-600); }
.btn--ghost { background: #fff; color: var(--brand); border-color: var(--line-2); }
.btn--ghost:hover { border-color: var(--brand); color: var(--brand-600); }
.btn--whatsapp { background: var(--wa); color: #fff; }
.btn--whatsapp:hover { background: #1eb357; }
.btn--sm { padding: 9px 16px; font-size: .875rem; }
.btn--block { width: 100%; }
.btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }

/* ---------------- 页头 ---------------- */
.header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(255,255,255,.92); backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
/* 高度用 min-height 而不是 height：logo 里的副标题一旦换行会把内容撑高，
   写死 height 会让内容溢出到 header 上下两侧（390px 下曾出现白缝 + 副标题被切）。
   品牌名 white-space:nowrap + 副标题单行省略，双保险保证只有一行。 */
.header__bar { display: flex; align-items: center; gap: 20px; min-height: var(--header-h); }
/* .logo 的第二个 <span> 里塞了「品牌名 + 副标题」两行。默认它在 flex 里会被压窄，
   品牌名就从中间断行（CUSTOMPACK / TECH 上下叠），390px 手机上很明显。
   这里禁止品牌名断行、副标题超出就省略，需要时由小屏媒体查询再缩字号。 */
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.22rem; color: var(--brand-dark); letter-spacing: -.02em; min-width: 0; }
.logo > span:last-child { display: block; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.15; }
.logo:hover { text-decoration: none; }
.logo__mark {
  width: 34px; height: 34px; border-radius: 9px; flex: none;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-600) 100%);
  color: #fff; display: grid; place-items: center; font-size: .9rem; font-weight: 800;
}
/* 副标题必须单行：它一旦换行（390px 下会折成 3 行）就把 logo 撑到 98px，
   溢出 72px 的 header，出现白缝并把文字切一半。 */
.logo__sub { display: block; font-size: .66rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); line-height: 1; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.nav { display: flex; align-items: center; gap: 4px; margin-inline-start: auto; }
.nav a {
  padding: 8px 14px; border-radius: var(--radius-sm); font-size: .95rem; font-weight: 500;
  color: var(--ink-2);
}
.nav a:hover { background: var(--bg-soft); text-decoration: none; }
.nav a.is-active { color: var(--brand); background: var(--brand-50); }

.header__actions { display: flex; align-items: center; gap: 10px; }

.langsel {
  position: relative;
}
.langsel__btn {
  display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-2); background: #fff; font: inherit; font-size: .875rem;
  font-weight: 600; color: var(--ink-2); cursor: pointer;
}
.langsel__flag {
  width: 18px; height: 12px; flex: none; display: block;
  object-fit: cover; border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, .12);
}
.langsel__menu {
  position: absolute; inset-block-start: calc(100% + 6px); inset-inline-end: 0;
  min-width: 190px; max-height: 70vh; overflow-y: auto; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius-sm); box-shadow: var(--shadow); padding: 6px; display: none; z-index: 70;
}
.langsel__menu.is-open { display: block; }
.langsel__menu button {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: start;
  padding: 8px 10px; border: 0; background: none;
  font: inherit; font-size: .9rem; border-radius: 6px; cursor: pointer; color: var(--ink);
}
.langsel__menu button:hover { background: var(--bg-soft); }
.langsel__menu button[aria-current="true"] { color: var(--brand); font-weight: 700; }
.langsel__menu button[aria-current="true"]::after {
  content: '✓'; margin-inline-start: auto; font-weight: 700; color: var(--brand);
}

.navtoggle { display: none; background: none; border: 1px solid var(--line-2); border-radius: 8px; width: 40px; height: 38px; cursor: pointer; }
.navtoggle span { display: block; width: 18px; height: 2px; background: var(--ink); margin: 3px auto; }

/* ---------------- Hero ----------------
   布局要点（别改回旧写法）：
   1) 照片必须铺满整屏宽度 → section 需要 breakout 出 .container。
      旧写法高度由文字决定、宽度由容器决定(1200px)，照片两侧各留 360px 底色，
      这就是"两边不饱满"的观感来源。
   2) 高度不要靠 <img> 撑（object-fit:cover + height:100% 时，
      自动高度会让图片的 height:100% 解析成 0，整块压成一条）。
      改为由 .hero__inner 的内边距撑住最小高度，照片绝对定位铺满即可。 */
.hero {
  position: relative; overflow: hidden; color: #fff;
  background: var(--brand-dark);
  min-height: 520px;
  display: flex; align-items: center;
}
.hero__bg { position: absolute; top: 0; right: 0; bottom: 0; left: 0; }
.hero__bg img {
  display: block; width: 100%; height: 100%;
  object-fit: cover; object-position: 50% 50%;
}
/* ⚠️ 不要再给照片加横向出血（历史遗留写法已删除，2026-10-21）。
   曾经为了"消掉边缘发暗"写过 left:-22% + width:calc(100% + 44%)，
   但那会让照片按 1.44 倍渲染 —— 1920 视口就要铺 2765px，
   1920 宽的原片被放大 1.44 倍，整张糊掉（用户反馈"清晰度不够"的直接原因）。

   实测这张照片左右两端本来就很实（边缘亮度 140 / 111，最暗列 71.8），
   根本不需要出血。cover 按容器原尺寸渲染即可，1:1 像素显示才最清晰。
   只在垂直方向留 2px 余量，避免小数像素在上下边缝出细线。 */
.hero--full .hero__bg img {
  position: absolute;
  top: -2px; left: 0;
  width: 100%;
  height: calc(100% + 4px);
  max-width: none;
}

.hero::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  /* 只在文字所在的中段压暗，左右两端都几乎不加罩 —— 
     两端各留一块干净照片，视觉上才是"满"的。
     可读性交给标题/正文自己的 text-shadow（见下方 .hero h1 / .hero__lead）。 */
  background:
    linear-gradient(90deg,
      rgba(7,32,48,.06) 0%,
      rgba(7,32,48,.22) 12%,
      rgba(7,32,48,.66) 24%,
      rgba(7,32,48,.62) 40%,
      rgba(7,32,48,.20) 54%,
      transparent 64%);
}
/* 文字块自己撑高度：手机端两行标题 + 三个按钮时也不会挤 */
/* 注意别给 .hero__inner 写 width:100%：它同时带着 .container（max-width:1200px + 左右内边距），
   写 100% 会把 max-width 覆盖掉，大屏文字贴边、手机上内容被挤出屏幕（2026-10-21 踩过）。 */
.hero__inner { position: relative; z-index: 2; padding: 96px 0 84px; }

/* 首屏通栏：铺满整屏宽度。
   <main id="cpt-main"> 是 header/footer 之间的独立块，宽度天生就是 100%，
   所以 section 只要不被 .container 包住，就已经通栏了；这里只需保证
   不被任何 max-width 限住，并让照片层略微出血盖住边界像素。
   ⚠️ 不要用 100vw（含滚动条宽度，会算出比视口还宽的怪值）；
      也不要用 left:50% + translateX(-50%)（出血方向容易反，2026-10-21 踩过）。 */
main#cpt-main { overflow-x: clip; }
.hero--full {
  width: 100%;
  max-width: 100%;
  margin-inline: 0;
  /* 照片向左右各延伸 400px 后再按中间裁切：
     这样无论视口多宽，左右两侧看到的都是照片"中部"的内容，不会有边缘虚化 */
}
/* 照片层左右各出血 200px。注意每条 inset 都要显式写：
   inset-inline 是逻辑属性，某些环境下和 inset 物理属性叠用时会被忽略。 */
.hero--full .hero__bg { top: 0; bottom: 0; left: -200px; right: -200px; }

.hero h1 { max-width: 18ch; color: #fff; text-shadow: 0 1px 3px rgba(3,18,28,.85), 0 4px 22px rgba(3,18,28,.6); }
.hero__lead { font-size: 1.15rem; max-width: 60ch; color: rgba(255,255,255,.95); margin-bottom: 28px; text-shadow: 0 1px 3px rgba(3,18,28,.8), 0 3px 16px rgba(3,18,28,.55); }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 36px; }
.hero__badges { display: flex; flex-wrap: wrap; gap: 10px; }
.hero__badge {
  display: inline-flex; align-items: center; gap: 7px; font-size: .85rem; font-weight: 600;
  padding: 7px 14px; border-radius: 999px; background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.22); color: #fff;
}
.hero__badge svg { flex: none; }

/* ---------------- 数据条 ---------------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.stat { background: #fff; padding: 26px 20px; text-align: center; }
.stat__num { font-size: 2rem; font-weight: 800; color: var(--brand); line-height: 1; letter-spacing: -.02em; }
.stat__num span { font-size: 1.1rem; }
.stat__label { font-size: .875rem; color: var(--muted); margin-top: 8px; }

/* ---------------- 卡片 / 网格 ---------------- */
.grid { display: grid; gap: 24px; }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; transition: .2s ease; display: flex; flex-direction: column;
}
.card:hover { box-shadow: var(--shadow-lg); border-color: var(--line-2); transform: translateY(-4px); }
.card__media { position: relative; aspect-ratio: 4 / 3; background: linear-gradient(135deg, #eef3f6, #dde8ee); overflow: hidden; }
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.card:hover .card__media img { transform: scale(1.05); }
.card__tag {
  position: absolute; inset-block-start: 12px; inset-inline-start: 12px;
  background: var(--accent); color: #fff; font-size: .72rem; font-weight: 700;
  padding: 4px 10px; border-radius: 999px; letter-spacing: .02em;
}
.card__body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card__title { font-size: 1.05rem; font-weight: 700; margin: 0; }
.card__title a { color: var(--ink); }
.card__title a:hover { color: var(--brand-600); text-decoration: none; }
.card__desc { color: var(--muted); font-size: .9rem; margin: 0; }
.card__meta { margin-top: auto; padding-top: 12px; display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-size: .75rem; font-weight: 600; color: var(--brand); background: var(--brand-50);
  padding: 4px 9px; border-radius: 6px;
}
.chip--gray { color: var(--ink-2); background: var(--bg-soft); }

/* ---------------- 分类 ---------------- */
.cat {
  position: relative; border-radius: var(--radius); overflow: hidden; min-height: 190px;
  display: flex; align-items: flex-end; padding: 20px; color: #fff; isolation: isolate;
  background: linear-gradient(160deg, #0a4a66, #0b3a50);
}
.cat img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; opacity: .55; }
.cat::before { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(6,32,45,.15) 0%, rgba(6,32,45,.85) 100%); }
.cat:hover { color: #fff; text-decoration: none; }
.cat h3 { margin: 0; font-size: 1.05rem; }
.cat span { font-size: .82rem; opacity: .85; }

/* ---------------- 优势 ---------------- */
.feature { display: flex; gap: 14px; align-items: flex-start; }
.feature__ico {
  width: 44px; height: 44px; flex: none; border-radius: 10px; background: var(--brand-50);
  color: var(--brand); display: grid; place-items: center;
}
.feature h3 { font-size: 1rem; margin: 0 0 4px; }
.feature p { margin: 0; font-size: .9rem; color: var(--muted); }

/* ---------------- 流程 ---------------- */
.steps { counter-reset: s; display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.step { position: relative; padding: 24px 18px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.step::before {
  counter-increment: s; content: counter(s);
  width: 34px; height: 34px; border-radius: 50%; background: var(--brand); color: #fff;
  display: grid; place-items: center; font-weight: 800; font-size: .95rem; margin-bottom: 12px;
}
.step h3 { font-size: .98rem; margin: 0 0 6px; }
.step p { margin: 0; font-size: .87rem; color: var(--muted); }

/* ---------------- FAQ ---------------- */
.faq { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; }
.faq details { border-bottom: 1px solid var(--line); }
.faq details:last-child { border-bottom: 0; }
.faq summary {
  cursor: pointer; padding: 18px 22px; font-weight: 600; font-size: 1rem; list-style: none;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; font-size: 1.35rem; color: var(--accent-text); font-weight: 700; line-height: 1; }
.faq details[open] summary::after { content: '−'; }
.faq .faq__a { padding: 0 22px 20px; color: var(--muted); font-size: .95rem; margin: 0; }

/* ---------------- 评价 ---------------- */
.quote-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.quote-card__text { margin: 0; color: var(--ink-2); font-size: .95rem; }
.quote-card__who { display: flex; align-items: center; gap: 12px; margin-top: auto; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--brand-50); color: var(--brand); display: grid; place-items: center; font-weight: 700; flex: none; }
.quote-card__name { font-weight: 700; font-size: .92rem; }
.quote-card__role { font-size: .8rem; color: var(--muted); }
.stars { color: var(--accent); letter-spacing: 2px; font-size: .9rem; }

/* ---------------- 表格 / 规格 ---------------- */
.spec { width: 100%; border-collapse: collapse; font-size: .93rem; }
.spec th, .spec td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: start; vertical-align: top; }
.spec th { width: 38%; color: var(--muted); font-weight: 600; background: var(--bg-soft); }
.spec tr:last-child th, .spec tr:last-child td { border-bottom: 0; }

.ticks { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.ticks li { display: flex; gap: 10px; align-items: flex-start; font-size: .93rem; }
.ticks li::before { content: '✓'; color: var(--ok); font-weight: 800; flex: none; }

/* ---------------- 表单 ---------------- */
.form { display: grid; gap: 16px; }
.form__row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.field { display: grid; gap: 6px; }
.field label { font-size: .87rem; font-weight: 600; color: var(--ink-2); }
.field label .req { color: var(--accent-text); }
.field input, .field select, .field textarea {
  font: inherit; font-size: .95rem; padding: 12px 14px; border: 1px solid var(--line-2);
  border-radius: var(--radius-sm); background: #fff; color: var(--ink); width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 0; border-color: var(--brand-600); background: #fff;
  box-shadow: 0 0 0 3px rgba(13,98,136,.18);
}
.field textarea { min-height: 118px; resize: vertical; }
.field__err { font-size: .8rem; color: #c0392b; min-height: 1em; }
.form__note { font-size: .82rem; color: var(--muted); }

.alert { padding: 14px 16px; border-radius: var(--radius-sm); font-size: .92rem; }
.alert--ok { background: #eaf7ef; color: #166a41; border: 1px solid #bfe3cd; }
.alert--err { background: #fdecea; color: #a32b1c; border: 1px solid #f5c6c0; }

/* ---------------- 联系块 ---------------- */
.contact-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; align-items: start; }
.contact-panel { background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.contact-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 18px; }
.contact-list li { display: flex; gap: 12px; align-items: flex-start; }
.contact-list .ico { width: 38px; height: 38px; flex: none; border-radius: 9px; background: #fff; border: 1px solid var(--line); color: var(--brand); display: grid; place-items: center; }
.contact-list li > span:last-child { display: block; min-width: 0; }
.contact-list .k {
  display: block; font-size: .78rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted); font-weight: 700; line-height: 1.4; margin-bottom: 3px;
}
.contact-list .v { display: block; font-weight: 600; font-size: .95rem; line-height: 1.45; word-break: break-word; overflow-wrap: anywhere; }

/* ---------------- 底部 CTA ---------------- */
.cta-band {
  background: linear-gradient(135deg, var(--brand-dark), var(--brand-600));
  color: #fff; border-radius: var(--radius-lg); padding: 48px 40px; text-align: center;
}
.cta-band h2 { color: #fff; }
.cta-band p { color: rgba(255,255,255,.85); max-width: 60ch; margin-inline: auto; }
.cta-band .btn { margin: 4px; }

/* ---------------- 页脚 ---------------- */
.footer { background: var(--bg-dark); color: rgba(255,255,255,.74); margin-top: 0; padding: 64px 0 28px; font-size: .9rem; line-height: 1.75; }
.footer a { color: rgba(255,255,255,.82); }
.footer a:hover { color: #fff; }
.footer__grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.2fr; gap: 40px; }
.footer h4 { color: #fff; font-size: .95rem; margin-bottom: 18px; letter-spacing: .01em; }
.footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.footer .logo { color: #fff; margin-bottom: 14px; }
.footer .logo__mark { background: var(--accent); }
.footer__bottom {
  margin-top: 40px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.12);
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; font-size: .82rem;
}

/* ---------------- 浮动工具条 ---------------- */
.fab { position: fixed; inset-inline-end: 20px; inset-block-end: 20px; z-index: 80; display: grid; gap: 10px; justify-items: center; }
.fab__btn {
  width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center;
  color: #fff; box-shadow: var(--shadow-lg); border: 0; cursor: pointer; font-size: 1.2rem;
}
.fab__btn--wa { background: var(--wa); }
.fab__btn--mail { background: var(--brand); }
.fab__btn--top { background: #fff; color: var(--ink-2); border: 1px solid var(--line-2); box-shadow: var(--shadow); }
.fab__btn:hover { transform: translateY(-2px); }

/* ---------------- 面包屑 ---------------- */
.crumbs { font-size: .82rem; color: var(--muted); padding: 18px 0 0; }
.crumbs a { color: var(--muted); }
.crumbs span { margin-inline: 6px; opacity: .6; }

/* ---------------- 产品详情 ---------------- */
.pd { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
.pd__media { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--bg-soft); }
.pd__media img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.pd__thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 10px; }
.pd__thumbs button { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; padding: 0; cursor: pointer; background: none; aspect-ratio: 1; }
.pd__thumbs img { width: 100%; height: 100%; object-fit: cover; }
.pd__thumbs button.is-active { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-50); }
.pd__price { font-size: .95rem; color: var(--muted); }
.badges { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.badge { font-size: .8rem; font-weight: 600; padding: 5px 11px; border-radius: 999px; background: var(--brand-50); color: var(--brand); }
.badge--ok { background: #eaf7ef; color: #166a41; }

/* ---------------- 过滤器 ---------------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.filters button {
  padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line-2); background: #fff;
  font: inherit; font-size: .9rem; font-weight: 600; color: var(--ink-2); cursor: pointer;
}
.filters button:hover { border-color: var(--brand); color: var(--brand); }
.filters button.is-active { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ---------------- 文章 ---------------- */
.post { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.post__body { padding: 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.post__date { font-size: .78rem; color: var(--muted); }
.post h3 { font-size: 1.02rem; margin: 0; }
.post p { font-size: .9rem; color: var(--muted); margin: 0; }
.article { max-width: 760px; }
.article h2 { margin-top: 1.6em; font-size: 1.35rem; }
.article h3 { margin-top: 1.3em; font-size: 1.12rem; }
.article p { color: var(--ink-2); }
.article ul, .article ol { margin: 0 0 1em; padding-inline-start: 1.4em; }
.article li { margin-bottom: .45em; color: var(--ink-2); }

/* ---------------- 后台 ---------------- */
.admin-wrap { max-width: 1100px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.admin-table th, .admin-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: start; vertical-align: top; }
.admin-table th { background: var(--bg-soft); font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.admin-table tr:hover td { background: #fafcfd; }
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.status-pill { font-size: .75rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--accent-50); color: var(--accent-dark); }
.status-pill[data-s="done"] { background: #eaf7ef; color: #166a41; }
.admin-empty { padding: 40px; text-align: center; color: var(--muted); }

/* ---------------- 响应式 ---------------- */
@media (max-width: 1024px) {
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .footer__grid { grid-template-columns: 1fr 1fr; }
  .contact-grid { grid-template-columns: 1fr; gap: 28px; }
  .pd { grid-template-columns: 1fr; gap: 28px; }
}
@media (max-width: 860px) {
  .nav { display: none; }
  .nav.is-open {
    display: flex; flex-direction: column; align-items: stretch; gap: 4px;
    position: absolute; inset-inline: 0; inset-block-start: var(--header-h);
    background: #fff; border-bottom: 1px solid var(--line); padding: 12px 24px 18px;
    box-shadow: var(--shadow);
  }
  .nav.is-open a { padding: 12px 8px; }
  .navtoggle { display: block; }
  .header__bar { position: relative; }
  .header .btn--primary { display: none; }
  .grid--3, .grid--2 { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .section { padding: 52px 0; }
  .hero__inner { padding: 64px 0 56px; }
  .hero { min-height: 0; }
  .form__row { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .grid--4 { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .footer__grid { grid-template-columns: 1fr; }
  .cta-band { padding: 32px 20px; }
  .container { padding-inline: 18px; }
  /* 手机上品牌名 + 语言下拉 + 汉堡按钮要挤在一行 390px 里，
     字号不缩就会把品牌名压到换行（CUSTOMPACK 第一行、TECH 第二行）。
     目标：390px 下 CUSTOMPACK TECH 完整显示不省略。 */
  .header__bar { gap: 8px; }
  .logo { font-size: .92rem; gap: 7px; letter-spacing: -.03em; }
  .logo__mark { width: 28px; height: 28px; border-radius: 8px; font-size: .76rem; }
  .logo__sub { font-size: .52rem; letter-spacing: .02em; }
  .langsel__btn { padding: 6px 8px; font-size: .8rem; gap: 4px; }
}

/* RTL 适配：样式已全部使用逻辑属性（inset-inline-* / margin-inline-* / padding-inline-*），
   浏览器在 dir="rtl" 下会自动翻转，无需再写 [dir="rtl"] 补偿规则。
   注：下方两条曾导致语言下拉在阿语下被推到屏幕左侧溢出，已移除，勿再加回。
     × [dir="rtl"] .langsel__menu { inset-inline-end: auto; inset-inline-start: 0; }
     × [dir="rtl"] .faq summary::after { content: '+'; }
*/

@media print {
  .header, .fab, .footer, .cta-band { display: none !important; }
}


/* ============================================================
   WordPress 适配补丁（追加在原 main.css 之后）
   —— 只放 WordPress 特有的类名修正，不动原设计变量与布局
   ============================================================ */

/* 语言下拉：WPML 场景下用 <a> 而不是 <button>，补上同样的样式 */
.langsel__menu a {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 9px 14px; border: 0; background: none; font: inherit; font-size: .9rem;
  color: var(--ink); cursor: pointer; text-align: start; text-decoration: none;
}
.langsel__menu a:hover { background: var(--bg-soft); text-decoration: none; }
.langsel__menu a[aria-current="true"] { color: var(--brand); font-weight: 700; }
.langsel__menu a[aria-current="true"]::after {
  content: '✓'; margin-inline-start: auto; color: var(--brand);
}

/* 顶部管理员条 */
body.admin-bar .header { margin-top: 32px; }
@media (max-width: 782px) { body.admin-bar .header { margin-top: 46px; } }

/* WordPress 默认类 */
.alignleft { float: left; margin: 0 1.5em 1em 0; }
.alignright { float: right; margin: 0 0 1em 1.5em; }
.aligncenter { display: block; margin-inline: auto; }
.alignwide { max-width: 1100px; margin-inline: auto; }
.alignfull { max-width: none; }
.screen-reader-text {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.wp-caption { max-width: 100%; }
.wp-caption-text { font-size: .85rem; color: var(--muted); text-align: center; margin-top: 6px; }
.gallery { display: grid; gap: 16px; grid-template-columns: repeat(3, 1fr); }

/* 分类筛选：WordPress 下用 <a>（带真实 URL，利于收录） */
.filters a {
  padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line-2); background: #fff;
  font: inherit; font-size: .9rem; font-weight: 600; color: var(--ink-2); text-decoration: none;
}
.filters a:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; }
.filters a.is-active { background: var(--brand); border-color: var(--brand); color: #fff; }

/* 分页 */
.nav-links { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 32px; }
.nav-links a, .nav-links span {
  padding: 8px 14px; border: 1px solid var(--line-2); border-radius: 8px;
  font-size: .9rem; font-weight: 600; color: var(--ink-2); text-decoration: none;
}
.nav-links .current { background: var(--brand); border-color: var(--brand); color: #fff; }

/* 下单前的承诺卡片（替代客户评价，不含姓名 / 星级） */
.pledge-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 24px; display: flex; flex-direction: column; gap: 10px;
  transition: box-shadow .2s, transform .2s, border-color .2s;
}
.pledge-card:hover { box-shadow: var(--shadow-lg); border-color: var(--line-2); transform: translateY(-4px); }
.pledge-card h3 {
  font-size: 1.02rem; margin: 0; line-height: 1.4; color: var(--brand);
  padding-inline-start: 14px; position: relative;
}
.pledge-card h3::before {
  content: ''; position: absolute; inset-inline-start: 0; top: .45em;
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
}
.pledge-card p { margin: 0; color: var(--muted); font-size: .93rem; line-height: 1.65; }

/* 键盘 / 读屏用户跳转到正文（默认隐藏，聚焦时出现） */
.skip-link {
  position: absolute; inset-inline-start: -9999px; top: 0; z-index: 999;
  padding: 12px 20px; background: var(--brand); color: #fff;
  font-weight: 600; border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus {
  inset-inline-start: 0; outline: 3px solid var(--accent-cta); outline-offset: 2px;
}

/* 文章内容里的通用排版 */
.article ul, .article ol { margin-bottom: 1em; }
.article img { border-radius: var(--radius); }
.article blockquote {
  margin: 1.4em 0; padding: 4px 0 4px 20px; border-inline-start: 3px solid var(--accent);
  color: var(--ink-2); font-style: italic;
}
