/* ==========================================================================
   首屏左右分栏 + 右侧示意配图
   --------------------------------------------------------------------------
   为什么加这个：
     原先首屏是单栏文字（title / subtitle / buttons 全挤在左半边），
     1440 宽下右半屏 448px 完全空着，整屏重心偏左、显得空。
     这里让首屏变成两栏：左边文案，右边一张示意卡。
     配图是纯 CSS 画的（见 cms_hero_art_html），不依赖任何图片文件。

   同时修掉一个对齐 bug：
     .cms-hero .cms-lead 继承了 cms.css 里的 margin:0 auto，
     于是「大标题左对齐、副标题却居中」，看着就是没对齐。
     分栏模式下强制左栏整体左对齐。
   ========================================================================== */

.cms-hero.has-media { padding: 104px 0 100px; }

.cms-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  gap: 64px;
  align-items: center;
}
.cms-hero-main { min-width: 0; }

/* 分栏下所有文字一律左对齐，覆盖 cms.css 的 margin:0 auto */
.cms-hero.has-media .cms-hero .cms-lead,
.cms-hero.has-media .cms-lead { margin-left: 0; margin-right: 0; }
.cms-hero.has-media .cms-hero-btns { justify-content: flex-start; }
.cms-hero.has-media .cms-hero h1 { max-width: 15em; }

/* ---------- 右侧配图容器 ---------- */
.cms-hero-side { min-width: 0; }
.cms-hero-art {
  position: relative;
  border-radius: 20px;
  padding: 20px;
  background: linear-gradient(158deg, #FFFFFF, #F4F8FF);
  border: 1px solid var(--cms-line);
  box-shadow: 0 26px 68px rgba(11, 37, 69, .13);
}
/* 卡片后面一层柔光，让它从页面上「浮」起来而不是贴上去。

   注意这里的 inset 不能超出容器：
   一个绝对定位元素用 inset:-14% -8% 撑到容器外，
   它的 scrollWidth 就会被算进父元素的 overflow 区域，
   于是父容器 scrollWidth(546) > clientWidth(505) ——
   内容其实只有 465px，撑破容器的是这层装饰。

   修法：让装饰只向内收缩（负 inset 改为 0），
   柔光效果改用 filter: blur() 实现，它不参与布局计算。
*/
.cms-hero-art::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: radial-gradient(120% 140% at 50% 0%,
              var(--cms-brand-glow, rgba(34,84,244,.14)), transparent 68%);
  filter: blur(18px);
  opacity: .9;
}
.cms-hero-cap {
  margin: 14px 2px 0;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--cms-ink-4);
  text-align: center;
}

/* ---------- 1) 源码目录面板 ---------- */
.cms-art-panel {
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--cms-line);
  box-shadow: 0 10px 30px rgba(11, 37, 69, .08);
}
.cms-art-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 11px 14px;
  background: #F7F9FC;
  border-bottom: 1px solid var(--cms-line);
}
.cms-art-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: #DFE5EE;
}
.cms-art-ph {
  margin-left: 8px;
  font-size: 12px;
  color: var(--cms-ink-4);
}
.cms-art-list { list-style: none; margin: 0; padding: 6px 0; }
.cms-art-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 16px;
  font-size: 14px;
  color: var(--cms-ink-2);
}
.cms-art-list li + li { border-top: 1px solid rgba(11, 37, 69, .05); }
.cms-art-nm { font-weight: 600; }
.cms-art-tag {
  flex: none;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
}
.cms-art-tag--ok {
  background: rgba(34, 84, 244, .1);
  color: var(--cms-brand);
}
.cms-art-tag--wait {
  background: rgba(148, 163, 184, .16);
  color: var(--cms-ink-3);
}
.cms-art-bar2 {
  padding: 11px 16px;
  background: #F7F9FC;
  border-top: 1px solid var(--cms-line);
  font-size: 12px;
  color: var(--cms-ink-4);
}

/* ---------- 2) 代码窗口 ---------- */
.cms-art-code {
  border-radius: 12px;
  overflow: hidden;
  background: #0B1D30;
  border: 1px solid #16375F;
  box-shadow: 0 14px 36px rgba(11, 29, 48, .3);
}
.cms-art-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, .05);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.cms-art-bar i {
  width: 9px; height: 9px; border-radius: 50%;
  background: rgba(255, 255, 255, .2);
}
.cms-art-file {
  margin-left: 10px;
  font-size: 11.5px;
  color: rgba(255, 255, 255, .55);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.cms-art-pre {
  margin: 0;
  padding: 16px 18px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.85;
  overflow-x: auto;
}
.cms-art-l { display: block; white-space: pre; }
.cms-art-l.k { color: #6FD3FF; }     /* 字段名 */
.cms-art-l.p { color: #9FB6D4; }     /* 属性行 */
.cms-art-foot {
  padding: 10px 16px;
  border-top: 1px solid rgba(255, 255, 255, .08);
  font-size: 12px;
}
.cms-art-ok { color: #5FE3A1; }

/* ---------- 3) 数据看板 ---------- */
.cms-art-stats { display: grid; gap: 12px; }
.cms-art-tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.cms-art-tile {
  padding: 14px 12px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--cms-line);
  text-align: center;
}
.cms-art-tile.is-on {
  background: linear-gradient(150deg, var(--cms-brand), var(--cms-brand-600, #0B3FD1));
  border-color: transparent;
  box-shadow: 0 10px 26px rgba(34, 84, 244, .28);
}
.cms-art-tile b {
  display: block;
  font-size: 24px;
  font-weight: 800;
  line-height: 1.2;
  color: var(--cms-ink);
  font-variant-numeric: tabular-nums;
}
.cms-art-tile span { font-size: 12px; color: var(--cms-ink-3); }
.cms-art-tile.is-on b { color: #fff; }
.cms-art-tile.is-on span { color: rgba(255, 255, 255, .82); }
.cms-art-chart {
  padding: 16px 16px 12px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--cms-line);
}
.cms-art-bars {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 92px;
}
.cms-art-bars i {
  flex: 1;
  height: var(--h, 50%);
  border-radius: 5px 5px 0 0;
  background: linear-gradient(180deg, var(--cms-brand), rgba(34, 84, 244, .28));
}
.cms-art-axis {
  display: block;
  margin-top: 10px;
  font-size: 11.5px;
  color: var(--cms-ink-4);
}

/* ==========================================================================
   特性区：新增三列卡片布局
   --------------------------------------------------------------------------
   原 left/right 布局在没有配图时，会为每项渲染一个
   aspect-ratio:4/3 的空方块只放大号数字。
   三项叠起来在 1440 宽下占掉 1764px 高度，其中约 1200px 是空白，
   这是「页面看起来很空、很丑」的主要原因。
   cards 布局把内容压进三张卡，高度降到 500px 上下。
   ========================================================================== */

.cms-fcards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(268px, 1fr));
  gap: 24px;
}
.cms-fcard {
  position: relative;
  padding: 30px 26px 28px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--cms-line);
  box-shadow: 0 2px 10px rgba(11, 37, 69, .04);
  transition: transform .3s cubic-bezier(.2, .8, .3, 1),
              border-color .3s ease, box-shadow .3s ease;
}
.cms-fcard::after {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  border-radius: 16px 16px 0 0;
  background: linear-gradient(90deg, var(--cms-brand), var(--cms-accent, #FF6A2B));
  opacity: 0;
  transition: opacity .3s ease;
}
.cms-fcard:hover {
  transform: translateY(-6px);
  border-color: var(--cms-brand-300, #B5DFFF);
  box-shadow: 0 20px 48px rgba(11, 37, 69, .13);
}
.cms-fcard:hover::after { opacity: 1; }

.cms-fcard-n {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  margin-bottom: 18px;
  border-radius: 12px;
  background: linear-gradient(150deg, rgba(34, 84, 244, .1), rgba(34, 84, 244, .04));
  color: var(--cms-brand);
  font-size: 17px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.cms-fcard-img {
  margin: -6px 0 18px;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: var(--cms-bg-2);
}
.cms-fcard-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cms-fcard h3 {
  margin: 0 0 12px;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--cms-ink);
}
.cms-fcard p {
  margin: 0;
  font-size: 15px;
  line-height: 1.85;
  color: var(--cms-ink-2);
}

/* 原分栏布局在没有配图时用的序号徽标（替代空白大方块） */
.cms-feat-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 44px;
  padding: 0 12px;
  margin-bottom: 16px;
  border-radius: 11px;
  background: linear-gradient(150deg, rgba(34, 84, 244, .1), rgba(34, 84, 244, .04));
  color: var(--cms-brand);
  font-size: 17px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   响应式
   ========================================================================== */
@media (max-width: 1080px) {
  .cms-hero-grid { grid-template-columns: 1fr; gap: 46px; }
  .cms-hero.has-media { padding: 88px 0 84px; }
  /* 单栏后配图不再那么抢戏，压一压高度 */
  .cms-hero-art { padding: 16px; }
}
@media (max-width: 640px) {
  .cms-hero.has-media { padding: 62px 0 58px; }
  .cms-hero-grid { gap: 34px; }
  .cms-fcards { grid-template-columns: 1fr; gap: 16px; }
  .cms-fcard { padding: 24px 20px; }
  .cms-art-tile b { font-size: 20px; }
  .cms-art-pre { font-size: 12px; }
}

/* ==========================================================================
   面包屑（配合 seo_breadcrumb_html）
   --------------------------------------------------------------------------
   原来用的是 div + span 的扁平结构（cms-crumb > a + span.sep），
   这里改成 <nav><ol><li> —— 语义更准确，读屏软件能识别为导航，
   搜索引擎也能从层级结构里理解页面关系。

   两种结构共用 .cms-crumb 类名，所以两套样式都保留：
   老结构（文章详情页 cms.php 里已有的）继续能用，
   新结构（本文件 seo.php 输出的）走 ol 规则。
   ========================================================================== */

.cms-crumb ol {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.cms-crumb li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  line-height: 1.6;
}
/* li 之间的分隔线：用 ::before 而不是额外的 span，
   少一个 DOM 节点，也少一处需要维护的样式 */
.cms-crumb li + li::before {
  content: "/";
  color: #C8D0DC;
  font-weight: 400;
}
.cms-crumb a {
  color: var(--cms-ink-3, #5F6575);
  text-decoration: none;
  transition: color .18s ease;
}
.cms-crumb a:hover {
  color: var(--cms-brand, #2254F4);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.cms-crumb .cur {
  color: var(--cms-ink, #0B1D30);
  font-weight: 600;
  max-width: 62vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .cms-crumb { margin-bottom: 16px; }
  .cms-crumb li { font-size: 12px; }
  .cms-crumb .cur { max-width: 52vw; }
}
