/* ============================================
   Ruizhite Website - Global Styles
   Optimized for SEO + Conversion
   ============================================ */

/* --- CSS Variables --- */
:root {
  --primary: #1a3a5c;
  --primary-dark: #0f2440;
  --accent: #e87722;
  --accent-hover: #c95d16;
  --bg-light: #f7f8fa;
  --bg-white: #ffffff;
  --text-dark: #1a1a2e;
  --text-mid: #4a4a5e;
  --text-light: #6b7280;
  --border: #e5e7eb;
  --border-light: #f0f0f5;
  --success: #059669;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --max-width: 1200px;
  --font-sans: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  color: var(--text-dark);
  background: var(--bg-light);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s;
}
a:hover { color: var(--accent); }

img { max-width: 100%; height: auto; display: block; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* --- Header / Navigation --- */
.site-header {
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.logo {
  display: flex;
  align-items: center;
  white-space: nowrap;
}
.logo img { height: 36px; width: auto; }

.nav-links {
  display: flex;
  list-style: none;
  gap: 4px;
}

.nav-links a {
  display: block;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-mid);
  transition: all 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
  background: var(--bg-light);
  color: var(--primary-dark);
}

.nav-links a.cta-nav {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}
.nav-links a.cta-nav:hover {
  background: var(--accent-hover);
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-dark);
  margin: 5px 0;
  transition: 0.3s;
}

/* --- Hero Section --- */
.hero {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, #1e4d7a 100%);
  color: #fff;
  padding: 80px 0 64px;
  text-align: center;
}

.hero .container { max-width: 860px; }

.hero h1 {
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 20px;
}

.hero p {
  font-size: 1.1rem;
  opacity: 0.92;
  max-width: 680px;
  margin: 0 auto 32px;
  line-height: 1.7;
}

.hero-btns {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 14px 32px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.25s;
  cursor: pointer;
  border: none;
  text-align: center;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-hover); color: #fff; }

.btn-outline {
  border: 2px solid rgba(255,255,255,0.5);
  color: #fff;
  background: transparent;
}
.btn-outline:hover {
  border-color: #fff;
  background: rgba(255,255,255,0.08);
  color: #fff;
}

/* --- Section Common --- */
.section {
  padding: 64px 0;
}
.section-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 12px;
  text-align: center;
}
.section-subtitle {
  text-align: center;
  color: var(--text-light);
  margin-bottom: 40px;
  font-size: 1rem;
}

/* --- Definition Block --- */
.definition-block {
  background: var(--bg-white);
  border-left: 4px solid var(--accent);
  padding: 28px 32px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  margin-bottom: 32px;
}

.definition-block h2 {
  font-size: 1.35rem;
  color: var(--primary-dark);
  margin-bottom: 12px;
}

.definition-block p {
  color: var(--text-mid);
  font-size: 1.02rem;
  line-height: 1.75;
}

/* --- Product Grid --- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

.product-card {
  background: var(--bg-white);
  border-radius: var(--radius-md);
  padding: 32px 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  transition: all 0.3s;
  text-align: center;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
}

.product-card .icon {
  font-size: 2.5rem;
  margin-bottom: 16px;
}

.product-card h3 {
  font-size: 1.15rem;
  margin-bottom: 8px;
  color: var(--primary-dark);
}

.product-card h3 a {
  color: inherit;
}
.product-card h3 a:hover { color: var(--accent); }

.product-card p {
  font-size: 0.9rem;
  color: var(--text-light);
}

/* --- Table Styles --- */
.table-wrapper {
  overflow-x: auto;
  margin-bottom: 24px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-white);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

thead { background: var(--primary-dark); color: #fff; }

th {
  padding: 14px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.95rem;
  color: var(--text-mid);
}

tbody tr:hover { background: var(--bg-light); }

/* --- FAQ Section --- */
.faq-item {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  overflow: hidden;
}

.faq-question {
  padding: 18px 24px;
  font-weight: 600;
  font-size: 1rem;
  color: var(--primary-dark);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
}

.faq-question::after {
  content: '+';
  font-size: 1.4rem;
  color: var(--accent);
  font-weight: 700;
}

.faq-item.open .faq-question::after { content: '−'; }

.faq-answer {
  padding: 0 24px 20px;
  color: var(--text-mid);
  font-size: 0.95rem;
  line-height: 1.75;
  display: none;
}

.faq-item.open .faq-answer { display: block; }

/* --- Features / Specs List --- */
.spec-list {
  list-style: none;
  background: var(--bg-white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 8px 0;
}

.spec-list li {
  padding: 14px 24px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.95rem;
}

.spec-list li:last-child { border-bottom: none; }

.spec-list .label {
  font-weight: 600;
  color: var(--primary-dark);
  min-width: 160px;
}

.spec-list .value { color: var(--text-mid); }

/* --- Contact / CTA Section --- */
.cta-section {
  background: linear-gradient(135deg, var(--accent), #d4651a);
  color: #fff;
  text-align: center;
  padding: 64px 0;
}

.cta-section h2 { font-size: 1.75rem; margin-bottom: 12px; }
.cta-section p { opacity: 0.95; margin-bottom: 28px; font-size: 1.05rem; }

.cta-section .btn {
  background: #fff;
  color: var(--accent);
  font-weight: 700;
}
.cta-section .btn:hover { background: var(--bg-light); }

/* --- Contact Form --- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}

.contact-info h2 {
  font-size: 1.5rem;
  color: var(--primary-dark);
  margin-bottom: 16px;
}

.contact-info p { color: var(--text-mid); margin-bottom: 12px; }

.contact-info .info-item {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 0.95rem;
}

.contact-form {
  background: var(--bg-white);
  padding: 32px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.form-group { margin-bottom: 18px; }

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 0.9rem;
  color: var(--text-dark);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(232, 119, 34, 0.1);
}

.form-group textarea { resize: vertical; min-height: 120px; }

/* --- About Page --- */
.about-hero {
  background: var(--bg-white);
  padding: 64px 0;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.about-hero h1 {
  font-size: 2rem;
  color: var(--primary-dark);
  margin-bottom: 16px;
}

.about-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 24px;
}

.about-content h2 {
  font-size: 1.4rem;
  color: var(--primary-dark);
  margin-bottom: 12px;
}

.about-content p {
  color: var(--text-mid);
  margin-bottom: 20px;
  font-size: 1rem;
}

/* --- Why Choose Us --- */
.why-us {
  background: var(--bg-white);
}

.why-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
}

.why-card {
  text-align: center;
  padding: 24px 16px;
  border-radius: var(--radius-md);
  background: var(--bg-light);
  transition: transform 0.3s, box-shadow 0.3s;
}

.why-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.why-card img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 12px;
  border: 3px solid var(--accent);
}

.why-card h3 {
  font-size: 1rem;
  color: var(--primary-dark);
  margin-bottom: 6px;
}

.why-card p {
  font-size: 0.85rem;
  color: var(--text-light);
  line-height: 1.5;
}

/* --- About Page Images --- */
.about-img {
  width: 100%;
  max-width: 600px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  margin: 24px auto;
  display: block;
}

.about-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin: 24px 0 32px;
}

.about-gallery img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  object-fit: cover;
  aspect-ratio: 3/2;
  box-shadow: var(--shadow-sm);
}

/* --- Breadcrumb --- */
.breadcrumb {
  padding: 16px 24px;
  font-size: 0.85rem;
  color: var(--text-light);
  background: var(--bg-white);
  border-bottom: 1px solid var(--border-light);
}

.breadcrumb a { color: var(--text-light); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb span { color: var(--text-dark); }

/* --- Footer --- */
.site-footer {
  background: var(--primary-dark);
  color: rgba(255,255,255,0.75);
  padding: 48px 0 24px;
  font-size: 0.9rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 32px;
  margin-bottom: 32px;
}

.footer-col h4 {
  color: #fff;
  font-size: 1rem;
  margin-bottom: 14px;
}

.footer-col ul { list-style: none; }

.footer-col ul li { margin-bottom: 8px; }

.footer-col ul li a {
  color: rgba(255,255,255,0.7);
  font-size: 0.88rem;
}
.footer-col ul li a:hover { color: var(--accent); }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 20px;
  text-align: center;
  font-size: 0.82rem;
}

/* --- Utility --- */
.text-center { text-align: center; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }

.tag {
  display: inline-block;
  background: var(--bg-light);
  color: var(--primary);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  margin: 4px;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .nav-toggle { display: block; }

  .nav-links {
    display: none;
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    background: var(--bg-white);
    flex-direction: column;
    padding: 12px;
    box-shadow: var(--shadow-md);
  }

  .nav-links.open { display: flex; }

  .hero { padding: 48px 0 40px; }
  .hero h1 { font-size: 1.6rem; }

  .section { padding: 40px 0; }
  .section-title { font-size: 1.4rem; }

  .contact-grid { grid-template-columns: 1fr; }

  .footer-grid { grid-template-columns: 1fr 1fr; }

  .product-grid { grid-template-columns: 1fr; }
}

/* --- Product Images --- */
.product-img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  background: var(--bg-light);
  aspect-ratio: 3/2;
  object-fit: cover;
}

.product-card .icon {
  display: none;
}

@media (max-width: 480px) {
  .hero h1 { font-size: 1.35rem; }
  .hero-btns { flex-direction: column; align-items: center; }
  .btn { width: 100%; max-width: 280px; }
  .footer-grid { grid-template-columns: 1fr; }
  .spec-list li { flex-direction: column; align-items: flex-start; gap: 4px; }
}
