/* ============================================
   中山市天思软件有限公司 - 企业官网样式
   ============================================ */

/* ---------- CSS Variables ---------- */
:root {
  --primary: #0d47a1;
  --primary-light: #1565c0;
  --primary-dark: #0a3d8f;
  --accent: #00bcd4;
  --accent-light: #26c6da;
  --text: #1a1a2e;
  --text-light: #555;
  --text-muted: #888;
  --bg: #ffffff;
  --bg-light: #f5f7fa;
  --bg-dark: #0a1628;
  --border: #e0e6ed;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.15);
  --radius: 8px;
  --radius-lg: 16px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  --container: 1200px;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

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

.section {
  padding: 80px 0;
}

/* ---------- Header ---------- */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}

.header.scrolled {
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 64px;
}

.header-inner .logo {
  flex-shrink: 0;
}

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

.logo-img {
  height: 40px;
  width: auto;
}

.nav {
  display: flex;
  gap: 6px;
  align-items: center;
  flex: 1;
  justify-content: center;
}

.nav-link {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  position: relative;
  padding: 6px 10px;
  transition: var(--transition);
  white-space: nowrap;
  border-radius: 6px;
  letter-spacing: 0.5px;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: var(--transition);
}

.nav-link:hover, .nav-link.active {
  color: var(--primary);
  background: rgba(13,71,161,0.06);
}

.nav-link:hover::after, .nav-link.active::after {
  width: 60%;
  left: 20%;
}

.header-phone {
  display: flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #e8f0fe 0%, #d2e3fc 100%);
  color: var(--primary);
  padding: 6px 14px;
  border-radius: 50px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  border: 1px solid rgba(13,71,225,0.12);
  transition: all 0.2s;
  flex-shrink: 0;
}

.header-phone i {
  font-size: 12px;
}

.header-phone:hover {
  background: linear-gradient(135deg, #d2e3fc 0%, #bbdefb 100%);
  border-color: rgba(13,71,225,0.3);
  box-shadow: 0 2px 8px rgba(13,71,225,0.15);
  transform: translateY(-1px);
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  flex-direction: column;
  gap: 5px;
}

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

/* ---------- Hero Banner ---------- */
.hero {
  position: relative;
  min-height: 35vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-top: 64px;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: 
    radial-gradient(ellipse at 20% 50%, rgba(13,71,161,0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(0,188,212,0.1) 0%, transparent 50%),
    linear-gradient(180deg, #f0f4ff 0%, #e8eef6 100%);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%230d47a1' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 800px;
  padding: 0;
  margin-top: -20px;
}

.hero-title {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 8px;
  color: var(--bg-dark);
}

.hero-title .highlight {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 16px;
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 8px;
  letter-spacing: 2px;
}

.hero-desc {
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 20px;
  text-align: left;
  max-width: 70%;
}

.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 32px;
  border-radius: 50px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: 2px solid transparent;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  border-color: transparent;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(13,71,161,0.3);
}

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

.btn-outline:hover {
  background: var(--primary);
  color: #fff;
  transform: translateY(-2px);
}

.btn-lg {
  padding: 16px 40px;
  font-size: 16px;
}

/* ---------- Section Header ---------- */
.section-header {
  text-align: center;
  margin-bottom: 56px;
}

.section-tag {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--accent);
  margin-bottom: 12px;
}

.section-title {
  font-size: 36px;
  font-weight: 800;
  color: var(--bg-dark);
  margin-bottom: 16px;
}

.section-desc {
  font-size: 16px;
  color: var(--text-light);
  max-width: 600px;
  margin: 0 auto;
}

/* ---------- Products Grid ---------- */
.products {
  background: var(--bg-light);
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.product-card {
  background: var(--bg);
  border-radius: var(--radius-lg);
  padding: 36px 28px;
  text-align: center;
  transition: var(--transition);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.product-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--card-accent, var(--primary));
  transform: scaleX(0);
  transition: var(--transition);
}

.product-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}

.product-card:hover::before {
  transform: scaleX(1);
}

.product-icon {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: #fff;
  margin: 0 auto 20px;
  background: var(--card-accent, var(--primary));
  transition: var(--transition);
}

.product-card:hover .product-icon {
  transform: scale(1.1) rotate(-5deg);
}

.product-card h3 {
  font-size: 32px;
  font-weight: 800;
  color: var(--bg-dark);
  margin-bottom: 4px;
}

.product-full {
  font-size: 14px;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 12px;
}

.product-desc {
  font-size: 14px;
  color: var(--text-light);
  line-height: 1.7;
  margin-bottom: 20px;
}

.product-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  transition: var(--transition);
}

.product-link:hover {
  color: var(--accent);
  gap: 10px;
}

/* Set each card's accent color */
.product-card:nth-child(1) { --card-accent: #1a73e8; }
.product-card:nth-child(2) { --card-accent: #7b1fa2; }
.product-card:nth-child(3) { --card-accent: #00897b; }
.product-card:nth-child(4) { --card-accent: #ef6c00; }
.product-card:nth-child(5) { --card-accent: #c62828; }
.product-card:nth-child(6) { --card-accent: #1565c0; }

/* ---------- Why Us ---------- */
.why-us {
  background: var(--bg);
}

.why-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.why-card {
  text-align: center;
  padding: 40px 24px;
  border-radius: var(--radius-lg);
  background: var(--bg-light);
  transition: var(--transition);
}

.why-card:hover {
  background: var(--bg);
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
}

.why-number {
  font-size: 56px;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
  margin-bottom: 8px;
}

.why-number span {
  font-size: 28px;
}

.why-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: #fff;
  margin: 0 auto 16px;
}

.why-card h3 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--bg-dark);
}

.why-card p {
  font-size: 14px;
  color: var(--text-light);
  line-height: 1.7;
}

/* ---------- Industries ---------- */
.industries {
  background: var(--bg-light);
}

.industries-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.industry-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg);
  padding: 20px 24px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: var(--transition);
  font-size: 16px;
  font-weight: 600;
}

.industry-item i {
  font-size: 20px;
  color: var(--accent);
}

.industry-item:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

/* ---------- CTA ---------- */
.cta {
  background: linear-gradient(135deg, var(--bg-dark), var(--primary-dark));
  color: #fff;
  text-align: center;
}

.cta-inner h2 {
  font-size: 36px;
  font-weight: 800;
  margin-bottom: 12px;
}

.cta-inner p {
  font-size: 16px;
  opacity: 0.85;
  margin-bottom: 32px;
}

.cta-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.cta .btn-primary {
  background: var(--accent);
  color: var(--bg-dark);
}

.cta .btn-primary:hover {
  background: var(--accent-light);
}

.cta .btn-outline {
  color: #fff;
  border-color: rgba(255,255,255,0.4);
}

.cta .btn-outline:hover {
  background: rgba(255,255,255,0.15);
  border-color: #fff;
}

.cta-contact {
  font-size: 14px;
  opacity: 0.7;
}

/* ---------- Footer ---------- */
.footer {
  background: #0a0f1a;
  color: rgba(255,255,255,0.7);
  padding: 60px 0 0;
}

.footer-main {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 2fr;
  gap: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.footer-logo-img {
  height: 40px;
  width: auto;
  margin-bottom: 16px;
}

.footer-desc {
  font-size: 14px;
  line-height: 1.8;
}

.footer-links h4, .footer-contact h4 {
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
}

.footer-links a {
  display: block;
  font-size: 14px;
  padding: 4px 0;
  transition: var(--transition);
}

.footer-links a:hover {
  color: var(--accent);
  padding-left: 4px;
}

.footer-contact p {
  font-size: 14px;
  padding: 4px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-contact i {
  color: var(--accent);
  width: 16px;
}

.footer-bottom {
  padding: 20px 0;
  text-align: center;
  font-size: 13px;
  opacity: 0.5;
}

.footer-icp {
  margin-top: 6px;
  font-size: 12px;
}

.footer-icp a {
  color: inherit;
  text-decoration: none;
}

.footer-icp a:hover {
  text-decoration: underline;
}

/* ---------- Back to Top ---------- */
.back-to-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(20px);
  transition: var(--transition);
  z-index: 999;
  box-shadow: var(--shadow-md);
}

.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--accent);
  transform: translateY(-3px);
}

/* ============================================
   Responsive Design
   ============================================ */

/* Tablet */
@media (max-width: 1024px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .why-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .industries-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .footer-main {
    grid-template-columns: 1fr 1fr;
  }
}

/* Mobile */
@media (max-width: 768px) {
  .nav {
    position: fixed;
    top: 72px;
    left: 0; right: 0;
    background: rgba(255,255,255,0.98);
    backdrop-filter: blur(12px);
    flex-direction: column;
    padding: 24px;
    gap: 16px;
    transform: translateY(-120%);
    transition: var(--transition);
    box-shadow: var(--shadow-md);
  }
  
  .nav.open {
    transform: translateY(0);
  }
  
  .menu-toggle {
    display: flex;
  }
  
  .header-phone {
    display: none;
  }
  
  .hero-title {
    font-size: 32px;
  }
  
  .hero-subtitle {
    font-size: 16px;
  }
  
  .section-title {
    font-size: 28px;
  }
  
  .products-grid {
    grid-template-columns: 1fr;
  }
  
  .why-grid {
    grid-template-columns: 1fr;
  }
  
  .industries-grid {
    grid-template-columns: 1fr;
  }
  
  .footer-main {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  
  .section {
    padding: 60px 0;
  }
  
  .hero {
    min-height: auto;
    padding: 60px 0;
  }
}

/* Small mobile */
@media (max-width: 480px) {
  .hero-title {
    font-size: 26px;
  }
  
  .btn-lg {
    padding: 14px 28px;
    font-size: 14px;
  }
  
  .product-card {
    padding: 28px 20px;
  }
  
  .product-card h3 {
    font-size: 26px;
  }
}

/* ---------- Featured Products ---------- */
.featured-products {
  background: var(--bg-light);
  padding-top: 8px;
  padding-bottom: 32px;
}

.featured-products .section-header {
  margin-bottom: 16px;
}

.featured-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 16px;
}

.featured-card {
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  text-decoration: none;
  color: inherit;
}

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

.featured-img-wrap {
  width: 100%;
  height: 120px;
  overflow: hidden;
  background: #f0f4f8;
  display: flex;
  align-items: center;
  justify-content: center;
}

.featured-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 16px;
  transition: var(--transition);
}

.featured-card:hover .featured-img-wrap img {
  transform: scale(1.05);
}

.featured-info {
  padding: 16px 20px 20px;
}

.featured-info h4 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.featured-info h5 {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.featured-info p {
  font-size: 12px;
  color: var(--text-light);
  line-height: 1.5;
}

@media (max-width: 768px) {
  .featured-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }
  .featured-img-wrap {
    height: 80px;
  }
}

@media (max-width: 480px) {
  .featured-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- Product Detail Page ---------- */
.product-detail {
  margin-top: 64px;
  padding: 40px 0 60px;
}

.product-detail-header {
  text-align: center;
  margin-bottom: 32px;
}

.product-detail-title {
  font-size: 32px;
  font-weight: 800;
  color: var(--bg-dark);
  margin-bottom: 8px;
}

.product-detail-subtitle {
  font-size: 16px;
  color: var(--primary);
  font-weight: 600;
}

.product-detail-body {
  max-width: 960px;
  margin: 0 auto;
  line-height: 1.8;
  color: var(--text);
  font-size: 15px;
}

.product-detail-body img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 16px 0;
}

.product-detail-body p {
  margin-bottom: 12px;
}

.product-detail-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
}

.product-detail-body td, .product-detail-body th {
  padding: 8px 12px;
  border: 1px solid #e0e0e0;
  vertical-align: top;
}

.product-detail-body .cp_div_bg,
.product-detail-body .cp_div_bg2,
.product-detail-body .cp_div_bg3 {
  padding: 24px 0;
  margin-bottom: 8px;
}

.product-detail-body .cdb_title {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 16px;
}

.product-detail-body .cdb_sc_de {
  text-indent: 2em;
  margin-bottom: 12px;
}

.product-detail-body .col-md-6,
.product-detail-body .col-sm-6 {
  width: 48%;
  display: inline-block;
  vertical-align: top;
  margin-right: 1%;
}

.product-detail-actions {
  text-align: center;
  margin-top: 40px;
  display: flex;
  gap: 16px;
  justify-content: center;
}

@media (max-width: 768px) {
  .product-detail-body .col-md-6,
  .product-detail-body .col-sm-6 {
    width: 100%;
    margin-right: 0;
  }
  
  .product-detail-title {
    font-size: 24px;
  }
}

/* ---------- Screen Reader Only (SEO friendly hidden text) ---------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
