/* ==============================
   style.css - 重庆江北黄泥磅医院
   版本: 1.0
   日期: 2025-02-27
   ============================== */

/* ---------- 重置 & 基础 ---------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  line-height: 1.8;
  color: #333;
  background: #f8f9fa;
  transition: background 0.3s, color 0.3s;
}

a {
  color: #1a5276;
  text-decoration: none;
  transition: color 0.3s;
}

a:hover {
  text-decoration: underline;
  color: #f1c40f;
}

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

/* ---------- 导航 ---------- */
nav {
  background: #1a5276;
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  transition: box-shadow 0.3s;
}

nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

nav .logo {
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
}

nav .logo span {
  color: #f1c40f;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 20px;
}

nav ul li a {
  color: #fff;
  padding: 8px 12px;
  border-radius: 4px;
  transition: background 0.3s, color 0.3s;
  font-size: 0.95rem;
}

nav ul li a:hover {
  background: rgba(255,255,255,0.15);
  text-decoration: none;
  color: #f1c40f;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.8rem;
  cursor: pointer;
  transition: transform 0.3s;
}

.menu-toggle:hover {
  transform: scale(1.1);
}

@media (max-width: 768px) {
  nav ul {
    display: none;
    flex-direction: column;
    background: #1a5276;
    position: absolute;
    top: 60px;
    left: 0;
    width: 100%;
    padding: 20px;
    gap: 10px;
  }
  nav ul.active {
    display: flex;
  }
  .menu-toggle {
    display: block;
  }
}

/* ---------- 面包屑 ---------- */
.breadcrumb {
  background: #fff;
  padding: 12px 0;
  border-bottom: 1px solid #e9ecef;
  font-size: 0.9rem;
  color: #6c757d;
  transition: background 0.3s;
}

.breadcrumb a {
  color: #1a5276;
}

.breadcrumb span {
  margin: 0 6px;
}

/* ---------- Banner ---------- */
.banner {
  position: relative;
  overflow: hidden;
  height: 420px;
  background: linear-gradient(135deg, #1a5276 0%, #2c3e50 100%);
}

.banner::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(241,196,15,0.1) 0%, transparent 70%);
  animation: bannerGlow 10s ease-in-out infinite alternate;
}

@keyframes bannerGlow {
  0% { transform: translate(0, 0); }
  100% { transform: translate(20%, 20%); }
}

.banner-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.8s ease-in-out;
}

.banner-slide.active {
  opacity: 1;
}

.banner-content {
  text-align: center;
  color: #fff;
  padding: 20px;
  max-width: 800px;
  background: rgba(0,0,0,0.2);
  backdrop-filter: blur(4px);
  border-radius: 16px;
  box-shadow: 0 4px 30px rgba(0,0,0,0.3);
}

.banner-content h1 {
  font-size: 2.5rem;
  margin-bottom: 20px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.banner-content p {
  font-size: 1.2rem;
  margin-bottom: 20px;
  opacity: 0.95;
}

.banner-content .btn {
  display: inline-block;
  background: #f1c40f;
  color: #1a5276;
  padding: 12px 36px;
  border-radius: 30px;
  font-weight: 700;
  font-size: 1.1rem;
  transition: transform 0.3s, box-shadow 0.3s;
  box-shadow: 0 4px 15px rgba(241,196,15,0.4);
}

.banner-content .btn:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(241,196,15,0.6);
  text-decoration: none;
}

.banner-dots {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
}

.banner-dots span {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  cursor: pointer;
  transition: background 0.3s, transform 0.3s;
}

.banner-dots span.active {
  background: #f1c40f;
  transform: scale(1.3);
}

@media (max-width: 768px) {
  .banner {
    height: 300px;
  }
  .banner-content h1 {
    font-size: 1.8rem;
  }
  .banner-content p {
    font-size: 1rem;
  }
}

/* ---------- 通用区块 ---------- */
section {
  padding: 60px 0;
}

.section-title {
  text-align: center;
  margin-bottom: 40px;
}

.section-title h2 {
  font-size: 2rem;
  color: #1a5276;
  position: relative;
  display: inline-block;
  padding-bottom: 12px;
}

.section-title h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: #f1c40f;
  transition: width 0.3s;
}

.section-title:hover h2::after {
  width: 100px;
}

.section-title p {
  color: #6c757d;
  margin-top: 10px;
  font-size: 1.05rem;
}

.bg-white {
  background: #fff;
  transition: background 0.3s;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
}

.grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 30px;
}

.grid-4 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 20px;
}

@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }
}

/* ---------- 卡片 ---------- */
.card {
  background: #fff;
  border-radius: 12px;
  padding: 25px;
  box-shadow: 0 2px 15px rgba(0,0,0,0.06);
  transition: transform 0.3s, box-shadow 0.3s, background 0.3s;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, #1a5276, #f1c40f);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s;
}

.card:hover::before {
  transform: scaleX(1);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 25px rgba(0,0,0,0.1);
}

.card h3 {
  color: #1a5276;
  margin-bottom: 12px;
  font-size: 1.2rem;
}

.card h4 {
  color: #2c3e50;
  margin: 10px 0 6px;
}

.card p {
  color: #555;
  font-size: 0.95rem;
}

.card svg {
  display: block;
  margin: 0 auto 15px;
  transition: transform 0.3s;
}

.card:hover svg {
  transform: rotate(10deg) scale(1.1);
}

/* ---------- 文章列表 ---------- */
.article-item {
  display: flex;
  gap: 20px;
  padding: 20px 0;
  border-bottom: 1px solid #e9ecef;
  transition: background 0.3s, padding 0.3s;
}

.article-item:last-child {
  border-bottom: none;
}

.article-item:hover {
  background: rgba(26,82,118,0.03);
  padding-left: 10px;
  padding-right: 10px;
  border-radius: 8px;
}

.article-item .meta {
  font-size: 0.85rem;
  color: #999;
  margin-bottom: 6px;
}

.article-item h3 {
  font-size: 1.1rem;
  margin-bottom: 6px;
}

.article-item h3 a {
  color: #1a5276;
  transition: color 0.3s;
}

.article-item h3 a:hover {
  color: #f1c40f;
}

.article-item p {
  color: #666;
  font-size: 0.92rem;
}

.article-item .read-more {
  color: #1a5276;
  font-weight: 600;
  font-size: 0.9rem;
  transition: color 0.3s, margin-left 0.3s;
  display: inline-block;
}

.article-item .read-more:hover {
  color: #f1c40f;
  margin-left: 5px;
}

/* ---------- FAQ ---------- */
.faq-item {
  border-bottom: 1px solid #e9ecef;
  padding: 15px 0;
  transition: background 0.3s;
}

.faq-item:hover {
  background: rgba(26,82,118,0.02);
  border-radius: 8px;
  padding-left: 10px;
  padding-right: 10px;
}

.faq-question {
  font-weight: 700;
  color: #1a5276;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1.05rem;
  transition: color 0.3s;
}

.faq-question:hover {
  color: #f1c40f;
}

.faq-question::after {
  content: '+';
  font-size: 1.4rem;
  transition: transform 0.3s;
}

.faq-item.open .faq-question::after {
  transform: rotate(45deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.3s;
  padding-top: 0;
}

.faq-item.open .faq-answer {
  max-height: 600px;
  padding-top: 12px;
}

.faq-answer p {
  color: #555;
  line-height: 1.7;
}

/* ---------- HowTo ---------- */
.howto-step {
  display: flex;
  gap: 20px;
  margin-bottom: 25px;
  align-items: flex-start;
  transition: transform 0.3s;
}

.howto-step:hover {
  transform: translateX(10px);
}

.howto-step .step-num {
  background: #1a5276;
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
  transition: background 0.3s, transform 0.3s;
}

.howto-step:hover .step-num {
  background: #f1c40f;
  color: #1a5276;
  transform: scale(1.1);
}

.howto-step h4 {
  color: #1a5276;
  margin-bottom: 6px;
}

.howto-step p {
  color: #555;
}

/* ---------- 联系 ---------- */
.contact-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.contact-info div {
  padding: 15px;
  background: #f8f9fa;
  border-radius: 8px;
  transition: transform 0.3s, box-shadow 0.3s, background 0.3s;
}

.contact-info div:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  background: #fff;
}

.contact-info strong {
  display: block;
  color: #1a5276;
  margin-bottom: 6px;
}

/* ---------- 页脚 ---------- */
footer {
  background: #1a5276;
  color: #ddd;
  padding: 40px 0 20px;
  font-size: 0.9rem;
  transition: background 0.3s;
}

footer .grid-4 {
  gap: 30px;
}

footer h4 {
  color: #fff;
  margin-bottom: 15px;
  font-size: 1.1rem;
  position: relative;
  display: inline-block;
}

footer h4::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 30px;
  height: 2px;
  background: #f1c40f;
  transition: width 0.3s;
}

footer h4:hover::after {
  width: 100%;
}

footer ul {
  list-style: none;
}

footer ul li {
  margin-bottom: 8px;
}

footer ul li a {
  color: #ddd;
  transition: color 0.3s, padding-left 0.3s;
}

footer ul li a:hover {
  color: #f1c40f;
  text-decoration: none;
  padding-left: 5px;
}

footer .copyright {
  text-align: center;
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 20px;
  margin-top: 30px;
  color: #aaa;
}

/* ---------- 返回顶部 ---------- */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: #1a5276;
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  z-index: 999;
  transition: opacity 0.3s, transform 0.3s, background 0.3s;
}

.back-to-top.show {
  display: flex;
}

.back-to-top:hover {
  transform: scale(1.1);
  background: #f1c40f;
  color: #1a5276;
}

/* ---------- 统计数字 ---------- */
.stats {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 20px;
  text-align: center;
}

.stats .stat-item h3 {
  font-size: 2.2rem;
  color: #1a5276;
  transition: color 0.3s;
}

.stats .stat-item:hover h3 {
  color: #f1c40f;
}

.stats .stat-item p {
  color: #6c757d;
}

/* ---------- 滚动动画 ---------- */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- 暗黑模式 ---------- */
body.dark-mode {
  background: #1a1a2e;
  color: #e0e0e0;
}

body.dark-mode .card {
  background: #16213e;
  color: #e0e0e0;
}

body.dark-mode .card h3,
body.dark-mode .card h4 {
  color: #f1c40f;
}

body.dark-mode .card p {
  color: #ccc;
}

body.dark-mode .bg-white {
  background: #16213e;
}

body.dark-mode .breadcrumb {
  background: #0f3460;
  color: #ccc;
}

body.dark-mode footer {
  background: #0f3460;
}

body.dark-mode .contact-info div {
  background: #1a1a2e;
}

body.dark-mode .contact-info div:hover {
  background: #16213e;
}

body.dark-mode .article-item:hover {
  background: rgba(241,196,15,0.05);
}

body.dark-mode .faq-item:hover {
  background: rgba(241,196,15,0.05);
}

.dark-toggle {
  background: none;
  border: 1px solid #fff;
  color: #fff;
  padding: 6px 12px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.3s, color 0.3s;
}

.dark-toggle:hover {
  background: #f1c40f;
  color: #1a5276;
  border-color: #f1c40f;
}

/* ---------- 搜索 ---------- */
.search-box {
  display: flex;
  gap: 8px;
}

.search-box input {
  padding: 8px 12px;
  border: 1px solid #ccc;
  border-radius: 20px;
  outline: none;
  width: 180px;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.search-box input:focus {
  border-color: #f1c40f;
  box-shadow: 0 0 8px rgba(241,196,15,0.3);
}

.search-box button {
  background: #f1c40f;
  border: none;
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.3s, transform 0.3s;
}

.search-box button:hover {
  background: #e0b50f;
  transform: scale(1.05);
}

@media (max-width: 768px) {
  .search-box input {
    width: 120px;
  }
}

/* ---------- 图片懒加载占位 ---------- */
.lazy-placeholder {
  background: #e9ecef;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80px;
  border-radius: 8px;
  transition: background 0.3s;
}

/* ---------- 响应式微调 ---------- */
@media (max-width: 480px) {
  .banner-content {
    margin: 0 10px;
  }
  .section-title h2 {
    font-size: 1.6rem;
  }
  .stats .stat-item h3 {
    font-size: 1.8rem;
  }
  nav .logo {
    font-size: 1.2rem;
  }
}