:root {
  --jy-text-strong: #334155;
  --jy-text-main: #475569;
  --jy-text-body: #475569;
  --jy-text-muted: #475569;
  --jy-text-soft: #475569;
  --jy-brand: #003b82;
  --jy-brand-deep: #002b67;
  --jy-border: #dce3ec;
  --jy-card-shadow: 0 18px 42px rgba(15, 39, 75, 0.08);
  --jy-card-shadow-hover: 0 24px 54px rgba(15, 39, 75, 0.14);
}

body.detail-page {
  --text-main: var(--jy-text-main);
  --text-sub: var(--jy-text-body);
  --text-dark: var(--jy-text-strong);
  --text-muted: var(--jy-text-muted);
  --text-light: var(--jy-text-muted);
  --primary-color: var(--jy-brand);
  color: var(--jy-text-main);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", "Noto Sans SC",
    system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.7;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body.detail-page main {
  color: var(--jy-text-main);
}

body.detail-page main :where(h1, h2, h3, h4, h5, h6) {
  color: var(--jy-text-strong);
  font-weight: 700;
  letter-spacing: -0.02em;
}

body.detail-page main :where(p, li, td, th, label, figcaption) {
  color: var(--jy-text-body);
  font-weight: 400 !important;
}

body.detail-page main :where(small, .eyebrow, .meta, .date, .caption) {
  color: var(--jy-text-body);
  font-weight: 400 !important;
}

body.detail-page main :where(a:not([class]), button) {
  font-weight: 600;
}

/* 把各页面原有的灰阶统一到同一套可读性更高的颜色层级。 */
body.detail-page main .text-slate-900,
body.detail-page main .text-slate-800,
body.detail-page main .text-gray-900,
body.detail-page main .text-gray-800 {
  color: var(--jy-text-strong);
}

body.detail-page main .text-slate-700,
body.detail-page main .text-slate-600,
body.detail-page main .text-gray-700,
body.detail-page main .text-gray-600 {
  color: var(--jy-text-body);
  font-weight: 400 !important;
}

body.detail-page main .text-slate-500,
body.detail-page main .text-slate-400,
body.detail-page main .text-gray-500,
body.detail-page main .text-gray-400 {
  color: var(--jy-text-body);
  font-weight: 400 !important;
}

/* 案例中心原文件使用了一套更深的专属灰阶，这里强制回归共享色阶。 */
body.cases-page {
  --text-dark: var(--jy-text-strong);
  --text-muted: var(--jy-text-body);
  --text-light: var(--jy-text-muted);
}

body.cases-page main :where(h1, h2, h3, h4, h5, h6) {
  color: var(--jy-text-strong);
}

body.cases-page main :where(p, li, td, th, label, figcaption) {
  color: var(--jy-text-body);
  font-weight: 400 !important;
}

body.cases-page .case-center-hero p,
body.cases-page main .detail-panel-header .en-title,
body.cases-page main .tab-nav-info .case-no {
  color: var(--jy-text-body);
  font-weight: 400 !important;
}

body.cases-page .tab-nav-item.active .case-no,
body.cases-page .tab-nav-item.active .case-title {
  color: #FFFFFF !important;
}

/* 深色或品牌色区域保留反白层级，不被正文统一规则误伤。 */
body.detail-page main :where(
  .text-white,
  [class*="bg-brand-"],
  [class*="bg-slate-8"],
  [class*="bg-slate-9"],
  [class*="bg-blue-8"],
  [class*="bg-blue-9"]
) :where(h1, h2, h3, h4, h5, h6, p, li, span, small) {
  color: inherit;
}

/* 知识中心品牌蓝卡片必须使用反白文字。 */
body.knowledge-page main .hero-brand-card {
  color: #ffffff;
}

body.knowledge-page main .hero-brand-card .hero-title-new {
  color: #ffffff;
}

body.knowledge-page main .hero-brand-card .hero-subtitle-new {
  color: #dbeafe;
}

body.knowledge-page main .hero-brand-card .hero-badge-light,
body.knowledge-page main .hero-brand-card .hero-tag-item,
body.knowledge-page main .hero-brand-card .hero-tag-item span {
  color: #f8fafc;
}

.jy-stat-value {
  display: flex;
  min-height: 1.15em;
  align-items: baseline;
  gap: 0.12em;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.045em;
  line-height: 1;
}

.jy-stat-number {
  display: inline-block;
}

.jy-stat-unit {
  color: var(--jy-brand);
  font-size: 0.52em;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.jy-stat-unit-area {
  font-size: 0.42em;
}

body.detail-page main .jy-stat-note {
  margin: 14px 0 0;
  color: var(--jy-text-body);
  font-size: 12px;
  font-weight: 400 !important;
  line-height: 1.5;
}

.jy-reading-progress {
  position: fixed;
  z-index: 3000;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  pointer-events: none;
  transform: scaleX(0);
  transform-origin: left center;
  background: linear-gradient(90deg, #0069d9, #00a6a6);
  box-shadow: 0 1px 8px rgba(0, 105, 217, 0.24);
  will-change: transform;
}

.jy-reveal {
  opacity: 0;
  transform: translateY(22px);
  transition:
    opacity 680ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 680ms cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--jy-reveal-delay, 0ms);
}

.jy-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.jy-interactive-card {
  transition:
    transform 320ms cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 320ms ease,
    border-color 320ms ease;
  will-change: transform;
}

@media (hover: hover) and (pointer: fine) {
  .jy-interactive-card:hover {
    z-index: 1;
    transform: translateY(-5px);
    border-color: rgba(0, 79, 158, 0.22);
    box-shadow: var(--jy-card-shadow-hover);
  }
}

.jy-interactive-button {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition:
    transform 180ms ease,
    box-shadow 240ms ease,
    filter 240ms ease;
}

.jy-interactive-button::after {
  position: absolute;
  z-index: -1;
  top: -45%;
  left: -70%;
  width: 45%;
  height: 190%;
  content: "";
  transform: rotate(18deg);
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.26),
    transparent
  );
  transition: left 560ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .jy-interactive-button:hover {
    transform: translateY(-2px);
    filter: saturate(1.06);
    box-shadow: 0 12px 26px rgba(0, 59, 130, 0.2);
  }

  .jy-interactive-button:hover::after {
    left: 130%;
  }
}

.jy-interactive-button:active {
  transform: translateY(0) scale(0.985);
}

.jy-interactive-button:focus-visible {
  outline: 3px solid rgba(0, 105, 217, 0.3);
  outline-offset: 3px;
}

.jy-image-frame {
  overflow: hidden;
}

.jy-image-frame img {
  transition:
    transform 700ms cubic-bezier(0.22, 1, 0.36, 1),
    filter 500ms ease;
  will-change: transform;
}

@media (hover: hover) and (pointer: fine) {
  .jy-image-frame:hover img {
    transform: scale(1.035);
    filter: saturate(1.04) contrast(1.015);
  }
}

@media (max-width: 767px) {
  body.detail-page {
    font-size: 15px;
  }

  .jy-reveal {
    transform: translateY(14px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .jy-reading-progress,
  .jy-reveal,
  .jy-interactive-card,
  .jy-interactive-button,
  .jy-image-frame img {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }

  .jy-reveal {
    opacity: 1;
    transform: none;
  }

  .jy-interactive-card:hover,
  .jy-interactive-button:hover,
  .jy-image-frame:hover img {
    transform: none;
  }
}
