/* ============================================================================
   第 2 页：详情页（左 1/3 按钮导航 · 右 2/3 内容，右侧独立滚动）
   ========================================================================= */

.page--detail {
  display: flex;
  flex-direction: column;
  /* 底图 + 浅色蒙版：第 2 页是浅色内容页，蒙版把红色退成暖粉底，
     白色卡片仍能跳出来；蒙版浓淡在 tokens.css 的 --bg-veil 一处可调。
     底图在左右安全距离之外与栏间缝隙处露出，成为品牌色的"画框"。 */
  background-color: var(--bg);
  background-image: var(--bg-veil), var(--bg-image);
  background-size: auto, cover;
  background-position: center, center;
  background-repeat: no-repeat, no-repeat;
  /* 左右安全距离之外的中间区域分两份：
     基准 1 : 2（左栏 = 中间区的 1/3），此处把左栏收窄至基准的 70%，
     即 0.7fr : 2.3fr（合计仍为 3 份，右栏自动承接让出的空间） */
  --grid-cols: 0.7fr 2.3fr; /* ← 改分栏比例只改这一行 */
}

/* 内容框架：统一左右安全距离，顶栏与分栏严格对齐 */
.detail__frame {
  flex: 1;
  min-height: 0;
  width: 100%;
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: var(--pad-y) var(--pad-x) clamp(16px, 2.4vh, 34px);
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 1.8vh, 22px);
}

/* ============================================================================
   顶栏
   ========================================================================= */

.detail__top {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.detail__lead {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.btn-back {
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--sh-1);
  color: var(--ink-2);
  transition:
    transform 280ms var(--ease-spring),
    background 220ms var(--ease-out),
    color 220ms var(--ease-out),
    border-color 220ms var(--ease-out),
    box-shadow 220ms var(--ease-out);
}

.btn-back:hover {
  transform: translateY(-2px);
  background: var(--brand-grad);
  border-color: transparent;
  color: #fff;
  box-shadow: var(--sh-brand);
}

.btn-back:active {
  transform: translateY(0) scale(0.96);
}

.detail__rule {
  width: 1px;
  height: 30px;
  background: var(--line);
  flex: none;
}

.detail__id {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.detail__id-mark {
  width: 38px;
  height: 38px;
  display: block;
  object-fit: contain;
  flex: none;
  /* logo 为透明底彩图，加一层极淡投影保证在浅色顶栏上轮廓清晰 */
  filter: drop-shadow(0 3px 8px rgba(180, 20, 30, 0.18));
}

.detail__id-text {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
  min-width: 0;
}

.detail__id-text b {
  font-size: 20.8px; /* 16px × 1.3（放大 30%） */
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
  white-space: nowrap;
}

.detail__id-text em {
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  color: var(--ink-3);
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.detail__chips {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: none;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 14px;
  border-radius: var(--r-pill);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--sh-1);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  white-space: nowrap;
}

.chip svg {
  color: var(--brand-2);
  flex: none;
}

/* ============================================================================
   主体分栏
   ========================================================================= */

.detail__body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: var(--grid-cols);
  gap: var(--gap-cols);
}

/* ---------- 左栏：按钮导航（不随右栏滚动）+ 底部品牌标识 ---------- */

.side-col {
  /* min-width: 0 必须显式声明：默认 min-width:auto 会按导航文字的 min-content
     撑宽左栏，使 0.7fr 分栏失效（窄视口下尤其明显）。 */
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 1.6vh, 18px);
}

.side-nav {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: clamp(7px, 1vh, 11px);
  overflow-y: auto; /* 仅在极矮视口下兜底，正常不出现滚动条 */
  overscroll-behavior: contain;
  padding-right: 2px;
  scrollbar-width: none;
}

.side-nav::-webkit-scrollbar {
  display: none;
}

/* 左栏底部品牌标识（半度云智能会务系统）：居中、约占栏宽 2/3 */
.side-brand {
  flex: none;
  margin-top: auto; /* 导航未占满时把标识推到底部 */
  margin-bottom: 30px; /* 整体相对底部上移 30px */
  display: flex;
  justify-content: center;
}

.side-brand img {
  width: 67%;
  max-width: 100%;
  height: auto;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}

.nav-item {
  position: relative;
  flex: none;
  display: flex;
  align-items: center;
  gap: 15px;
  width: 100%;
  padding: clamp(11px, 1.5vh, 15px) clamp(13px, 1.2vw, 18px);
  border-radius: var(--r-lg);
  background: linear-gradient(to bottom, #FFF8F1 0%, #FFD6AB 100%);
  border: 1px solid rgba(223, 27, 33, 0.22);
  box-shadow: var(--sh-1);
  text-align: left;
  overflow: hidden;
  transition:
    transform 300ms var(--ease-spring),
    background 240ms var(--ease-out),
    border-color 240ms var(--ease-out),
    box-shadow 240ms var(--ease-out),
    color 240ms var(--ease-out);
}

.nav-item > * {
  position: relative;
  z-index: 1;
}

.nav-item:hover {
  transform: translateY(-2px);
  border-color: rgba(223, 27, 33, 0.42);
  box-shadow: var(--sh-2);
}

.nav-item:hover .nav-item__icon {
  color: #DF1B21;
}

.nav-item.is-active {
  border: 2px solid #DF1B21;
  box-shadow: 0 10px 26px rgba(223, 27, 33, 0.20);
}

.nav-item.is-active .nav-item__icon {
  color: #DF1B21;
}

.nav-item.is-active .nav-item__cn {
  color: #DF1B21;
}

.nav-item.is-active .nav-item__en {
  color: rgba(223, 27, 33, 0.62);
}

.nav-item.is-active .nav-item__chev {
  display: none;
}

.nav-item__icon {
  width: 53px;
  height: 53px;
  flex: none;
  display: grid;
  place-items: center;
  color: #DF1B21;
  transition: color 240ms var(--ease-out);
}

.nav-item__text {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
  min-width: 0;
  flex: 1;
}

.nav-item__cn {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.005em;
  color: #DF1B21;
  font-family: "Songti SC", "STSong", "SimSun", "宋体", "Noto Serif CJK SC", serif;
  white-space: nowrap;
  transition: color 240ms var(--ease-out);
}

.nav-item__en {
  font-family: "Songti SC", "STSong", "SimSun", "宋体", "Noto Serif CJK SC", serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: rgba(223, 27, 33, 0.60);
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 240ms var(--ease-out);
}

.nav-item__chev {
  flex: none;
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 260ms var(--ease-out), transform 260ms var(--ease-out);
  color: var(--ink-4);
}

/* ---------- 右栏：内容面板（独立滚动区） ---------- */

.panel-wrap {
  position: relative;
  min-height: 0;
  border-radius: var(--r-xl);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--sh-2);
  overflow: hidden;
}

.panel {
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: clamp(20px, 2.8vh, 36px) clamp(20px, 2.6vw, 44px) clamp(26px, 5vh, 58px);
  transition: opacity var(--dur-panel) var(--ease-out), transform var(--dur-panel) var(--ease-out);
}

.panel.is-swapping {
  opacity: 0;
  transform: translateY(10px);
}

/* 顶部 / 底部可滚动渐隐提示 */
.panel-wrap::before,
.panel-wrap::after {
  content: "";
  position: absolute;
  /* 必须铺满面板内框（inset 0）：留 1px / 12px 缝会让底下的图片从缝里透出来，
     在上下边缘形成一条红线。绝对定位以 padding box 为基准，故不会盖住边框。 */
  left: 0;
  right: 0;
  height: 68px;
  pointer-events: none;
  z-index: 3;
  opacity: 0;
  transition: opacity 320ms var(--ease-out);
}

.panel-wrap::before {
  top: 0;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  background: linear-gradient(to bottom, var(--surface) 32%, rgba(255, 255, 255, 0));
}

.panel-wrap::after {
  bottom: 0;
  border-radius: 0 0 var(--r-xl) var(--r-xl);
  background: linear-gradient(to top, var(--surface) 32%, rgba(255, 255, 255, 0));
}

.panel-wrap.can-scroll-up::before {
  opacity: 1;
}

.panel-wrap.can-scroll-down::after {
  opacity: 1;
}

/* 面板头部 */
.panel__head {
  padding-bottom: clamp(14px, 2vh, 22px);
  border-bottom: 1px solid var(--line-2);
}

.panel__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.2em;
  color: var(--brand-2);
  text-transform: uppercase;
}

.panel__eyebrow::before {
  content: "";
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: var(--brand-grad);
}

.panel__title {
  margin-top: 10px;
  font-size: clamp(24px, 2.4vw, 34px);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.16;
  color: var(--ink);
}

.panel__desc {
  margin-top: 10px;
  max-width: 68ch;
  font-size: 14.5px;
  line-height: 1.72;
  color: var(--ink-2);
}

/* 要点标签行 */
.panel__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--r-pill);
  background: var(--brand-soft);
  color: var(--brand-3);
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
}

/* 分组标题 */
.panel__group {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: clamp(24px, 3.4vh, 40px) 0 16px;
}

.panel__group-num {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--brand-2);
  padding: 3px 8px;
  border-radius: var(--r-sm);
  background: var(--brand-soft);
  flex: none;
}

.panel__group-title {
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.panel__group-line {
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* ============================================================================
   图片单元（“以图片为主”的承载块）
   ========================================================================= */

.shot {
  position: relative;
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface-2);
  box-shadow: var(--sh-1);
  transition: transform 400ms var(--ease-spring), box-shadow 400ms var(--ease-out),
    border-color 300ms var(--ease-out);
}

.shot:hover {
  transform: translateY(-3px);
  border-color: var(--brand-soft-2);
  box-shadow: var(--sh-2);
}

.shot + .shot {
  margin-top: clamp(14px, 1.8vh, 20px);
}

.shot__media {
  position: relative;
  width: 100%;
  aspect-ratio: var(--ar, 16 / 9);
  background: linear-gradient(150deg, #eef3fb 0%, #e6ecf7 100%);
  overflow: hidden;
}

.shot__media > svg,
.shot__media > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.shot__cap {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 16px;
  border-top: 1px solid var(--line-2);
  background: var(--surface);
}

.shot__idx {
  flex: none;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--brand-2);
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--brand-soft);
}

.shot__cap b {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
}

.shot__cap span {
  margin-left: auto;
  font-size: 12px;
  color: var(--ink-3);
  white-space: nowrap;
}

/* 双图并排 */
.shot-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(14px, 1.8vh, 20px);
  margin-top: clamp(14px, 1.8vh, 20px);
}

.shot-row .shot + .shot {
  margin-top: 0;
}

/* 面板尾部信息条 */
.panel__note {
  margin-top: clamp(22px, 3vh, 34px);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 18px;
  border-radius: var(--r-lg);
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 13.5px;
  line-height: 1.68;
  color: var(--ink-2);
}

.panel__note svg {
  flex: none;
  margin-top: 2px;
  color: var(--brand-2);
}

.panel__end {
  margin-top: clamp(24px, 3.4vh, 40px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.2em;
  color: var(--ink-4);
  text-transform: uppercase;
}

.panel__end::before,
.panel__end::after {
  content: "";
  height: 1px;
  width: 54px;
  background: var(--line);
}

/* ============================================================================
   矮视口兜底：左栏（8 个按钮 + 底部品牌标识）已无余量时收紧按钮上下内边距，
   保证按钮与标识都完整显示、导航自身不出现滚动
   ========================================================================= */

@media (max-height: 860px) and (min-width: 901px) {
  .nav-item {
    padding-top: 9px;
    padding-bottom: 9px;
  }

  .side-nav {
    gap: 6px;
  }
}

/* ============================================================================
   小屏兜底：左栏改为横向 chip 条，仍保持右侧独立滚动
   ========================================================================= */

@media (max-width: 900px) {
  .detail__body {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    gap: 12px;
  }

  .side-col {
    gap: 10px;
  }

  .side-brand img {
    width: 46%;
    max-width: 190px;
  }

  .side-nav {
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 8px;
    padding-bottom: 4px;
    scrollbar-width: none;
  }

  .nav-item {
    width: auto;
    padding: 9px 14px;
    gap: 9px;
    border-radius: var(--r-pill);
  }

  .nav-item__icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
  }

  .nav-item__cn {
    font-size: 15.5px;
  }

  .nav-item__en,
  .nav-item__chev {
    display: none;
  }

  .detail__chips .chip:nth-child(2) {
    display: none;
  }

  .shot-row {
    grid-template-columns: 1fr;
  }
}

/* ============================================================================
   内联图标尺寸
   ========================================================================= */

.btn-back svg {
  width: 19px;
  height: 19px;
}

.chip svg {
  width: 15px;
  height: 15px;
}

.nav-item__icon svg {
  width: 28px;
  height: 28px;
}

.nav-item__chev svg {
  width: 16px;
  height: 16px;
}

.panel__note svg {
  width: 17px;
  height: 17px;
}

/* ============================================================================
   进入详情页时的错峰入场
   （backwards 填充：动画结束即释放 transform，不影响 hover 效果）
   ========================================================================= */

@keyframes navIn {
  from { opacity: 0; transform: translateX(-18px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes panelIn {
  from { opacity: 0; transform: translateY(22px) scale(0.99); }
  to { opacity: 1; transform: none; }
}

@keyframes topIn {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: none; }
}

.page--detail.is-entered .detail__top {
  animation: topIn 480ms var(--ease-out) backwards;
  animation-delay: 180ms;
}

.page--detail.is-entered .side-nav .nav-item {
  animation: navIn 560ms var(--ease-out) backwards;
  animation-delay: calc(var(--i, 0) * 55ms + 240ms);
}

/* 品牌标识在最后一个按钮之后入场 */
.page--detail.is-entered .side-brand {
  animation: navIn 560ms var(--ease-out) backwards;
  animation-delay: 680ms;
}

.page--detail.is-entered .panel-wrap {
  animation: panelIn 620ms var(--ease-out) backwards;
  animation-delay: 300ms;
}
