/* ============================================================
   盒子猫官网 · 子页面样式（内容页 / 服务页）
   复用 tokens.css 变量与 base.css 组件，只补充「文章型页面」所需。
   载入顺序：tokens.css → base.css → sections.css → subpage.css
   ============================================================ */

/* ============================================================
   1 · 页头区（面包屑 + 标题 + 导语 + 元信息）
   ============================================================ */
.sub-hero {
  position: relative;
  overflow: hidden;
  padding: 52px 0 56px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
/* 底纹：品牌色柔和光晕 + 极细等距网格，纯 CSS 无外部图片 */
.sub-hero::before {
  content: '';
  position: absolute; inset: 0; z-index: 0;
  background:
    radial-gradient(820px 320px at 84% -18%, color-mix(in srgb, var(--brand) 11%, transparent), transparent 70%),
    radial-gradient(520px 260px at 8% 118%, color-mix(in srgb, var(--cyan) 7%, transparent), transparent 72%);
  pointer-events: none;
}
.sub-hero::after {
  content: '';
  position: absolute; inset: 0; z-index: 0;
  background-image:
    linear-gradient(to right, color-mix(in srgb, var(--tx) 5%, transparent) 1px, transparent 1px),
    linear-gradient(to bottom, color-mix(in srgb, var(--tx) 5%, transparent) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, .5), transparent 78%);
          mask-image: linear-gradient(to bottom, rgba(0, 0, 0, .5), transparent 78%);
  pointer-events: none;
}
.sub-hero .wrap { position: relative; z-index: 1; }

/* ---- 面包屑 ---- */
.crumbs {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  font-size: 13px; color: var(--tx-3);
  margin-bottom: 22px;
}
.crumbs a {
  color: var(--tx-2); text-decoration: none;
  border-radius: var(--r-xs);
  transition: color var(--t-fast) var(--ease);
}
.crumbs a:hover { color: var(--brand); }
.crumbs .sep { color: var(--tx-3); opacity: .6; user-select: none; }
.crumbs [aria-current="page"] { color: var(--tx-3); }

/* ---- 文章标题区 ---- */
.sub-hero h1 {
  font-size: clamp(30px, 4.4vw, 46px);
  line-height: 1.24;
  letter-spacing: -.015em;
  font-weight: 700;
  color: var(--tx);
  /* 用 em 而非 ch 限宽：中文 1 字≈1em，ch 只有 0.5em 左右，
     用 ch 会把「…但没人接得住」断成「…但没人接／得住」 */
  max-width: 17.5em;
  margin: 14px 0 20px;
}
.sub-hero h1 em {
  font-style: normal;
  color: var(--brand);
}
.sub-hero .lead {
  font-size: 17px;
  line-height: 1.8;
  color: var(--tx-2);
  max-width: 62ch;
}

/* ---- 元信息（更新日期 / 阅读时长 / 适用地区）---- */
.art-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px;
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--line-2);
  font-size: 13px; color: var(--tx-3);
}
.art-meta > span { display: inline-flex; align-items: center; gap: 7px; }
.art-meta .ico { width: 15px; height: 15px; opacity: .8; }
.art-meta .dot { color: var(--tx-3); opacity: .45; }

/* ============================================================
   2 · 正文区（左正文 + 右目录）
   ============================================================ */
.sub-body { padding-block: 64px 88px; }

.art-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 262px;
  gap: 64px;
  align-items: start;
}

/* ---- 正文排版 ---- */
.prose {
  font-size: 16.5px;
  line-height: 1.88;
  color: var(--tx-2);
  max-width: 74ch;
}
.prose > *:first-child { margin-top: 0; }

.prose h2 {
  position: relative;
  font-size: 24px;
  line-height: 1.4;
  font-weight: 680;
  color: var(--tx);
  letter-spacing: -.01em;
  margin: 56px 0 20px;
  padding-left: 16px;
  scroll-margin-top: calc(var(--header-h) + 24px);
}
.prose h2::before {
  content: '';
  position: absolute; left: 0; top: .18em; bottom: .18em;
  width: 3px; border-radius: 2px;
  background: linear-gradient(to bottom, var(--brand), color-mix(in srgb, var(--brand) 35%, transparent));
}
.prose h3 {
  font-size: 17.5px;
  font-weight: 650;
  color: var(--tx);
  margin: 34px 0 14px;
  scroll-margin-top: calc(var(--header-h) + 24px);
}
.prose h4 {
  font-size: 15.5px; font-weight: 650; color: var(--tx);
  margin: 24px 0 10px;
}

.prose p { margin: 0 0 20px; }
.prose strong { color: var(--tx); font-weight: 650; }
.prose em { font-style: normal; color: var(--brand); font-weight: 600; }

.prose a {
  color: var(--brand);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--brand) 35%, transparent);
  transition: border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.prose a:hover {
  color: var(--brand-d);
  border-bottom-color: var(--brand);
}

.prose ul, .prose ol { margin: 0 0 22px; padding-left: 0; list-style: none; }
.prose ul li, .prose ol li {
  position: relative;
  padding-left: 26px;
  margin-bottom: 11px;
}
.prose ul li::before {
  content: '';
  position: absolute; left: 6px; top: .72em;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--brand);
  opacity: .55;
}
.prose ol { counter-reset: li; }
.prose ol li { counter-increment: li; padding-left: 32px; }
.prose ol li::before {
  content: counter(li);
  position: absolute; left: 0; top: .18em;
  width: 21px; height: 21px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 650; font-variant-numeric: tabular-nums;
  color: var(--brand); background: var(--brand-l);
}

.prose blockquote {
  margin: 26px 0;
  padding: 18px 22px;
  border-left: 3px solid var(--brand);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  background: var(--brand-soft);
  color: var(--tx-2);
}
.prose blockquote p:last-child { margin-bottom: 0; }

.prose hr {
  border: 0; height: 1px; background: var(--line);
  margin: 44px 0;
}

.prose code {
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: .89em;
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--surface-3);
  color: var(--tx);
}

/* ============================================================
   3 · 提示框 callout
   ============================================================ */
.callout {
  position: relative;
  margin: 26px 0;
  padding: 18px 20px 18px 54px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-size: 15px;
  line-height: 1.78;
}
.callout .ico {
  position: absolute; left: 18px; top: 19px;
  width: 20px; height: 20px;
}
.callout b { display: block; color: var(--tx); margin-bottom: 4px; font-weight: 650; }
.callout p { margin: 0 0 8px; }
.callout p:last-child { margin-bottom: 0; }
.callout ul { margin: 6px 0 0; }
.callout ul li { margin-bottom: 7px; padding-left: 22px; }
.callout ul li::before { left: 4px; }

.callout--tip {
  background: var(--brand-soft);
  border-color: color-mix(in srgb, var(--brand) 24%, transparent);
}
.callout--tip .ico { color: var(--brand); }
.callout--ok {
  background: var(--ok-bg);
  border-color: color-mix(in srgb, var(--ok) 26%, transparent);
}
.callout--ok .ico { color: var(--ok); }
.callout--warn {
  background: var(--warn-bg);
  border-color: color-mix(in srgb, var(--warn) 28%, transparent);
}
.callout--warn .ico { color: var(--warn); }
.callout--danger {
  background: var(--danger-bg);
  border-color: color-mix(in srgb, var(--danger) 26%, transparent);
}
.callout--danger .ico { color: var(--danger); }

/* ============================================================
   4 · 表格
   ============================================================ */
.tbl-wrap {
  margin: 26px 0;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--surface);
}
.tbl-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
  line-height: 1.6;
  min-width: 560px;
}
table.tbl caption {
  caption-side: top;
  text-align: left;
  padding: 14px 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--tx-3);
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}
table.tbl th, table.tbl td {
  padding: 13px 18px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line-2);
  color: var(--tx-2);
}
table.tbl thead th {
  background: var(--surface-2);
  color: var(--tx);
  font-weight: 650;
  font-size: 13.5px;
  white-space: nowrap;
}
table.tbl tbody tr:last-child th,
table.tbl tbody tr:last-child td { border-bottom: 0; }
table.tbl tbody tr:hover { background: var(--surface-2); }
table.tbl td strong { color: var(--tx); }

/* 状态标签 */
.tag {
  display: inline-block;
  padding: 2px 9px;
  border-radius: var(--r-pill);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.7;
  white-space: nowrap;
}
.tag--need { color: var(--danger); background: var(--danger-bg); }
.tag--cond { color: var(--warn);   background: var(--warn-bg); }
.tag--none { color: var(--ok);     background: var(--ok-bg); }
.tag--info { color: var(--brand);  background: var(--brand-l); }

/* ============================================================
   5 · 步骤列表
   ============================================================ */
.steps { margin: 30px 0; counter-reset: st; list-style: none; padding: 0; }
.steps > li {
  position: relative;
  counter-increment: st;
  padding: 0 0 30px 56px;
  /* 时间轴竖线：用品牌色淡化版，比中性描边线更容易看见 */
  border-left: 2px solid color-mix(in srgb, var(--brand) 16%, transparent);
  margin-left: 19px;
}
.steps > li:last-child { padding-bottom: 0; border-left-color: transparent; }
.steps > li::before {
  content: counter(st);
  position: absolute; left: -19px; top: -2px;
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 15px; font-weight: 680; font-variant-numeric: tabular-nums;
  color: var(--brand);
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--brand) 32%, transparent);
  box-shadow: var(--sh-xs);
}
.steps > li h3 { margin: 4px 0 8px; font-size: 17px; }
.steps > li p { margin: 0 0 8px; font-size: 15.5px; }
.steps > li p:last-child { margin-bottom: 0; }

/* ============================================================
   6 · 要点网格
   ============================================================ */
.kvs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
  margin: 28px 0;
}
.kv {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  transition: border-color var(--t-mid) var(--ease), box-shadow var(--t-mid) var(--ease), transform var(--t-mid) var(--ease);
}
.kv .ico-tile { margin-bottom: 13px; }
.kv h3, .kv h4 { margin: 0 0 7px; font-size: 15.5px; font-weight: 650; color: var(--tx); }
.kv p { margin: 0; font-size: 14.5px; line-height: 1.72; color: var(--tx-2); }
@media (hover: hover) and (pointer: fine) {
  .kv:hover {
    border-color: color-mix(in srgb, var(--brand) 30%, transparent);
    box-shadow: var(--sh-sm);
    transform: translateY(-3px);
  }
}
.kv--key {
  border-color: color-mix(in srgb, var(--brand) 34%, transparent);
  background: var(--brand-soft);
}

/* ============================================================
   7 · 侧栏（目录 / 迷你 CTA）
   ============================================================ */
.art-side {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  display: flex; flex-direction: column; gap: 20px;
}

.toc {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  overflow: hidden;
}
.toc-h {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 16px;
  font-size: 13px; font-weight: 650; color: var(--tx);
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  letter-spacing: .02em;
}
.toc-h .ico { width: 15px; height: 15px; color: var(--brand); }
.toc-nav { padding: 8px; max-height: min(58vh, 520px); overflow-y: auto; }
.toc-nav a {
  display: block;
  padding: 8px 12px 8px 14px;
  border-radius: var(--r-xs);
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--tx-2);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.toc-nav a:hover { background: var(--surface-2); color: var(--tx); }
.toc-nav a.is-active {
  color: var(--brand);
  background: var(--brand-soft);
  border-left-color: var(--brand);
  font-weight: 600;
}
.toc-nav a.lv3 { padding-left: 28px; font-size: 13px; color: var(--tx-3); }

/* 侧栏迷你转化卡 */
.mini-cta {
  padding: 20px;
  border-radius: var(--r-md);
  border: 1px solid color-mix(in srgb, var(--brand) 26%, transparent);
  background: var(--brand-soft);
}
.mini-cta b { display: block; font-size: 15px; color: var(--tx); margin-bottom: 7px; font-weight: 650; }
.mini-cta p { margin: 0 0 14px; font-size: 13.5px; line-height: 1.7; color: var(--tx-2); }
.mini-cta .btn { width: 100%; justify-content: center; }
.mini-cta .mc-note {
  display: block; margin-top: 10px;
  font-size: 12.5px; color: var(--tx-3); text-align: center;
}

/* ============================================================
   8 · 页尾转化区
   ============================================================ */
.sub-cta {
  padding-block: 72px;
  background: var(--surface);
  border-top: 1px solid var(--line);
}
.cta-box {
  position: relative;
  overflow: hidden;
  padding: 40px;
  border-radius: var(--r-lg);
  background: var(--ink);
  color: #fff;
}
.cta-box::after {
  content: '';
  position: absolute; right: -80px; top: -80px;
  width: 320px; height: 320px; border-radius: 50%;
  background: radial-gradient(circle, rgba(43, 92, 230, .5), transparent 68%);
  pointer-events: none;
}
.cta-box > * { position: relative; z-index: 1; }
.cta-box h2 {
  font-size: clamp(22px, 2.8vw, 30px);
  line-height: 1.32; font-weight: 680;
  color: #fff; margin: 0 0 14px;
  max-width: 17em; /* 同 h1：中文标题按 em 限宽，避免拆词 */
}
.cta-box h2 em { font-style: normal; color: #8FB0FF; }
.cta-box p { margin: 0 0 26px; font-size: 15.5px; line-height: 1.8; color: rgba(255, 255, 255, .72); max-width: 56ch; }
.cta-box .cta-acts { display: flex; flex-wrap: wrap; gap: 12px; }
.cta-box .btn--ghost {
  color: #fff;
  border-color: rgba(255, 255, 255, .28);
  background: rgba(255, 255, 255, .06);
}
.cta-box .btn--ghost:hover { background: rgba(255, 255, 255, .13); border-color: rgba(255, 255, 255, .45); }

/* ============================================================
   9 · 相关阅读
   ============================================================ */
.related { padding-block: 64px; }
.related-h {
  font-size: 15px; font-weight: 650; color: var(--tx);
  margin: 0 0 22px; letter-spacing: .01em;
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}
.rcard {
  display: flex; flex-direction: column; gap: 10px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  text-decoration: none;
  transition: border-color var(--t-mid) var(--ease), box-shadow var(--t-mid) var(--ease), transform var(--t-mid) var(--ease);
}
.rcard:hover {
  border-color: color-mix(in srgb, var(--brand) 34%, transparent);
  box-shadow: var(--sh-md);
  transform: translateY(-4px);
}
.rcard .ico-tile { margin-bottom: 4px; }
.rcard b { font-size: 16px; font-weight: 650; color: var(--tx); line-height: 1.45; }
.rcard span { font-size: 14px; line-height: 1.72; color: var(--tx-2); }
.rcard .rc-more {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: auto; padding-top: 10px;
  font-size: 13.5px; font-weight: 600; color: var(--brand);
}
.rcard .rc-more .ico { width: 15px; height: 15px; transition: transform var(--t-fast) var(--ease); }
.rcard:hover .rc-more .ico { transform: translateX(3px); }

/* ============================================================
   10 · 声明行（更新时间 / 免责）
   ============================================================ */
.disclaim {
  margin-top: 40px;
  padding: 18px 20px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1px dashed var(--line);
  font-size: 13.5px;
  line-height: 1.78;
  color: var(--tx-3);
}
.disclaim b { color: var(--tx-2); font-weight: 600; }

/* ============================================================
   11 · 响应式
   ============================================================ */
@media (max-width: 1080px) {
  .art-layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .art-side { position: static; margin-bottom: 40px; order: -1; }
  .toc-nav { max-height: 260px; }
  .mini-cta { display: none; }
}

@media (max-width: 720px) {
  .sub-hero { padding: 36px 0 40px; }
  .sub-hero h1 { max-width: none; }
  .sub-hero .lead { font-size: 15.5px; }
  .sub-body { padding-block: 44px 60px; }
  .prose { font-size: 16px; }
  .prose h2 { font-size: 21px; margin-top: 44px; }
  .prose h3 { font-size: 16.5px; }
  .callout { padding: 16px 16px 16px 48px; }
  .callout .ico { left: 15px; top: 17px; }
  .kvs { grid-template-columns: 1fr; }
  .steps > li { padding-left: 46px; }
  .steps > li::before { width: 32px; height: 32px; font-size: 14px; left: -16px; }
  .cta-box { padding: 28px 22px; }
  .cta-box .cta-acts .btn { width: 100%; justify-content: center; }
  .related { padding-block: 46px; }
  .sub-cta { padding-block: 52px; }
}

@media (max-width: 480px) {
  .crumbs { font-size: 12.5px; }
  .tbl-wrap { border-radius: var(--r-sm); }
  table.tbl { font-size: 14px; }
  table.tbl th, table.tbl td { padding: 11px 14px; }
}

/* 打印：去掉装饰与侧栏，保证正文可读 */
@media print {
  .sub-hero::before, .sub-hero::after { display: none; }
  .art-side, .mini-cta, .sub-cta, .related, .site-header, .footer, .progress, .to-top, .mobile-cta { display: none !important; }
  .art-layout { display: block; }
  .prose { max-width: none; font-size: 11pt; }
}
