/* =============================================================
   桓牧凌 官网 · 自定义样式 style.css
   说明：本文件为手写补充样式（导航、灯箱、时间轴、动效等）
   与 ./tailwind.css 配合使用，加载顺序：tailwind.css → style.css
   ============================================================= */

:root {
  /* 主色：深蓝（标题文字 / 描边 / 小面积强调） */
  --navy: #1E3A5F;
  --navy-800: #172E4B;
  --navy-900: #102038;   /* 全站深色大区块统一底色：页脚 / CTA / Banner 叠层 */
  /* 科技蓝：主行动色 / 链接 / 强调 */
  --tech: #3B82F6;
  --tech-light: #60A5FA;
  --tech-dark: #2563EB;
  --header-h: 76px;
}

img {
  max-width: 100%;
  height: auto;
}

/* 锚点定位避开固定导航 */
[id] {
  scroll-margin-top: 90px;
}

/* ---------- 1. 顶部导航 ---------- */
.site-header {
  height: var(--header-h);
  transition: background-color .35s ease, box-shadow .35s ease, height .35s ease;
}

.site-header.is-solid {
  background: rgba(255, 255, 255, .97);
  backdrop-filter: saturate(180%) blur(10px);
  box-shadow: 0 2px 18px rgba(30, 58, 95, .10);
  height: 64px;
}

.nav-link {
  position: relative;
  color: #fff;
  font-size: 15px;
  padding: 8px 2px;
  transition: color .3s ease;
  white-space: nowrap;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background: var(--tech);
  transition: width .3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.nav-link.active {
  color: #fff;
  font-weight: 600;
}

.site-header.is-solid .nav-link {
  color: #334155;
}

.site-header.is-solid .nav-link:hover,
.site-header.is-solid .nav-link.active {
  color: var(--navy);
}

.logo-dark {
  display: none;
}

.site-header.is-solid .logo-light {
  display: none;
}

.site-header.is-solid .logo-dark {
  display: block;
}

/* 顶部 logo 旁的品牌名（蓝色系，与 logo 协调） */
.brand-text {
  color: var(--tech-light);
  font-size: 16px;
  letter-spacing: 1px;
  line-height: 1;
  transition: color .35s ease;
}

.site-header.is-solid .brand-text {
  color: var(--tech);
}

@media (min-width: 640px) {
  .brand-text { font-size: 18px; letter-spacing: 1.5px; }
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: #fff;
  margin: 5px 0;
  border-radius: 2px;
  transition: transform .3s ease, opacity .25s ease, background-color .3s ease;
}

.site-header.is-solid .hamburger span {
  background: var(--navy);
}

.hamburger.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger.open span:nth-child(2) {
  opacity: 0;
}

.hamburger.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* 移动端下拉菜单 */
.mobile-menu {
  max-height: 0;
  overflow: hidden;
  transition: max-height .4s cubic-bezier(.22, .61, .36, 1);
  background: #fff;
  box-shadow: 0 12px 24px rgba(30, 58, 95, .12);
}

.mobile-menu.open {
  max-height: 460px;
}

.mobile-menu a {
  display: block;
  padding: 14px 20px;
  color: #334155;
  font-size: 15px;
  border-bottom: 1px solid #f1f5f9;
}

.mobile-menu a.active {
  color: var(--tech);
  font-weight: 600;
}

/* ---------- 2. Banner 轮播 ---------- */
.banner-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1.1s ease;
  pointer-events: none;
}

.banner-slide.active {
  opacity: 1;
  pointer-events: auto;
}

.banner-slide.active .banner-img {
  animation: kb 9s ease-out both;
}

@keyframes kb {
  from { transform: scale(1.02); }
  to { transform: scale(1.12); }
}

.banner-dot {
  width: 34px;
  height: 3px;
  background: rgba(255, 255, 255, .38);
  transition: background-color .3s ease;
  cursor: pointer;
}

.banner-dot.active {
  background: var(--tech);
}

.scroll-hint {
  animation: floatY 2s ease-in-out infinite;
}

@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(9px); }
}

/* ---------- 3. 滚动进场动画 ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .8s cubic-bezier(.22, .61, .36, 1), transform .8s cubic-bezier(.22, .61, .36, 1);
  will-change: opacity, transform;
}

.reveal.in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ---------- 4. 图片懒加载淡入 ---------- */
.lazy-img {
  opacity: 0;
  transition: opacity .6s ease;
  background: linear-gradient(110deg, #eef2f7 30%, #e2e8f0 50%, #eef2f7 70%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}

.lazy-img.loaded {
  opacity: 1;
  animation: none;
  background: none;
}

@keyframes shimmer {
  to { background-position: -200% 0; }
}

/* ---------- 5. 通用卡片 / 图片放大 ---------- */
.zoom-wrap {
  overflow: hidden;
}

.zoom-wrap img {
  transition: transform .7s cubic-bezier(.22, .61, .36, 1);
}

.group:hover .zoom-wrap img,
.zoom-wrap:hover img {
  transform: scale(1.07);
}

.case-card {
  transition: transform .35s ease, box-shadow .35s ease;
}

.case-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(30, 58, 95, .18);
}

/* ---------- 6. 发展历程时间轴 ---------- */
.timeline {
  position: relative;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: linear-gradient(180deg, var(--tech), rgba(59, 130, 246, .15));
}

.tl-item {
  position: relative;
  padding-left: 56px;
  padding-bottom: 36px;
}

.tl-dot {
  position: absolute;
  left: 10px;
  top: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--tech);
  box-shadow: 0 0 0 5px rgba(59, 130, 246, .12);
}

@media (min-width: 768px) {
  .timeline::before {
    left: 50%;
    transform: translateX(-50%);
  }
  .tl-item {
    width: 50%;
    padding-left: 0;
    padding-right: 48px;
    text-align: right;
  }
  .tl-item:nth-child(even) {
    margin-left: 50%;
    padding-right: 0;
    padding-left: 48px;
    text-align: left;
  }
  .tl-item .tl-dot {
    left: auto;
    right: -9px;
  }
  .tl-item:nth-child(even) .tl-dot {
    left: -9px;
    right: auto;
  }
}

/* ---------- 7. 案例分类筛选 ---------- */
.filter-btn {
  padding: 8px 20px;
  border-radius: 999px;
  font-size: 14px;
  color: #475569;
  background: #f1f5f9;
  transition: all .25s ease;
  cursor: pointer;
}

.filter-btn:hover {
  color: var(--navy);
  background: #e2e8f0;
}

.filter-btn.active {
  background: var(--navy);
  color: #fff;
}

.case-item.hide {
  display: none;
}

/* ---------- 7.1 案例卡片（统一缩略图 + 标题 + 描述） ---------- */
.case-card {
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(30, 58, 95, .08);
  border: 1px solid rgba(30, 58, 95, .06);
  display: flex;
  flex-direction: column;
  transition: transform .35s ease, box-shadow .35s ease;
  break-inside: avoid;
}

.case-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px rgba(30, 58, 95, .16);
}

.case-card.hide { display: none; }

.case-thumb-btn {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.case-thumb {
  position: relative;
  display: block;
  width: 100%;
  background: #eef2f7 linear-gradient(110deg, #eef2f7 30%, #e2e8f0 50%, #eef2f7 70%) 0 0/200% 100%;
  overflow: hidden;
}

.case-thumb-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .7s cubic-bezier(.22, .61, .36, 1);
  opacity: 0;
}

.case-thumb-img.loaded { opacity: 1; animation: none; background: none; }

.case-thumb-btn:hover .case-thumb-img {
  transform: scale(1.06);
}

.case-thumb-cat {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(16, 32, 56, .72);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 12px;
  letter-spacing: .5px;
  line-height: 1;
}

.case-thumb-zoom {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 46px;
  height: 46px;
  margin: -23px 0 0 -23px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, .92);
  color: var(--navy);
  opacity: 0;
  transform: scale(.82);
  transition: opacity .3s ease, transform .3s ease;
  pointer-events: none;
}

.case-thumb-overlay {
  position: absolute;
  inset: 0;
  background: rgba(16, 32, 56, 0);
  opacity: 0;
  transition: opacity .3s ease, background-color .3s ease;
  pointer-events: none;
}

.case-thumb-btn:hover .case-thumb-overlay {
  opacity: 1;
  background: rgba(16, 32, 56, .28);
}

.case-thumb-btn:hover .case-thumb-zoom {
  opacity: 1;
  transform: scale(1);
}

.case-body {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1 1 auto;
}

.case-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--navy);
  line-height: 1.4;
  margin: 0;
  /* 单/两行省略，保持排版对齐 */
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.case-desc {
  font-size: 13px;
  color: #64748b;
  line-height: 1.6;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- 7.2 案例分类板块 + 纯图片轮播 ---------- */
.case-block {
  scroll-margin-top: 90px;
}

.case-block-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 16px;
}

.case-block-title {
  position: relative;
  margin: 0;
  padding-left: 14px;
  font-size: 20px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.3;
}

.case-block-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 18px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--tech), var(--tech-light));
}

.case-block-count {
  font-size: 13px;
  color: #94a3b8;
}

/* 轮播容器 */
.carousel {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  background: #0f1f33;
  box-shadow: 0 10px 30px rgba(30, 58, 95, .12);
}

.carousel-track {
  display: flex;
  transition: transform .55s cubic-bezier(.22, .61, .36, 1);
}

.carousel-slide {
  flex: 0 0 100%;
  width: 100%;
}

.carousel-slide img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  user-select: none;
  -webkit-user-drag: none;
}

/* 左右切换箭头 */
.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .25);
  background: rgba(16, 32, 56, .45);
  backdrop-filter: blur(4px);
  color: #fff;
  cursor: pointer;
  transition: background-color .25s ease, transform .25s ease;
}

.carousel-arrow:hover {
  background: var(--tech);
  border-color: var(--tech);
}

.carousel-arrow svg { width: 22px; height: 22px; }

.carousel-prev { left: 14px; }
.carousel-next { right: 14px; }

/* 底部圆点指示 */
.carousel-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 14px;
  z-index: 3;
  display: flex;
  justify-content: center;
  gap: 8px;
}

.carousel-dot {
  width: 9px;
  height: 9px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .5);
  cursor: pointer;
  transition: background-color .25s ease, width .25s ease;
}

.carousel-dot.active {
  width: 22px;
  border-radius: 5px;
  background: #fff;
}

/* ---------- 8. 全屏灯箱相册 ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(9, 17, 30, .96);
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transition: opacity .32s ease, visibility .32s ease;
}

.lightbox.open {
  opacity: 1;
  visibility: visible;
}

.lb-top {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  color: #fff;
  background: linear-gradient(180deg, rgba(0, 0, 0, .55), transparent);
}

.lb-stage {
  flex: 1 1 auto;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
}

.lb-img {
  max-width: 92%;
  max-height: 100%;
  object-fit: contain;
  transform-origin: center center;
  transition: transform .28s cubic-bezier(.22, .61, .36, 1), opacity .28s ease;
  cursor: zoom-in;
  user-select: none;
  -webkit-user-drag: none;
}

.lb-img.zoomed {
  cursor: grab;
  transition: transform .12s linear;
}

.lb-img.dragging {
  cursor: grabbing;
  transition: none;
}

.lb-img.fading {
  opacity: 0;
}

.lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .22);
  transition: background-color .25s ease, transform .25s ease;
  cursor: pointer;
  z-index: 3;
}

.lb-nav:hover {
  background: var(--tech);
  border-color: var(--tech);
}

.lb-prev { left: 14px; }
.lb-next { right: 14px; }

.lb-btn {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: rgba(255, 255, 255, .10);
  border: 1px solid rgba(255, 255, 255, .18);
  transition: background-color .25s ease;
  cursor: pointer;
}

.lb-btn:hover {
  background: rgba(255, 255, 255, .26);
}

.lb-close:hover {
  background: #ef4444;
  border-color: #ef4444;
}

.lb-bottom {
  flex: 0 0 auto;
  padding: 10px 12px 18px;
  background: linear-gradient(0deg, rgba(0, 0, 0, .6), transparent);
}

.lb-thumbs {
  display: flex;
  gap: 8px;
  justify-content: flex-start;
  overflow-x: auto;
  padding: 6px 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .3) transparent;
}

.lb-thumbs::-webkit-scrollbar { height: 5px; }
.lb-thumbs::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .3); border-radius: 4px; }

.lb-thumb {
  flex: 0 0 auto;
  width: 92px;
  height: 60px;
  object-fit: cover;
  border-radius: 5px;
  opacity: .45;
  border: 2px solid transparent;
  cursor: pointer;
  transition: opacity .25s ease, border-color .25s ease;
}

.lb-thumb:hover { opacity: .85; }

.lb-thumb.active {
  opacity: 1;
  border-color: var(--tech);
}

.lb-loading {
  position: absolute;
  width: 38px;
  height: 38px;
  border: 3px solid rgba(255, 255, 255, .25);
  border-top-color: var(--tech);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  display: none;
}

.lb-loading.show { display: block; }

@keyframes spin { to { transform: rotate(360deg); } }

body.lb-lock {
  overflow: hidden;
}

@media (max-width: 640px) {
  .lb-nav { width: 40px; height: 40px; }
  .lb-prev { left: 6px; }
  .lb-next { right: 6px; }
  .lb-thumb { width: 68px; height: 46px; }
  .lb-img { max-width: 98%; }
}

/* ---------- 9. 表单 ---------- */
.form-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #dbe3ec;
  border-radius: 6px;
  font-size: 14px;
  color: #1e293b;
  background: #fff;
  transition: border-color .25s ease, box-shadow .25s ease;
}

.form-input::placeholder { color: #a3b0c2; }

.form-input:focus {
  outline: none;
  border-color: var(--tech);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, .14);
}

.form-input.error {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, .12);
}

.err-tip {
  display: none;
  margin-top: 6px;
  font-size: 12px;
  color: #ef4444;
}

.err-tip.show { display: block; }

/* 提交成功弹窗 */
.modal {
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, .55);
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s ease, visibility .3s ease;
  padding: 20px;
}

.modal.open { opacity: 1; visibility: visible; }

.modal-box {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border-radius: 12px;
  padding: 34px 26px 26px;
  text-align: center;
  transform: translateY(18px) scale(.97);
  transition: transform .35s cubic-bezier(.22, .61, .36, 1);
}

.modal.open .modal-box { transform: none; }

.ok-circle {
  width: 68px;
  height: 68px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: #ecfdf5;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ok-circle svg {
  stroke-dasharray: 40;
  stroke-dashoffset: 40;
  animation: draw .5s .15s ease forwards;
}

@keyframes draw { to { stroke-dashoffset: 0; } }

/* ---------- 10. 返回顶部 ---------- */
.to-top {
  position: fixed;
  right: 18px;
  bottom: 24px;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--navy-900);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: all .3s ease;
  z-index: 60;
  cursor: pointer;
}

.to-top.show {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.to-top:hover { background: var(--tech); }

/* ---------- 11. 页脚 ---------- */
.footer-link {
  color: #9fb3cd;
  font-size: 14px;
  line-height: 2.1;
  transition: color .25s ease, padding-left .25s ease;
}

.footer-link:hover {
  color: #fff;
  padding-left: 4px;
}

/* ---------- 12. 数字统计 ---------- */
.stat-num {
  font-variant-numeric: tabular-nums;
}

/* 打印优化 */
@media print {
  .site-header, .to-top, .lightbox, .modal { display: none !important; }
}
