/* ====================================
   yhdz6.com - 佑华电子 官方网站
   英/繁中文双语版
   ==================================== */

:root {
  --primary: #0a3d6b;
  --primary-light: #1a6fb5;
  --accent: #e8731a;
  --accent-hover: #d0640f;
  --dark: #1a1a2e;
  --text: #333333;
  --text-light: #666666;
  --bg-light: #f8f9fa;
  --bg-white: #ffffff;
  --border: #e0e0e0;
  --shadow: 0 2px 20px rgba(0,0,0,0.08);
  --shadow-hover: 0 8px 30px rgba(0,0,0,0.15);
  --radius: 8px;
  --radius-lg: 16px;
  --max-width: 1200px;
  --header-height: 100px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

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

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* ======== Language Switcher ======== */
.lang-bar {
  background: var(--dark);
  color: #aaa;
  font-size: 13px;
  padding: 6px 0;
}
.lang-bar .container {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 4px;
}
.lang-btn {
  background: none;
  border: 1px solid transparent;
  color: #999;
  cursor: pointer;
  padding: 3px 10px;
  border-radius: 3px;
  font-size: 13px;
  transition: all 0.2s;
}
.lang-btn:hover { color: #fff; border-color: #555; }
.lang-btn.active {
  color: var(--accent);
  border-color: var(--accent);
  font-weight: 600;
}
.lang-divider { color: #444; font-size: 11px; }

/* ======== Header ======== */
.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--bg-white);
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
}
.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}
.logo-img {
  width: 55px;
  height: 55px;
  border-radius: 50%;
  object-fit: cover;
}
.logo-text h1 {
  font-size: 20px;
  color: var(--primary);
  font-weight: 700;
  line-height: 1.3;
}
.logo-text span {
  font-size: 13px;
  color: var(--text-light);
}

/* Navigation */
.nav { display: flex; gap: 4px; }
.nav a {
  padding: 8px 16px;
  font-size: 15px;
  color: var(--text);
  border-radius: 4px;
  transition: all 0.2s;
  position: relative;
  font-weight: 500;
}
.nav a:hover,
.nav a.active {
  color: var(--primary-light);
  background: rgba(26, 111, 181, 0.06);
}
.nav a::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 60%;
  height: 2px;
  background: var(--primary-light);
  transition: transform 0.2s;
}
.nav a:hover::after,
.nav a.active::after { transform: translateX(-50%) scaleX(1); }

/* Mobile menu toggle */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: var(--primary);
  padding: 8px;
}

/* ======== Hero Banner ======== */
.hero {
  background: linear-gradient(135deg, #0a3d6b 0%, #1a6fb5 50%, #0a3d6b 100%);
  color: #fff;
  padding: 80px 0;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(232,115,26,0.15) 0%, transparent 70%);
  border-radius: 50%;
}
.hero .container {
  display: flex;
  align-items: center;
  gap: 60px;
  position: relative;
  z-index: 1;
}
.hero-content { flex: 1; }
.hero-content h2 {
  font-size: 42px;
  font-weight: 800;
  margin-bottom: 8px;
  line-height: 1.2;
}
.hero-content .hero-sub {
  font-size: 22px;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 20px;
}
.hero-content p {
  font-size: 16px;
  color: rgba(255,255,255,0.85);
  margin-bottom: 30px;
  max-width: 540px;
  line-height: 1.8;
}
.hero-img {
  flex: 0 0 380px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.hero-img img {
  width: 100%;
  height: 280px;
  object-fit: cover;
}

.btn {
  display: inline-block;
  padding: 12px 32px;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  border: none;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(232,115,26,0.4);
}
.btn-outline {
  background: transparent;
  color: #fff;
  border: 2px solid rgba(255,255,255,0.4);
  margin-left: 12px;
}
.btn-outline:hover {
  border-color: #fff;
  background: rgba(255,255,255,0.1);
}

/* ======== Sections ======== */
.section {
  padding: 70px 0;
}
.section-alt { background: var(--bg-light); }
.section-title {
  text-align: center;
  margin-bottom: 50px;
}
.section-title h3 {
  font-size: 30px;
  color: var(--primary);
  font-weight: 700;
  margin-bottom: 10px;
}
.section-title p {
  color: var(--text-light);
  font-size: 16px;
  max-width: 600px;
  margin: 0 auto;
}
.section-title .en {
  display: block;
  font-size: 13px;
  color: #aaa;
  text-transform: uppercase;
  letter-spacing: 3px;
  margin-top: 4px;
}

/* ======== Pain Points / Problems ======== */
.problems-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
.problem-card {
  background: var(--bg-white);
  border-radius: var(--radius);
  padding: 30px 20px;
  text-align: center;
  box-shadow: var(--shadow);
  transition: all 0.3s;
  border-top: 3px solid var(--accent);
}
.problem-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-hover); }
.problem-icon {
  font-size: 44px;
  margin-bottom: 12px;
}
.problem-card h4 { font-size: 18px; margin-bottom: 8px; color: var(--primary); }
.problem-card p { font-size: 14px; color: var(--text-light); }

/* ======== Products ======== */
.products-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.product-card {
  background: var(--bg-white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: all 0.3s;
}
.product-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-hover); }
.product-img {
  height: 200px;
  overflow: hidden;
}
.product-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s;
}
.product-card:hover .product-img img { transform: scale(1.08); }
.product-info { padding: 20px; }
.product-info h4 { font-size: 17px; color: var(--primary); margin-bottom: 6px; }
.product-info p { font-size: 14px; color: var(--text-light); }

/* ======== Advantages ======== */
.advantages-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.advantage-card {
  background: var(--bg-white);
  border-radius: var(--radius);
  padding: 30px;
  text-align: center;
  box-shadow: var(--shadow);
  transition: all 0.3s;
}
.advantage-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-hover); }
.adv-icon {
  width: 64px;
  height: 64px;
  line-height: 64px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  border-radius: 50%;
  color: #fff;
  font-size: 28px;
  margin: 0 auto 16px;
}
.advantage-card h4 { font-size: 18px; color: var(--primary); margin-bottom: 8px; }
.advantage-card p { font-size: 14px; color: var(--text-light); }

/* ======== About / Intro ======== */
.about-section .container {
  display: flex;
  gap: 50px;
  align-items: center;
}
.about-image {
  flex: 0 0 450px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.about-image img { width: 100%; height: 320px; object-fit: cover; }
.about-text { flex: 1; }
.about-text h3 { font-size: 28px; color: var(--primary); margin-bottom: 16px; }
.about-text p { 
  font-size: 15px;
  color: var(--text-light);
  line-height: 1.9;
  margin-bottom: 16px;
}
.about-stats {
  display: flex;
  gap: 30px;
  margin-top: 24px;
}
.stat-item { text-align: center; }
.stat-num {
  font-size: 32px;
  font-weight: 700;
  color: var(--accent);
}
.stat-label { font-size: 13px; color: var(--text-light); }

/* ======== Certification / Awards ======== */
.cert-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
}
.cert-item {
  background: var(--bg-white);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  box-shadow: var(--shadow);
  transition: all 0.3s;
}
.cert-item:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.cert-item img {
  width: 100%;
  height: 140px;
  object-fit: contain;
  margin-bottom: 8px;
}
.cert-item span { font-size: 13px; color: var(--text-light); }

/* ======== News ======== */
.news-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.news-card {
  background: var(--bg-white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: all 0.3s;
}
.news-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-hover); }
.news-img { height: 180px; overflow: hidden; }
.news-img img { width: 100%; height: 100%; object-fit: cover; }
.news-body { padding: 20px; }
.news-date { font-size: 13px; color: #aaa; margin-bottom: 6px; }
.news-body h4 { font-size: 16px; color: var(--primary); margin-bottom: 8px; line-height: 1.4; }
.news-body p { font-size: 14px; color: var(--text-light); }

/* ======== Contact CTA ======== */
.cta-section {
  background: linear-gradient(135deg, var(--primary) 0%, #0d4f8a 100%);
  color: #fff;
  text-align: center;
  padding: 60px 0;
}
.cta-section h3 { font-size: 28px; margin-bottom: 12px; }
.cta-section p { font-size: 16px; color: rgba(255,255,255,0.8); margin-bottom: 24px; }
.cta-phone {
  font-size: 36px;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: 2px;
}

/* ======== Footer ======== */
.footer {
  background: var(--dark);
  color: #aaa;
  padding: 40px 0 20px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 30px;
}
.footer-col h4 {
  color: #fff;
  font-size: 17px;
  margin-bottom: 16px;
  position: relative;
  padding-bottom: 10px;
}
.footer-col h4::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 30px;
  height: 2px;
  background: var(--accent);
}
.footer-col p { font-size: 14px; line-height: 1.8; }
.footer-col ul li { margin-bottom: 8px; }
.footer-col ul li a { font-size: 14px; color: #aaa; transition: color 0.2s; }
.footer-col ul li a:hover { color: var(--accent); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 20px;
  text-align: center;
  font-size: 13px;
}

/* ======== Page Header (subpages) ======== */
.page-header {
  background: linear-gradient(135deg, #0a3d6b, #1a6fb5);
  color: #fff;
  padding: 50px 0;
  text-align: center;
}
.page-header h2 { font-size: 32px; font-weight: 700; margin-bottom: 6px; }
.page-header p { font-size: 16px; color: rgba(255,255,255,0.75); }

/* ======== Contact Page ======== */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}
.contact-info h4 {
  font-size: 20px;
  color: var(--primary);
  margin-bottom: 20px;
}
.contact-item {
  display: flex;
  gap: 14px;
  margin-bottom: 18px;
  align-items: flex-start;
}
.contact-icon {
  width: 40px;
  height: 40px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 18px;
  flex-shrink: 0;
}
.contact-item div { flex: 1; }
.contact-item strong { display: block; font-size: 14px; color: var(--primary); margin-bottom: 2px; }
.contact-item span { font-size: 14px; color: var(--text-light); }

/* ======== Lang-specific: hidden elements ======== */
[lang="en"] .zh-only,
[lang="zh"] .en-only,
[lang="zh-Hant"] .en-only,
[lang="zh-Hant"] .zh-only { display: none !important; }

/* ======== Responsive ======== */
@media (max-width: 1024px) {
  .problems-grid { grid-template-columns: repeat(2, 1fr); }
  .products-grid { grid-template-columns: repeat(2, 1fr); }
  .advantages-grid { grid-template-columns: repeat(2, 1fr); }
  .cert-grid { grid-template-columns: repeat(3, 1fr); }
  .news-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .hero .container { flex-direction: column; }
  .hero-content h2 { font-size: 28px; }
  .hero-img { flex: none; width: 100%; }
  .nav {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: #fff;
    flex-direction: column;
    padding: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  }
  .nav.open { display: flex; }
  .menu-toggle { display: block; }
  .about-section .container { flex-direction: column; }
  .about-image { flex: none; width: 100%; }
  .problems-grid { grid-template-columns: repeat(2, 1fr); }
  .products-grid { grid-template-columns: 1fr; }
  .advantages-grid { grid-template-columns: 1fr; }
  .cert-grid { grid-template-columns: repeat(3, 1fr); }
  .news-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .about-stats { flex-wrap: wrap; gap: 16px; }
  .lang-bar .container { justify-content: center; }
}

@media (max-width: 480px) {
  .logo-text h1 { font-size: 16px; }
  .logo-text span { font-size: 11px; }
  .problems-grid { grid-template-columns: 1fr; }
  .cert-grid { grid-template-columns: repeat(2, 1fr); }
}
