/* 案例页两级分类：顶部一级（全部 / 书籍 / 视频）+ 二级题材筛选，吸顶 */

/* ① 一级分类 tab */
.seg-bar {
  position: sticky !important;
  top: var(--case-barh, 55px) !important;
  z-index: 9 !important;
  display: flex !important;
  align-items: center !important;
  gap: 24px !important;
  margin: -10px -12px 0 !important;
  padding: 10px 12px 7px !important;
  background: #fff !important;
}
.seg {
  position: relative;
  appearance: none; -webkit-appearance: none;
  border: 0; background: none; margin: 0;
  padding: 0 0 8px;
  font: inherit; font-size: 15px; line-height: 15px; color: #8c847a;
  letter-spacing: .3px; cursor: pointer;
  display: inline-flex; align-items: baseline; gap: 5px;
  -webkit-tap-highlight-color: transparent;
}
.seg b { font-size: 11px; font-weight: 500; color: #b2aaa0; font-variant-numeric: tabular-nums; }
.seg.on { color: #1e1c19; font-weight: 600; }
.seg.on b { color: #8c847a; }
.seg.on::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0;
  height: 2px; border-radius: 2px; background: #2f4a42;
}
.seg-bar.solo { border-bottom: 1px solid #efede9; padding-bottom: 8px; }

/* ② 二级题材筛选：紧接一级 tab，一起吸顶 */
.cat-bar {
  position: sticky !important;
  top: calc(var(--case-barh, 55px) + var(--case-segh, 44px)) !important;
  z-index: 8 !important;
  margin: 0 -12px 0 !important;
  padding: 2px 12px 12px !important;
  background: #fff !important;
  border-bottom: 1px solid #efede9 !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch !important;
  scrollbar-width: none !important;
  transition: box-shadow .18s ease;
}
.cat-bar::-webkit-scrollbar { display: none; }
.cat-bar.stuck { box-shadow: 0 10px 18px -12px rgba(23, 20, 17, .2); }

/* ③ 成书样板：白底独立卡片 */
.sb-wrap {
  background: #fff !important;
  border: 1px solid #eeebe4 !important;
  border-radius: 18px !important;
  padding: 15px 15px 17px !important;
  margin: 12px 0 20px !important;
  box-shadow: 0 1px 2px rgba(28, 24, 20, .03) !important;
}
.sb-head { margin-bottom: 13px !important; }
.sb-h { font-size: 15px !important; font-weight: 600 !important; letter-spacing: .4px !important; color: #1e1c19 !important; }
.sb-sub { font-size: 11.5px !important; color: #9c948a !important; letter-spacing: .1px !important; }

/* ④ 书脊横滑 → 3 列 2 行网格 */
.sb-rail {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 15px 11px !important;
  overflow: visible !important;
  overflow-x: visible !important;
  padding: 0 !important;
  -webkit-overflow-scrolling: auto !important;
  scroll-snap-type: none !important;
}
.sb-card {
  width: auto !important; min-width: 0 !important; flex: none !important;
  display: flex !important; flex-direction: column !important; height: 100% !important;
}
.sb-cv {
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 112 / 166 !important;
  border-radius: 3px 8px 8px 3px !important;
  box-shadow: 0 2px 6px rgba(28, 24, 20, .10) !important;
}
.sb-t {
  font-size: 12.5px !important; line-height: 1.32 !important; margin-top: 8px !important;
  color: #241f1b !important; white-space: normal !important; text-overflow: clip !important;
  display: -webkit-box !important; -webkit-line-clamp: 2 !important; -webkit-box-orient: vertical !important; overflow: hidden !important;
}
.sb-a {
  font-size: 11px !important; color: #928a80 !important;
  margin-top: auto !important; padding-top: 3px !important;
}

/* ⑤ 视频案例分区标题 */
.vc-head {
  display: flex; align-items: baseline; gap: 8px;
  margin: 0 0 12px;
}
.vc-h { font-size: 15px; font-weight: 600; letter-spacing: .4px; color: #1e1c19; }
.vc-sub { font-size: 11.5px; color: #9c948a; }

/* ⑥ 隐藏态：绕过本文件 !important 的 display 声明 */
.is-hide { display: none !important; }

/* ⑦ 顶部筛选入口 */
.fbtn {
  margin-left: auto !important;
  display: inline-flex !important; align-items: center !important; gap: 5px !important;
  height: 24px; padding: 0 10px; border-radius: 12px;
  border: 1px solid #e6e1d8; background: #f6f4f0; color: #4a443d;
  font: inherit; font-size: 12px; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.fbtn i { font-style: normal; font-size: 11px; color: #fff; background: #23405c;
  min-width: 15px; height: 15px; line-height: 15px; border-radius: 8px; text-align: center; padding: 0 3px; display: none; }
.fbtn.on { border-color: #cfd9e4; background: #eef2f7; color: #23405c; font-weight: 600; }
.fbtn.on i { display: inline-block; }

/* ⑧ 筛选抽屉 */
.flt-mask { position: fixed; inset: 0; background: rgba(20, 18, 16, .38); z-index: 68; opacity: 0; transition: opacity .2s; }
.flt-mask.on { opacity: 1; }
.flt-sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 69;
  background: #fff; border-radius: 18px 18px 0 0;
  max-height: 76vh; display: flex; flex-direction: column;
  transform: translateY(102%); transition: transform .26s cubic-bezier(.22,.61,.36,1);
  box-shadow: 0 -8px 28px rgba(20, 18, 16, .16);
}
.flt-sheet.on { transform: translateY(0); }
.flt-bar { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 10px; }
.flt-tt { font-size: 16px; font-weight: 600; color: #1e1c19; letter-spacing: .4px; }
.flt-x { border: 0; background: none; font-size: 20px; line-height: 1; color: #9c948a; cursor: pointer; padding: 4px 6px; }
.flt-body { padding: 2px 18px 8px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.flt-grp { padding: 12px 0 4px; }
.flt-lb { font-size: 12.5px; color: #7b736a; letter-spacing: .3px; margin-bottom: 9px; }
.flt-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.flt-o {
  border: 1px solid #eae5dc; background: #fff; color: #4a443d;
  font: inherit; font-size: 12.5px; line-height: 1; padding: 8px 12px; border-radius: 15px;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  display: inline-flex; align-items: baseline; gap: 4px;
}
.flt-o b { font-size: 10.5px; font-weight: 500; color: #b2aaa0; }
.flt-o.on { background: #23405c; border-color: #23405c; color: #fff; font-weight: 600; }
.flt-o.on b { color: rgba(255,255,255,.72); }
.flt-foot {
  display: flex; gap: 10px; padding: 12px 18px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid #f2efea; background: #fff;
}
.flt-reset { flex: 0 0 96px; height: 44px; border-radius: 22px; border: 1px solid #e6e1d8; background: #fff; color: #6b6359; font: inherit; font-size: 14px; cursor: pointer; }
.flt-ok { flex: 1; height: 44px; border-radius: 22px; border: 0; background: #23405c; color: #fff; font: inherit; font-size: 14.5px; font-weight: 600; cursor: pointer; }

/* ⑨ 空结果提示 */
.flt-empty { display: none; margin: 6px 0 10px; padding: 34px 0; text-align: center;
  font-size: 13px; color: #9c948a; background: #fff; border: 1px solid #eeebe4; border-radius: 14px; }
.flt-empty.on { display: block; }

/* ⑩ 已选条件条 */
.flt-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin: 0 0 11px; }
.flt-chips .fc {
  display: inline-flex; align-items: center; gap: 5px;
  height: 26px; padding: 0 9px; border-radius: 13px;
  background: #eef2f7; border: 1px solid #dbe3ec; color: #23405c;
  font-size: 11.5px; letter-spacing: .1px;
}
.flt-chips .fc b { font-weight: 600; }
.flt-chips .fc span { font-size: 14px; line-height: 1; color: #7e93a8; cursor: pointer; padding-left: 1px; }
.flt-chips .fclr { border: 0; background: none; font: inherit; font-size: 11.5px; color: #9c948a; cursor: pointer; padding: 2px 2px; }

/* ⑪ 案例搜索 */
.case-search { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 13px;
  margin: 0 0 10px; background: #fff; border: 1px solid #eeebe4; border-radius: 19px; }
.case-search svg { width: 16px; height: 16px; flex: 0 0 16px; color: #b0a89d; }
.case-search input { flex: 1 1 auto; min-width: 0; border: 0; outline: 0; background: none;
  font: inherit; font-size: 13.5px; color: #1e1c19; }
.case-search input::-webkit-search-cancel-button { display: none; }
.case-search .cs-x { display: none; flex: 0 0 auto; border: 0; background: none; font-size: 17px;
  line-height: 1; color: #9c948a; padding: 0 2px; cursor: pointer; }
.case-search.on .cs-x { display: block; }

/* ⑫ 卡片播放数 + 已收藏星标 */
.g-vw { display: block; margin-top: 5px; font-size: 10.5px; color: #b0a89d; letter-spacing: .2px; }
.g-card { position: relative; }
.g-card[data-fav="1"]::after { content: "★"; position: absolute; z-index: 3; top: 5px; right: 8px;
  font-size: 13px; line-height: 1; color: #ffd76a; text-shadow: 0 1px 3px rgba(0, 0, 0, .45); }


/* 补丁未应用前不露旧版布局；2.8s 后自动兜底显示，防止脚本异常时白屏 */
.case-page{opacity:0;animation:caseShow .16s ease 2.8s forwards}
.case-page.is-ready{opacity:1;transition:opacity .18s ease .26s}
@keyframes caseShow{to{opacity:1}}

/* 案例页页头 */
.cs-head { display: flex; align-items: baseline; gap: 8px; padding: 16px 2px 10px; }
.cs-head b { font-size: 19px; font-weight: 700; color: #2f4a42; letter-spacing: .5px; }
.cs-head span { font-size: 12px; color: #a09789; }

/* 视频卡一句话说明（来自案例 desc） */
.g-desc {
  margin: 3px 0 0; font-size: 12px; line-height: 1.5; color: #8d8477;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* 320 小屏：两条筛选条 content-box + padding 导致整页多出 4px 横向可拖 */
.case-page .seg-bar,
.case-page .cat-bar { box-sizing: border-box !important; max-width: 100% !important; }

/* 底部固定导航压住最后一排内容：给案例页留出安全区 */
.case-page { padding-bottom: 96px !important; }
