/* ==========================================================================
   毅博士官网 公共样式  cervical-pillow.com
   设计系统：淡蓝背景 + 专业健康蓝 + 白色卡片
   ========================================================================== */

/* ---------- 设计变量 ---------- */
:root {
  --bg: #eaf3fb;
  --bg-soft: #f5fafe;
  --primary: #2f7fc1;
  --primary-dark: #1f5f99;
  --primary-deep: #174a78;
  --primary-light: #dcecf8;
  --accent: #56a6dd;
  --text: #23364d;
  --text-soft: #5b7186;
  --border: #d5e4f2;
  --white: #ffffff;
  --shadow: 0 8px 24px rgba(31, 95, 153, 0.09);
  --shadow-hover: 0 14px 32px rgba(31, 95, 153, 0.16);
  --radius: 12px;
  --radius-lg: 18px;
  --nav-h: 72px;
  --maxw: 1200px;
}

/* ---------- 重置 ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background-color: var(--bg);
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; font-size: 16px; }

/* ---------- 通用容器 ---------- */
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.section { padding: 64px 0; }
.section-soft { background: var(--bg-soft); }
.text-center { text-align: center; }

/* 区块标题 */
.section-head { text-align: center; margin-bottom: 44px; }
.section-head h2 {
  font-size: 30px;
  font-weight: 700;
  color: var(--primary-deep);
  letter-spacing: 1px;
}
.section-head p {
  margin-top: 10px;
  color: var(--text-soft);
  font-size: 15px;
  letter-spacing: 2px;
}
.section-head .title-bar {
  width: 56px;
  height: 4px;
  margin: 16px auto 0;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--primary));
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-block;
  padding: 12px 32px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 1px;
  transition: all 0.25s ease;
  border: 1.5px solid transparent;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-2px); box-shadow: var(--shadow); }
.btn-outline { border-color: var(--primary); color: var(--primary); background: transparent; }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-light { background: #fff; color: var(--primary-dark); }
.btn-light:hover { background: var(--primary-light); transform: translateY(-2px); }

/* ==========================================================================
   顶部导航
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--nav-h);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 14px rgba(31, 95, 153, 0.08);
}
.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 42px; height: 42px; flex-shrink: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--primary-dark));
  display: flex; align-items: center; justify-content: center;
}
.brand-mark svg { width: 24px; height: 24px; }
.brand-name { font-size: 22px; font-weight: 700; color: var(--primary-deep); letter-spacing: 2px; }
.brand-sub { font-size: 11px; color: var(--text-soft); letter-spacing: 3px; display: block; margin-top: -4px; }

.nav-menu { display: flex; align-items: center; gap: 4px; }
.nav-item { position: relative; }
.nav-link {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 10px 14px;
  font-size: 15.5px;
  font-weight: 500;
  color: var(--text);
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
  white-space: nowrap;
}
.nav-link:hover, .nav-item.active .nav-link { color: var(--primary); background: var(--primary-light); }
.nav-link .caret { width: 10px; height: 10px; transition: transform 0.25s; }
.nav-item.has-dropdown:hover .caret { transform: rotate(180deg); }

/* 商品系列下拉 */
.nav-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  min-width: 170px;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-hover);
  border: 1px solid var(--border);
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.22s ease;
}
.nav-item.has-dropdown:hover .nav-dropdown,
.nav-item.has-dropdown.open .nav-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
.nav-dropdown a {
  display: block;
  padding: 10px 14px;
  font-size: 14.5px;
  border-radius: 8px;
  color: var(--text);
  transition: all 0.18s;
}
.nav-dropdown a:hover { background: var(--primary-light); color: var(--primary-dark); padding-left: 20px; }

/* 移动端汉堡按钮 */
.nav-toggle { display: none; width: 42px; height: 42px; align-items: center; justify-content: center; }
.nav-toggle span {
  display: block;
  width: 24px; height: 2px;
  background: var(--primary-dark);
  position: relative;
  transition: all 0.3s;
}
.nav-toggle span::before, .nav-toggle span::after {
  content: ""; position: absolute; left: 0; width: 24px; height: 2px; background: var(--primary-dark); transition: all 0.3s;
}
.nav-toggle span::before { top: -8px; }
.nav-toggle span::after { top: 8px; }
body.menu-open .nav-toggle span { background: transparent; }
body.menu-open .nav-toggle span::before { top: 0; transform: rotate(45deg); }
body.menu-open .nav-toggle span::after { top: 0; transform: rotate(-45deg); }

/* ==========================================================================
   首页 Hero
   ========================================================================== */
.hero {
  position: relative;
  min-height: 520px;
  display: flex;
  align-items: center;
  background: linear-gradient(120deg, #dcecf8 0%, #eaf3fb 45%, #f3f9fe 100%);
  overflow: hidden;
}
.hero-bg {
  position: absolute; inset: 0;
  opacity: 0.92;
}
.hero-bg img { width: 100%; height: 100%; object-fit: cover; object-position: center right; }
.hero::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(223, 238, 250, 0.96) 0%, rgba(234, 243, 251, 0.78) 42%, rgba(234, 243, 251, 0.1) 75%);
}
.hero-inner { position: relative; z-index: 2; max-width: var(--maxw); margin: 0 auto; padding: 80px 20px; width: 100%; }
.hero-content { max-width: 560px; }
.hero-tag {
  display: inline-block;
  padding: 6px 16px;
  background: rgba(47, 127, 193, 0.12);
  color: var(--primary-dark);
  border-radius: 30px;
  font-size: 13.5px;
  letter-spacing: 2px;
  margin-bottom: 22px;
}
.hero h1 {
  font-size: 44px;
  line-height: 1.28;
  font-weight: 800;
  color: var(--primary-deep);
  letter-spacing: 1px;
  margin-bottom: 20px;
}
.hero p { font-size: 17px; color: var(--text-soft); margin-bottom: 34px; max-width: 480px; }
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; }

/* 首页数据条 */
.stat-bar { background: var(--primary-dark); color: #fff; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; padding: 38px 0; text-align: center; }
.stat-num { font-size: 34px; font-weight: 800; color: #cfe6fa; }
.stat-label { font-size: 14px; color: rgba(255, 255, 255, 0.82); margin-top: 4px; letter-spacing: 1px; }

/* ==========================================================================
   卡片网格（首页介绍 / 资讯 / 产品系列）
   ========================================================================== */
.about-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: center; }
.about-img { border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); }
.about-img img { width: 100%; height: 380px; object-fit: cover; transition: transform 0.5s ease; }
.about-img:hover img { transform: scale(1.04); }
.about-text h3 { font-size: 26px; color: var(--primary-deep); margin-bottom: 18px; font-weight: 700; }
.about-text p { color: var(--text-soft); margin-bottom: 14px; }
.about-points { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 22px 0 28px; }
.about-points li { display: flex; align-items: center; gap: 9px; font-size: 15px; color: var(--text); }
.about-points svg { width: 18px; height: 18px; flex-shrink: 0; }

/* 资讯卡片 */
.news-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.news-card {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.28s, box-shadow 0.28s;
  display: flex;
  flex-direction: column;
}
.news-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-hover); }
.news-card .news-img { height: 200px; overflow: hidden; }
.news-card .news-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s; }
.news-card:hover .news-img img { transform: scale(1.06); }
.news-body { padding: 22px 22px 26px; flex: 1; display: flex; flex-direction: column; }
.news-date { font-size: 13px; color: var(--accent); letter-spacing: 1px; margin-bottom: 8px; }
.news-body h4 { font-size: 17.5px; color: var(--primary-deep); margin-bottom: 10px; font-weight: 700; line-height: 1.5; }
.news-body p { font-size: 14px; color: var(--text-soft); flex: 1; }
.news-more { margin-top: 14px; font-size: 14px; color: var(--primary); font-weight: 600; }

/* 产品系列卡片 */
.series-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.series-card {
  background: #fff;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.28s, box-shadow 0.28s;
}
.series-card:hover { transform: translateY(-7px); box-shadow: var(--shadow-hover); }
.series-card .series-img { height: 240px; overflow: hidden; background: var(--primary-light); }
.series-card .series-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s; }
.series-card:hover .series-img img { transform: scale(1.06); }
.series-body { padding: 22px 24px 26px; }
.series-body h4 { font-size: 19px; color: var(--primary-deep); font-weight: 700; margin-bottom: 8px; }
.series-body .series-items { font-size: 13.5px; color: var(--text-soft); margin-bottom: 16px; line-height: 1.6; }
.series-link { font-size: 14px; color: var(--primary); font-weight: 600; display: inline-flex; align-items: center; gap: 5px; }
.series-link svg { width: 14px; height: 14px; transition: transform 0.2s; }
.series-card:hover .series-link svg { transform: translateX(4px); }

/* CTA 区 */
.cta-band {
  background: linear-gradient(120deg, var(--primary), var(--primary-dark));
  color: #fff;
  padding: 54px 0;
}
.cta-band .container { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.cta-band h3 { font-size: 25px; font-weight: 700; margin-bottom: 6px; }
.cta-band p { color: rgba(255, 255, 255, 0.85); font-size: 15px; }

/* ==========================================================================
   内页公共
   ========================================================================== */
.page-banner {
  background: linear-gradient(120deg, var(--primary-dark), var(--accent));
  color: #fff;
  padding: 64px 0 56px;
  text-align: center;
}
.page-banner h1 { font-size: 34px; font-weight: 800; letter-spacing: 2px; margin-bottom: 10px; }
.page-banner p { font-size: 15px; color: rgba(255, 255, 255, 0.85); letter-spacing: 1px; }
.breadcrumb { font-size: 13.5px; color: rgba(255,255,255,0.8); margin-top: 12px; }
.breadcrumb a:hover { text-decoration: underline; }

.content-card {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 44px;
  margin-bottom: 32px;
}
.content-card h2 { font-size: 24px; color: var(--primary-deep); margin: 26px 0 14px; font-weight: 700; }
.content-card h2:first-child { margin-top: 0; }
.content-card p { color: var(--text-soft); margin-bottom: 14px; }
.content-img { border-radius: var(--radius); overflow: hidden; margin: 24px 0; }
.content-img img { width: 100%; }

/* 产品列表（商品系列页） */
.product-category { margin-bottom: 56px; scroll-margin-top: calc(var(--nav-h) + 20px); }
.product-category > h2 {
  font-size: 23px;
  color: var(--primary-deep);
  padding-bottom: 12px;
  border-bottom: 2px solid var(--primary-light);
  margin-bottom: 26px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.product-category > h2::before {
  content: "";
  width: 6px; height: 24px;
  border-radius: 3px;
  background: var(--primary);
}
.product-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.product-card {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.25s, box-shadow 0.25s;
}
.product-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-hover); }
.product-card .product-img { height: 180px; background: var(--primary-light); overflow: hidden; }
.product-card .product-img img { width: 100%; height: 100%; object-fit: cover; }
.product-card .product-name { padding: 15px 16px; font-size: 15px; font-weight: 600; color: var(--text); text-align: center; }

/* ==========================================================================
   表单（代理商加盟）
   ========================================================================== */
.form-wrap { max-width: 820px; margin: 0 auto; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 24px; }
.form-group { display: flex; flex-direction: column; }
.form-group.full { grid-column: 1 / -1; }
.form-group label { font-size: 14.5px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.form-group label .req { color: #d9534f; margin-left: 3px; }
.form-group input, .form-group select, .form-group textarea {
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--bg-soft);
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(47, 127, 193, 0.13);
  background: #fff;
}
.form-group textarea { resize: vertical; min-height: 110px; }
.form-tip { font-size: 13px; color: var(--text-soft); margin-top: 8px; }
.form-actions { margin-top: 28px; text-align: center; }
.form-actions .btn { min-width: 180px; }
.form-note {
  margin-top: 26px;
  padding: 18px 22px;
  background: var(--primary-light);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--primary-dark);
}

/* 提示消息 */
.toast {
  position: fixed;
  top: 90px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: var(--primary-deep);
  color: #fff;
  padding: 13px 30px;
  border-radius: 10px;
  font-size: 15px;
  box-shadow: var(--shadow-hover);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
  z-index: 2000;
}
.toast.show { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.toast.success { background: #2e8b57; }
.toast.error { background: #c0392b; }

/* ==========================================================================
   联系我们 / 售后服务
   ========================================================================== */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.contact-list li {
  display: flex;
  gap: 16px;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}
.contact-list li:last-child { border-bottom: none; }
.contact-icon {
  width: 46px; height: 46px; flex-shrink: 0;
  border-radius: 10px;
  background: var(--primary-light);
  display: flex; align-items: center; justify-content: center;
}
.contact-icon svg { width: 22px; height: 22px; }
.contact-list h4 { font-size: 16px; color: var(--primary-deep); margin-bottom: 4px; font-weight: 700; }
.contact-list p, .contact-list a { font-size: 15px; color: var(--text-soft); }
.contact-list a:hover { color: var(--primary); }
.map-box {
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-height: 340px;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  color: var(--primary-dark);
  padding: 30px;
  text-align: center;
}
.map-box svg { width: 56px; height: 56px; }

.qr-box { text-align: center; padding: 20px; }
.qr-box .qr-img {
  max-width: 280px;
  margin: 0 auto 20px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.qr-box .qr-img img { width: 100%; }
.qr-box h3 { font-size: 21px; color: var(--primary-deep); margin-bottom: 10px; }
.qr-box p { color: var(--text-soft); font-size: 15px; }

/* ==========================================================================
   页脚
   ========================================================================== */
.site-footer { background: var(--primary-deep); color: rgba(255, 255, 255, 0.82); padding: 56px 0 0; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 36px; padding-bottom: 40px; }
.footer-brand .brand-name { color: #fff; }
.footer-brand p { font-size: 14px; margin-top: 16px; color: rgba(255,255,255,0.7); max-width: 280px; }
.footer-col h4 { color: #fff; font-size: 16px; margin-bottom: 18px; font-weight: 700; letter-spacing: 1px; }
.footer-col ul li { margin-bottom: 10px; font-size: 14px; }
.footer-col a { color: rgba(255,255,255,0.72); transition: color 0.2s; }
.footer-col a:hover { color: #fff; }
.footer-col p { font-size: 14px; color: rgba(255,255,255,0.72); margin-bottom: 10px; }
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding: 20px 0;
  font-size: 13px;
  color: rgba(255,255,255,0.55);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
.footer-bottom a:hover { color: #fff; }

/* ==========================================================================
   可视化编辑模式
   ========================================================================== */
.edit-toolbar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 1500;
  background: var(--primary-deep);
  color: #fff;
  padding: 12px 20px;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.2);
}
body.edit-mode .edit-toolbar { display: flex; }
body.edit-mode { padding-bottom: 64px; }
.edit-toolbar .btn { padding: 8px 20px; font-size: 14px; }
.edit-toolbar .tip { font-size: 13.5px; color: rgba(255,255,255,0.8); }
body.edit-mode [data-edit] {
  outline: 2px dashed var(--accent);
  outline-offset: 3px;
  cursor: text;
  background: rgba(86, 166, 221, 0.07);
}
body.edit-mode [data-edit]:focus { outline-color: var(--primary); background: #fff; }
[data-edit-img]:not(.hero-bg) { position: relative; }
body.edit-mode [data-edit-img]::after {
  content: "点击更换图片";
  position: absolute;
  bottom: 8px; left: 50%;
  transform: translateX(-50%);
  background: rgba(23, 74, 120, 0.88);
  color: #fff;
  font-size: 13px;
  padding: 6px 16px;
  border-radius: 6px;
  pointer-events: none;
}
.hidden-file { display: none; }
.admin-entry {
  position: fixed;
  right: 12px; bottom: 12px;
  width: 14px; height: 14px;
  z-index: 900;
  opacity: 0.12;
  border-radius: 50%;
  background: var(--primary);
}
.admin-entry:hover { opacity: 0.4; }

/* ==========================================================================
   响应式
   ========================================================================== */
@media (max-width: 992px) {
  .series-grid { grid-template-columns: repeat(2, 1fr); }
  .product-grid { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .about-grid { grid-template-columns: 1fr; gap: 32px; }
  .about-img img { height: 300px; }
  .contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  .nav-menu {
    position: fixed;
    top: var(--nav-h);
    left: 0; right: 0;
    background: #fff;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 10px 16px 24px;
    box-shadow: var(--shadow);
    max-height: calc(100vh - var(--nav-h));
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.3s ease;
  }
  body.menu-open .nav-menu { transform: translateX(0); }
  .nav-link { padding: 13px 14px; justify-content: space-between; }
  .nav-dropdown {
    position: static;
    transform: none;
    opacity: 1;
    visibility: visible;
    box-shadow: none;
    border: none;
    background: var(--bg-soft);
    display: none;
    min-width: 0;
    margin: 0 8px;
  }
  .nav-item.has-dropdown.open .nav-dropdown { display: block; }
  .nav-item.has-dropdown:hover .nav-dropdown { transform: none; }

  .hero { min-height: 440px; }
  .hero-bg { background-position: center; }
  .hero::after { background: rgba(234, 243, 251, 0.72); }
  .hero h1 { font-size: 31px; }
  .hero p { font-size: 15.5px; }
  .hero-inner { padding: 56px 20px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 26px; }
  .section { padding: 46px 0; }
  .section-head h2 { font-size: 25px; }
  .news-grid { grid-template-columns: 1fr; }
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .content-card { padding: 26px 20px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-group.full { grid-column: auto; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .cta-band .container { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 420px) {
  .product-grid { grid-template-columns: 1fr; }
  .series-grid { grid-template-columns: 1fr; }
  .about-points { grid-template-columns: 1fr; }
  .hero h1 { font-size: 27px; }
}
