/* ============================================================
   KDS INSTRUMENT — 工业仪器商城样式
   配色：深蓝/青色工业风
   ============================================================ */

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

:root {
  --primary:   #0ea5e9;
  --primary-d: #0284c7;
  --accent:    #10b981;
  --dark:      #0f172a;
  --dark2:     #1e293b;
  --text:      #1e293b;
  --text-sub:  #64748b;
  --bg:        #f1f5f9;
  --white:     #ffffff;
  --radius:    12px;
  --shadow:    0 4px 20px rgba(0,0,0,.06);
  --shadow-hov:0 8px 32px rgba(0,0,0,.12);
  --trans:     all .28s cubic-bezier(.4,0,.2,1);
}

html { scroll-behavior: smooth; }
body {
  font-family: "PingFang SC","Microsoft YaHei",sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- 按钮 ---------- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: var(--white);
  padding: 12px 28px;
  border-radius: 30px;
  font-weight: 700;
  font-size: 15px;
  transition: var(--trans);
  border: 2px solid transparent;
  cursor: pointer;
}
.btn-primary:hover {
  background: var(--primary-d);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(14,165,233,.35);
}

.btn-white {
  display: inline-block;
  background: rgba(255,255,255,.15);
  color: var(--white);
  padding: 10px 22px;
  border-radius: 30px;
  font-weight: 700;
  font-size: 14px;
  border: 2px solid rgba(255,255,255,.6);
  transition: var(--trans);
  backdrop-filter: blur(4px);
  cursor: pointer;
}
.btn-white:hover {
  background: var(--white);
  color: var(--primary-d);
  transform: translateY(-2px);
}

/* ---------- 顶部通知栏 ---------- */
.top-bar {
  background: var(--dark);
  color: var(--white);
  text-align: center;
  padding: 8px 16px;
  font-size: 12px;
  letter-spacing: .5px;
  border-bottom: 2px solid var(--primary);
}

/* ---------- 导航栏 ---------- */
.navbar {
  background: var(--white);
  box-shadow: 0 2px 12px rgba(0,0,0,.06);
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 64px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.logo-icon { font-size: 26px; }
.logo-text {
  font-size: 18px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: .5px;
}

.nav-links {
  display: flex;
  gap: 2px;
  flex: 1;
  justify-content: center;
}
.nav-links a {
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-sub);
  transition: var(--trans);
  white-space: nowrap;
}
.nav-links a:hover, .nav-links a.active {
  color: var(--primary);
  background: #f0f9ff;
}

.nav-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.search-box {
  display: flex;
  border: 1.5px solid #e2e8f0;
  border-radius: 24px;
  overflow: hidden;
  transition: var(--trans);
}
.search-box:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(14,165,233,.12); }
.search-box input {
  border: none; outline: none;
  padding: 8px 14px;
  font-size: 13px;
  width: 180px;
  background: transparent;
}
.search-box button {
  background: var(--primary);
  border: none;
  color: white;
  font-size: 14px;
  padding: 8px 14px;
  cursor: pointer;
  transition: var(--trans);
}
.search-box button:hover { background: var(--primary-d); }

.icon-btn {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  position: relative;
  transition: var(--trans);
}
.icon-btn:hover { background: #f0f9ff; }

/* ---------- 语言切换 ---------- */
.lang-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #f0f9ff;
  border: 1.5px solid #e2e8f0;
  border-radius: 24px;
  padding: 6px 14px;
  cursor: pointer;
  transition: var(--trans);
  white-space: nowrap;
}
.lang-toggle:hover {
  background: #e0f2fe;
  border-color: var(--primary);
}
.lang-flag { font-size: 16px; }
.lang-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}
.badge {
  position: absolute;
  top: 0; right: 0;
  background: var(--primary);
  color: white;
  font-size: 10px;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* ============================================================
   1. 轮播图 Hero
   ============================================================ */
.hero-slider {
  position: relative;
  overflow: hidden;
  height: 480px;
}
.slides-wrap {
  display: flex;
  height: 100%;
  transition: transform .6s cubic-bezier(.4,0,.2,1);
}
.slide {
  min-width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  padding: 0 80px;
  position: relative;
  overflow: hidden;
}
.slide-content {
  z-index: 2;
  color: var(--white);
  max-width: 540px;
}
.slide-tag {
  display: inline-block;
  background: rgba(14,165,233,.3);
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 16px;
  backdrop-filter: blur(4px);
  border: 1px solid rgba(14,165,233,.4);
}
.slide-content h1 {
  font-size: 44px;
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: 16px;
  text-shadow: 0 2px 16px rgba(0,0,0,.3);
}
.slide-desc {
  font-size: 15px;
  margin-bottom: 28px;
  opacity: .88;
  line-height: 1.7;
}
.slide-img {
  position: absolute;
  right: 100px;
  font-size: 180px;
  opacity: .1;
  animation: float 5s ease-in-out infinite;
  user-select: none;
}
@keyframes float {
  0%,100% { transform: translateY(0) rotate(-3deg); }
  50%      { transform: translateY(-16px) rotate(3deg); }
}

.slider-dots {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 10;
}
.dot {
  width: 10px; height: 10px;
  border-radius: 5px;
  background: rgba(255,255,255,.4);
  cursor: pointer;
  transition: var(--trans);
}
.dot.active { background: var(--white); width: 28px; }

.arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,.15);
  border: none;
  color: var(--white);
  font-size: 22px;
  padding: 12px 16px;
  border-radius: 50%;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: var(--trans);
  z-index: 10;
}
.arrow:hover { background: rgba(255,255,255,.3); }
.arrow-left  { left: 24px; }
.arrow-right { right: 24px; }

/* ============================================================
   Section 通用
   ============================================================ */
.section { padding: 64px 0 0; }
.section-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.section-header h2 {
  font-size: 26px;
  font-weight: 800;
  position: relative;
}
.section-header h2::after {
  content: '';
  display: block;
  width: 40px;
  height: 4px;
  background: var(--primary);
  border-radius: 2px;
  margin-top: 6px;
}
.view-all {
  margin-left: auto;
  color: var(--primary);
  font-size: 14px;
  font-weight: 600;
  transition: var(--trans);
}
.view-all:hover { opacity: .7; }

/* ============================================================
   2. 产品分类
   ============================================================ */
.category-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
}
.cat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px 8px;
  box-shadow: var(--shadow);
  transition: var(--trans);
  cursor: pointer;
  border: 2px solid transparent;
}
.cat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hov);
  border-color: var(--primary);
}
.cat-icon {
  width: 80px; height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(135deg,#f0f9ff,#e0f2fe);
}
.cat-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
  transition: transform .3s ease;
}
.cat-card:hover .cat-icon img {
  transform: scale(1.08);
}
.cat-card span { font-size: 13px; font-weight: 600; color: var(--text); text-align: center; }

/* ============================================================
   3. 促销活动
   ============================================================ */
.promo-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 20px;
}
.promo-card {
  border-radius: 18px;
  padding: 32px 28px;
  color: var(--white);
  position: relative;
  overflow: hidden;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  transition: var(--trans);
}
.promo-card:hover { transform: translateY(-4px); box-shadow: 0 12px 36px rgba(0,0,0,.2); }

.promo-label {
  display: inline-block;
  background: rgba(255,255,255,.2);
  padding: 3px 12px;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 8px;
}
.promo-text h3 { font-size: 22px; font-weight: 800; line-height: 1.3; margin-bottom: 14px; }

.promo-deco {
  position: absolute;
  top: 16px; right: 20px;
  font-size: 60px;
  opacity: .15;
}

.countdown {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  font-size: 13px;
}
.time-blocks {
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 800;
  font-size: 18px;
}
.time-blocks span {
  background: rgba(0,0,0,.3);
  padding: 4px 8px;
  border-radius: 6px;
  min-width: 36px;
  text-align: center;
}

/* ============================================================
   4. 热门产品
   ============================================================ */
.tab-bar { display: flex; gap: 8px; flex-wrap: wrap; }
.tab {
  background: none;
  border: 1.5px solid #e2e8f0;
  padding: 6px 18px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-sub);
  transition: var(--trans);
}
.tab.active, .tab:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--white);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
  padding-bottom: 64px;
}
.product-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--trans);
  cursor: pointer;
  position: relative;
  border: 1px solid #e2e8f0;
}
.product-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-hov);
  border-color: var(--primary);
}

.product-thumb {
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 64px;
  position: relative;
  overflow: hidden;
}

.product-badge {
  position: absolute;
  top: 10px; left: 10px;
  background: var(--primary);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 12px;
}

.product-wish {
  position: absolute;
  top: 10px; right: 10px;
  background: rgba(255,255,255,.85);
  border: none;
  width: 32px; height: 32px;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--trans);
  backdrop-filter: blur(4px);
  opacity: 0;
}
.product-card:hover .product-wish { opacity: 1; }
.product-wish:hover { transform: scale(1.15); background: #fff0f0; }

.product-info { padding: 14px 14px 16px; }
.product-name {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--dark);
}
.product-spec {
  font-size: 12px;
  color: var(--text-sub);
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.product-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.price-now {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary);
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.price-old {
  font-size: 12px;
  color: #94a3b8;
  text-decoration: line-through;
}
.inquiry-tag {
  background: #f0f9ff;
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 8px;
  border: 1px solid #e0f2fe;
}
.product-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-sub);
}
.product-rating { color: #f59e0b; }
.btn-inquiry {
  background: var(--primary);
  color: white;
  border: none;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--trans);
}
.btn-inquiry:hover { background: var(--primary-d); transform: scale(1.05); }

/* ============================================================
   5. 应用行业
   ============================================================ */
.brands-section { padding-bottom: 64px; }
.brands-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.brand-item {
  background: var(--white);
  border-radius: var(--radius);
  padding: 24px 16px;
  text-align: center;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-sub);
  box-shadow: var(--shadow);
  transition: var(--trans);
  cursor: pointer;
  border: 2px solid transparent;
  line-height: 1.6;
}
.brand-item:hover {
  color: var(--primary);
  border-color: var(--primary);
  transform: translateY(-3px);
  box-shadow: var(--shadow-hov);
}

/* ============================================================
   6. CTA / 联系我们
   ============================================================ */
.cta-section { padding-bottom: 64px; }
.cta-box {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  background: linear-gradient(135deg, var(--dark), var(--dark2));
  border-radius: 20px;
  padding: 48px;
  color: var(--white);
}
.cta-text h2 {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 16px;
}
.cta-text p {
  font-size: 15px;
  opacity: .85;
  line-height: 1.8;
  margin-bottom: 24px;
}
.cta-contacts { display: flex; flex-direction: column; gap: 10px; }
.cta-contact-item {
  font-size: 14px;
  opacity: .9;
}

.cta-form {
  background: rgba(255,255,255,.06);
  border-radius: 16px;
  padding: 32px;
  backdrop-filter: blur(8px);
}
.cta-form h3 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 20px;
}
.cta-form form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.cta-form input,
.cta-form textarea {
  padding: 12px 16px;
  border-radius: 10px;
  border: 1.5px solid rgba(255,255,255,.15);
  background: rgba(255,255,255,.06);
  color: var(--white);
  font-size: 14px;
  outline: none;
  transition: var(--trans);
  font-family: inherit;
}
.cta-form input::placeholder,
.cta-form textarea::placeholder {
  color: rgba(255,255,255,.4);
}
.cta-form input:focus,
.cta-form textarea:focus {
  border-color: var(--primary);
  background: rgba(255,255,255,.1);
}
.cta-form textarea { resize: vertical; }

/* ============================================================
   Footer
   ============================================================ */
.footer {
  background: var(--dark);
  color: rgba(255,255,255,.7);
  padding-top: 48px;
}
.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 40px;
}
.footer-col h4 {
  color: var(--white);
  font-size: 16px;
  margin-bottom: 16px;
}
.footer-col p { font-size: 14px; line-height: 1.8; }
.footer-col ul li { margin-bottom: 10px; }
.footer-col ul a { font-size: 14px; transition: color .2s; }
.footer-col ul a:hover { color: var(--primary); }

.social-icons { display: flex; gap: 14px; font-size: 22px; margin-top: 12px; }
.social-icons a { transition: transform .2s; }
.social-icons a:hover { transform: scale(1.2); }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  padding: 20px 0;
  text-align: center;
  font-size: 13px;
  color: rgba(255,255,255,.35);
}

/* ===================== 询价弹窗 ===================== */
.inquiry-modal {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15,23,42,0.45);
  z-index: 10000;
  justify-content: center;
  align-items: center;
}
.inquiry-modal.active { display: flex; }
.inquiry-modal-content {
  background: #fff;
  border-radius: 16px;
  width: 560px;
  max-width: 95vw;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.18);
  animation: modalIn 0.25s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(30px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.inquiry-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid #e2e8f0;
}
.inquiry-modal-header h3 {
  font-size: 18px;
  color: #0f172a;
  margin: 0;
}
.inquiry-modal-close {
  background: none;
  border: none;
  font-size: 26px;
  color: #94a3b8;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
}
.inquiry-modal-close:hover { color: #0f172a; }
.inquiry-modal-body { padding: 20px 24px; }
.inquiry-modal-footer {
  padding: 16px 24px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
.inquiry-product-item {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  background: #f8fafc;
  border-radius: 8px;
  margin-bottom: 8px;
  font-size: 14px;
  color: #334155;
}
.inquiry-product-item .rm {
  margin-left: auto;
  background: none;
  border: none;
  color: #dc2626;
  cursor: pointer;
  font-size: 16px;
}
.inquiry-form-row {
  margin-bottom: 14px;
}
.inquiry-form-row label {
  display: block;
  font-size: 13px;
  color: #475569;
  margin-bottom: 5px;
  font-weight: 500;
}
.inquiry-form-row input,
.inquiry-form-row textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
  font-family: inherit;
}
.inquiry-form-row input:focus,
.inquiry-form-row textarea:focus {
  border-color: #0f172a;
}
.inquiry-form-row textarea { resize: vertical; min-height: 70px; }
.inquiry-empty-msg {
  text-align: center;
  color: #94a3b8;
  padding: 30px 0;
  font-size: 14px;
}
.inquiry-empty-msg a {
  color: #0f172a;
  font-weight: 600;
  text-decoration: underline;
}

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 1024px) {
  .category-grid { grid-template-columns: repeat(4, 1fr); }
  .product-grid   { grid-template-columns: repeat(3, 1fr); }
  .promo-grid     { grid-template-columns: 1fr 1fr; }
  .footer-inner   { grid-template-columns: 1fr 1fr; }
  .cta-box        { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .search-box input { width: 100px; }
  .hero-slider { height: 320px; }
  .slide { padding: 0 24px; }
  .slide-content h1 { font-size: 28px; }
  .slide-img { display: none; }
  .category-grid { grid-template-columns: repeat(3, 1fr); }
  .product-grid   { grid-template-columns: repeat(2, 1fr); }
  .promo-grid     { grid-template-columns: 1fr; }
  .footer-inner   { grid-template-columns: 1fr; }
  .brands-row     { grid-template-columns: repeat(2, 1fr); }
  .cta-box        { padding: 24px; }
}

@media (max-width: 480px) {
  .category-grid { grid-template-columns: repeat(2, 1fr); }
}
