/* ============================================================
   TOPECH — Petroleum Testing Instruments & Lubricant Additives
   Global stylesheet (layout inspired by topech.top)
   ============================================================ */

:root {
  --primary: #0b3d66;
  --primary-dark: #072a48;
  --primary-light: #12518a;
  --accent: #f5a623;
  --accent-dark: #d98c0f;
  --text: #26313c;
  --text-light: #5c6b7a;
  --bg: #ffffff;
  --bg-soft: #f4f7fa;
  --border: #e3e9f0;
  --radius: 12px;
  --shadow: 0 2px 12px rgba(11, 61, 102, 0.08);
  --shadow-lg: 0 10px 30px rgba(11, 61, 102, 0.15);
  --maxw: 1180px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: "Segoe UI", "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  font-size: 16px;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 22px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: 0.5px;
}

.logo .logo-mark {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; font-weight: 800;
}

.logo small { display: block; font-size: 10px; font-weight: 500; color: var(--text-light); letter-spacing: 1.5px; }

.main-nav ul { display: flex; gap: 6px; }

.main-nav a {
  display: block;
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
  transition: all .2s;
}

.main-nav a:hover { color: var(--primary); background: var(--bg-soft); }
.main-nav a.active { color: var(--primary); background: #e8f0f8; }

.nav-toggle { display: none; background: none; border: 0; font-size: 26px; color: var(--primary); cursor: pointer; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 12px 26px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 15px;
  transition: all .2s;
  border: 2px solid transparent;
  cursor: pointer;
}

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); transform: translateY(-1px); }
.btn-outline { border-color: rgba(255,255,255,.65); color: #fff; }
.btn-outline:hover { background: rgba(255,255,255,.12); }
.btn-dark { background: var(--primary); color: #fff; }
.btn-dark:hover { background: var(--primary-light); }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 55%, var(--primary-light) 100%);
  color: #fff;
  padding: 76px 0 84px;
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute; right: -140px; top: -140px;
  width: 420px; height: 420px; border-radius: 50%;
  background: radial-gradient(circle, rgba(245,166,35,.18), transparent 70%);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 48px;
  align-items: center;
  position: relative;
  z-index: 1;
}

.hero-tag {
  display: inline-block;
  background: rgba(245, 166, 35, .18);
  border: 1px solid rgba(245, 166, 35, .5);
  color: #ffd58a;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1px;
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 18px;
}

.hero h1 { font-size: 40px; line-height: 1.2; margin-bottom: 18px; font-weight: 800; }
.hero p.lead { font-size: 17px; color: #cfe0ef; margin-bottom: 30px; max-width: 560px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

.hero-figure {
  background: #fff;
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-lg);
}
.hero-figure img { border-radius: 8px; width: 100%; aspect-ratio: 4/3; object-fit: cover; }

/* ---------- Sections ---------- */
.section { padding: 68px 0; }
.section-soft { background: var(--bg-soft); }

.section-head { text-align: center; max-width: 720px; margin: 0 auto 44px; }
.section-head h2 { font-size: 30px; color: var(--primary); margin-bottom: 10px; font-weight: 800; }
.section-head p { color: var(--text-light); font-size: 16px; }

/* ---------- Category cards ---------- */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.cat-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px 26px;
  transition: all .25s;
  display: block;
}

.cat-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-4px); border-color: var(--primary-light); }
.cat-card .cat-icon {
  width: 54px; height: 54px; border-radius: 12px;
  background: linear-gradient(135deg, #e8f0f8, #d4e4f3);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; margin-bottom: 16px;
}
.cat-card h3 { font-size: 19px; color: var(--primary); margin-bottom: 8px; }
.cat-card p { font-size: 14px; color: var(--text-light); }
.cat-card .cat-count { display: inline-block; margin-top: 14px; font-size: 13px; font-weight: 700; color: var(--accent-dark); }

/* ---------- Product cards ---------- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  gap: 24px;
}

.product-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all .25s;
  display: flex;
  flex-direction: column;
}

.product-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-4px); }

.product-card .thumb {
  background: #fff;
  height: 210px;
  display: flex; align-items: center; justify-content: center;
  padding: 14px;
  border-bottom: 1px solid var(--border);
}
.product-card .thumb img { max-height: 100%; max-width: 100%; object-fit: contain; }

.product-card .body { padding: 18px 18px 20px; flex: 1; display: flex; flex-direction: column; }
.product-card .cat-label { font-size: 12px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: var(--accent-dark); margin-bottom: 6px; }
.product-card h3 { font-size: 16.5px; color: var(--text); line-height: 1.4; margin-bottom: 8px; flex: 0; }
.product-card .brief { font-size: 13.5px; color: var(--text-light); margin-bottom: 14px; flex: 1; }
.product-card .more { font-size: 14px; font-weight: 700; color: var(--primary); }
.product-card:hover .more { color: var(--accent-dark); }

.view-all { text-align: center; margin-top: 40px; }

/* ---------- Stats ---------- */
.stats-bar {
  background: linear-gradient(120deg, var(--primary), var(--primary-light));
  color: #fff;
  padding: 44px 0;
}

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; text-align: center; }
.stat-item .num { font-size: 34px; font-weight: 800; color: #ffd58a; }
.stat-item .label { font-size: 14px; color: #cfe0ef; margin-top: 4px; }

/* ---------- Application cards ---------- */
.app-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }

.app-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  transition: all .25s;
}
.app-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-4px); }
.app-card .app-icon { font-size: 30px; margin-bottom: 14px; }
.app-card h3 { font-size: 18px; color: var(--primary); margin-bottom: 8px; }
.app-card p { font-size: 14px; color: var(--text-light); margin-bottom: 12px; }
.app-card .rec { font-size: 13px; font-weight: 700; color: var(--accent-dark); }

/* ---------- Breadcrumb & page banner ---------- */
.page-banner {
  background: linear-gradient(120deg, var(--primary-dark), var(--primary-light));
  color: #fff;
  padding: 52px 0 44px;
}
.page-banner h1 { font-size: 34px; font-weight: 800; margin-bottom: 8px; }
.page-banner p { color: #cfe0ef; max-width: 700px; }

.breadcrumb { font-size: 13.5px; color: #a9c4da; margin-bottom: 18px; }
.breadcrumb a { color: #ffd58a; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .sep { margin: 0 8px; opacity: .6; }

.breadcrumb-dark { color: var(--text-light); margin-bottom: 20px; font-size: 13.5px; }
.breadcrumb-dark a { color: var(--primary); }
.breadcrumb-dark a:hover { text-decoration: underline; }

/* ---------- Filter tabs ---------- */
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-bottom: 40px; }
.filter-btn {
  padding: 9px 20px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: #fff;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-light);
  cursor: pointer;
  transition: all .2s;
}
.filter-btn:hover { border-color: var(--primary); color: var(--primary); }
.filter-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ---------- Product detail ---------- */
.detail-top { display: grid; grid-template-columns: 1fr 1.1fr; gap: 46px; align-items: start; padding: 50px 0 20px; }

.detail-gallery .main-img {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex; align-items: center; justify-content: center;
  min-height: 380px;
  box-shadow: var(--shadow);
}
.detail-gallery .main-img img { max-height: 420px; object-fit: contain; }

.detail-gallery .thumbs { display: flex; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.detail-gallery .thumbs button {
  width: 84px; height: 84px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: #fff;
  padding: 6px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .2s;
}
.detail-gallery .thumbs button.active, .detail-gallery .thumbs button:hover { border-color: var(--primary); }
.detail-gallery .thumbs img { max-height: 100%; max-width: 100%; object-fit: contain; }

/* Product test video */
.video-wrap {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.video-wrap video {
  display: block;
  width: 100%;
  max-height: 520px;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: #0a0a0a;
}
.video-note { margin-top: 12px; font-size: 14px; color: var(--text-light); }

.detail-info .cat-label { font-size: 13px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--accent-dark); }
.detail-info h1 { font-size: 30px; color: var(--primary); line-height: 1.25; margin: 8px 0 10px; }
.detail-info .sub { font-size: 15px; font-weight: 600; color: var(--text-light); margin-bottom: 16px; }
.detail-info .desc { font-size: 15px; color: var(--text); margin-bottom: 20px; }

.tag-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 26px; }
.tag-row span {
  background: #e8f0f8;
  color: var(--primary);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 12px;
}

.detail-info .btn { margin-right: 10px; }

/* Spec table */
.spec-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.spec-table th, .spec-table td { padding: 13px 18px; text-align: left; font-size: 14.5px; border-bottom: 1px solid var(--border); vertical-align: top; }
.spec-table th { width: 34%; background: var(--bg-soft); color: var(--primary); font-weight: 700; }
.spec-table tr:last-child th, .spec-table tr:last-child td { border-bottom: 0; }

.detail-section { padding: 44px 0 8px; }
.detail-section h2 { font-size: 24px; color: var(--primary); margin-bottom: 20px; font-weight: 800; }

.feature-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.feature-item {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow);
}
.feature-item h4 { color: var(--primary); font-size: 16px; margin-bottom: 6px; }
.feature-item p { font-size: 14px; color: var(--text-light); }
.feature-item .f-icon { font-size: 24px; margin-bottom: 10px; }

/* FAQ */
.faq-item { border: 1px solid var(--border); border-radius: var(--radius); background: #fff; margin-bottom: 12px; overflow: hidden; }
.faq-q {
  width: 100%; text-align: left; background: none; border: 0;
  padding: 18px 22px; font-size: 15.5px; font-weight: 700; color: var(--text);
  cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.faq-q::after { content: "+"; font-size: 22px; color: var(--primary); transition: transform .25s; }
.faq-item.open .faq-q::after { transform: rotate(45deg); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height .3s ease; }
.faq-a-inner { padding: 0 22px 18px; font-size: 14.5px; color: var(--text-light); }

/* CTA banner */
.cta-banner {
  background: linear-gradient(120deg, var(--primary-dark), var(--primary-light));
  border-radius: 16px;
  color: #fff;
  text-align: center;
  padding: 52px 30px;
  margin: 56px 0;
}
.cta-banner h2 { font-size: 28px; margin-bottom: 10px; }
.cta-banner p { color: #cfe0ef; max-width: 640px; margin: 0 auto 26px; }
.cta-banner .btn { margin: 0 8px 10px; }

/* ---------- Resources ---------- */
.resource-list { display: grid; gap: 22px; }
.resource-card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 30px; box-shadow: var(--shadow);
}
.resource-card h3 { color: var(--primary); font-size: 20px; margin-bottom: 10px; }
.resource-card .meta { font-size: 13px; color: var(--text-light); margin-bottom: 14px; font-weight: 600; }
.resource-card p { font-size: 14.5px; color: var(--text-light); }
.resource-card a.read { display: inline-block; margin-top: 12px; font-weight: 700; color: var(--accent-dark); font-size: 14px; }

.article-body { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 36px; box-shadow: var(--shadow); }
.article-body h3 { color: var(--primary); margin: 26px 0 10px; font-size: 19px; }
.article-body p { margin-bottom: 14px; font-size: 15px; }
.article-body ol, .article-body ul { margin: 0 0 14px 22px; }
.article-body li { margin-bottom: 8px; font-size: 15px; list-style: disc; }
.article-body ol li { list-style: decimal; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
.contact-info-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 30px; box-shadow: var(--shadow); margin-bottom: 20px; }
.contact-info-card h3 { color: var(--primary); font-size: 18px; margin-bottom: 8px; }
.contact-info-card p { font-size: 14.5px; color: var(--text-light); }
.contact-info-card a { color: var(--accent-dark); font-weight: 700; }

.form-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 34px; box-shadow: var(--shadow); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 14px; font-weight: 700; margin-bottom: 6px; color: var(--text); }
.form-group input, .form-group textarea, .form-group select {
  width: 100%; padding: 11px 14px; border: 1.5px solid var(--border); border-radius: 8px;
  font-size: 14.5px; font-family: inherit; transition: border-color .2s; background: #fff;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus { outline: none; border-color: var(--primary); }

/* ---------- Footer ---------- */
.site-footer { background: var(--primary-dark); color: #b8cddd; margin-top: 70px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 36px; padding: 56px 0 40px; }
.footer-grid h4 { color: #fff; font-size: 16px; margin-bottom: 16px; }
.footer-grid p, .footer-grid li { font-size: 14px; margin-bottom: 9px; }
.footer-grid a:hover { color: #ffd58a; }
.footer-logo { font-size: 22px; font-weight: 800; color: #fff; margin-bottom: 12px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); padding: 18px 0; text-align: center; font-size: 13px; color: #8ba6bb; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero-grid, .detail-top, .contact-grid { grid-template-columns: 1fr; }
  .cat-grid, .app-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 28px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .hero h1 { font-size: 32px; }
}

@media (max-width: 680px) {
  .main-nav {
    position: fixed; inset: 68px 0 auto 0;
    background: #fff; border-bottom: 1px solid var(--border);
    display: none; box-shadow: var(--shadow-lg);
  }
  .main-nav.open { display: block; }
  .main-nav ul { flex-direction: column; padding: 12px 20px 18px; }
  .nav-toggle { display: block; }
  .cat-grid, .app-grid, .feature-grid, .form-row { grid-template-columns: 1fr; }
  .hero { padding: 52px 0 60px; }
  .hero h1 { font-size: 27px; }
  .section { padding: 48px 0; }
  .page-banner h1 { font-size: 26px; }
}
