/* Phonjex 中文站 - 设计系统 */

/* ===== CSS Variables ===== */
:root {
  /* Colors - 工业蓝绿色主题 */
  --primary: #253aa5;        /* Teal - clean, hygienic */
  --primary-dark: #066fca;
  --primary-light: #066fca;
  --secondary: #1E293B;      /* Slate dark */
  --accent: #3da3b9;         /* Amber for CTAs */
  --accent-hover: #75d6f7;
  
  /* Neutrals */
  --bg-primary: #FFFFFF;
  --bg-secondary: #F8FAFC;
  --bg-dark: #0F172A;
  --text-primary: #1E293B;
  --text-secondary: #64748B;
  --text-light: #94A3B8;
  --border: #E2E8F0;
  
  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2rem;
  --space-xl: 3rem;
  --space-2xl: 4rem;
  
  /* Typography */
  --font-family: 'Outfit', 'PingFang SC', 'Microsoft YaHei', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-light: 300;
  --font-regular: 400;
  --font-medium: 500;
  --font-bold: 700;
  
  /* Transitions */
  --transition: 0.3s ease;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  overflow-x: hidden;
  font-family: var(--font-family);
  font-weight: var(--font-regular);
  line-height: 1.7;
  color: var(--text-primary);
  background: var(--bg-primary);
}

/* ===== Typography ===== */
h1, h2, h3, h4, h5, h6 {
  font-weight: var(--font-bold);
  line-height: 1.3;
  color: var(--secondary);
}

h1 { font-size: clamp(2rem, 5vw, 3rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2rem); }
h3 { font-size: clamp(1.25rem, 3vw, 1.5rem); }

p { margin-bottom: 1rem; }

a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
}

a:hover { color: var(--primary-dark); }

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

/* ===== Container ===== */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-family: var(--font-family);
  font-size: 1rem;
  font-weight: var(--font-medium);
  border: 2px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition);
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-dark);
  color: white;
}

.btn-accent {
  background: var(--accent);
  color: white;
}

.btn-accent:hover {
  background: var(--accent-hover);
  color: white;
}

.btn-outline {
  background: transparent;
  border-color: var(--primary);
  color: var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: white;
}

/* ===== Header & Navigation ===== */
.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--bg-primary);
  box-shadow: var(--shadow-sm);
}

.nav-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo img {
  width: 160px;
  height: auto;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  list-style: none;
}

.nav-link {
  position: relative;
  padding: 0.5rem 0;
  font-weight: var(--font-medium);
  color: var(--text-primary);
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary);
}

/* Dropdown */
.has-dropdown {
  position: relative;
}

.dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 240px;
  background: var(--bg-primary);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: var(--transition);
}

.has-dropdown:hover .dropdown,
.has-dropdown:focus-within .dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown a {
  display: block;
  padding: 0.75rem 1rem;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
}

.dropdown a:last-child { border-bottom: none; }

.dropdown a:hover {
  background: var(--bg-secondary);
  color: var(--primary);
}

/* Mobile Menu Toggle */
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  transition: var(--transition);
}

/* ===== Hero Section ===== */
.hero {
  position: relative;
  padding: var(--space-2xl) 0;
  background: linear-gradient(135deg, var(--bg-secondary) 0%, #E0F2F1 100%);
  overflow: hidden;
}

.hero-content {
  position: relative;
  max-width: 600px;
}

.hero h1 {
  margin-bottom: var(--space-md);
}

.hero p {
  font-size: 1.125rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-lg);
}

.hero-buttons {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

/* ===== Sections ===== */
.section {
  padding: var(--space-2xl) 0;
}

.section-alt {
  background: var(--bg-secondary);
}

.section-title {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.section-title h2 {
  margin-bottom: var(--space-sm);
}

.section-title p {
  max-width: 600px;
  margin: 0 auto;
  color: var(--text-secondary);
}

/* ===== Cards ===== */
.card {
  background: var(--bg-primary);
  border-radius: 12px;
  padding: var(--space-lg);
  box-shadow: var(--shadow-md);
  transition: var(--transition);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.card h3 {
  margin-bottom: var(--space-sm);
}

.card p {
  color: var(--text-secondary);
  margin-bottom: 0;
}

/* ===== Grid ===== */
.grid {
  display: grid;
  gap: var(--space-lg);
}

.grid > * {
  min-width: 0;
}

.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* FAQ 双列布局：项目按行排列，展开时不拉伸同行 */
.faq-grid { align-items: start; }
.faq-grid > .faq-item { margin-bottom: 0; }

@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ===== Features ===== */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-lg);
}

.feature-card {
  text-align: center;
  padding: var(--space-xl);
}

.feature-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto var(--space-md);
  padding: var(--space-sm);
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  border-radius: 14px;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== Products ===== */
.product-card {
  background: var(--bg-primary);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

.product-image {
  position: relative;
  aspect-ratio: 4/3;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.product-card:hover .product-image img {
  transform: scale(1.05);
}

.product-info {
  padding: var(--space-md);
}

.product-info h3 {
  margin-bottom: var(--space-xs);
  font-size: 1.125rem;
}

.product-info p {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-bottom: var(--space-sm);
}

.product-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-weight: var(--font-medium);
  color: var(--primary);
}

/* ===== Tables ===== */
.table-wrapper {
  overflow-x: auto;
  border-radius: 8px;
  box-shadow: var(--shadow-md);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-primary);
}

th, td {
  padding: 0.875rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  background: var(--primary);
  color: white;
  font-weight: var(--font-medium);
}

tr:hover { background: var(--bg-secondary); }

/* ===== FAQ ===== */
.faq-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: var(--space-sm);
  overflow: hidden;
}

.faq-question {
  width: 100%;
  padding: 1rem 1.25rem;
  background: var(--bg-primary);
  border: none;
  text-align: left;
  font-family: var(--font-family);
  font-size: 1rem;
  font-weight: var(--font-medium);
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.faq-question::after {
  content: '+';
  font-size: 1.5rem;
  color: var(--primary);
  transition: var(--transition);
}

.faq-item.active .faq-question::after {
  transform: rotate(45deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.faq-item.active .faq-answer {
  max-height: 500px;
}

.faq-answer-content {
  padding: 1rem 1.25rem;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ===== Contact ===== */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-lg);
}

.contact-card {
  text-align: center;
  padding: var(--space-xl);
}

.contact-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto var(--space-md);
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.contact-card h3 {
  margin-bottom: var(--space-sm);
}

.contact-card p {
  color: var(--text-secondary);
  margin-bottom: 0;
  font-size: 0.9375rem;
}

.contact-card a {
  color: var(--primary);
}

/* ===== Footer ===== */
.footer {
  background: var(--bg-dark);
  color: white;
  padding: var(--space-2xl) 0 var(--space-lg);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(4, 1fr);
  gap: var(--space-xl);
  margin-bottom: var(--space-lg);
}

.footer-brand p {
  color: var(--text-light);
  margin-top: var(--space-sm);
  line-height: 1.7;
}

.footer h4 {
  color: white;
  margin-bottom: var(--space-md);
}

.footer-col-desc {
  color: var(--text-light);
  font-size: 0.82rem;
  line-height: 1.6;
  margin: calc(var(--space-sm) * -1 + 2px) 0 var(--space-sm);
  max-width: 30ch;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: var(--space-xs);
}

.footer-links a {
  color: var(--text-light);
}

.footer-links a:hover {
  color: var(--primary-light);
}

/* ===== 页脚联系信息 · 横向信息条 + 线性图标 ===== */
.footer-contact {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md) var(--space-lg);
  padding-top: var(--space-lg);
  margin-bottom: var(--space-lg);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-contact-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
  line-height: 1.5;
}

.footer-contact-item svg.fi {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.9);
}

.footer-contact-item a {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-contact-item a:hover {
  color: var(--primary-light);
}

.footer-bottom {
  padding-top: var(--space-lg);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  color: var(--text-light);
  font-size: 0.875rem;
}

/* ===== Breadcrumb ===== */
.breadcrumb {
  padding: var(--space-sm) 0;
  background: var(--bg-secondary);
}

.breadcrumb-list {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  list-style: none;
  font-size: 0.875rem;
}

.breadcrumb-list li {
  color: var(--text-secondary);
}

.breadcrumb-list a {
  color: var(--primary);
}

.breadcrumb-list li:not(:last-child)::after {
  content: '›';
  margin-left: 0.5rem;
  color: var(--text-light);
}

/* ===== CTA Section ===== */
.cta-section {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  padding: var(--space-2xl) 0;
  text-align: center;
  color: white;
}

.cta-section h2 {
  color: white;
  margin-bottom: var(--space-sm);
}

.cta-section p {
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: var(--space-lg);
}

.cta-buttons {
  display: flex;
  gap: var(--space-sm);
  justify-content: center;
  flex-wrap: wrap;
}

/* ===== Mobile Styles ===== */
@media (max-width: 768px) {
  .menu-toggle {
    display: flex;
  }

  .nav-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    flex-direction: column;
    align-items: flex-start;
    padding: var(--space-xl);
    background: var(--bg-primary);
    box-shadow: var(--shadow-xl);
    transition: var(--transition);
    z-index: 1001;
  }

  .nav-menu.active {
    right: 0;
  }

  .nav-menu .has-dropdown {
    width: 100%;
  }

  .dropdown {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    padding-left: var(--space-md);
  }

  .footer-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .footer-col-desc {
    max-width: 100%;
  }

  .footer-contact {
    grid-template-columns: 1fr;
    text-align: left;
  }

  .footer-contact-item {
    justify-content: center;
  }

  .hero-buttons {
    flex-direction: column;
  }

  .hero-buttons .btn {
    width: 100%;
  }
}

/* ===== Accessibility ===== */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ===== Clients Logo Wall ===== */
.clients-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: var(--space-md);
  align-items: center;
  justify-items: center;
}

.client-logo {
  min-width: 0;
  padding: var(--space-sm);
  
  opacity: 1;
  transition: var(--transition);
}

.client-logo:hover {
  
  opacity: 1;
}

.client-logo img {
  width: auto;
  max-width: 100%;
  max-width: 140px;
  max-height: 60px;
  object-fit: contain;
}

@media (max-width: 1024px) {
  .clients-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  /* 页脚：五列 → 两列，避免文字挤压 */
  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-lg);
  }

  .footer-brand {
    grid-column: 1 / -1;
  }

  .footer-contact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .clients-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
