/* ============================================
   INDUSTRA - common.css (公共样式)
   所有页面共享：基础变量、头部、导航、底部、按钮、表单、悬浮栏、滚动动画
   ============================================ */

/* ---------- 基础变量 ---------- */
:root {
  --color-primary: #f7270b;
  --color-primary-dark: #c41e08;
  --color-primary-light: #f94d35;
  --color-accent: #f7270b;
  --color-accent-dark: #c41e08;
  --color-accent-light: #f94d35;
  --color-ink: #0F172A;
  --color-ink-soft: #1E293B;
  --color-ink-muted: #64748B;
  --color-muted: #F1F5F9;
  --color-line: #E2E8F0;
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out-circ: cubic-bezier(0.85, 0, 0.15, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

html { -webkit-text-size-adjust: 100%; }
body { overflow-x: hidden; }

/* 尊重减弱动画偏好 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- 跳转链接（无障碍） ---------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 1000;
  padding: 0.75rem 1.25rem;
  background: var(--color-primary);
  color: #fff;
  border-radius: 0 0 0.5rem 0;
  font-size: 0.875rem;
}
.skip-link:focus { left: 0; }

/* ---------- 页面顶部留白（补偿固定头部） ---------- */
.page-offset { padding-top: 5rem; } /* 80px，与 lg:h-20 一致 */
@media (min-width: 1024px) { .page-offset { padding-top: 5rem; } }

/* ---------- WordPress 管理栏兼容 ---------- */
/* 管理员登录后顶部固定元素需下移，避免被 #wpadminbar 遮挡 */
body.admin-bar #site-header {
  top: 32px;
}
body.admin-bar .skip-link {
  top: 32px;
}
body.admin-bar .scroll-progress-bar {
  top: 32px !important;
}
@media (max-width: 782px) {
  body.admin-bar #site-header {
    top: 46px;
  }
  /* 手机端 #wpadminbar 非吸顶（随页面滚动），滚动后让头部贴回顶部，避免顶部留空 */
  body.admin-bar #site-header.scrolled {
    top: 0;
  }
  body.admin-bar .skip-link {
    top: 46px;
  }
  body.admin-bar .scroll-progress-bar {
    top: 46px !important;
  }
}

/* ============================================
   头部 / 导航
   ============================================ */
#site-header.scrolled .bg-white\/95 {
  box-shadow: 0 4px 24px -8px rgba(15, 23, 42, 0.12);
}

/* 导航链接 - 带底部下划线动画 */
.nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 0.625rem 1rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-ink-soft);
  border-radius: 0.5rem;
  transition: color 0.25s var(--ease-out-expo), background-color 0.25s;
  cursor: pointer;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0.25rem;
  left: 50%;
  width: calc(100% - 2rem);
  height: 2px;
  background: var(--color-primary);
  border-radius: 2px;
  transform: translateX(-50%) scaleX(0);
  transform-origin: center;
  transition: transform 0.3s var(--ease-out-expo);
}
.nav-link:hover {
  color: var(--color-primary);
  background-color: var(--color-muted);
}
.nav-link:hover::after { transform: translateX(-50%) scaleX(1); }
.nav-link.active {
  color: var(--color-primary);
}
.nav-link.active::after { transform: translateX(-50%) scaleX(1); }
.nav-link:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* 深色导航栏样式覆盖 */
.header-dark .nav-link {
  color: #ffffff;
}
.header-dark .nav-link:hover {
  color: var(--color-primary);
  background-color: rgba(255, 255, 255, 0.08);
}
.header-dark .nav-link.active {
  color: var(--color-primary);
}

/* 二级下拉菜单 */
.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 280px;
  padding: 0.5rem;
  margin-top: 0.5rem;
  background: #fff;
  border: 1px solid var(--color-line);
  border-radius: 0.75rem;
  box-shadow: 0 16px 40px -8px rgba(15, 23, 42, 0.18);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.25s var(--ease-out-expo), transform 0.25s var(--ease-out-expo), visibility 0.25s;
  z-index: 50;
}
.group:hover > .dropdown-menu,
.group:focus-within > .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* 下拉菜单项 - 带左侧指示条动画 */
.dropdown-item {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  padding: 0.625rem 0.875rem 0.625rem 1rem;
  border-radius: 0.5rem;
  overflow: hidden;
  transition: background-color 0.2s, transform 0.2s var(--ease-out-expo);
}
.dropdown-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 3px;
  height: 0;
  background: var(--color-primary);
  border-radius: 0 3px 3px 0;
  transform: translateY(-50%);
  transition: height 0.25s var(--ease-out-expo);
}
.dropdown-item:hover {
  background-color: #f8fbfe;
  transform: translateX(4px);
}
.dropdown-item:hover::before { height: 60%; }

/* 移动端菜单图标切换 */
#mobile-toggle[aria-expanded="true"] .icon-open { display: none; }
#mobile-toggle[aria-expanded="true"] .icon-close { display: block; }

/* ============================================
   区块标题（通用）
   ============================================ */
.section-eyebrow {
  display: inline-block;
  padding: 0.375rem 0.875rem;
  margin-bottom: 1rem;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-primary);
  background: #fef1f0;
  border-radius: 999px;
}
.section-title {
  font-family: 'Lexend', 'Noto Sans SC', sans-serif;
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--color-ink);
  margin-bottom: 1rem;
}
.section-desc {
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--color-ink-muted);
}

/* ============================================
   按钮（通用）
   ============================================ */

/* 主按钮 - 带光泽扫过动画 */
.btn-primary {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1.75rem;
  background: var(--color-primary);
  color: #fff;
  font-weight: 500;
  border-radius: 999px;
  box-shadow: 0 8px 20px -8px rgba(10, 77, 140, 0.6);
  overflow: hidden;
  transition: transform 0.25s var(--ease-out-expo), background-color 0.25s, box-shadow 0.25s;
  cursor: pointer;
}
.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,0.25), transparent);
  transition: left 0.6s var(--ease-out-expo);
}
.btn-primary:hover {
  background: var(--color-primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 14px 30px -8px rgba(10, 77, 140, 0.7);
}
.btn-primary:hover::before { left: 100%; }
.btn-primary:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

/* 幽灵按钮 - 带箭头滑动 */
.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1.75rem;
  color: #fff;
  font-weight: 500;
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  border-radius: 999px;
  backdrop-filter: blur(8px);
  background: rgba(255, 255, 255, 0.05);
  transition: background-color 0.25s, border-color 0.25s, transform 0.25s var(--ease-out-expo), gap 0.25s var(--ease-out-expo);
  cursor: pointer;
}
.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.9);
  transform: translateY(-2px);
  gap: 0.75rem;
}

/* 次要按钮（浅色背景上使用） */
.btn-secondary {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: #fff;
  color: var(--color-primary);
  font-weight: 500;
  border: 1px solid var(--color-line);
  border-radius: 999px;
  box-shadow: 0 4px 12px -4px rgba(15, 23, 42, 0.08);
  overflow: hidden;
  transition: transform 0.25s var(--ease-out-expo), box-shadow 0.25s, border-color 0.25s, gap 0.25s;
  cursor: pointer;
}
.btn-secondary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(120deg, transparent, rgba(10,77,140,0.08), transparent);
  transition: left 0.5s var(--ease-out-expo);
}
.btn-secondary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px -6px rgba(15, 23, 42, 0.14);
  border-color: #cfe0f0;
  gap: 0.75rem;
}
.btn-secondary:hover::before { left: 100%; }

/* 文字链接（带箭头滑动） */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-primary);
  transition: color 0.2s, gap 0.25s var(--ease-out-expo);
  cursor: pointer;
}
.link-arrow:hover {
  color: var(--color-primary-dark);
  gap: 0.625rem;
}

/* ============================================
   表单（通用）
   ============================================ */
.form-label {
  display: block;
  margin-bottom: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
}
.form-label-light {
  color: var(--color-ink-soft);
}
.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.9375rem;
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 0.625rem;
  transition: border-color 0.2s, background-color 0.2s, box-shadow 0.2s;
}
.form-input::placeholder { color: rgba(255, 255, 255, 0.4); }
.form-input:focus {
  outline: none;
  border-color: var(--color-accent);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.25);
}

/* 浅色背景表单 */
.form-input-light {
  color: var(--color-ink);
  background: #fff;
  border: 1px solid var(--color-line);
}
.form-input-light::placeholder { color: #94a3b8; }
.form-input-light:focus {
  border-color: var(--color-primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(10, 77, 140, 0.12);
}
.form-input-light.invalid {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}

.form-error {
  display: none;
  margin-top: 0.375rem;
  font-size: 0.8125rem;
  color: #f87171;
}
.form-error.show { display: block; }

/* ============================================
   底部
   ============================================ */
.footer-title {
  font-family: 'Lexend', 'Noto Sans SC', sans-serif;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 1rem;
}

/* 底部链接 - 带箭头滑入 */
.footer-link {
  position: relative;
  display: inline-block;
  padding-left: 0;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.6);
  overflow: hidden;
  transition: color 0.2s, padding-left 0.25s var(--ease-out-expo);
}
.footer-link::before {
  content: '→';
  position: absolute;
  left: -1rem;
  top: 0;
  opacity: 0;
  transition: opacity 0.25s, left 0.25s var(--ease-out-expo);
}
.footer-link:hover {
  color: #fff;
  padding-left: 1rem;
}
.footer-link:hover::before {
  opacity: 1;
  left: 0;
}

/* ============================================
   悬浮按钮栏
   ============================================ */
.floating-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  color: #fff;
  background: var(--color-ink-soft);
  border-radius: 999px;
  box-shadow: 0 8px 20px -8px rgba(15, 23, 42, 0.4);
  transition: transform 0.25s var(--ease-spring), background-color 0.25s, box-shadow 0.25s;
  cursor: pointer;
}
.floating-btn:hover {
  transform: scale(1.12) rotate(-3deg);
  background: var(--color-ink);
  box-shadow: 0 12px 28px -8px rgba(15, 23, 42, 0.5);
}
#back-to-top {
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.3s, transform 0.3s var(--ease-out-expo), background-color 0.2s;
}
#back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* ============================================
   滚动渐显（通用）
   ============================================ */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s var(--ease-out-expo), transform 0.7s var(--ease-out-expo);
  will-change: opacity, transform;
}
.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* 网格子项交错动画 */
.reveal.is-stagger > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s var(--ease-out-expo), transform 0.6s var(--ease-out-expo);
}
.reveal.is-stagger.revealed > * {
  opacity: 1;
  transform: translateY(0);
}
.reveal.is-stagger.revealed > *:nth-child(1) { transition-delay: 0.05s; }
.reveal.is-stagger.revealed > *:nth-child(2) { transition-delay: 0.12s; }
.reveal.is-stagger.revealed > *:nth-child(3) { transition-delay: 0.19s; }
.reveal.is-stagger.revealed > *:nth-child(4) { transition-delay: 0.26s; }
.reveal.is-stagger.revealed > *:nth-child(5) { transition-delay: 0.33s; }
.reveal.is-stagger.revealed > *:nth-child(6) { transition-delay: 0.4s; }
.reveal.is-stagger.revealed > *:nth-child(7) { transition-delay: 0.47s; }
.reveal.is-stagger.revealed > *:nth-child(8) { transition-delay: 0.54s; }

/* ============================================
   图片懒加载（通用）
   ============================================ */
img.lazy-img,
img[loading="lazy"] {
  background: linear-gradient(110deg, #f1f5f9 8%, #e2e8f0 18%, #f1f5f9 33%);
  background-size: 200% 100%;
  animation: shimmer 1.5s linear infinite;
}
img.lazy-img.loaded,
img[loading="lazy"].loaded {
  animation: none;
  background: none;
}
@keyframes shimmer {
  to { background-position-x: -200%; }
}

/* ============================================
   数字计数动画
   ============================================ */
.stat-number {
  display: inline-block;
}

/* ============================================
   卡片悬浮效果
   ============================================ */
.card-hover {
  transition: transform 0.35s var(--ease-out-expo), box-shadow 0.35s, border-color 0.35s, background-color 0.35s;
}
.card-hover:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px -12px rgba(15, 23, 42, 0.15);
  border-color: rgba(247, 39, 11, 0.2);
  background-color: rgba(241, 245, 249, 0.8);
}
.card-hover:hover .card-icon {
  transform: scale(1.1) rotate(-5deg);
}
.card-hover:hover .card-title {
  color: var(--color-primary);
}
.card-icon {
  transition: transform 0.35s var(--ease-spring), background-color 0.35s;
}
.card-title {
  transition: color 0.25s;
}

/* ============================================
   富文本内容（the_content 排版）
   用于 page.php 等通过前端编辑器输出的正文
   ============================================ */
.rich-content {
  color: var(--color-ink);
  font-size: 1rem;
  line-height: 1.85;
  word-wrap: break-word;
}
.rich-content > * + * {
  margin-top: 1.25em;
}
.rich-content h1,
.rich-content h2,
.rich-content h3,
.rich-content h4,
.rich-content h5,
.rich-content h6 {
  color: var(--color-ink);
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.01em;
}
.rich-content h1 { font-size: 2rem; margin-top: 1.5em; }
.rich-content h2 {
  font-size: 1.6rem;
  margin-top: 1.5em;
  padding-bottom: 0.5em;
  border-bottom: 1px solid var(--color-line);
}
.rich-content h3 { font-size: 1.3rem; }
.rich-content h4 { font-size: 1.15rem; }
.rich-content h5 { font-size: 1.05rem; }
.rich-content h6 { font-size: 1rem; }
.rich-content p { color: var(--color-ink-muted); }
.rich-content a {
  color: var(--color-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.25s;
}
.rich-content a:hover { color: var(--color-primary-dark); }
.rich-content ul,
.rich-content ol {
  padding-left: 1.4em;
  color: var(--color-ink-muted);
}
.rich-content ul { list-style: disc; }
.rich-content ol { list-style: decimal; }
.rich-content li { margin-top: 0.5em; }
.rich-content li::marker { color: var(--color-primary); font-weight: 600; }
.rich-content blockquote {
  margin: 1.5em 0;
  padding: 1em 1.5em;
  border-left: 4px solid var(--color-primary);
  border-radius: 0.5rem;
  background: var(--color-muted);
  color: var(--color-ink-soft);
  font-style: italic;
}
.rich-content blockquote p { margin: 0; }
.rich-content img {
  border-radius: 0.75rem;
  box-shadow: 0 10px 30px -12px rgba(15, 23, 42, 0.2);
}
.rich-content figure {
  margin: 1.5em 0;
}
.rich-content figcaption {
  margin-top: 0.6em;
  text-align: center;
  font-size: 0.875rem;
  color: var(--color-ink-muted);
}
.rich-content hr {
  margin: 2em auto;
  width: 4rem;
  border: 0;
  border-top: 3px solid var(--color-primary);
  opacity: 0.75;
}
.rich-content code {
  padding: 0.15em 0.4em;
  border-radius: 0.35rem;
  background: var(--color-muted);
  color: var(--color-primary-dark);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88em;
}
.rich-content pre {
  padding: 1.25em 1.5em;
  border-radius: 0.75rem;
  background: var(--color-ink-soft);
  color: #f8fafc;
  overflow-x: auto;
  line-height: 1.6;
}
.rich-content pre code {
  padding: 0;
  background: transparent;
  color: inherit;
}
.rich-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.rich-content th,
.rich-content td {
  padding: 0.75em 1em;
  border: 1px solid var(--color-line);
  text-align: left;
}
.rich-content th {
  background: var(--color-muted);
  color: var(--color-ink);
  font-weight: 600;
}
.rich-content tr:nth-child(even) td {
  background: rgba(241, 245, 249, 0.6);
}

/* ============================================
   工具类
   ============================================ */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }
