/* ==========================================================================
   UNIVER SEHOLDING — main.css
   高端 B2B 供应链企业官网 · 复刻 lifung.com 质感
   说明：本文件为自定义样式（配色变量 / 组件 / 动效），
   布局与排版主用 Tailwind CSS v3 工具类（见 index.html）。
   ========================================================================== */

/* ---------- 1. 设计令牌（Design Tokens） ---------- */
:root {
  --ink:        #0e0e0e;   /* 主黑 */
  --charcoal:   #1a1a1a;   /* 炭灰 */
  --charcoal-2: #2a2a2a;
  --slate:      #6d6d6d;   /* 正文灰 */
  --slate-light:#9a9a9a;
  --line:       #e7e5e0;   /* 分隔线 */
  --paper:      #f6f5f2;   /* 米白底 */
  --white:      #ffffff;

  --brand:      #cd202c;   /* 品牌红 */
  --brand-dark: #a91923;
  --gold:       #b8924a;   /* 柔和金 */
  --gold-soft:  #cbb278;

  --shadow-sm:  0 4px 20px rgba(14,14,14,.06);
  --shadow-md:  0 14px 38px rgba(14,14,14,.12);
  --shadow-lg:  0 28px 70px rgba(14,14,14,.18);

  --radius: 16px;
  --ease: cubic-bezier(.22,.61,.36,1);
}

/* ---------- 2. 基础 ---------- */
html { scroll-behavior: smooth; }

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body.no-scroll { overflow: hidden; }

::selection { background: var(--brand); color: #fff; }

/* 细滚动条（克制） */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--paper); }
::-webkit-scrollbar-thumb { background: #c9c6bf; border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--slate-light); }

/* ---------- 3. 排版辅助 ---------- */
.font-display { letter-spacing: -0.025em; }

/* 金色小眉标（eyebrow） */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .8rem;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--gold);
}
.eyebrow::before {
  content: "";
  width: 30px;
  height: 1px;
  background: var(--gold);
}
.eyebrow.eyebrow-light { color: var(--gold-soft); }
.eyebrow.eyebrow-light::before { background: var(--gold-soft); }
.eyebrow.eyebrow-red { color: var(--brand); }
.eyebrow.eyebrow-red::before { background: var(--brand); }

/* ---------- 4. 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  padding: .95rem 1.85rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: .9rem;
  letter-spacing: .01em;
  white-space: nowrap;
  transition: transform .3s var(--ease), background .3s var(--ease),
    color .3s var(--ease), box-shadow .3s var(--ease), border-color .3s var(--ease);
}
.btn svg { transition: transform .3s var(--ease); }
.btn:hover svg { transform: translateX(4px); }

.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); transform: translateY(-2px); box-shadow: var(--shadow-md); }

.btn-outline-dark { border: 1px solid var(--charcoal-2); color: var(--ink); }
.btn-outline-dark:hover { background: var(--ink); color: #fff; transform: translateY(-2px); }

.btn-outline-red { border: 1px solid var(--ink); background: #fff; color: var(--ink); }
.btn-outline-red:hover { background: var(--brand); border-color: var(--brand); color: #fff; transform: translateY(-2px); box-shadow: var(--shadow-md); }

.btn-outline-light { border: 1px solid rgba(255,255,255,.45); color: #fff; }
.btn-outline-light:hover { background: #fff; color: var(--ink); transform: translateY(-2px); }

.btn-gold { background: var(--gold); color: #fff; }
.btn-gold:hover { background: #9a7a3a; transform: translateY(-2px); box-shadow: var(--shadow-md); }

/* ---------- 5. 吸顶导航 ---------- */
.site-header {
  background: #fff;
  transition: background .45s var(--ease), box-shadow .45s var(--ease),
    border-color .45s var(--ease), padding .45s var(--ease);
  border-bottom: 1px solid transparent;
}
.site-header.scrolled {
  background: rgba(255,255,255,.9);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom-color: var(--line);
  box-shadow: 0 1px 0 rgba(14,14,14,.04), 0 12px 32px rgba(14,14,14,.06);
}

.nav-link {
  position: relative;
  font-size: .93rem;
  font-weight: 500;
  color: var(--charcoal);
  transition: color .25s var(--ease);
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 0; bottom: -6px;
  width: 100%; height: 1px;
  background: var(--brand);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .35s var(--ease);
}
.nav-link:hover { color: var(--brand); }
.nav-link:hover::after { transform: scaleX(1); }
.nav-link.is-active { color: var(--brand); }
.nav-link.is-active::after { transform: scaleX(1); }

/* ---------- 6. 多级下拉菜单（桌面端） ---------- */
.has-dropdown { position: relative; }

/* 父菜单（带下拉）不显示下划线，避免悬停/当前页高亮时出现下划线动画 */
.has-dropdown > .nav-link::after { display: none; }

/* 桥接父项与下拉菜单之间的空隙，避免鼠标斜向移动时 hover 中断 */
.has-dropdown::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  min-width: 280px;
  width: 100%;
  height: 18px;
  transform: translateX(-50%);
}

.dropdown {
  position: absolute;
  top: calc(100% + 16px);
  left: 50%;
  min-width: 280px;
  padding: .55rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(-50%) translateY(10px);
  transition: opacity .3s var(--ease), transform .3s var(--ease), visibility .3s;
}
/* 小三角箭头 */
.dropdown::before {
  content: "";
  position: absolute;
  top: -6px; left: 50%;
  width: 12px; height: 12px;
  background: #fff;
  border-left: 1px solid var(--line);
  border-top: 1px solid var(--line);
  transform: translateX(-50%) rotate(45deg);
}
.has-dropdown:hover .dropdown,
.has-dropdown:focus-within .dropdown {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.dropdown a {
  display: flex;
  align-items: center;
  gap: .8rem;
  padding: .72rem .95rem;
  border-radius: 10px;
  font-size: .9rem;
  font-weight: 500;
  color: var(--charcoal);
  text-decoration: none;
  transition: background .2s var(--ease), color .2s var(--ease);
}
.dropdown a:hover { background: var(--paper); color: var(--brand); }
.dropdown .dropdown-note {
  font-size: .72rem;
  color: var(--slate-light);
  letter-spacing: .04em;
}

/* ---------- 7. 移动端汉堡菜单 ---------- */
.menu-toggle { position: relative; width: 44px; height: 44px; }
.menu-toggle span {
  position: absolute;
  left: 10px; right: 10px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform .35s var(--ease), opacity .3s var(--ease), top .35s var(--ease);
}
.menu-toggle span:nth-child(1) { top: 16px; }
.menu-toggle span:nth-child(2) { top: 22px; }
.menu-toggle span:nth-child(3) { top: 28px; }
.menu-toggle.active span:nth-child(1) { top: 22px; transform: rotate(45deg); }
.menu-toggle.active span:nth-child(2) { opacity: 0; }
.menu-toggle.active span:nth-child(3) { top: 22px; transform: rotate(-45deg); }

.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 45;
  background: #fff;
  padding: 96px 24px 40px;
  overflow-y: auto;
  transform: translateX(100%);
  visibility: hidden;
  transition: transform .5s var(--ease), visibility .5s;
}
.mobile-menu.open { transform: translateX(0); visibility: visible; }

.mobile-item { border-bottom: 1px solid var(--line); }
.mobile-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 0;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--ink);
}
.mobile-link.is-active { color: var(--brand); }
.mobile-sub {
  max-height: 0;
  overflow: hidden;
  transition: max-height .4s var(--ease);
}
.mobile-item.open .mobile-sub { max-height: 420px; }
.mobile-sub a {
  display: block;
  padding: .7rem 0 .7rem .6rem;
  font-size: .98rem;
  color: var(--slate);
  border-bottom: 1px solid var(--paper);
}
.mobile-sub a:last-child { border-bottom: none; }
.mobile-sub-toggle svg { transition: transform .35s var(--ease); }
.mobile-item.open .mobile-sub-toggle svg { transform: rotate(180deg); }

/* 移动端父级：链接 + 独立展开箭头 */
.mobile-row { display: flex; align-items: center; justify-content: space-between; }
.mobile-row .mobile-link { flex: 1; }
.mobile-chevron {
  width: 46px;
  height: 46px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  background: none;
  border: none;
  cursor: pointer;
}

/* ---------- 8. 首屏 Hero（视差 + 滚动淡入） ---------- */
.hero {
  position: relative;
  min-height: 50vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  color: #fff;
}
@media (min-width: 768px) {
  .hero { min-height: 65vh; }
}
@media (min-width: 1024px) {
  .hero { min-height: calc(100vh - 5rem); }
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0,0,0,.8) 0%, rgba(0,0,0,.65) 45%, rgba(0,0,0,.9) 100%);
}
.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.hero-content { position: relative; z-index: 2; }

/* 首屏 SVG 线条动画（lifung.com 风格循环图形） */
.graphic-animation {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}
.svg-graphics {
  position: absolute;
  inset: 0;
}
.loop {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: clamp(150px, 24vw, 250px);
  height: clamp(327px, 52.2vw, 544px);
  overflow: visible;
}
.line-group-bot,
.line-group-top {
  position: absolute;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.line-group-bot { left: 0; bottom: 0; }
.line-group-top { right: 0; top: 0; }

.loop path,
.line-group-bot line,
.line-group-top line {
  fill: none;
  stroke: var(--brand);
  stroke-width: 4px;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: var(--dash, 200px);
  animation: graphic-draw 15s cubic-bezier(.77, 0, .18, 1) infinite backwards;
}

.top_line   { --dash: 379px; }
.bottom_line{ --dash: 379px; }
.line_A     { --dash: 239px; }

/* 第一组：顶部横线先画 */
.line-group-top .line_A { animation-delay: 0s; }
/* 第二组：底部横线，等顶部消失后再出现 */
.line-group-bot .line_A { animation-delay: 4s; }
/* 第三组：中间循环最后画 */
.loop .top_line    { animation-delay: 8s; }
.loop .bottom_line { animation-delay: 8.4s; }

@keyframes graphic-draw {
  0%   { stroke-dashoffset: var(--dash); opacity: 0; }
  4%   { opacity: .9; }
  20%  { stroke-dashoffset: 0; opacity: .9; }
  27%  { stroke-dashoffset: 0; opacity: 0; }
  100% { stroke-dashoffset: var(--dash); opacity: 0; }
}

/* ---------- 9. 内容卡片 ---------- */
.card {
  position: relative;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .45s var(--ease), box-shadow .45s var(--ease), border-color .45s var(--ease);
}
.card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-md);
  border-color: transparent;
}

.card-media { overflow: hidden; }
.card-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .9s var(--ease);
}
.card:hover .card-media img { transform: scale(1.06); }

/* 图片底部渐变遮罩，统一占位图气质 */
.img-fade { position: relative; }
.img-fade::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(14,14,14,0) 45%, rgba(14,14,14,.5) 100%);
  pointer-events: none;
}

/* 悬停下划线箭头 */
.link-more {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-size: .85rem;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--brand);
}
.link-more svg { transition: transform .3s var(--ease); }
.link-more:hover svg { transform: translateX(5px); }

/* 统计数字 */
.stat-number {
  font-size: clamp(2.4rem, 4.5vw, 3.6rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
}

/* ---------- 10. 滚动淡入动效（克制柔和） ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .85s var(--ease), transform .85s var(--ease);
  will-change: opacity, transform;
}
.reveal.in-view { opacity: 1; transform: none; }

/* ---------- 11. 表单 ---------- */
.field {
  width: 100%;
  padding: .9rem 1.05rem;
  border: 1px solid var(--line);
  border-radius: 11px;
  font-size: .92rem;
  color: var(--ink);
  background: #fff;
  transition: border-color .25s var(--ease), box-shadow .25s var(--ease);
}
.field:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(205,32,44,.1);
}
.field::placeholder { color: var(--slate-light); }

/* ---------- 13. 页脚 ---------- */
.footer-link {
  color: var(--slate);
  font-size: .9rem;
  transition: color .25s var(--ease);
}
.footer-link:hover { color: #fff; }

.social-btn {
  width: 40px; height: 40px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #c9c6bf;
  transition: all .3s var(--ease);
}
.social-btn:hover { background: var(--brand); border-color: var(--brand); color: #fff; transform: translateY(-3px); }

/* ---------- 13b. 首页多图轮播（Hero Carousel） ---------- */
.hero-slides {
  position: absolute;
  inset: -12% 0;
  overflow: hidden;
}
.hero-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1.1s var(--ease);
  will-change: opacity;
}
.hero-slide.is-active { opacity: 1; }

/* 左右切换箭头 */
.hero-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.35);
  background: rgba(14,14,14,.28);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .3s var(--ease), border-color .3s var(--ease), transform .3s var(--ease);
}
.hero-arrow:hover {
  background: var(--brand);
  border-color: var(--brand);
  transform: translateY(-50%) scale(1.06);
}
.hero-arrow-prev { left: 22px; }
.hero-arrow-next { right: 22px; }
@media (min-width: 768px) {
  .hero-arrow-prev { left: 40px; }
  .hero-arrow-next { right: 40px; }
}

/* 底部圆点指示 */
.hero-dots {
  position: absolute;
  bottom: 74px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  display: flex;
  gap: 10px;
}
.hero-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: rgba(255,255,255,.45);
  border: none;
  cursor: pointer;
  transition: width .35s var(--ease), background .35s var(--ease);
  padding: 0;
}
.hero-dot.is-active { width: 26px; background: #fff; }

/* ---------- 13c. 内页页眉（Page Hero） ---------- */
.page-hero {
  position: relative;
  padding: 5rem 0 5rem;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.page-hero::before {
  content: "";
  position: absolute;
  top: -40%;
  right: -12%;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(205,32,44,.07), transparent 62%);
  pointer-events: none;
}

/* ---------- 12. 集团双板块切换（Tabs） ---------- */
.entity-tab {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 1.05rem 1.3rem;
  text-align: left;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  cursor: pointer;
  transition: background .3s var(--ease), border-color .3s var(--ease);
}
.entity-tab:hover { border-color: var(--brand); }
.entity-tab.is-active {
  background: var(--paper);
  border-color: var(--brand);
}
.entity-tab-label {
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .03em;
  color: var(--slate);
}
.entity-tab-name {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--ink);
}
.entity-tab.is-active .entity-tab-label { color: var(--brand); }
.entity-tab.is-active .entity-tab-name { color: var(--brand); }

/* ---------- 14. 无障碍：减少动态 ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero-slides { transform: none !important; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- 15. 分页 ---------- */
.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.pagination li { margin: 0; list-style: none; }
.pagination li a,
.pagination li span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  font-size: .9rem;
  font-weight: 500;
  text-decoration: none;
  transition: all .25s var(--ease);
}
.pagination li a:hover {
  border-color: var(--brand);
  color: var(--brand);
}
.pagination li.active > span {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.pagination li.disabled > span {
  background: transparent;
  border-color: var(--line);
  color: var(--slate-light);
  cursor: not-allowed;
}

/* ---------- 16. 正文标题还原（富文本内容 h1-h6） ---------- */
/* 抵消 Tailwind Preflight 对标题的 font-size/font-weight/margin 重置，
   让富文本正文里的标题恢复正常的层级与字重。 */
.the-content h1,
.the-content h2,
.the-content h3,
.the-content h4,
.the-content h5,
.the-content h6 {
  font-size: revert;
  font-weight: revert;
  margin: revert;
}
