/* ========================================
   Highmax Industrial - Main Stylesheet
   上海海脉实业有限公司
   Responsive Design (PC + Mobile)
   ======================================== */

/* --- CSS Custom Properties --- */
:root {
  --primary: #1a365d;
  --primary-light: #2c5282;
  --primary-dark: #0f2440;
  --accent: #c53030;
  --accent-light: #e53e3e;
  --bg: #f7fafc;
  --bg-card: #ffffff;
  --text: #2d3748;
  --text-light: #718096;
  --text-lighter: #a0aec0;
  --border: #e2e8f0;
  --shadow: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 25px -5px rgba(0,0,0,0.12);
  --shadow-xl: 0 20px 40px -10px rgba(0,0,0,0.15);
  --radius: 10px;
  --radius-sm: 6px;
  --max-width: 1200px;
  --header-height: 72px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC", "Noto Sans JP", "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary-light); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--accent); }
ul, ol { list-style: none; }

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

/* --- Header --- */
.header {
  background: linear-gradient(180deg, var(--primary-dark) 0%, var(--primary) 100%);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}
.header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
}
.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
.logo::before {
  content: '◆';
  color: var(--accent);
  font-size: 0.9rem;
  margin-right: 2px;
}
.logo:hover { color: #fff; }

/* --- Navigation --- */
.nav { display: flex; align-items: center; gap: 0; }
.nav a {
  color: rgba(255,255,255,0.8);
  padding: 8px 18px;
  font-size: 0.9rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  position: relative;
}
.nav a::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 18px;
  right: 18px;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform 0.3s ease;
  border-radius: 1px;
}
.nav a:hover, .nav a.active {
  color: #fff;
  background: rgba(255,255,255,0.08);
}
.nav a:hover::after, .nav a.active::after {
  transform: scaleX(1);
}

/* Language Switcher */
.lang-switch {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-left: 16px;
  padding-left: 16px;
  border-left: 1px solid rgba(255,255,255,0.15);
}
.lang-switch a {
  padding: 4px 10px;
  font-size: 0.78rem;
  border-radius: 4px;
  font-weight: 600;
}
.lang-switch a::after { display: none; }
.lang-switch a.active {
  background: rgba(255,255,255,0.15);
  color: #fff;
}

/* Hamburger Menu */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
  background: none;
  border: none;
}
.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: var(--transition);
}

/* --- Hero Section --- */
.hero {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 40%, var(--primary-light) 100%);
  color: #fff;
  padding: 90px 0 100px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(255,255,255,0.03) 0%, transparent 70%);
  border-radius: 50%;
}
.hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--primary-light), var(--accent));
}
.hero h1 {
  font-size: 2.8rem;
  font-weight: 800;
  margin-bottom: 20px;
  letter-spacing: 2px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.hero p {
  font-size: 1.15rem;
  opacity: 0.88;
  max-width: 640px;
  margin: 0 auto;
  line-height: 1.9;
  letter-spacing: 0.3px;
}

/* --- Section --- */
.section { padding: 64px 0; }
.section-alt { background: var(--bg-card); }
.section-title {
  font-size: 1.9rem;
  color: var(--primary);
  text-align: center;
  margin-bottom: 44px;
  position: relative;
  padding-bottom: 18px;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 50px;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--primary-light));
  border-radius: 2px;
}

/* --- Category Cards --- */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
}
.category-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 36px 24px 28px;
  text-align: center;
  box-shadow: var(--shadow);
  transition: var(--transition);
  border: 1px solid transparent;
  position: relative;
  overflow: hidden;
}
.category-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  transform: scaleX(0);
  transition: transform 0.3s ease;
}
.category-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-xl);
  border-color: rgba(44,82,130,0.1);
}
.category-card:hover::before {
  transform: scaleX(1);
}
.category-card .icon {
  font-size: 2.6rem;
  margin-bottom: 16px;
  display: block;
}
.category-card h3 {
  font-size: 1.1rem;
  color: var(--primary);
  margin-bottom: 8px;
  font-weight: 600;
}
.category-card p {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 20px;
  line-height: 1.6;
}
.category-card .btn {
  display: inline-block;
  padding: 9px 22px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  transition: var(--transition);
  box-shadow: 0 2px 6px rgba(26,54,93,0.3);
}
.category-card .btn:hover {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(197,48,48,0.35);
  transform: translateY(-1px);
}

/* --- Product Grid --- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 24px;
}
.product-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}
.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(44,82,130,0.15);
}
.product-card .card-body {
  padding: 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.product-card h3 {
  font-size: 1.05rem;
  color: var(--primary);
  margin-bottom: 8px;
  font-weight: 600;
}
.product-card .formula {
  font-size: 0.82rem;
  color: var(--text-light);
  margin-bottom: 12px;
  font-family: "Courier New", monospace;
  background: var(--bg);
  padding: 4px 10px;
  border-radius: 4px;
  display: inline-block;
  width: fit-content;
}
.product-card .desc {
  font-size: 0.85rem;
  color: var(--text-light);
  flex: 1;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.7;
}
.product-card .card-footer {
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.product-card .card-footer a {
  font-size: 0.85rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.product-card .card-footer a::after {
  content: '';
  display: inline-block;
  width: 0;
  height: 0;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 5px solid var(--primary-light);
  transition: var(--transition);
}
.product-card .card-footer a:hover::after {
  border-left-color: var(--accent);
  margin-left: 4px;
}

/* --- Breadcrumb --- */
.breadcrumb {
  padding: 16px 0;
  font-size: 0.85rem;
  color: var(--text-light);
}
.breadcrumb a { color: var(--primary-light); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb span { margin: 0 8px; color: var(--text-lighter); }

/* --- Product Detail --- */
.product-detail {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 44px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.product-detail h1 {
  font-size: 1.9rem;
  color: var(--primary);
  margin-bottom: 28px;
  padding-bottom: 18px;
  border-bottom: 2px solid var(--border);
  font-weight: 700;
  letter-spacing: 0.5px;
}
.product-detail .meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 36px;
}
.product-detail .meta-item {
  padding: 18px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--primary-light);
  transition: var(--transition);
}
.product-detail .meta-item:hover {
  border-left-color: var(--accent);
  box-shadow: var(--shadow);
}
.product-detail .meta-item .label {
  font-size: 0.78rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
  font-weight: 500;
}
.product-detail .meta-item .value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.5;
}

/* --- Spec Table --- */
.spec-section {
  margin-top: 36px;
}
.spec-section h2 {
  font-size: 1.35rem;
  color: var(--primary);
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}
.spec-section h2::before {
  content: '';
  width: 4px;
  height: 22px;
  background: var(--accent);
  border-radius: 2px;
}
.spec-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}
.spec-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  min-width: 600px;
}
.spec-table thead th {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: #fff;
  padding: 14px 16px;
  text-align: center;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: 0.3px;
}
.spec-table thead th:first-child {
  border-radius: var(--radius-sm) 0 0 0;
}
.spec-table thead th:last-child {
  border-radius: 0 var(--radius-sm) 0 0;
}
.spec-table tbody td {
  padding: 11px 16px;
  border-bottom: 1px solid #edf2f7;
  text-align: center;
  transition: background 0.15s ease;
}
.spec-table tbody tr:hover { background: #ebf4ff; }
.spec-table tbody tr:nth-child(even) { background: #fafcff; }
.spec-table tbody tr:nth-child(even):hover { background: #ebf4ff; }
.spec-table .section-header td {
  background: linear-gradient(135deg, #edf2f7 0%, #e2e8f0 100%);
  font-weight: 700;
  color: var(--primary);
  text-align: center;
  padding: 11px 16px;
  letter-spacing: 0.3px;
}
.spec-table .row-label {
  font-weight: 600;
  text-align: left;
  background: #f8fafc;
  white-space: nowrap;
  color: var(--text);
}

/* --- Info Pages (About/Contact) --- */
.info-page {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 44px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  line-height: 1.9;
}
.info-page h1 {
  font-size: 1.9rem;
  color: var(--primary);
  margin-bottom: 28px;
  padding-bottom: 18px;
  border-bottom: 2px solid var(--border);
  font-weight: 700;
}
.info-page h2 {
  font-size: 1.3rem;
  color: var(--primary);
  margin: 28px 0 14px;
  font-weight: 600;
}
.info-page p { margin-bottom: 16px; }

/* --- Footer --- */
.footer {
  background: linear-gradient(180deg, var(--primary-dark) 0%, #0a1929 100%);
  color: rgba(255,255,255,0.7);
  padding: 48px 0 0;
  font-size: 0.9rem;
}
.footer .container {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
}
.footer h4 {
  color: #fff;
  margin-bottom: 18px;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}
.footer a { color: rgba(255,255,255,0.7); }
.footer a:hover { color: #fff; }
.footer .copyright {
  text-align: center;
  padding: 24px 0;
  margin-top: 36px;
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 0.8rem;
  color: rgba(255,255,255,0.45);
}

/* --- Back Link --- */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 24px;
  font-size: 0.9rem;
  color: var(--text-light);
  padding: 6px 0;
  border-bottom: 1px dashed transparent;
  transition: var(--transition);
}
.back-link:hover {
  color: var(--primary);
  border-bottom-color: var(--primary-light);
}

/* --- Responsive --- */
@media (max-width: 768px) {
  :root { --header-height: 62px; }

  .hamburger { display: flex; }

  .nav {
    display: none;
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--primary-dark);
    flex-direction: column;
    padding: 16px;
    gap: 4px;
    box-shadow: var(--shadow-xl);
    animation: slideDown 0.3s ease;
  }
  @keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
  }
  .nav.open { display: flex; }
  .nav a {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
  }
  .nav a::after { display: none; }
  .lang-switch {
    margin-left: 0;
    padding-left: 0;
    border-left: none;
    padding-top: 10px;
    margin-top: 10px;
    border-top: 1px solid rgba(255,255,255,0.15);
  }

  .hero { padding: 52px 0 60px; }
  .hero h1 { font-size: 1.7rem; letter-spacing: 1px; }
  .hero p { font-size: 0.95rem; }

  .section { padding: 44px 0; }
  .section-title { font-size: 1.4rem; margin-bottom: 28px; }

  .category-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }
  .category-card { padding: 24px 16px 20px; }
  .category-card .icon { font-size: 2rem; }
  .category-card h3 { font-size: 0.95rem; }

  .product-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .product-detail {
    padding: 24px 18px;
  }
  .product-detail h1 { font-size: 1.4rem; }
  .product-detail .meta {
    grid-template-columns: 1fr;
  }

  .info-page { padding: 24px 18px; }
  .info-page h1 { font-size: 1.4rem; }

  .footer .container {
    grid-template-columns: 1fr;
    gap: 28px;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .category-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .category-card { padding: 18px 12px 16px; }
  .category-card .icon { font-size: 1.5rem; margin-bottom: 10px; }
  .category-card h3 { font-size: 0.85rem; }
  .category-card p { font-size: 0.75rem; margin-bottom: 12px; }
  .category-card .btn { padding: 7px 14px; font-size: 0.75rem; }
  .hero h1 { font-size: 1.4rem; }
  .hero p { font-size: 0.88rem; }
}

/* --- Utilities --- */
.text-center { text-align: center; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
