/* 心康心血管医院 - 心电图折线风 */
:root {
  --red: #e63946;
  --red-deep: #c1121f;
  --white: #ffffff;
  --gray: #f0f0f0;
  --gray-deep: #e2e2e2;
  --text: #333333;
  --text-light: #8a8a8a;
  --shadow: 0 6px 22px rgba(230, 57, 70, 0.15);
  --font: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", sans-serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--white);
  line-height: 1.75;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ===== 心电图折线 ===== */
.ecg-line {
  position: relative;
  height: 60px;
  overflow: hidden;
}
.ecg-line svg { width: 100%; height: 100%; display: block; }
.ecg-line .trace {
  fill: none;
  stroke: var(--red);
  stroke-width: 2.5;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.ecg-line.anim .trace { stroke-dasharray: 900; stroke-dashoffset: 900; animation: trace 3.5s linear infinite; }
.ecg-line.anim .beat { fill: var(--red); animation: blink 1s ease-in-out infinite; }
@keyframes trace { to { stroke-dashoffset: 0; } }
@keyframes blink { 0%, 100% { opacity: 0.15; } 50% { opacity: 1; } }

/* ===== 顶部 ===== */
.topbar { background: var(--red); color: #fff; font-size: 13px; padding: 8px 0; }
.topbar .container { display: flex; justify-content: space-between; align-items: center; }
.topbar a { color: #ffd6d9; margin-left: 16px; }
.topbar a:hover { color: #fff; }

/* ===== 导航 ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  box-shadow: 0 3px 16px rgba(230, 57, 70, 0.12);
  border-bottom: 3px solid var(--red);
}
.nav-wrap { display: flex; align-items: center; justify-content: space-between; height: 76px; }
.logo { display: flex; align-items: center; gap: 12px; }
.logo .pulse {
  width: 48px; height: 48px;
  background: var(--red);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.logo .pulse::before, .logo .pulse::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--red);
  animation: pulseRing 2s ease-out infinite;
}
.logo .pulse::after { animation-delay: 1s; }
@keyframes pulseRing {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.9); opacity: 0; }
}
.logo h1 { font-size: 22px; color: var(--red-deep); }
.logo small { display: block; font-size: 12px; color: var(--text-light); font-weight: normal; }
.nav { display: flex; gap: 6px; }
.nav a {
  display: inline-block;
  padding: 10px 20px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  border: 2px solid transparent;
  border-radius: 6px;
  transition: all 0.3s;
}
.nav a:hover { color: var(--red); border-color: var(--red); }
.nav a.active { background: var(--red); color: #fff; }
.nav-toggle {
  display: none;
  width: 44px; height: 44px;
  border: 2px solid var(--red);
  border-radius: 8px;
  background: #fff;
  color: var(--red);
  font-size: 20px;
  cursor: pointer;
}

/* ===== Hero - 巨大心跳折线 ===== */
.hero {
  position: relative;
  z-index: 1;
  background: linear-gradient(180deg, #fff 0%, var(--gray) 100%);
  padding: 70px 0 0;
  overflow: hidden;
}
.hero-inner {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 50px;
  align-items: center;
}
.hero-text h2 {
  font-size: 44px;
  line-height: 1.3;
  color: var(--red-deep);
  margin-bottom: 10px;
}
.hero-text h2 span { position: relative; }
.hero-text h2 span::after {
  content: "";
  position: absolute;
  bottom: -4px; left: 0; right: 0;
  height: 4px;
  background: var(--red);
  border-radius: 2px;
}
.hero-text p { color: var(--text-light); font-size: 17px; margin: 16px 0 26px; }
.hero-btns { display: flex; gap: 14px; flex-wrap: wrap; }
.btn {
  display: inline-block;
  padding: 13px 30px;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 600;
  border: 2px solid var(--red);
  cursor: pointer;
  transition: all 0.3s;
}
.btn-red { background: var(--red); color: #fff; }
.btn-red:hover { background: var(--red-deep); border-color: var(--red-deep); }
.btn-outline { color: var(--red); }
.btn-outline:hover { background: var(--red); color: #fff; }
.hero-img {
  border-radius: 18px;
  overflow: hidden;
  border: 5px solid var(--red);
  box-shadow: var(--shadow);
  position: relative;
}
.hero-img img { width: 100%; height: 400px; object-fit: cover; }
.hero-img .hb {
  position: absolute;
  bottom: -18px; left: 50%;
  transform: translateX(-50%);
  background: var(--red);
  color: #fff;
  padding: 8px 20px;
  border-radius: 999px;
  font-size: 14px;
  white-space: nowrap;
  box-shadow: 0 6px 16px rgba(230, 57, 70, 0.4);
  animation: hbPulse 2s ease-in-out infinite;
}
@keyframes hbPulse {
  0%, 100% { transform: translateX(-50%) scale(1); }
  50% { transform: translateX(-50%) scale(1.06); }
}
.hero-ecg { height: 110px; margin-top: 40px; }

/* ===== 通用板块 ===== */
.section { position: relative; z-index: 1; padding: 90px 0; }
.section-alt { background: var(--gray); }
.section-head { text-align: center; margin-bottom: 50px; }
.section-head .heart-ico {
  width: 44px; height: 44px;
  margin: 0 auto 14px;
  background: var(--red);
  color: #fff;
  font-size: 20px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  animation: hbBeat 1.6s ease-in-out infinite;
}
@keyframes hbBeat {
  0%, 100% { transform: scale(1); }
  25% { transform: scale(1.15); }
  40% { transform: scale(0.95); }
  55% { transform: scale(1.1); }
}
.section-head h2 { font-size: 34px; color: var(--red-deep); }
.section-head p { color: var(--text-light); margin-top: 8px; }
.section-head .mini-ecg { max-width: 260px; height: 36px; margin: 10px auto 0; opacity: 0.7; }

/* ===== 用心守护 ===== */
.care-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; align-items: center; }
.care-img { border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); }
.care-img img { height: 400px; width: 100%; object-fit: cover; }
.care-text h3 { font-size: 28px; color: var(--red-deep); margin-bottom: 16px; }
.care-text p { color: var(--text-light); margin-bottom: 14px; }
.care-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 24px; }
.care-stat {
  background: #fff;
  border-radius: 12px;
  text-align: center;
  padding: 20px 8px;
  border-bottom: 4px solid var(--red);
  box-shadow: 0 4px 14px rgba(230, 57, 70, 0.1);
}
.care-stat b { display: block; font-size: 28px; color: var(--red-deep); }
.care-stat span { font-size: 13px; color: var(--text-light); }

/* ===== 科室 - 心形图标 + 折线小图 ===== */
.dept-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.dept-card {
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  transition: all 0.35s;
  border-top: 5px solid var(--red);
}
.dept-card:nth-child(3n) { border-top-color: var(--red-deep); }
.dept-card:hover { transform: translateY(-8px); box-shadow: var(--shadow); }
.dept-card .dhead {
  background: linear-gradient(180deg, #fff, var(--gray));
  padding: 22px 18px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.dept-card .dhead .heart {
  width: 44px; height: 44px;
  background: var(--red);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.dept-card .dhead h3 { font-size: 17px; color: var(--text); }
.dept-card .dhead .en { font-size: 11px; color: var(--text-light); }
.dept-card .dbody { padding: 4px 18px 16px; }
.dept-card .dbody p { font-size: 14px; color: var(--text-light); }
.dept-card .mini-ecg { height: 30px; margin-top: 8px; opacity: 0.75; }

/* ===== 诊疗技术 ===== */
.tech-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.tech {
  background: #fff;
  border-radius: 14px;
  padding: 28px 22px;
  text-align: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  transition: all 0.35s;
  position: relative;
}
.tech:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.tech .ico {
  width: 56px; height: 56px;
  margin: 0 auto 14px;
  background: var(--gray);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  color: var(--red);
}
.tech h3 { font-size: 17px; color: var(--red-deep); margin-bottom: 8px; }
.tech p { font-size: 14px; color: var(--text-light); }
.tech .tag {
  position: absolute;
  top: 14px; right: 14px;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  padding: 2px 10px;
  border-radius: 999px;
}

/* ===== 专家 ===== */
.doc-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.doc {
  background: #fff;
  border-radius: 14px;
  text-align: center;
  padding: 26px 18px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  transition: all 0.35s;
}
.doc:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.doc img {
  width: 120px; height: 120px;
  border-radius: 50%;
  margin: 0 auto 14px;
  object-fit: cover;
  border: 4px solid var(--red);
}
.doc h3 { font-size: 18px; color: var(--text); }
.doc .post { font-size: 13px; color: var(--red); margin: 6px 0; font-weight: 600; }
.doc p { font-size: 13px; color: var(--text-light); }

/* ===== 联系 ===== */
.contact-wrap {
  background: #fff;
  border-radius: 16px;
  padding: 40px;
  box-shadow: var(--shadow);
  border: 2px solid var(--red);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 36px;
}
.contact-info h3 { font-size: 24px; color: var(--red-deep); margin-bottom: 16px; }
.contact-info li { padding: 10px 0; border-bottom: 2px dashed var(--gray-deep); font-size: 15px; }
.contact-info li b { color: var(--red); }
.contact-form h3 { font-size: 20px; color: var(--red-deep); margin-bottom: 16px; }
.form-row { margin-bottom: 14px; }
.form-row input, .form-row textarea, .form-row select {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--gray-deep);
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  background: #fff;
  outline: none;
  transition: border-color 0.3s;
}
.form-row input:focus, .form-row textarea:focus, .form-row select:focus { border-color: var(--red); }
.form-row textarea { min-height: 100px; resize: vertical; }
.form-row small { color: var(--red); font-size: 12px; display: none; }
.form-row.error small { display: block; }
.form-row.error input, .form-row.error textarea, .form-row.error select { border-color: var(--red); }
.form-msg { padding: 12px; border-radius: 8px; margin-top: 8px; display: none; font-size: 14px; }
.form-msg.ok { display: block; background: #d9f0e3; color: #1d7a44; }
.form-msg.bad { display: block; background: #fde2e2; color: #b02a2a; }

/* ===== 页脚 ===== */
.site-footer { background: #222; color: #bbb; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 30px; padding: 50px 0 26px; }
.footer-grid h3 { font-size: 17px; color: #fff; margin-bottom: 14px; }
.footer-grid p, .footer-grid li { font-size: 14px; margin-bottom: 8px; }
.footer-grid li a:hover { color: var(--red); }
.footer-bottom { border-top: 1px solid #444; padding: 16px 0; text-align: center; font-size: 13px; }

/* ===== 动画 ===== */
.reveal { opacity: 0; transform: translateY(40px); transition: all 0.7s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal-d1 { transition-delay: 0.1s; }
.reveal-d2 { transition-delay: 0.2s; }
.reveal-d3 { transition-delay: 0.3s; }

/* ===== 页面头部 ===== */
.page-hero {
  background: linear-gradient(135deg, var(--red-deep), var(--red));
  color: #fff;
  padding: 70px 0 80px;
  text-align: center;
  position: relative;
}
.page-hero h2 { font-size: 40px; margin-bottom: 8px; }
.page-hero p { font-size: 16px; color: #ffd6d9; }
.breadcrumb { margin-top: 10px; font-size: 14px; }
.breadcrumb a:hover { text-decoration: underline; }
.page-hero .ecg-line { position: absolute; bottom: 0; left: 0; right: 0; opacity: 0.4; height: 44px; }
.page-hero .ecg-line .trace { stroke: #fff; }

/* ===== 产品/科室页 ===== */
.dept-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.dept-card .dimg { height: 190px; overflow: hidden; }
.dept-card .dimg img { width: 100%; height: 100%; object-fit: cover; }
.dept-card .dbody { padding: 14px 18px 18px; }

/* ===== 新闻页 ===== */
.news-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.news-card {
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  transition: all 0.35s;
  border-bottom: 4px solid var(--red);
}
.news-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.news-card img { height: 190px; width: 100%; object-fit: cover; }
.news-body { padding: 20px; }
.news-body .date { font-size: 13px; color: var(--red); font-weight: 600; }
.news-body h3 { font-size: 18px; margin: 8px 0; }
.news-body p { font-size: 14px; color: var(--text-light); }

/* ===== 响应式 ===== */
@media (max-width: 992px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-img img { height: 320px; }
  .care-grid { grid-template-columns: 1fr; }
  .dept-grid, .tech-grid, .doc-grid, .news-grid, .dept-list { grid-template-columns: repeat(2, 1fr); }
  .contact-wrap { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .nav-toggle { display: flex; align-items: center; justify-content: center; }
  .nav {
    display: none;
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: #fff;
    flex-direction: column;
    padding: 12px 20px 20px;
    border-bottom: 3px solid var(--red);
  }
  .nav.open { display: flex; }
  .nav a { width: 100%; text-align: center; }
  .dept-grid, .tech-grid, .doc-grid, .news-grid, .dept-list, .care-stats { grid-template-columns: 1fr; }
  .hero-text h2 { font-size: 34px; }
  .section { padding: 60px 0; }
  .topbar .container { flex-direction: column; gap: 4px; }
}

/* ===== 淡入动画（兼容 fade-in） ===== */
.fade-in { opacity: 0; transform: translateY(40px); transition: all 0.7s ease; }
.fade-in.visible { opacity: 1; transform: none; }

/* ===== 页面头部高亮词 ===== */
.page-hero h2 strong { color: #ffd6d9; }
.page-hero h2 span { color: #ffd6d9; }

/* ===== 链接样式修正 ===== */
.dept-card .dhead h3 a { color: var(--text); text-decoration: none; }
.dept-card .dhead h3 a:hover { color: var(--red-deep); }
.dept-list a.dimg { display: block; height: 190px; overflow: hidden; }
.dept-list a.dimg img { width: 100%; height: 100%; object-fit: cover; }
.news-body h3 a { color: var(--text); text-decoration: none; }
.news-body h3 a:hover { color: var(--red-deep); }
.dept-card .dbody .prod-params { margin-top: 4px; font-size: 13px; }
.dept-card .dbody .prod-params b { color: var(--red-deep); }

/* ===== 科室筛选标签 ===== */
.cat-tabs { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin-bottom: 40px; }
.cat-tab {
  padding: 11px 26px;
  border-radius: 30px;
  border: 2px solid var(--red);
  background: #fff;
  color: var(--red-deep);
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  transition: all 0.3s;
}
.cat-tab.active, .cat-tab:hover { background: var(--red); color: #fff; border-color: var(--red); }

/* ===== 医院文化 ===== */
.culture-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.team-placeholder {
  width: 120px; height: 120px;
  border-radius: 50%;
  margin: 0 auto 14px;
  display: flex; align-items: center; justify-content: center;
  background: var(--red); color: #fff;
  font-size: 2rem; font-weight: 700;
  border: 4px solid var(--red);
}

/* ===== 返回顶部 ===== */
.back-top {
  position: fixed; right: 26px; bottom: 26px;
  width: 48px; height: 48px;
  border-radius: 8px;
  background: var(--red); color: #fff;
  border: none; font-size: 1.2rem; cursor: pointer;
  opacity: 0; visibility: hidden; transform: translateY(16px);
  transition: all 0.35s; z-index: 999;
  box-shadow: 0 8px 20px rgba(230, 57, 70, 0.4);
}
.back-top.show { opacity: 1; visibility: visible; transform: none; }

/* ===== CMS 适配 ===== */
.cms-section { padding: 80px 0; }
.cms-detail { max-width: 900px; margin: 0 auto; }
.cms-detail > img { border-radius: 12px; margin: 0 auto 12px; max-width: 100%; }
.cms-detail h1 { font-size: 30px; margin: 18px 0; color: var(--red-deep); }
.cms-detail .lead { color: var(--text-light); margin-bottom: 20px; font-size: 17px; }
.cms-detail .news-date-label {
  display: inline-block;
  background: var(--red); color: #fff;
  font-size: 13px; font-weight: 600;
  padding: 4px 14px; border-radius: 20px;
}
.cms-content h2 { font-size: 24px; margin: 24px 0 12px; color: var(--red-deep); }
.cms-content h3 { font-size: 20px; margin: 20px 0 10px; color: var(--red-deep); }
.cms-content p, .cms-content ul, .cms-content li { color: var(--text-light); margin-bottom: 15px; line-height: 1.9; }
.cms-content ul { padding-left: 18px; list-style: disc; }
.cms-content img { border-radius: 12px; }
.cms-back { display: inline-block; color: var(--red-deep); font-size: 14px; font-weight: 700; margin-bottom: 20px; }
.cms-back:hover { text-decoration: underline; }
.spec-list { list-style: none; padding: 0; margin: 0; }
.spec-list li { color: var(--text-light); padding: 10px 0; border-bottom: 2px dashed var(--gray-deep); font-size: 15px; }
.spec-list li b { color: var(--red-deep); }
.cms-pager { padding: 30px 0; text-align: center; }
.cms-pager .pagination { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; list-style: none; padding: 0; margin: 0; }
.cms-pager .page-link { padding: 10px 16px; border: 2px solid var(--gray-deep); border-radius: 8px; background: #fff; color: var(--red-deep); font-size: 14px; transition: all 0.3s; display: inline-block; }
.cms-pager .page-link:hover { border-color: var(--red); color: var(--red); }
.cms-pager .page-item.active .page-link { background: var(--red); border-color: var(--red); color: #fff; }
.cms-pager .page-item.disabled .page-link { opacity: 0.5; pointer-events: none; }
.cms-grid { display: grid; gap: 16px; }
.cms-card { display: block; background: #fff; border-radius: 12px; padding: 20px 24px; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06); border-left: 5px solid var(--red); transition: all 0.3s; }
.cms-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.cms-card h3 { font-size: 17px; color: var(--text); margin-bottom: 6px; }
.cms-card p { font-size: 14px; color: var(--text-light); }

/* ===== 响应式补充 ===== */
@media (max-width: 992px) {
  .culture-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .culture-grid { grid-template-columns: 1fr; }
  .cat-tabs { gap: 8px; }
}
