/* 新海发医药 · 静态企业站公共样式（无外部依赖） */
:root{
  --brand:#176694; --brand-dark:#0f4b6e; --accent:#12a093;
  --ink:#21313e; --muted:#66798a; --line:#dfe8ee; --bg:#f5f8fa;
  --white:#fff; --radius:12px; --shadow:0 8px 26px rgba(16,58,84,.08);
  --max:1160px;
}
*,*::before,*::after{box-sizing:border-box}
html{scroll-behavior:smooth}
body{margin:0;font:16px/1.75 -apple-system,BlinkMacSystemFont,"Microsoft YaHei","PingFang SC","Helvetica Neue",Arial,sans-serif;color:var(--ink);background:var(--white);-webkit-text-size-adjust:100%}
img{max-width:100%;display:block}
a{color:var(--brand);text-decoration:none}
a:hover{color:var(--brand-dark)}
ul{margin:0;padding:0;list-style:none}
h1,h2,h3,h4{line-height:1.35;margin:0;color:var(--ink)}
p{margin:0 0 1em}
:focus-visible{outline:2px solid var(--accent);outline-offset:3px}
.container{width:calc(100% - 40px);max-width:var(--max);margin:0 auto}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.text-muted{color:var(--muted)}
.center{text-align:center}

/* ---------- 头部 ---------- */
.site-header{position:sticky;top:0;z-index:50;background:rgba(255,255,255,.96);border-bottom:1px solid var(--line);backdrop-filter:blur(8px)}
.header-inner{display:flex;align-items:center;gap:24px;min-height:72px}
.logo{display:flex;align-items:center;gap:10px;flex:0 0 auto;color:var(--brand-dark)}
.logo:hover{color:var(--brand-dark)}
.logo-mark {
  width: 38px;
  height: 38px;
  display: block;           /* 或 inline-flex */
  background: transparent;  /* 或直接删掉 background */
}
.logo-text strong{display:block;font-size:17px;line-height:1.2;letter-spacing:.5px}
.logo-text small{display:block;font-size:11px;color:var(--muted);letter-spacing:2px}
.site-nav{margin-left:auto;display:flex;align-items:center;gap:2px;flex-wrap:wrap}
.site-nav a{display:block;padding:9px 12px;border-radius:8px;font-size:15px;color:#3d4d5b}
.site-nav a:hover,.site-nav a.active{background:#eaf4f9;color:var(--brand)}
.header-tel{flex:0 0 auto;font-weight:700;color:var(--brand);font-size:15px;white-space:nowrap}
.nav-toggle{display:none;margin-left:auto;width:42px;height:42px;border:1px solid var(--line);border-radius:9px;background:#fff;cursor:pointer;padding:9px}
.nav-toggle span{display:block;height:2px;background:var(--ink);border-radius:2px;margin:5px 0}

/* ---------- 通用区块 ---------- */
.section{padding:70px 0}
.section.alt{background:var(--bg)}
.section-head{max-width:760px;margin:0 auto 38px;text-align:center}
.eyebrow{display:inline-block;color:var(--accent);font-size:13px;font-weight:700;letter-spacing:3px;margin-bottom:10px}
.section-head h2{font-size:clamp(25px,3.2vw,34px);margin-bottom:12px}
.section-head p{color:var(--muted);margin:0}
.lead{font-size:17px;color:var(--muted)}
.grid{display:grid;gap:22px}
.grid-2{grid-template-columns:repeat(2,minmax(0,1fr))}
.grid-3{grid-template-columns:repeat(3,minmax(0,1fr))}
.grid-4{grid-template-columns:repeat(4,minmax(0,1fr))}
.card{background:#fff;border:1px solid var(--line);border-radius:var(--radius);padding:26px;box-shadow:var(--shadow)}
.card h3{font-size:19px;margin-bottom:10px}
.card p{color:var(--muted);margin-bottom:0;font-size:15px}
.card .icon{width:46px;height:46px;border-radius:12px;background:#e8f5f7;color:var(--accent);display:grid;place-items:center;margin-bottom:16px;font-size:22px;font-weight:800}
.divider{height:3px;width:48px;background:var(--accent);border-radius:3px;margin:16px 0 22px}
.center .divider{margin-left:auto;margin-right:auto}
.note{font-size:13px;color:var(--muted)}

/* ---------- 按钮 ---------- */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:11px 20px;border-radius:9px;border:1px solid transparent;font-size:15px;font-weight:600;cursor:pointer;line-height:1.4;transition:.18s ease}
.btn-primary{background:var(--brand);color:#fff}
.btn-primary:hover{background:var(--brand-dark);color:#fff}
.btn-ghost{background:#fff;border-color:var(--brand);color:var(--brand)}
.btn-ghost:hover{background:#eaf4f9;color:var(--brand-dark)}
.btn-sm{padding:8px 14px;font-size:14px}
.btn-row{display:flex;flex-wrap:wrap;gap:12px}

/* ---------- 图片占位：JS 检测到真实照片会自动加 .is-real，去掉全部占位效果 ---------- */
.ph{position:relative;overflow:hidden;border-radius:var(--radius);background:linear-gradient(135deg,#eef4f8,#e1ebf2);border:1px dashed #b9cbd8;display:grid;place-items:center;min-height:160px}
.ph img{width:100%;height:100%;object-fit:cover;opacity:.32}
.ph-label{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);background:rgba(255,255,255,.92);border:1px solid var(--line);color:#4c6070;padding:8px 14px;border-radius:8px;font-size:13px;font-weight:700;white-space:nowrap;max-width:92%;overflow:hidden;text-overflow:ellipsis}
.ph-license .ph-label{border-color:#d9b46a;color:#8a6420;background:rgba(255,251,238,.95)}
/* 真实照片：不透明、不裁切、不遮挡，按原图比例完整显示（营业执照上的字不会被切掉） */
.ph.is-real{aspect-ratio:auto;min-height:0;display:block;background:none;border:0}
.ph.is-real img{opacity:1;object-fit:contain;width:100%;height:auto}
.ph.is-real .ph-label{display:none}
.cert-card .ph.is-real{border:0}
.ratio-43{aspect-ratio:4/3}
.ratio-32{aspect-ratio:3/2}
.ratio-169{aspect-ratio:16/9}

/* ---------- 首页 ---------- */
.hero{background:linear-gradient(180deg,#f0f7fa 0%,#fff 100%);padding:64px 0 56px;overflow:hidden}
.hero-grid{display:grid;grid-template-columns:1.05fr .95fr;gap:48px;align-items:center}
.hero h1{font-size:clamp(30px,4.4vw,48px);letter-spacing:.5px;margin:14px 0 18px}
.hero h1 em{font-style:normal;color:var(--brand)}
.hero .slogan{font-size:18px;color:var(--accent);font-weight:700;letter-spacing:2px;margin-bottom:18px}
.hero .lead{max-width:540px}
.hero-figure{margin:0}
.hero-figure .ph{border-radius:16px;box-shadow:var(--shadow)}
.stats{display:flex;gap:26px;flex-wrap:wrap;margin-top:26px;padding-top:22px;border-top:1px solid var(--line)}
.stats b{display:block;font-size:19px;color:var(--brand)}
.stats span{font-size:13px;color:var(--muted)}
.business-card .ph{margin-bottom:18px}
.advantage{display:flex;gap:16px;align-items:flex-start}
.advantage .num{flex:0 0 38px;height:38px;border-radius:50%;background:var(--brand);color:#fff;display:grid;place-items:center;font-weight:700}
.advantage h3{font-size:18px;margin:4px 0 6px}

/* ---------- 通用内页横幅 ---------- */
.page-banner{background:linear-gradient(120deg,var(--brand-dark),var(--brand) 60%,var(--accent));color:#fff;padding:52px 0 46px}
.page-banner h1{color:#fff;font-size:clamp(27px,3.5vw,36px);margin:8px 0 8px}
.page-banner p{color:rgba(255,255,255,.85);margin:0}
.crumb{font-size:13px;color:rgba(255,255,255,.72)}
.crumb a{color:rgba(255,255,255,.9)}
.crumb a:hover{color:#fff}

/* ---------- 关于 / 时间轴 ---------- */
.about-intro{display:grid;grid-template-columns:.9fr 1.1fr;gap:40px;align-items:center}
.fact-list li{display:flex;gap:12px;padding:12px 0;border-bottom:1px dashed var(--line)}
.fact-list li:last-child{border-bottom:0}
.fact-list b{flex:0 0 84px;color:var(--muted);font-weight:600}
.timeline{position:relative;margin-top:10px;padding-left:30px}
.timeline::before{content:"";position:absolute;left:8px;top:8px;bottom:8px;width:2px;background:#d5e4ec}
.timeline li{position:relative;padding:0 0 26px 12px}
.timeline li::before{content:"";position:absolute;left:-28px;top:8px;width:12px;height:12px;border-radius:50%;background:var(--accent);border:3px solid #e6f5f3}
.timeline .when{display:inline-block;color:var(--brand);font-weight:700;font-size:14px;margin-bottom:4px}
.culture-quote{border-left:4px solid var(--accent);padding:8px 0 8px 20px;color:var(--muted)}

/* ---------- 资质证照 ---------- */
.cert-card{overflow:hidden;cursor:zoom-in}
.cert-card .ph{border-radius:0;border:0;border-bottom:1px solid var(--line)}
.cert-card:hover .ph img{transform:scale(1.02)}
.cert-card .ph img{transition:transform .25s ease}
.cert-body{padding:18px 20px 20px}
.cert-body h3{font-size:18px;margin-bottom:8px}
.cert-meta{font-size:14px;color:var(--muted);display:grid;gap:4px}
.cert-zoom{font-size:13px;color:var(--brand);margin-top:12px;display:inline-block}
.gov-link{display:flex;align-items:center;justify-content:space-between;gap:18px;flex-wrap:wrap;background:#eaf4f9;border:1px solid #cfe3ee;border-radius:var(--radius);padding:20px 24px;margin-top:30px}
.gov-link strong{font-size:17px}

/* ---------- 服务 ---------- */
.service-tabs{display:flex;gap:10px;flex-wrap:wrap;justify-content:center;margin-bottom:30px}
.service-tabs button{border:1px solid var(--line);background:#fff;color:#455767;padding:9px 18px;border-radius:99px;cursor:pointer;font-size:15px}
.service-tabs button.active,.service-tabs button:hover{background:var(--brand);border-color:var(--brand);color:#fff}
.service-item{display:none}
.service-item.show{display:block}
.service-detail{display:grid;grid-template-columns:.95fr 1.05fr;gap:34px;align-items:start}
.service-detail h3{font-size:23px;margin:6px 0 14px}
.check-list li{padding:7px 0 7px 26px;position:relative;color:#4a5c6b}
.check-list li::before{content:"";position:absolute;left:2px;top:16px;width:9px;height:9px;border-radius:50%;background:var(--accent)}
.price-note{background:var(--bg);border-radius:10px;padding:14px 16px;color:var(--muted);font-size:14px;margin:18px 0}

/* ---------- 联系 ---------- */
.contact-grid{display:grid;grid-template-columns:1fr 1fr;gap:22px}
.contact-card h3{margin-bottom:12px;font-size:19px}
.info-row{display:flex;gap:12px;padding:10px 0;border-bottom:1px dashed var(--line);font-size:15px}
.info-row:last-child{border-bottom:0}
.info-row b{flex:0 0 62px;color:var(--muted);font-weight:600}
.map-box{position:relative;aspect-ratio:4/3;background:linear-gradient(135deg,#edf3f7,#e1ebf2);border:1px dashed #b9cbd8;border-radius:10px;overflow:hidden;display:grid;place-items:center;margin-top:16px}
.map-box iframe{position:absolute;inset:0;width:100%;height:100%;border:0}
.map-hint{text-align:center;color:#5d7385;padding:20px;font-size:14px;position:relative;z-index:1}
.map-hint b{display:block;font-size:16px;margin-bottom:4px;color:var(--brand)}
.map-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:12px}
.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px}
.form-grid .full{grid-column:1/-1}
.field label{display:block;font-size:14px;font-weight:600;margin-bottom:6px}
.field input,.field textarea,.field select{width:100%;padding:11px 13px;border:1px solid #cfdae3;border-radius:9px;font:inherit;font-size:15px;color:var(--ink);background:#fff}
.field textarea{min-height:110px;resize:vertical}
.field input:focus,.field textarea:focus{border-color:var(--brand)}
.form-tip{font-size:13px;color:var(--muted);margin:14px 0 0}

/* ---------- 新闻 ---------- */
.news-list{display:grid;gap:16px;max-width:900px;margin:0 auto}
.news-item{background:#fff;border:1px solid var(--line);border-radius:var(--radius);overflow:hidden}
.news-toggle{width:100%;display:flex;gap:18px;align-items:center;text-align:left;background:#fff;border:0;padding:16px 20px;cursor:pointer;font:inherit;color:inherit}
.news-toggle:hover{background:#f8fbfc}
.news-toggle img{width:110px;height:74px;object-fit:cover;border-radius:8px;flex:0 0 auto}
.news-toggle .t{flex:1;min-width:0}
.news-toggle .t strong{display:block;font-size:17px;margin-bottom:5px}
.news-toggle .t small{color:var(--muted);font-size:13px}
.news-toggle .arrow{color:var(--brand);font-size:20px;transition:transform .2s}
.news-toggle[aria-expanded="true"] .arrow{transform:rotate(90deg)}
.news-detail{padding:0 20px 20px 148px;color:var(--muted);font-size:15px}
.news-detail[hidden]{display:none}

/* ---------- 悬浮咨询 ---------- */
.float-consult{position:fixed;right:18px;bottom:22px;z-index:60;display:flex;flex-direction:column;gap:10px;align-items:flex-end}
.float-consult>div{position:relative}
.float-btn{width:50px;height:50px;border-radius:50%;border:0;background:var(--brand);color:#fff;display:grid;place-items:center;box-shadow:0 8px 20px rgba(15,75,110,.28);cursor:pointer;font-size:13px;font-weight:700}
.float-btn.wechat{background:var(--accent)}
.float-btn:hover{filter:brightness(1.08);color:#fff}
.float-panel{display:none;position:absolute;right:62px;bottom:0;background:#fff;border:1px solid var(--line);box-shadow:var(--shadow);border-radius:12px;padding:16px 18px;width:230px;font-size:14px;color:var(--ink)}
.float-panel.open{display:block}
.float-panel b{display:block;color:var(--brand);font-size:16px;margin-bottom:6px}
.back-top{display:none;width:44px;height:44px;border-radius:50%;border:1px solid var(--line);background:#fff;color:var(--muted);cursor:pointer;font-size:18px}
.back-top.show{display:block}

/* ---------- 灯箱 ---------- */
[data-lightbox]{cursor:zoom-in}
.lightbox{position:fixed;inset:0;z-index:100;background:rgba(9,25,36,.88);display:none;align-items:center;justify-content:center;padding:24px}
.lightbox.open{display:flex}
.lightbox img{max-width:min(92vw,1000px);max-height:80vh;object-fit:contain;border-radius:6px;background:#fff}
.lightbox-cap{color:#e7f1f6;text-align:center;margin-top:12px;font-size:14px}
.lightbox-close{position:absolute;top:18px;right:22px;width:42px;height:42px;border-radius:50%;border:1px solid rgba(255,255,255,.5);background:transparent;color:#fff;font-size:26px;cursor:pointer;line-height:1}

/* ---------- 页脚 ---------- */
.site-footer{background:#123c57;color:#c9dae5;padding:56px 0 0;font-size:14px}
.footer-grid{display:grid;grid-template-columns:1.4fr 1fr 1fr;gap:36px;padding-bottom:38px}
.site-footer h4{color:#fff;font-size:16px;margin-bottom:14px}
.site-footer p{margin-bottom:8px}
.site-footer a{color:#c9dae5}
.site-footer a:hover{color:#fff}
.footer-links li{margin-bottom:7px}
.footer-bottom{border-top:1px solid rgba(255,255,255,.16);padding:18px 0;text-align:center;font-size:13px;color:#9eb9ca}
.footer-bottom a{color:#bcd8e8}

/* ---------- 响应式 ---------- */
@media (max-width:980px){
  .header-inner{flex-wrap:wrap;gap:10px;padding:10px 0}
  .nav-toggle{display:block}
  .site-nav{display:none;width:100%;margin:6px 0 4px;flex-direction:column;align-items:stretch;background:#fff;border:1px solid var(--line);border-radius:10px;padding:6px}
  .site-nav.open{display:flex}
  .site-nav a{padding:11px 14px}
  .header-tel{margin-left:0}
  .hero-grid,.about-intro,.service-detail{grid-template-columns:1fr;gap:28px}
  .grid-4{grid-template-columns:repeat(2,minmax(0,1fr))}
  .grid-3{grid-template-columns:repeat(2,minmax(0,1fr))}
  .contact-grid{grid-template-columns:1fr}
  .footer-grid{grid-template-columns:1fr 1fr}
}
@media (max-width:640px){
  .container{width:calc(100% - 30px)}
  .section{padding:50px 0}
  .hero{padding:44px 0 40px}
  .grid-2,.grid-3,.grid-4,.form-grid{grid-template-columns:1fr}
  .form-grid .full{grid-column:auto}
  .hero .btn-row .btn{flex:1 1 100%}
  .footer-grid{grid-template-columns:1fr;gap:24px}
  .news-toggle{padding:12px;gap:12px}
  .news-toggle img{width:80px;height:60px}
  .news-toggle .t strong{font-size:15px}
  .news-detail{padding:0 14px 16px}
  .float-consult{right:12px;bottom:14px}
  .float-panel{right:60px;width:200px}
  .logo-text small{display:none}
  .header-tel{display:none}
  .logo-text strong{font-size:15px}
}
/* ===== 商品列表 ===== */
.product-toolbar {
  display: flex; flex-wrap: wrap; gap: 16px;
  justify-content: space-between; align-items: center;
  margin-bottom: 24px;
}

.product-filter { display: flex; flex-wrap: wrap; gap: 10px; }
.product-filter button {
  padding: 8px 18px; border: 1px solid #ddd; border-radius: 20px;
  background: #fff; cursor: pointer; font-size: 14px; color: #333;
  transition: all .2s;
}
.product-filter button:hover { border-color: #0d6efd; color: #0d6efd; }
.product-filter button.active { background: #0d6efd; color: #fff; border-color: #0d6efd; }

.product-search {
  padding: 9px 16px; border: 1px solid #ddd; border-radius: 20px;
  font-size: 14px; min-width: 240px; outline: none; transition: border-color .2s;
}
.product-search:focus { border-color: #0d6efd; }

.product-grid {
  display: grid; gap: 24px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.product-card {
  border: 1px solid #eee; border-radius: 10px; overflow: hidden;
  background: #fff; display: flex; flex-direction: column;
  transition: box-shadow .2s, transform .2s;
}
.product-card:hover { box-shadow: 0 6px 20px rgba(0,0,0,.08); transform: translateY(-2px); }
.product-img { aspect-ratio: 4/3; background: #f6f6f6; overflow: hidden; }
.product-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product-body { padding: 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.product-cat { font-size: 12px; color: #0d6efd; }
.product-body h3 { font-size: 16px; margin: 0; line-height: 1.4; }
.product-body p { margin: 0; font-size: 13px; color: #666; line-height: 1.6; }
.product-body .btn { margin-top: auto; align-self: flex-start; }
.product-loading { grid-column: 1/-1; text-align: center; color: #999; padding: 40px 0; }

.product-pager {
  display: flex; flex-wrap: wrap; gap: 8px;
  justify-content: center; align-items: center;
  margin-top: 32px;
}
.product-pager button {
  min-width: 38px; height: 38px; padding: 0 12px;
  border: 1px solid #ddd; background: #fff; border-radius: 6px;
  cursor: pointer; font-size: 14px; color: #333; transition: all .2s;
}
.product-pager button:hover:not(:disabled) { border-color: #0d6efd; color: #0d6efd; }
.product-pager button.active { background: #0d6efd; color: #fff; border-color: #0d6efd; }
.product-pager button:disabled { opacity: .4; cursor: not-allowed; }
.product-pager .pager-gap { color: #999; padding: 0 4px; }
.product-pager .pager-info { font-size: 13px; color: #888; margin-left: 8px; }

@media (max-width: 640px) {
  .product-toolbar { flex-direction: column; align-items: stretch; }
  .product-search { min-width: 0; width: 100%; }
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; }
}
