/* 重置默认样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Microsoft YaHei", "微软雅黑", Arial, sans-serif;
  line-height: 1.6;
  color: #333;
}

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

/* 顶部导航 */
.top-bar {
  background-color: #f5f5f5;
  padding: 5px 0;
  font-size: 12px;
}

.top-bar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.top-links {
  display: flex;
  align-items: center;
  gap: 10px;
}

.top-links a {
  color: #666;
  text-decoration: none;
  font-size: 13px;
  transition: color 0.3s ease;
  position: relative;
}

.top-links a:hover {
  color: #0057fa;
}

.top-links a:after {
  content: "";
  position: absolute;
  width: 0;
  height: 1px;
  bottom: -2px;
  left: 50%;
  background-color: #0057fa;
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

.top-links a:hover:after {
  width: 100%;
}

.top-links .separator {
  color: #ddd;
  font-size: 12px;
  user-select: none;
}

/* 头部 */
.header {
  padding: 20px 0;
}

.header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.logo strong {
  font-size: 24px;
  color: #333;
  letter-spacing: 1px;
}

.logo strong span {
  color: #0057fa;
  margin: 0 5px;
  position: relative;
}

.logo strong span:after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background: #0057fa;
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.logo strong:hover span:after {
  transform: scaleX(1);
}

.logo > span {
  font-size: 14px;
  color: #666;
  letter-spacing: 0.5px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 30px;
}

.hotline {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 15px;
  border-radius: 8px;
  background: linear-gradient(135deg, #f0f4ff, #fff);
  border: 1px solid #d6e4ff;
  transition: all 0.3s ease;
}

.hotline:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 87, 250, 0.1);
}

.phone-icon {
  font-size: 24px;
  color: #0057fa;
  animation: shake 1s infinite;
  display: inline-block;
}

@keyframes shake {
  0% {
    transform: rotate(0deg);
  }
  10% {
    transform: rotate(-10deg);
  }
  20% {
    transform: rotate(10deg);
  }
  30% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(0deg);
  }
}

.hotline-info {
  display: flex;
  flex-direction: column;
}

.hotline .label {
  font-size: 12px;
  color: #666;
  margin-bottom: 2px;
}

.hotline .phone-number {
  font-size: 20px;
  font-weight: bold;
  color: #0057fa;
  text-decoration: none;
  letter-spacing: 1px;
  transition: color 0.3s ease;
}

.hotline .phone-number:hover {
  color: #0046c8;
}

.search-section {
  max-width: 800px;
  margin: 30px auto;
  padding: 0 15px;
}

.search {
  display: flex;
  align-items: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.search input {
  flex: 1;
  height: 46px;
  padding: 0 20px;
  border: 2px solid #0057fa;
  border-right: none;
  outline: none;
  font-size: 15px;
  transition: all 0.3s ease;
}

.search input:focus {
  box-shadow: inset 0 0 3px rgba(0, 87, 250, 0.2);
}

.search button {
  height: 46px;
  padding: 0 35px;
  background-color: #0057fa;
  border: none;
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 15px;
  font-weight: 500;
}

.search button:hover {
  background-color: #0046c8;
  transform: translateX(2px);
}

.hot-keywords {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 5px;
}

.hot-keywords .label {
  color: #666;
  font-size: 13px;
  white-space: nowrap;
}

.keyword-list {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
}

.keyword-list a {
  color: #666;
  text-decoration: none;
  font-size: 13px;
  transition: all 0.3s ease;
  position: relative;
}

.keyword-list a:hover {
  color: #0057fa;
}

.keyword-list a:after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background-color: #0057fa;
  transition: width 0.3s ease;
}

.keyword-list a:hover:after {
  width: 100%;
}

/* 主导航 */
.main-nav {
  background-color: #0057fa;
  box-shadow: 0 2px 8px rgba(0, 87, 250, 0.2);
}

.main-nav .container {
  position: relative;
  display: flex;
  align-items: center;
}

.main-nav .container > ul {
  list-style: none;
  display: flex;
}

.main-nav li a {
  display: block;
  padding: 15px 25px;
  color: white;
  text-decoration: none;
  font-size: 16px;
  transition: background-color 0.3s ease;
}

.main-nav li a:hover,
.main-nav li a.active {
  background-color: #0046c8;
}

/* 下拉菜单样式 */
.main-nav .dropdown {
  position: relative;
}

.main-nav .dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  width: min(900px, calc(100vw - 30px));
  background-color: #fff;
  box-shadow: 0 2px 10px rgba(0, 87, 250, 0.1);
  border-radius: 0 0 4px 4px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  z-index: 1000;
  border: 1px solid #e8f0ff;
  border-top: 3px solid #0057fa;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0;
  max-height: 60vh;
  overflow: auto;
  padding: 8px 0;
}

.main-nav .dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.main-nav .dropdown-menu li {
  border-bottom: 1px solid #e8f0ff;
}

.main-nav .dropdown-menu li:last-child {
  border-bottom: none;
}

.main-nav .dropdown-menu a {
  padding: 12px 20px;
  color: #333;
  font-size: 14px;
  display: block;
  transition: all 0.3s ease;
  white-space: normal;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.main-nav .dropdown-menu a:hover {
  background-color: #f0f4ff;
  color: #0057fa;
  padding-left: 25px;
}

.main-nav .dropdown > a:after {
  content: "▾";
  margin-left: 5px;
  display: inline-block;
  transition: transform 0.3s ease;
}

.main-nav .dropdown:hover > a:after {
  transform: rotate(180deg);
}

.main-nav .dropdown-menu .loading {
  padding: 15px 20px;
  color: #666;
  text-align: center;
  font-size: 14px;
}

.main-nav .dropdown-menu .error {
  padding: 15px 20px;
  color: #ff4444;
  text-align: center;
  font-size: 14px;
}

/* 医院列表页面样式 */
.main-content {
  width: 1200px;
  margin: 30px auto;
  padding: 0 15px;
}
.hospital-container {
  display: flex;
  gap: 30px;
}

.left-section {
  width: 240px;
  flex-shrink: 0;
}

.right-section {
  flex: 1;
}

/* 导航标题 */
.nav-title {
  padding: 20px;
  width: 240px;
  background: -webkit-linear-gradient(bottom, #0057fa, #2aade5);
}

.nav-title .title {
  font-size: 20px;
  font-weight: bold;
  color: #fff;
  margin-bottom: 5px;
}

.nav-title .desc {
  font-size: 12px;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* 面包屑导航 */
.breadcrumb {
  background: #fff;
  padding: 15px 20px;
  border-radius: 8px;
  margin-bottom: 20px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  font-size: 14px;
  color: #666;
}

.breadcrumb .location {
  color: #999;
  margin-right: 5px;
}

.breadcrumb a {
  color: #0057fa;
  text-decoration: none;
  transition: color 0.3s ease;
}

.breadcrumb a:hover {
  color: #0046c8;
}

.breadcrumb .separator {
  margin: 0 8px;
  color: #ccc;
}

.breadcrumb .current {
  color: #333;
}

/* 侧边栏样式 */
.sidebar {
  display: flex;
  flex-direction: column;
  background: #fff;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  gap: 1px;
}

.sidebar-item {
  width: 240px;
  padding: 8px 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #666;
  border-left: 3px solid transparent;
}

.sidebar-item:hover {
  background: #ed6517;
  color: #fff;
}

.sidebar-item.active {
  background: #ed6517;
  color: #fff;
}

.sidebar-item .icon {
  font-size: 18px;
}

/* 医院列表区域 */
.hospital-list {
  flex: 1;
}

.filter-bar {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid #f0f0f0;
}

.filter-item {
  padding: 6px 15px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 14px;
  color: #666;
  background: #f5f5f5;
}

.filter-item:hover {
  background: #e8f0ff;
  color: #0057fa;
}

.filter-item.active {
  background: #0057fa;
  color: white;
}

.hospital-grid .loading,
.hospital-grid .error {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px;
  color: #666;
  font-size: 14px;
  background: #f9f9f9;
  border-radius: 8px;
}

.hospital-detail {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  padding: 25px;
}

.hospital-detail h2 {
  font-size: 24px;
  color: #333;
  margin-bottom: 15px;
}

.hospital-detail .description {
  color: #666;
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid #f0f0f0;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.info-item .label {
  color: #999;
  font-size: 13px;
}

.info-item .value {
  color: #333;
  font-size: 15px;
}

.action-bar {
  display: flex;
  justify-content: flex-end;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #f0f0f0;
}

/* 轮播图 */
.banner.swiper {
  width: 100%;
  height: 500px;
  margin-bottom: 30px;
}

.banner .swiper-slide {
  text-align: center;
  background: #fff;
}

.banner .swiper-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.banner .swiper-pagination-bullet {
  --swiper-pagination-color: #fff;
  --swiper-pagination-bullet-inactive-color: #999;
  --swiper-pagination-bullet-inactive-opacity: 0.5;
  --swiper-pagination-bullet-size: 10px;
  --swiper-pagination-bullet-horizontal-gap: 6px;
}

.banner .swiper-pagination-bullet-active {
  opacity: 1;
  background: #fff;
}

.banner .swiper-button-next,
.banner .swiper-button-prev {
  --swiper-navigation-color: #fff;
  --swiper-navigation-size: 30px;
  background-color: rgba(0, 0, 0, 0.4);
  padding: 20px;
  border-radius: 50%;
  width: var(--swiper-navigation-size);
  height: var(--swiper-navigation-size);
}

.banner .swiper-button-next:hover,
.banner .swiper-button-prev:hover {
  background: rgba(0, 0, 0, 0.5);
}

.banner .swiper-button-next:after,
.banner .swiper-button-prev:after {
  font-size: 24px;
}

/* 页脚 */
.footer {
  background-color: #f5f5f5;
  padding: 40px 0 20px;
  margin-top: 50px;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  margin-bottom: 30px;
}

.footer-section h3 {
  font-size: 18px;
  margin-bottom: 15px;
}

.footer-section ul {
  list-style: none;
}

.footer-section ul li {
  margin-bottom: 10px;
}

.footer-section a {
  color: #666;
  text-decoration: none;
}

.footer-section a:hover {
  color: #0057fa;
}

.copyright {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid #ddd;
  color: #666;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .footer-content {
    grid-template-columns: 1fr;
  }

  .search input {
    width: 250px;
  }
}

@media (max-width: 480px) {
  .top-bar .container {
    flex-direction: column;
    text-align: center;
  }

  .top-links {
    margin-top: 5px;
  }

  .header .container {
    flex-direction: column;
  }

  .search {
    margin-top: 15px;
    width: 100%;
  }

  .search input {
    width: 100%;
  }
}

/* 科室展示样式 */
.department-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: calc(100% - 200px); /* 限制最大宽度，为标签留出空间 */
  overflow: hidden;
}

.department-section {
  margin-bottom: 30px;
  background: #fff;
  border: 1px solid #cce3e8;
  border-radius: 4px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
  overflow: hidden; /* 防止内容溢出 */
}

.department-container {
  display: flex;
  align-items: flex-start;
  padding: 8px 16px;
  min-height: 40px; /* 设置最小高度 */
}

.department-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-right: 20px;
  margin-right: 20px;
  border-right: 1px solid #e6e6e6;
  white-space: nowrap;
  color: #1296db;
  font-size: 14px;
  font-weight: 500;
  flex-shrink: 0; /* 防止标签被压缩 */
}

.department-label img {
  width: 14px;
  height: 14px;
}

.department-tags {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 60px; /* 限制最大高度，防止过多科室撑开 */
  overflow: hidden;
  position: relative;
}

.department-tag {
  padding: 4px 12px;
  font-size: 13px;
  color: #333;
  text-decoration: none;
  background: #f5f5f5;
  border-radius: 16px;
  border: 1px solid #e0e0e0;
  transition: all 0.3s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.department-tag-more {
  color: #999;
  font-size: 14px;
  border-radius: 16px;
  padding: 4px 8px;
  align-self: center;
}

.department-tag-more:hover {
  color: #fff;
  background-color: #0057fa;
  border-color: #0057fa;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 122, 255, 0.3);
}

.department-tag:hover {
  color: #fff;
  background-color: #0057fa;
  border-color: #0057fa;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 122, 255, 0.3);
}

.department-tags .loading {
  width: 100%;
  text-align: center;
  color: #999;
  padding: 20px 0;
}

/* 科室展开/收起相关样式 */
.department-more {
  color: #999;
  font-size: 14px;
  padding: 4px 8px;
  align-self: center;
}

.department-expand {
  margin-top: 8px;
  text-align: center;
}

.expand-btn {
  background: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 16px;
  padding: 6px 16px;
  font-size: 13px;
  color: #666;
  cursor: pointer;
  transition: all 0.3s ease;
  outline: none;
}

.expand-btn:hover {
  background: #0057fa;
  color: #fff;
  border-color: #0057fa;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 122, 255, 0.3);
}

/* 展开状态的科室列表 */
.department-list.expanded {
  max-height: none !important;
  transition: max-height 0.3s ease;
}

/* 文章列表样式 */
.article-list {
  display: grid;
  grid-template-columns: repeat(3, calc((100% - 20px) / 3));
  gap: 10px;
  grid-auto-rows: auto;
  grid-auto-flow: row;
}

.article-card {
  background: #f0f0f0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border: 1px solid #e6e6e6;
}

.article-top {
  border-bottom: 1px solid #e6e6e6;
  height: 200px;
  overflow: hidden;
}

.article-top img {
  width: 100%;
  height: 100%;
  cursor: pointer;
  object-fit: cover;
  display: block;
  transition: all 0.5s;
}

.article-top img:hover {
  transform: scale(1.1);
}

.article-bottom {
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.article-title {
  font-size: 14px;
  line-height: 1.4;
  height: 40px;
  overflow: hidden;
  display: -webkit-box;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  margin: 0;
}

.article-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.action-btn {
  padding: 6px 16px;
  text-align: center;
  font-size: 14px;
  text-decoration: none;
  color: #fff;
}

.action-btn.primary {
  background: #0057fa;
  color: white;
}

.action-btn.secondary {
  background: -webkit-linear-gradient(bottom, #ed6517, #ea3516);
}

.no-data {
  text-align: center;
  padding: 40px;
  color: #999;
  font-size: 14px;
  background: #f9f9f9;
  border-radius: 8px;
}

.error {
  text-align: center;
  padding: 40px;
  color: #ff4444;
  font-size: 14px;
  background: #fff5f5;
  border-radius: 8px;
}
