/* =========================================
   CSS Variables & Reset
========================================= */
:root {
  --primary: #fbbf24;
  --primary-hover: #d97706;
  --dark-bg: #101820;
  --darker-bg: #0a0f14;
  --light-bg: #f3f4f6;
  --card-bg: #1f2937;
  --white: #ffffff;
  --text-white: #ffffff;
  --text-light-gray: #9ca3af;
  --text-dark: #111827;
  --border-color: rgba(255, 255, 255, 0.1);
  --border-gray: #d1d5db;
  --transition: all 0.3s ease;
  --border-radius: 4px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Inter", sans-serif;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--white);
  color: var(--text-dark);
  line-height: 1.6;
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

ul {
  list-style: none;
}

img {
  max-width: 100%;
  display: block;
}

h1, h2, h3, h4 {
  line-height: 1.2;
  font-weight: 800;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
}

.section-padding {
  padding: 5rem 0;
}

.bg-light {
  background-color: var(--light-bg);
}

.text-center {
  text-align: center;
}

/* =========================================
   Buttons
========================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1.75rem;
  font-family: "Inter", sans-serif;
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.4;
  text-decoration: none;
  text-transform: uppercase;
  border-radius: var(--border-radius);
  border: 2px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background-color: var(--primary);
  color: var(--dark-bg);
  border-color: var(--primary);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  border-color: var(--primary-hover);
  color: var(--dark-bg);
}

.btn-outline {
  background-color: transparent;
  color: var(--text-dark);
  border-color: var(--border-gray);
}

.btn-outline:hover {
  background-color: var(--text-dark);
  color: var(--white);
  border-color: var(--text-dark);
}

.btn-dark {
  background-color: var(--text-dark);
  color: var(--white);
  border-color: var(--text-dark);
}

.btn-dark:hover {
  background-color: #374151;
  border-color: #374151;
  color: var(--white);
}

.btn-large {
  padding: 1rem 2.5rem;
  font-size: 1rem;
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.8125rem;
  font-weight: 600;
  border-width: 1.5px;
  text-transform: none;
}

/* Project card: white bg + black text */
.project-card-actions {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.project-card-actions .btn {
  width: 100%;
  justify-content: center;
}

.project-card .btn.btn-outline.btn-sm {
  background-color: var(--white);
  color: var(--text-dark);
  border: 1.5px solid var(--border-gray);
}

.project-card .btn.btn-outline.btn-sm:hover {
  background-color: var(--text-dark);
  color: var(--white);
  border-color: var(--text-dark);
}

/* =========================================
   Navbar
========================================= */
/* 顶部导航：与首页一致——悬浮于 Hero 之上，半透明毛玻璃（改样式请同步 style.css 首页导航） */
.navbar-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: rgba(16, 24, 32, 0.4);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  border-bottom: 1px solid var(--border-color);
}

.navbar-wrapper .navbar {
  position: static;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom: none;
}

.navbar {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border-color);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-white);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo-icon {
  color: var(--primary);
  font-style: italic;
  letter-spacing: -2px;
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-links a {
  color: var(--text-white);
  font-size: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--primary);
}

.nav-arrow {
  font-size: 0.6rem;
}

.hamburger {
  display: none;
  color: var(--text-white);
  font-size: 1.5rem;
  cursor: pointer;
}

.mobile-menu {
  display: none;
  flex-direction: column;
  background-color: var(--darker-bg);
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  padding: 1rem 20px;
  border-top: 1px solid var(--border-color);
}

.mobile-menu.active {
  display: flex;
}

.mobile-menu a {
  color: var(--text-white);
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-color);
  font-weight: 600;
}

.mobile-menu a:last-child {
  border-bottom: none;
  margin-top: 1rem;
}

/* =========================================
   Page Hero
========================================= */
.page-hero {
  height: 45vh;
  min-height: 430px;
  padding-top: 150px; /* 悬浮导航高度补偿 */
  display: flex;
  align-items: center;
  background:
    linear-gradient(rgba(16, 24, 32, 0.85), rgba(16, 24, 32, 0.85)),
    url("/projects/img/industrial-metal-manufacturing-projects-banner.webp")
      center / cover no-repeat;
  text-align: center;
}

.hero-content {
  width: 100%;
}

.hero-content h1 {
  color: var(--white);
  font-size: 3.5rem;
  margin-bottom: 1rem;
  text-transform: uppercase;
}

.hero-content p {
  color: var(--primary);
  font-size: 1.25rem;
  font-weight: 500;
}

/* =========================================
   Breadcrumb
========================================= */
.breadcrumb {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-light-gray);
  margin-bottom: 1.25rem;
}

.breadcrumb a {
  color: var(--text-light-gray);
}

.breadcrumb a:hover {
  color: var(--primary);
}

.breadcrumb .divider {
  color: var(--border-color);
}

.breadcrumb .current {
  color: var(--primary);
  font-weight: 600;
}

/* =========================================
   Filter Navigation
========================================= */
.filter-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 3rem;
}

.filter-btn {
  background-color: transparent;
  border: 2px solid var(--dark-bg);
  color: var(--dark-bg);
  padding: 0.6rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 700;
  border-radius: 30px;
  cursor: pointer;
  transition: var(--transition);
}

.filter-btn:hover {
  background-color: var(--dark-bg);
  color: var(--white);
}

.filter-btn.active {
  background-color: var(--primary);
  border-color: var(--primary);
  color: var(--dark-bg);
}

/* =========================================
   Project Grid & Cards
========================================= */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.project-card {
  background-color: var(--card-bg);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.project-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.project-card.hidden {
  display: none;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.project-card.visible {
  animation: fadeIn 0.4s ease forwards;
}

.card-image-wrapper {
  position: relative;
  overflow: hidden;
}

.card-image-wrapper img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  transition: transform 0.5s ease;
  cursor: zoom-in;
}

.project-card:hover .card-image-wrapper img {
  transform: scale(1.05);
}

.category-tag {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background-color: var(--primary);
  color: var(--dark-bg);
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 2px;
  text-transform: uppercase;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.card-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-content h3 {
  color: var(--white);
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
}

.project-location {
  color: var(--primary);
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.card-content p {
  color: var(--text-light-gray);
  font-size: 0.9rem;
  line-height: 1.5;
}

/* Empty state */
.no-projects-message {
  color: #6b7280;
  font-size: 0.9375rem;
}

.no-projects-message a {
  color: var(--primary-hover);
  font-weight: 500;
}

.no-projects-message a:hover {
  text-decoration: underline;
}

/* =========================================
   Pagination
========================================= */
.pagination-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-top: 2.5rem;
  margin-bottom: 1.25rem;
  width: 100%;
  flex-wrap: wrap;
}

.pagination-btn {
  min-width: 40px;
  height: 40px;
  padding: 0 0.75rem;
  background-color: var(--white);
  color: var(--text-dark);
  border: 1.5px solid var(--border-gray);
  font-family: "Inter", sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.pagination-btn:hover:not(:disabled):not(.active) {
  background-color: var(--text-dark);
  color: var(--white);
  border-color: var(--text-dark);
}

.pagination-btn.active {
  background-color: var(--primary);
  color: var(--text-dark);
  border-color: var(--primary);
  box-shadow: 0 4px 6px -1px rgba(251, 191, 36, 0.3);
}

.pagination-btn:disabled {
  background-color: #f9fafb;
  color: var(--text-light-gray);
  border-color: #e5e7eb;
  cursor: not-allowed;
  box-shadow: none;
  opacity: 0.7;
}

/* =========================================
   Export Banner
========================================= */
.export-banner {
  background-color: var(--primary);
  padding: 4rem 20px;
  color: var(--dark-bg);
}

.export-banner h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.export-banner p {
  font-size: 1.1rem;
  font-weight: 500;
}

.export-banner em {
  font-style: normal;
  font-weight: 700;
  text-decoration: underline;
}

/* =========================================
   CTA Banner
========================================= */
.cta-banner {
  background: linear-gradient(135deg, #222 0%, #111 100%);
  padding: 3.5rem 0;
}

.cta-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 2rem;
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 2.5rem 3rem;
}

.cta-banner h3 {
  font-size: 1.8rem;
  color: var(--white);
  max-width: 65%;
  line-height: 1.4;
}

/* =========================================
   Footer
========================================= */
footer {
  background-color: var(--dark-bg);
  color: var(--text-light-gray);
  padding-top: 4rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 2rem;
  margin-bottom: 4rem;
}

.brand-col .logo {
  display: inline-block;
  margin-bottom: 1.5rem;
}

.brand-col p {
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
}

.mini-stats {
  display: flex;
  gap: 1.5rem;
}

.mini-stats div {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-white);
}

.mini-stats i {
  color: var(--primary);
  font-size: 1.25rem;
}

.footer-col h4 {
  color: var(--text-white);
  margin-bottom: 1.5rem;
  font-size: 1rem;
}

.footer-col ul {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-col ul li a {
  font-size: 0.875rem;
  color: var(--text-light-gray);
}

.footer-col ul li a:hover {
  color: var(--primary);
}

.contact-details li {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  font-size: 0.875rem;
}

.contact-details i {
  color: var(--primary);
  margin-top: 0.25rem;
  flex-shrink: 0;
}

.contact-details a {
  color: var(--text-light-gray);
}

.contact-details a:hover {
  color: var(--primary);
}

.social-links {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

.social-links a {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light-gray);
}

.social-links a:hover {
  background-color: var(--primary);
  color: var(--dark-bg);
  border-color: var(--primary);
}

.footer-bottom {
  border-top: 1px solid var(--border-color);
  padding: 2rem 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.legal-links a {
  color: var(--text-light-gray);
}

.legal-links a:hover {
  color: var(--primary);
}

.legal-links .divider {
  margin: 0 0.5rem;
  color: var(--border-color);
}

/* =========================================
   Floating Sidebar
========================================= */
.floating-sidebar {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 1px;
  box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
}

.sidebar-item {
  position: relative;
  width: 50px;
  height: 50px;
  background-color: var(--text-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.sidebar-item a {
  color: var(--white);
  font-size: 24px;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-item i {
  color: var(--white);
  font-size: 20px;
}

.sidebar-item.whatsapp:hover {
  background-color: #25d366;
}

.sidebar-item.telegram:hover {
  background-color: #229ed9;
}

.sidebar-item.email:hover {
  background-color: var(--primary);
}

.sidebar-item.back-to-top:hover {
  background-color: #4b5563;
}

.sidebar-tooltip {
  position: absolute;
  right: 60px;
  top: 50%;
  transform: translateY(-50%) translateX(20px);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  pointer-events: none;
  z-index: 10000;
}

.sidebar-item:hover .sidebar-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) translateX(0);
}

.qr-tooltip {
  background-color: var(--white);
  padding: 10px;
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
  border: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.qr-tooltip img {
  width: 240px;
  height: 240px;
  object-fit: contain;
  max-width: none; /* 防止全局 img{max-width:100%} 导致弹窗塌缩 */
}

.qr-tooltip span {
  font-size: 13px;
  font-weight: bold;
  color: #374151;
  white-space: nowrap; /* 防止微信昵称被竖排 */
}

.text-tooltip {
  background-color: var(--primary);
  color: var(--text-dark);
  font-weight: bold;
  padding: 12px 16px;
  border-radius: 6px;
  white-space: nowrap;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.text-tooltip::after,
.qr-tooltip::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -6px;
  transform: translateY(-50%);
  border-width: 6px 0 6px 6px;
  border-style: solid;
}

.text-tooltip::after {
  border-color: transparent transparent transparent var(--primary);
}

.qr-tooltip::after {
  border-color: transparent transparent transparent var(--white);
}

/* =========================================
   Project Lightbox
========================================= */
.project-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  padding: 20px;
}

.project-lightbox.active {
  opacity: 1;
  visibility: visible;
}

.project-lightbox img {
  max-width: 90%;
  max-height: 85vh;
  border-radius: 8px;
  object-fit: contain;
  transform: scale(0.8);
  transition: transform 0.3s ease;
  cursor: zoom-out;
}

.project-lightbox.active img {
  transform: scale(1);
}

/* =========================================
   Responsive
========================================= */
@media (max-width: 1024px) {
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero-content h1 {
    font-size: 2.8rem;
  }
}

@media (max-width: 992px) {
  .nav-links,
  .nav-actions {
    display: none;
  }

  .hamburger {
    display: block;
  }
}

@media (max-width: 768px) {
  .hero-content h1 {
    font-size: 2.2rem;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }

  .cta-flex {
    flex-direction: column;
    text-align: center;
  }

  .cta-banner h3 {
    max-width: 100%;
  }

  /* Floating sidebar → bottom bar on mobile */
  .sidebar-tooltip,
  .qr-tooltip,
  .text-tooltip {
    display: none !important;
  }

  .floating-sidebar {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    transform: none;
    flex-direction: row;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 99999;
  }

  .sidebar-item {
    flex: 1;
    height: 55px;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
  }

  .sidebar-item:last-child {
    border-right: none;
  }

  .sidebar-item i {
    font-size: 22px;
  }

  body {
    padding-bottom: 60px !important;
  }
}

@media (max-width: 576px) {
  .projects-grid {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .filter-btn {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
  }
}
/* 卡片等高 + 按钮贴底 */
.project-card {
  background-color: var(--card-bg);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  height: 100%; /* 关键：在 grid 里撑满单元格高度 */
}

.card-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1; /* 占满图片下方剩余空间 */
}

.card-content p {
  color: var(--text-light-gray);
  font-size: 0.9rem;
  line-height: 1.5;
  flex: 1; /* 描述区可伸缩，把按钮往下推 */
}

.project-card-actions {
  margin-top: auto; /* 关键：按钮始终贴在卡片底部 */
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.project-card-actions .btn {
  width: 100%;
  justify-content: center;
}

/* ==========================================
   页脚微信悬停二维码弹层（与 style.css 保持一致）
   ========================================== */
.footer-wechat {
    position: relative;
}

.footer-wechat-trigger {
    cursor: pointer;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.4);
}

.footer-qr-pop {
    position: absolute;
    bottom: calc(100% + 12px);
    left: 0;
    z-index: 999;

    background: #ffffff;
    padding: 12px;
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
    border: 1px solid #e5e7eb;

    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;

    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: all 0.25s ease;

    pointer-events: none;
}

.footer-qr-pop::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 28px;
    border: 8px solid transparent;
    border-top-color: #ffffff;
}

.footer-wechat:hover .footer-qr-pop {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.footer-qr-pop img {
    display: block;
    width: 160px;
    height: 160px;
    object-fit: cover;
    border-radius: 6px;
}

.footer-qr-pop span {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}

.brand-col .logo img {
  width: 200px;
  height: auto;
}

/* 导航栏 logo：桌面 100px 高，移动端自适应缩小（与 style.css 保持一致） */
.navbar .logo img {
  height: 100px;
  width: auto;
  max-width: none;
}

@media (max-width: 768px) {
  .navbar .logo img {
    height: 56px;
  }
}

/* 导航栏字号放大（与全站导航统一） */
.nav-actions .btn {
  font-size: 1rem;
}
