/* ============================================================
 * cps-enhance.css — v1.53.0 优惠券资讯站共享视觉增强层
 *
 * 由 theme_extra_css() 仅在 category=cps 的 5 套券站模板下加载：
 *   coupondash / couponlite / couponpress / couponvip / dealjournal
 * 放在各自的 layout-*.css 之后、theme-*.css 之前。
 *
 * 选择器统一以 html[data-template] 限定（特异性与 layout-* 相同，靠加载
 * 顺序覆盖），因此不影响通用商城模板。
 * ============================================================ */

html[data-template] {
  --cps-brand: #ff4d2e;
  --cps-brand-2: #ff8a1f;
  --cps-brand-soft: #fff0eb;
  --cps-ink: #211c1a;
  --cps-ink-2: #5a504c;
  --cps-muted: #9a8f89;
  --cps-line: #f0e6e0;
  --cps-bg: #fff8f5;
  --cps-card: #fff;
  --cps-price: #e11d48;
  --cps-mint: #0f9d76;
  --cps-r: 16px;
  --cps-sh-1: 0 2px 10px rgba(90, 40, 20, .05);
  --cps-sh-2: 0 14px 32px rgba(150, 60, 25, .13);
}

html[data-template] body {
  background: var(--cps-bg);
  color: var(--cps-ink);
  -webkit-font-smoothing: antialiased;
}

/* ---------- 顶部刊头：铺满容器 + 玻璃质感 ---------- */
html[data-template] .cd-head,
html[data-template] .cl-head,
html[data-template] .cp-head,
html[data-template] .cv-head,
html[data-template] .dj-head {
  margin-left: -16px;
  margin-right: -16px;
  box-shadow: 0 6px 22px rgba(120, 35, 10, .16);
  background-image: linear-gradient(115deg, #ff4126 0%, #ff6a1f 52%, #ff9a2e 100%);
}
html[data-template] .cd-head::after,
html[data-template] .cl-head::after,
html[data-template] .cp-head::after,
html[data-template] .cv-head::after,
html[data-template] .dj-head::after {
  content: "";
  position: absolute;
  right: 6%;
  top: -46px;
  width: 190px;
  height: 130px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .09);
  pointer-events: none;
}
html[data-template] .cd-search,
html[data-template] .cl-search,
html[data-template] .cp-search,
html[data-template] .cv-search {
  border-radius: 999px;
  box-shadow: 0 6px 18px rgba(110, 25, 0, .22);
  transition: box-shadow .2s ease, transform .2s ease;
}
html[data-template] .cd-search:focus-within,
html[data-template] .cl-search:focus-within,
html[data-template] .cp-search:focus-within,
html[data-template] .cv-search:focus-within {
  box-shadow: 0 8px 24px rgba(110, 25, 0, .3), 0 0 0 3px rgba(255, 255, 255, .55);
  transform: translateY(-1px);
}

/* ---------- 首屏主视觉 ---------- */
html[data-template] .cd-hero,
html[data-template] .cl-hero,
html[data-template] .cp-hero,
html[data-template] .cv-hero,
html[data-template] .dj-hero {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  border: 1px solid rgba(255, 180, 150, .55);
  background: linear-gradient(118deg, #fff1e9 0%, #fff7ef 46%, #fffdf9 100%);
  box-shadow: var(--cps-sh-1);
}
html[data-template] .cd-hero::before,
html[data-template] .cl-hero::before,
html[data-template] .cp-hero::before,
html[data-template] .cv-hero::before,
html[data-template] .dj-hero::before {
  content: "";
  position: absolute;
  right: -70px;
  bottom: -110px;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 138, 31, .16), rgba(255, 138, 31, 0) 68%);
  pointer-events: none;
}
html[data-template] .cd-hero > *,
html[data-template] .cl-hero > *,
html[data-template] .cp-hero > *,
html[data-template] .cv-hero > *,
html[data-template] .dj-hero > * { position: relative; z-index: 1; }
html[data-template] .cd-hero-txt h1,
html[data-template] .cl-hero-txt h1,
html[data-template] .cp-hero-txt h1,
html[data-template] .cv-hero-txt h1,
html[data-template] .dj-hero-txt h1 {
  letter-spacing: -.6px;
  background: linear-gradient(100deg, #2b1d18 20%, #c23a18 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
html[data-template] .cd-hero-stats div,
html[data-template] .cp-hero-stats div,
html[data-template] .cv-hero-stats div {
  border-radius: 14px;
  border: 1px solid rgba(255, 190, 160, .6);
  box-shadow: var(--cps-sh-1);
  transition: transform .2s ease;
}
html[data-template] .cd-hero-stats div:hover,
html[data-template] .cp-hero-stats div:hover,
html[data-template] .cv-hero-stats div:hover { transform: translateY(-3px); }

/* ---------- 频道 + 排序筛选条 ---------- */
html[data-template] .cps-filter {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 16px 0 4px;
  padding: 10px 12px;
  border: 1px solid var(--cps-line);
  border-radius: 14px;
  background: var(--cps-card);
  box-shadow: var(--cps-sh-1);
}
html[data-template] .cps-filter-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1 1 320px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
html[data-template] .cps-filter-chips::-webkit-scrollbar { display: none; }
html[data-template] .cps-filter-chips a {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--cps-line);
  background: #fffaf7;
  color: var(--cps-ink-2);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  transition: color .16s ease, border-color .16s ease, background .16s ease, transform .16s ease;
}
html[data-template] .cps-filter-chips a:hover {
  color: var(--cps-brand);
  border-color: #ffc7b3;
  background: var(--cps-brand-soft);
  transform: translateY(-1px);
}
html[data-template] .cps-filter-chips a.is-on {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(115deg, var(--cps-brand), var(--cps-brand-2));
  box-shadow: 0 4px 12px rgba(255, 77, 46, .26);
}
html[data-template] .cps-filter-chips a i { font-size: 10px; font-style: normal; opacity: .78; }
html[data-template] .cps-filter-sorts {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex: 0 0 auto;
  padding: 3px;
  border-radius: 10px;
  background: #f6f2ef;
}
html[data-template] .cps-filter-sorts span {
  font-size: 11px;
  color: var(--cps-muted);
  padding: 0 7px 0 5px;
  white-space: nowrap;
}
html[data-template] .cps-filter-sorts a {
  padding: 6px 11px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--cps-ink-2);
  white-space: nowrap;
  transition: background .16s ease, color .16s ease;
}
html[data-template] .cps-filter-sorts a:hover { color: var(--cps-brand); }
html[data-template] .cps-filter-sorts a.is-on {
  background: #fff;
  color: var(--cps-brand);
  box-shadow: 0 2px 8px rgba(90, 40, 20, .1);
}

/* ---------- 今日主推（bento） ---------- */
html[data-template] .cps-feature {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0 4px;
}
html[data-template] .cps-feature > a {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: 186px;
  padding: 15px;
  border-radius: var(--cps-r);
  overflow: hidden;
  color: #fff;
  background: linear-gradient(125deg, #ff5a2c, #ff9a2e);
  box-shadow: var(--cps-sh-1);
  transition: transform .2s ease, box-shadow .2s ease;
}
html[data-template] .cps-feature > a:hover { transform: translateY(-4px); box-shadow: var(--cps-sh-2); }
html[data-template] .cps-feature > a:nth-child(2) { background: linear-gradient(125deg, #e8452f, #ff7a45); }
html[data-template] .cps-feature > a:nth-child(3) { background: linear-gradient(125deg, #f97316, #fbbf24); }
html[data-template] .cps-feature img {
  position: absolute;
  right: -14px;
  bottom: -14px;
  width: 46%;
  height: 116%;
  object-fit: cover;
  opacity: .38;
  transform: rotate(-7deg);
  transition: transform .35s ease, opacity .35s ease;
}
html[data-template] .cps-feature > a:hover img { transform: rotate(-3deg) scale(1.05); opacity: .48; }
html[data-template] .cps-feature-txt { position: relative; z-index: 1; max-width: 68%; }
html[data-template] .cps-feature-txt small {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .08em;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .22);
  border: 1px solid rgba(255, 255, 255, .35);
  margin-bottom: 8px;
}
html[data-template] .cps-feature-txt b {
  display: block;
  font-size: 14px;
  line-height: 1.5;
  font-weight: 700;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
html[data-template] .cps-feature-txt em {
  display: block;
  margin-top: 9px;
  font-style: normal;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.4px;
}
html[data-template] .cps-feature-txt em i { font-style: normal; font-size: 13px; margin-right: 2px; }

/* ---------- 券卡片：票券质感 ---------- */
html[data-template] .cd-grid,
html[data-template] .cl-grid,
html[data-template] .cp-grid,
html[data-template] .cv-grid,
html[data-template] .dj-grid { gap: 16px; }
html[data-template] .cd-card,
html[data-template] .cl-card,
html[data-template] .cp-card,
html[data-template] .cv-card,
html[data-template] .dj-card {
  border-radius: var(--cps-r);
  border: 1px solid var(--cps-line);
  box-shadow: var(--cps-sh-1);
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
html[data-template] .cd-card:hover,
html[data-template] .cl-card:hover,
html[data-template] .cp-card:hover,
html[data-template] .cv-card:hover,
html[data-template] .dj-card:hover {
  transform: translateY(-5px);
  border-color: #ffcbba;
  box-shadow: var(--cps-sh-2);
}
html[data-template] .cd-card-img,
html[data-template] .cl-card-img,
html[data-template] .cp-card-img,
html[data-template] .cv-card-img,
html[data-template] .dj-card-img { background: linear-gradient(140deg, #fdf3ee, #fffaf7); }
html[data-template] .cd-card-img img,
html[data-template] .cl-card-img img,
html[data-template] .cp-card-img img,
html[data-template] .cv-card-img img,
html[data-template] .dj-card-img img { transition: transform .4s ease; }
html[data-template] .cd-card:hover .cd-card-img img,
html[data-template] .cl-card:hover .cl-card-img img,
html[data-template] .cp-card:hover .cp-card-img img,
html[data-template] .cv-card:hover .cv-card-img img,
html[data-template] .dj-card:hover .dj-card-img img { transform: scale(1.06); }

/* 图片加载失败：隐藏图片、父容器显示占位，不再留一块淡图 */
html[data-template] .is-noimg {
  position: relative;
  background: linear-gradient(140deg, #fdf3ee, #fffaf7);
}
html[data-template] .is-noimg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 138, 31, .13) 0 26px, transparent 27px),
    linear-gradient(140deg, #fdf3ee, #fffaf7);
}
html[data-template] .is-noimg::before {
  content: "暂无图片";
  position: absolute;
  z-index: 1;
  left: 50%;
  top: 58%;
  transform: translateX(-50%);
  font-size: 11px;
  letter-spacing: .06em;
  color: #c2aca2;
  white-space: nowrap;
}
html[data-template] img.is-broken { display: none !important; }

/* 票券条：左右半圆缺口 + 虚线分隔 */
html[data-template] .cps-ticket {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  position: relative;
  margin: 2px 0 1px;
  padding: 7px 12px;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(100deg, #ff4d2e, #ff8a1f);
  box-shadow: 0 4px 12px rgba(255, 77, 46, .2);
  overflow: hidden;
}
html[data-template] .cps-ticket::before,
html[data-template] .cps-ticket::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--cps-card);
  transform: translateY(-50%);
}
html[data-template] .cps-ticket::before { left: -5px; }
html[data-template] .cps-ticket::after { right: -5px; }
html[data-template] .cps-ticket b { font-size: 14px; font-weight: 800; letter-spacing: -.2px; }
html[data-template] .cps-ticket b i { font-style: normal; font-size: 11px; margin-right: 1px; }
html[data-template] .cps-ticket small { font-size: 10.5px; font-weight: 600; opacity: .95; }
html[data-template] .cps-ticket.is-pdd { background: linear-gradient(100deg, #e02e24, #ff5e40); }
html[data-template] .cps-ticket.is-tbk { background: linear-gradient(100deg, #ff6a00, #ff9626); }
html[data-template] .cps-badges {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 1px;
}
html[data-template] .cps-badges span {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  color: var(--cps-ink-2);
  background: #f7f2ef;
  border: 1px solid var(--cps-line);
}
html[data-template] .cps-badges span.is-off { color: #fff; background: #c2410c; border-color: transparent; }
html[data-template] .cps-badges span.is-past { color: #fff; background: #94a3b8; border-color: transparent; }
html[data-template] .cps-badges span.is-discount { color: #b45309; background: #fff3d9; border-color: #ffe0a3; }

html[data-template] .cd-card-go,
html[data-template] .cl-card-go,
html[data-template] .cp-card-go,
html[data-template] .cv-card-go,
html[data-template] .dj-card-go {
  border-radius: 10px;
  letter-spacing: .02em;
  transition: filter .18s ease, transform .18s ease;
}
html[data-template] .cd-card:hover .cd-card-go,
html[data-template] .cl-card:hover .cl-card-go,
html[data-template] .cp-card:hover .cp-card-go,
html[data-template] .cv-card:hover .cv-card-go,
html[data-template] .dj-card:hover .dj-card-go { transform: translateY(-1px); }

/* ---------- 区块标题 ---------- */
html[data-template] .cd-sec-head,
html[data-template] .cl-sec-head,
html[data-template] .cp-sec-head,
html[data-template] .cv-sec-head {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--cps-line);
  margin-bottom: 16px;
}
html[data-template] .cd-sec-ico,
html[data-template] .cl-sec-ico,
html[data-template] .cp-sec-ico,
html[data-template] .cv-sec-ico { border-radius: 11px; box-shadow: var(--cps-sh-1); }

/* ---------- 热榜 / 分类 / 标签 ---------- */
html[data-template] .cd-rank a,
html[data-template] .cp-rank a,
html[data-template] .cv-rank a {
  border-radius: 12px;
  box-shadow: var(--cps-sh-1);
  transition: transform .18s ease, box-shadow .18s ease;
}
html[data-template] .cd-rank a:hover,
html[data-template] .cp-rank a:hover,
html[data-template] .cv-rank a:hover { transform: translateX(3px); box-shadow: var(--cps-sh-2); }
html[data-template] .cd-cats a,
html[data-template] .cp-cats a,
html[data-template] .cv-cats a,
html[data-template] .cd-chips a,
html[data-template] .cp-chips a,
html[data-template] .cv-chips a {
  border-radius: 999px;
  box-shadow: 0 1px 4px rgba(90, 40, 20, .04);
  transition: transform .18s ease, color .18s ease, border-color .18s ease;
}
html[data-template] .cd-cats a:hover,
html[data-template] .cp-cats a:hover,
html[data-template] .cv-cats a:hover,
html[data-template] .cd-chips a:hover,
html[data-template] .cp-chips a:hover,
html[data-template] .cv-chips a:hover { transform: translateY(-2px); }

/* ---------- 空态 / 提示 ---------- */
html[data-template] .cd-empty,
html[data-template] .cl-empty,
html[data-template] .cp-empty,
html[data-template] .cv-empty {
  border-radius: var(--cps-r);
  border: 1px dashed #f3d8cc;
  background: linear-gradient(140deg, #fffaf7, #fff);
}
html[data-template] .cd-demo,
html[data-template] .cp-demo { border-radius: 12px; }

/* ---------- 全站内链 ---------- */
html[data-template] .cd-links,
html[data-template] .cp-links,
html[data-template] .cv-links {
  border-radius: var(--cps-r);
  box-shadow: var(--cps-sh-1);
}
html[data-template] .cd-links-grid a,
html[data-template] .cp-links-grid a,
html[data-template] .cv-links-grid a { transition: color .16s ease, transform .16s ease; }
html[data-template] .cd-links-grid a:hover,
html[data-template] .cp-links-grid a:hover,
html[data-template] .cv-links-grid a:hover { transform: translateX(2px); }

/* ---------- 分页 ---------- */
html[data-template] .cd-pager a,
html[data-template] .cp-pager a,
html[data-template] .cv-pager a { border-radius: 10px; box-shadow: var(--cps-sh-1); }

/* ---------- 返回顶部 ---------- */
html[data-template] .cps-top {
  position: fixed;
  right: 18px;
  bottom: calc(78px + env(safe-area-inset-bottom));
  z-index: 80;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--cps-line);
  border-radius: 50%;
  background: #fff;
  color: var(--cps-brand);
  font-size: 17px;
  box-shadow: 0 8px 22px rgba(90, 40, 20, .18);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity .22s ease, transform .22s ease, visibility .22s ease;
  -webkit-tap-highlight-color: transparent;
}
html[data-template] .cps-top.is-on { opacity: 1; visibility: visible; transform: translateY(0); }
html[data-template] .cps-top:hover { background: var(--cps-brand); color: #fff; }

/* ---------- 卡片入场 ---------- */
html[data-template] .cps-reveal { opacity: 0; transform: translateY(14px); }
html[data-template] .cps-reveal.is-in {
  opacity: 1;
  transform: translateY(0);
  transition: opacity .45s ease, transform .45s ease;
}

/* ---------- 吸底条层级与安全区 ---------- */
html[data-template] .cp-sticky,
html[data-template] .cp-tabbar { backdrop-filter: saturate(1.4) blur(8px); }
html[data-template] .cp-tabbar { z-index: 66; }
html[data-template] .cp-sticky { z-index: 72; }
html[data-template] .cp-sticky-cta { border-radius: 12px; }
html[data-template] .cd-wrap,
html[data-template] .cl-wrap,
html[data-template] .cp-wrap,
html[data-template] .cv-wrap { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }

/* ---------- 详情页购买卡 ---------- */
html[data-template] .cd-buy-card,
html[data-template] .cl-buy-card,
html[data-template] .cp-buy-card,
html[data-template] .cv-buy-card {
  border-radius: var(--cps-r);
  box-shadow: var(--cps-sh-1);
}
html[data-template] .cd-coupon,
html[data-template] .cl-coupon,
html[data-template] .cp-coupon,
html[data-template] .cv-coupon { border-radius: 12px; }
html[data-template] .cd-primary,
html[data-template] .cl-primary,
html[data-template] .cp-primary,
html[data-template] .cv-primary { border-radius: 12px; }

/* ---------- 响应式 ---------- */
@media (max-width: 991.98px) {
  html[data-template] .cps-feature { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  html[data-template] .cps-feature > a:last-child { display: none; }
  html[data-template] .cps-filter-sorts { width: 100%; overflow-x: auto; scrollbar-width: none; }
}
@media (max-width: 767.98px) {
  html[data-template] .cd-head,
  html[data-template] .cl-head,
  html[data-template] .cp-head,
  html[data-template] .cv-head,
  html[data-template] .dj-head { margin-left: -12px; margin-right: -12px; }
  html[data-template] .cps-filter { padding: 9px 10px; border-radius: 12px; }
  html[data-template] .cps-filter-chips { flex-basis: 100%; }
  html[data-template] .cps-feature { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  html[data-template] .cps-feature > a { min-height: 150px; padding: 12px; }
  html[data-template] .cps-feature-txt em { font-size: 19px; }
  html[data-template] .cps-top { right: 12px; width: 38px; height: 38px; }
  html[data-template] .cps-ticket { padding: 6px 10px; }
  html[data-template] .cps-ticket b { font-size: 13px; }
}
@media (max-width: 479.98px) {
  html[data-template] .cps-feature { grid-template-columns: 1fr; }
  html[data-template] .cps-feature > a { min-height: 128px; }
  html[data-template] .cps-feature > a:nth-child(2) { display: none; }
  html[data-template] .cps-filter-sorts span { display: none; }
  html[data-template] .cps-filter-sorts a { flex: 1 1 0; text-align: center; padding: 6px 4px; }
}

@media (prefers-reduced-motion: reduce) {
  html[data-template] .cps-reveal,
  html[data-template] .cps-reveal.is-in { opacity: 1; transform: none; transition: none; }
  html[data-template] .cd-card,
  html[data-template] .cl-card,
  html[data-template] .cp-card,
  html[data-template] .cv-card,
  html[data-template] .cps-feature > a { transition: none; }
}
@media print {
  html[data-template] .cps-top,
  html[data-template] .cps-filter,
  html[data-template] .cps-feature,
  html[data-template] .cp-tabbar,
  html[data-template] .cp-sticky { display: none !important; }
  html[data-template] .cps-reveal { opacity: 1 !important; transform: none !important; }
}
