/*
Theme Name: TICHN 田村科技
Theme URI: https://www.moonrover.com.cn/
Author: WorkBuddy
Description: 浙江田村科技有限公司官网主题，工业蓝风格，专注工业变频器与永磁伺服驱动。
Version: 1.0.0
Text Domain: tiancun
Tags: business, industrial, responsive
*/

/* ============================================
   浙江田村科技有限公司 官网 · 全局样式
   品牌：TICHN 田村電氣
   ============================================ */

:root {
  --primary: #0a4d8c;
  --primary-dark: #073a6a;
  --primary-light: #e8f1fa;
  --accent: #e8590c;
  --text: #1f2937;
  --text-muted: #6b7280;
  --bg: #ffffff;
  --bg-gray: #f5f7fa;
  --border: #e5e7eb;
  --radius: 8px;
  --shadow: 0 4px 20px rgba(10, 77, 140, 0.08);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, "Segoe UI", "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  font-size: 15px;
}

a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
img { max-width: 100%; height: auto; display: block; }

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ============ 顶部导航 ============ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.site-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 20px;
  color: var(--primary);
}
.site-brand .logo-mark {
  width: 36px;
  height: 36px;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 700;
}
.site-brand .logo-sub { font-size: 12px; color: var(--text-muted); font-weight: 400; }

.main-nav { display: flex; gap: 4px; }
.main-nav a {
  padding: 8px 16px;
  font-size: 15px;
  color: var(--text);
  border-radius: var(--radius);
  transition: all .2s;
}
.main-nav a:hover,
.main-nav a.current-menu-item { color: var(--primary); background: var(--primary-light); }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 24px;
  color: var(--primary);
  cursor: pointer;
}

/* ============ Hero 首屏 ============ */
.hero {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 55%, #1166b0 100%);
  color: #fff;
  padding: 96px 0 88px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
/* Hero 背景图叠加 */
.hero-bg {
  position: absolute;
  inset: 0;
  background-image: url('../images/hero-bg.svg');
  background-size: cover;
  background-position: center;
  opacity: 0.9;
  pointer-events: none;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(255,255,255,0.08), transparent 50%),
              radial-gradient(circle at 80% 80%, rgba(255,255,255,0.06), transparent 50%);
}
.hero .container { position: relative; z-index: 1; }
.hero h1 {
  font-size: 42px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 18px;
  letter-spacing: 1px;
}
.hero p {
  font-size: 18px;
  color: rgba(255,255,255,0.9);
  max-width: 680px;
  margin: 0 auto 32px;
}
.hero-btns { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.btn {
  display: inline-block;
  padding: 13px 32px;
  border-radius: 40px;
  font-size: 16px;
  font-weight: 500;
  transition: all .25s;
  cursor: pointer;
  border: none;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #d04e0a; transform: translateY(-2px); box-shadow: 0 8px 20px rgba(232,89,12,.35); }
.btn-outline { background: transparent; color: #fff; border: 1.5px solid rgba(255,255,255,.6); }
.btn-outline:hover { background: rgba(255,255,255,.12); border-color: #fff; }

/* ============ 通用 section ============ */
.section { padding: 72px 0; }
.section-gray { background: var(--bg-gray); }
.section-head { text-align: center; margin-bottom: 48px; }
.section-head h2 {
  font-size: 30px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
}
.section-head .sub { color: var(--text-muted); font-size: 16px; }
.section-head .bar {
  width: 44px;
  height: 4px;
  background: var(--accent);
  margin: 16px auto 0;
  border-radius: 2px;
}

/* ============ 卡片网格 ============ */
.card-grid { display: grid; gap: 24px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

.product-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px 24px;
  transition: all .25s;
  display: block;
}
.product-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow);
  border-color: var(--primary);
}
.product-icon {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 16px;
}
.product-img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 16px;
  background: #eef3f8;
}
.product-card h3 { font-size: 18px; margin-bottom: 8px; color: var(--text); }
.product-card p { font-size: 14px; color: var(--text-muted); }

/* ============ 卖点 ============ */
.feature-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px;
  transition: all .2s;
}
.feature-item:hover { box-shadow: var(--shadow); }
.feature-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
}
.feature-item h3 { font-size: 16px; margin-bottom: 6px; }
.feature-item p { font-size: 14px; color: var(--text-muted); }

/* ============ 应用行业标签 ============ */
.industry-tags { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.industry-tag {
  padding: 10px 22px;
  border: 1px solid var(--border);
  border-radius: 40px;
  font-size: 15px;
  color: var(--text);
  transition: all .2s;
}
.industry-tag:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ============ 关于公司横条 ============ */
.about-strip {
  display: flex;
  align-items: center;
  gap: 48px;
  background: var(--primary-dark);
  color: #fff;
  border-radius: 16px;
  padding: 48px;
}
.about-strip .left { flex: 1.4; }
.about-strip .right { flex: 1; }
.about-strip h2 { font-size: 28px; margin-bottom: 16px; }
.about-strip p { color: rgba(255,255,255,.85); font-size: 15px; margin-bottom: 24px; }
.stats { display: flex; gap: 32px; }
.stat .num { font-size: 34px; font-weight: 700; color: #fff; }
.stat .label { font-size: 13px; color: rgba(255,255,255,.75); }

/* 关于公司 - 厂房背景图版本 */
.about-strip-bg {
  position: relative;
  background-image: url('assets/images/factory.jpg');
  background-size: cover;
  background-position: center;
  isolation: isolate;
}
.about-strip-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(7,25,45,0.45) 0%, rgba(10,45,80,0.3) 55%, rgba(16,70,120,0.15) 100%);
  z-index: -1;
  border-radius: 16px;
}
.about-strip-bg .left,
.about-strip-bg .right { position: relative; z-index: 1; }

/* ============ 页脚 ============ */
.site-footer {
  background: #0d2233;
  color: rgba(255,255,255,.75);
  padding: 48px 0 24px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.4fr;
  gap: 40px;
  margin-bottom: 32px;
}
.site-footer h4 { color: #fff; font-size: 16px; margin-bottom: 16px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer ul li { margin: 0; padding: 0; }
.site-footer a { color: rgba(255,255,255,.75); font-size: 14px; display: block; margin-bottom: 10px; transition: color .2s; }
.site-footer a:hover { color: #fff; }
.footer-brand .site-brand { color: #fff; margin-bottom: 12px; }
.footer-brand p { font-size: 13px; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.12);
  padding-top: 20px;
  text-align: center;
  font-size: 13px;
  color: rgba(255,255,255,.5);
}

/* ============ 页面横幅 ============ */
.page-banner {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: #fff;
  padding: 56px 0;
  text-align: center;
}
.page-banner h1 { font-size: 34px; font-weight: 700; margin-bottom: 8px; }
.page-banner p { color: rgba(255,255,255,.85); font-size: 16px; }

/* ============ 内容页 ============ */
.page-content { padding: 56px 0; }
.page-content .entry-content { max-width: 860px; margin: 0 auto; }
.page-content .entry-content h2 { font-size: 24px; margin: 32px 0 16px; color: var(--text); }
.page-content .entry-content h3 { font-size: 19px; margin: 24px 0 12px; }
.page-content .entry-content p { margin-bottom: 16px; color: var(--text); }
.page-content .entry-content ul { list-style: disc; padding-left: 24px; margin-bottom: 16px; }
.page-content .entry-content ul li { margin-bottom: 8px; }
.page-content .entry-content img { border-radius: 8px; margin: 16px 0; }

/* ============ 产品详情页 ============ */
.product-detail {
  display: flex;
  gap: 48px;
  align-items: flex-start;
}
.product-detail-media {
  flex: 0 0 40%;
  max-width: 40%;
}
.product-detail-media img {
  width: 100%;
  border-radius: 12px;
  background: var(--bg-gray);
  padding: 24px;
  box-shadow: var(--shadow);
}
.product-detail-body {
  flex: 1;
  min-width: 0;
}
.product-model {
  text-align: center;
  margin-top: 12px;
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 500;
}
.product-detail .entry-content {
  max-width: none;
  margin: 0;
}
.entry-content .lead {
  font-size: 18px;
  line-height: 1.6;
  color: var(--text);
  border-left: 3px solid var(--primary);
  padding-left: 16px;
  margin-bottom: 24px;
  font-weight: 500;
}
.entry-content ul li { color: var(--text); }
.product-cta {
  margin-top: 32px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.product-cta .btn-outline {
  color: var(--primary);
  border-color: var(--primary);
}
.product-cta .btn-outline:hover {
  background: var(--primary);
  color: #fff;
}

/* ============ 关于我们页厂房背景 ============ */
.page-content.page-id-8 {
  position: relative;
  background-image: url('assets/images/factory.jpg');
  background-size: cover;
  background-position: center;
}
.page-content.page-id-8::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.78) 0%, rgba(255,255,255,0.6) 50%, rgba(255,255,255,0.4) 100%);
  z-index: 0;
}
.page-content.page-id-8 .container {
  position: relative;
  z-index: 1;
}

/* ============ 厂区展示图 ============ */
.entry-content img.factory-full {
  width: 100%;
  max-width: 100%;
  border-radius: 12px;
  box-shadow: var(--shadow);
  margin: 16px 0 24px;
}

/* ============ 下载/表格 ============ */
.download-table { width: 100%; border-collapse: collapse; }
.download-table th, .download-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.download-table th { background: var(--bg-gray); font-weight: 600; color: var(--text); }
.download-table a { color: var(--primary); }

/* ============ 联系我们布局 ============ */
.contact-layout {
  display: flex;
  gap: 48px;
  align-items: flex-start;
}
.contact-info { flex: 1; }
.contact-info h2 { font-size: 24px; margin-bottom: 24px; }
.contact-item {
  display: flex;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.contact-label {
  flex: 0 0 64px;
  font-weight: 600;
  color: var(--primary);
}
.contact-value { color: var(--text); }
.contact-form-wrap { flex: 1.4; }
.contact-form-wrap h2 { font-size: 24px; margin-bottom: 8px; }
.form-tip { color: var(--text-muted); font-size: 14px; margin-bottom: 20px; }
.form-success {
  background: #e8f5e9;
  color: #2e7d32;
  padding: 14px 18px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 15px;
}
.form-row { display: flex; gap: 16px; }
.form-row input { flex: 1; }

/* ============ 表单 ============ */
.contact-form input, .contact-form textarea, .contact-form select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 15px;
  font-family: inherit;
  margin-bottom: 16px;
  background: #fff;
  box-sizing: border-box;
}
.contact-form input:focus, .contact-form textarea:focus, .contact-form select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(10,77,140,.1);
}
.contact-form textarea { min-height: 140px; resize: vertical; }
.btn-block { width: 100%; }

/* ============ 响应式 ============ */
@media (max-width: 992px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .about-strip { flex-direction: column; padding: 32px; }
  .hero h1 { font-size: 32px; }
  .contact-layout { flex-direction: column; }
  .product-detail { flex-direction: column; }
  .product-detail-media { max-width: 100%; flex: none; }
}
@media (max-width: 640px) {
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .main-nav { display: none; position: absolute; top: 68px; left: 0; right: 0; background: #fff; flex-direction: column; padding: 12px 0; border-bottom: 1px solid var(--border); }
  .main-nav.open { display: flex; }
  .nav-toggle { display: block; }
  .hero { padding: 64px 0; }
  .hero h1 { font-size: 26px; }
  .stats { flex-wrap: wrap; }
}

/* ============================================
   高级感动画系统（入场动画 + 滚动触发）
   ============================================ */

/* 基础 reveal 状态：初始隐藏，触发后播放 */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity .8s cubic-bezier(.22,.61,.36,1), transform .8s cubic-bezier(.22,.61,.36,1);
  will-change: opacity, transform;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* 不同方向/形式的变体 */
.reveal-left   { transform: translateX(-50px); }
.reveal-right  { transform: translateX(50px); }
.reveal-left.is-visible,
.reveal-right.is-visible { transform: translateX(0); }

.reveal-scale  { transform: scale(.85); }
.reveal-scale.is-visible { transform: scale(1); }

.reveal-blur   { filter: blur(8px); transition: opacity .8s cubic-bezier(.22,.61,.36,1), transform .8s cubic-bezier(.22,.61,.36,1), filter .8s; }
.reveal-blur.is-visible { filter: blur(0); }

/* 交错延迟（配合 JS 给每个元素设置 transition-delay 或手动类） */
.delay-1 { transition-delay: .1s; }
.delay-2 { transition-delay: .2s; }
.delay-3 { transition-delay: .3s; }
.delay-4 { transition-delay: .4s; }
.delay-5 { transition-delay: .5s; }
.delay-6 { transition-delay: .6s; }

/* ============ 首屏 Hero 动画 ============ */
@keyframes heroIn {
  from { opacity: 0; transform: translateY(50px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes heroInUp {
  from { opacity: 0; transform: translateY(70px) scale(.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes heroFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes btnPop {
  0%   { opacity: 0; transform: scale(.6) translateY(20px); }
  60%  { opacity: 1; transform: scale(1.06) translateY(0); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}
.hero-anim { animation: heroInUp .9s cubic-bezier(.22,.61,.36,1) both; }
.hero-anim-delay-1 { animation: heroInUp .9s .15s cubic-bezier(.22,.61,.36,1) both; }
.hero-anim-delay-2 { animation: heroInUp .9s .3s cubic-bezier(.22,.61,.36,1) both; }
.hero-anim-btn { animation: btnPop .7s .55s cubic-bezier(.34,1.56,.64,1) both; }

/* 首屏背景光晕呼吸 */
@keyframes heroGlow {
  0%, 100% { opacity: .55; transform: scale(1); }
  50%      { opacity: .85; transform: scale(1.06); }
}
.hero-bg-anim { animation: heroGlow 8s ease-in-out infinite; }

/* 首屏装饰光点浮动 */
@keyframes floatDot {
  0%, 100% { transform: translateY(0); opacity: .5; }
  50%      { transform: translateY(-18px); opacity: .9; }
}

/* ============ 区块标题下划线展开 ============ */
@keyframes barGrow {
  from { width: 0; }
  to   { width: 44px; }
}
.section-head .bar.anim {
  animation: barGrow .8s .2s cubic-bezier(.22,.61,.36,1) both;
}

/* ============ 产品卡片图片悬浮 ============ */
@keyframes imgFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}
.product-card:hover .product-img {
  animation: imgFloat 2.2s ease-in-out infinite;
}
.product-card {
  transition: transform .3s cubic-bezier(.22,.61,.36,1), box-shadow .3s, border-color .3s;
}
.product-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 16px 40px rgba(10, 77, 140, 0.18);
  border-color: var(--primary);
}

/* ============ 核心优势图标弹入 ============ */
@keyframes iconPop {
  0%   { transform: scale(0) rotate(-30deg); opacity: 0; }
  70%  { transform: scale(1.15) rotate(5deg); opacity: 1; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}
.feature-item.is-visible .feature-icon {
  animation: iconPop .6s cubic-bezier(.34,1.56,.64,1) both;
}

/* 核心优势卡片 hover 微交互 */
.feature-item {
  transition: transform .3s cubic-bezier(.22,.61,.36,1), box-shadow .3s;
}
.feature-item:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 32px rgba(10, 77, 140, 0.14);
}

/* ============ 数字统计（滚动计数后微弹） ============ */
@keyframes numPulse {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.15); }
  100% { transform: scale(1); }
}
.stat .num.counted { animation: numPulse .5s ease; }

/* ============ 行业标签交错淡入 ============ */
.industry-tag {
  transition: transform .25s cubic-bezier(.22,.61,.36,1), background .2s, color .2s, border-color .2s;
}
.industry-tag:hover {
  transform: translateY(-4px) scale(1.05);
}

/* ============ 导航栏滚动效果 ============ */
.site-header {
  transition: box-shadow .3s, background .3s;
}
.site-header.scrolled {
  box-shadow: 0 4px 20px rgba(10, 77, 140, 0.1);
}

/* ============ 逐字字幕动画（ani-text 手法） ============ */
.ani-text {
  display: inline-block;
}
.ani-text .c-text {
  display: inline-block;
  opacity: 0;
  transform: translateY(30px) rotateX(-40deg);
  transition: opacity .6s cubic-bezier(.22,.61,.36,1), transform .6s cubic-bezier(.22,.61,.36,1);
  will-change: opacity, transform;
}
.ani-text.is-view .c-text {
  opacity: 1;
  transform: translateY(0) rotateX(0);
}

/* ============ 图片视差移动 ============ */
.parallax-img {
  transition: transform .1s linear;
  will-change: transform;
}
.parallax-wrap {
  overflow: hidden;
  border-radius: 12px;
}

/* ============ 无障碍降级：尊重系统减少动画偏好 ============ */
@media (prefers-reduced-motion: reduce) {
  .ani-text .c-text {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .parallax-img { transform: none !important; }
  .reveal,
  .reveal-left,
  .reveal-right,
  .reveal-scale,
  .reveal-blur {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    transition: none !important;
  }
  .hero-anim,
  .hero-anim-delay-1,
  .hero-anim-delay-2,
  .hero-anim-btn,
  .hero-bg-anim,
  .section-head .bar.anim,
  .feature-item.is-visible .feature-icon,
  .stat .num.counted {
    animation: none !important;
  }
}
