/**
 * 全站布局增强层 — 栅格、间距、区块层级
 * 加载顺序：common → index/inner → polish → layout
 */
:root {
  --layout-max: 1334px;
  --layout-gap: 32px;
  --layout-gap-sm: 20px;
  --layout-section: 48px;
  --layout-radius: 10px;
  --layout-shadow: 0 12px 40px rgba(4, 74, 140, 0.09);
  --layout-shadow-sm: 0 4px 20px rgba(4, 74, 140, 0.06);
}

/* ========== 内页：内容区布局 ========== */
.page-inner > .container {
  position: relative;
  z-index: 1;
}

.page-inner .inner-wrap {
  align-items: stretch;
}

.page-inner .inner-main > .tab-module,
.page-inner .inner-main > .box-card:first-child,
.page-inner .container.inner-full > .tab-module,
.page-inner .container.inner-full > .dept-wrap {
  border-radius: var(--layout-radius);
  box-shadow: var(--layout-shadow);
}

.page-inner .container.inner-full {
  padding-top: 0;
}

.page-inner .container.inner-full > .specialty-stats {
  margin-bottom: var(--layout-gap);
}

.page-inner .container.inner-full > .box-card,
.page-inner .container.inner-full > .tab-module,
.page-inner .container.inner-full > .dept-wrap {
  margin-bottom: var(--layout-gap);
}

/* 侧栏吸顶 */
.inner-side {
  position: sticky;
  top: 24px;
  align-self: flex-start;
}

.inner-side .side-box + .side-box {
  margin-top: var(--layout-gap-sm);
}

.side-box-list a {
  display: block;
  padding: 14px 20px;
  font-size: 14px;
  line-height: 1.4;
  border-left: 3px solid transparent;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.side-box-list a:hover {
  background: #f0f6fc;
  color: var(--h-primary, #044a8c);
}

/* Tab 导航均分 */
.tab-nav {
  display: flex;
  padding: 0 !important;
}

.tab-nav a {
  flex: 1;
  text-align: center;
  min-width: 0;
}

.tab-panel {
  padding: 8px 0 0;
}

.tab-panel .box-card {
  box-shadow: none;
  border-radius: 0;
  margin-bottom: 0;
  padding: 32px 36px 36px;
}

.tab-panel .box-card:last-child {
  margin-bottom: 0;
}

/* 简介区布局 */
.intro-block {
  gap: 40px !important;
}

.intro-block .intro-img {
  width: 420px !important;
  height: 280px !important;
}

.stat-row {
  grid-template-columns: repeat(4, 1fr) !important;
  gap: var(--layout-gap-sm) !important;
}

.stat-item {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 120px;
}

/* 荣誉 / 领导网格 */
.honor-grid {
  grid-template-columns: repeat(3, 1fr) !important;
  gap: var(--layout-gap-sm) !important;
}

.honor-item {
  padding: 28px 16px;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
}

.honor-item:hover {
  transform: translateY(-2px);
}

.leader-grid {
  gap: var(--layout-gap) !important;
}

.leader-card {
  padding: 28px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.2s, box-shadow 0.2s;
}

.leader-card .avatar {
  margin-bottom: 16px;
}

.leader-card p {
  font-size: 13px;
  color: var(--h-text-sub, #5c6f82);
  line-height: 1.7;
  margin-top: 12px;
}

/* 新闻列表布局 */
.featured-news {
  height: 380px !important;
  margin-bottom: var(--layout-gap) !important;
}

.featured-news .caption {
  padding: 36px 40px !important;
}

.news-list-item {
  padding: 24px 16px !important;
  margin: 0 -16px;
  border-radius: 6px;
  transition: background 0.2s;
}

.news-list-item .body h3 {
  line-height: 1.5;
  margin-bottom: 10px;
}

.news-date-item {
  padding: 20px 0;
  border-bottom: 1px dashed var(--h-line, #e4edf5);
}

.news-date-item:last-child {
  border-bottom: none;
}

/* 专家网格 */
.expert-grid {
  grid-template-columns: repeat(4, 1fr) !important;
  gap: var(--layout-gap-sm) !important;
  padding: 28px 32px !important;
}

.expert-card {
  padding: 20px 16px 24px;
  transition: transform 0.25s, box-shadow 0.25s;
}

.expert-card .photo {
  width: 120px;
  height: 160px;
  margin: 0 auto 14px;
}

/* 科室导航网格 */
.dept-wrap .dept-cat-nav {
  display: flex;
  padding: 0 12px;
}

.dept-wrap .dept-cat-nav a {
  flex: 1;
  text-align: center;
}

.dept-panel.dept-links {
  grid-template-columns: repeat(6, 1fr) !important;
  gap: 12px !important;
  padding: 28px 32px 32px !important;
}

.dept-links a {
  height: 44px !important;
  line-height: 44px !important;
  font-size: 14px !important;
}

/* 专科页 */
.specialty-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--layout-gap-sm);
  margin-bottom: var(--layout-gap);
}

.specialty-stats .item {
  text-align: center;
  padding: 28px 16px;
  background: #fff;
  border-radius: var(--layout-radius);
  box-shadow: var(--layout-shadow-sm);
}

.tech-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--layout-gap-sm);
}

.tech-item {
  padding: 24px 20px;
  background: #fafcfe;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.tech-item:hover {
  box-shadow: var(--layout-shadow-sm);
}

.dept-experts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--layout-gap-sm);
}

.dept-expert-card {
  display: flex;
  gap: 20px;
  padding: 20px;
  border: 1px solid var(--h-line, #e4edf5);
  border-radius: var(--layout-radius);
  align-items: center;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.dept-expert-card:hover {
  box-shadow: var(--layout-shadow-sm);
  border-color: var(--h-primary-light, #3d9ae8);
}

.dept-expert-card .photo {
  width: 80px;
  height: 106px;
  flex-shrink: 0;
  border-radius: 4px;
}

.specialty-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  padding: 8px 0 16px;
}

.btn-primary,
.btn-outline {
  display: inline-block;
  min-width: 160px;
  height: 44px;
  line-height: 44px;
  text-align: center;
  border-radius: 4px;
  font-size: 15px;
  font-weight: 500;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.btn-primary {
  background: var(--h-primary, #044a8c);
  color: #fff;
}

.btn-primary:hover {
  background: var(--h-primary-mid, #1a6bb5);
  color: #fff;
}

.btn-outline {
  border: 1px solid var(--h-primary, #044a8c);
  color: var(--h-primary, #044a8c);
}

.btn-outline:hover {
  background: var(--h-primary, #044a8c);
  color: #fff;
}

/* 医生详情双栏 */
.doctor-layout {
  display: flex;
  gap: var(--layout-gap);
  align-items: flex-start;
}

.doctor-layout .inner-main {
  flex: 1;
  min-width: 0;
}

.doctor-layout .inner-side {
  width: 280px;
  flex-shrink: 0;
}

.article-wrap {
  padding: 36px 40px;
}

.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 32px 0 8px;
}

/* ========== 首页布局 ========== */

/* 取消 JS 滚动动画前的隐藏状态，保证静态可见 */
.main .key_specialty .mobile_swiper div li {
  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
  margin-top: 64px !important;
}

.main .announcement .announcement_swiper .lists ul {
  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
}

.main {
  display: flow-root;
  padding: 36px 0 56px;
}

.main .key_specialty.container,
.main .expert_team.container,
.main .technology.container,
.main .announcement.container {
  float: none;
  clear: both;
}

/* 特色技术 + 医院公告 双栏 */
.main .technology.container {
  width: calc(50% - 16px);
  float: left;
  height: auto !important;
  min-height: 300px;
  margin-bottom: 0;
  box-sizing: border-box;
}

.main .announcement.container {
  width: calc(50% - 16px);
  float: right;
  margin-top: 0 !important;
  height: auto !important;
  min-height: 300px;
  padding: 0 !important;
  box-sizing: border-box;
}

.main .announcement .announcement_swiper {
  margin-top: 24px !important;
}

.main .announcement .announcement_swiper .lists ul {
  width: calc(33.333% - 10px) !important;
  height: auto !important;
  min-height: 300px;
  margin-bottom: 0;
  border-radius: var(--layout-radius);
}

.main .announcement .announcement_swiper .lists {
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px 0;
}

.main .technology ul {
  flex-direction: column;
  flex-wrap: nowrap;
  padding: 16px 24px 24px !important;
}

.main .technology ul a {
  width: 100% !important;
  height: auto !important;
  min-height: 56px;
  margin-bottom: 12px !important;
  padding-bottom: 8px;
}

/* 就医入口 — 弹性换行 */
.sub_nav_box .sub_nav {
  display: flex !important;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 14px 10px;
  align-items: stretch;
}

.sub_nav_box .sub_nav a,
.sub_nav_box .sub_nav i {
  width: calc(16.666% - 10px) !important;
  min-width: 100px;
  height: auto !important;
  min-height: 108px;
  float: none !important;
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 14px 8px;
  box-sizing: border-box;
}

.sub_nav_box .sub_nav i {
  display: none !important;
}

.sub_nav_box .sub_nav a img {
  width: 48px;
  height: auto;
  margin-bottom: 8px;
}

.sub_nav_box .sub_nav a span {
  font-size: 13px;
  line-height: 1.3;
}

/* 新闻 Tab 区块 */
.tab.container {
  clear: both;
  float: none;
  height: auto !important;
  min-height: 480px;
  padding: 36px 40px 44px !important;
  box-sizing: border-box;
}

.tab .tab_title {
  width: 100% !important;
  max-width: var(--layout-max);
  border-bottom: 2px solid var(--h-line, #e4edf5);
  padding-bottom: 4px;
}

.tab .tab_title a {
  flex: 1;
  text-align: center;
  padding: 12px 0;
  font-size: 17px;
  position: relative;
}

.tab .tab_title a.active::after {
  content: '';
  position: absolute;
  left: 20%;
  right: 20%;
  bottom: -6px;
  height: 3px;
  background: var(--h-primary, #044a8c);
  border-radius: 2px;
}

.tab .tab_content {
  height: auto !important;
  min-height: 400px;
  margin-top: 28px !important;
  overflow: hidden;
}

.tab .tab_content::after {
  content: '';
  display: table;
  clear: both;
}

.tab .tab_content ul a {
  border-radius: 6px;
  transition: box-shadow 0.2s, transform 0.2s;
}

.tab .tab_content ul a:hover {
  box-shadow: var(--layout-shadow-sm);
  transform: translateX(4px);
}

/* 科室导航首页区块 */
.department_nav.container {
  clear: both;
  padding: 32px 28px;
  box-sizing: border-box;
}

.department_nav .left,
.department_nav .right {
  box-sizing: border-box;
}

/* 页脚布局 */
.footer .content.container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 36px 0;
}

.footer .content ul {
  display: flex;
  gap: 32px;
}

.footer .content ul li {
  text-align: center;
}

/* 科室主页 */
.dept-header {
  display: flex;
  gap: 32px;
  padding: 32px 36px;
  margin-bottom: var(--layout-gap);
  align-items: center;
}

.dept-intro-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--layout-gap);
}

/* 内页主栏卡片间距 */
.inner-main > .box-card,
.inner-main > .dept-header {
  margin-bottom: var(--layout-gap);
  border-radius: var(--layout-radius);
  box-shadow: var(--layout-shadow);
}

.inner-main > .dept-header {
  margin-bottom: var(--layout-gap) !important;
}

/* 特色诊疗 */
.treatment-grid {
  grid-template-columns: repeat(2, 1fr) !important;
  gap: var(--layout-gap-sm) !important;
}

.treatment-card {
  padding: 24px !important;
  border-radius: var(--layout-radius);
  transition: box-shadow 0.2s, border-color 0.2s;
}

.treatment-card:hover {
  box-shadow: var(--layout-shadow-sm);
}

.treatment-card h4 {
  color: var(--h-primary, #044a8c);
  font-weight: 600;
  margin-bottom: 10px;
}

/* 同科室专家 */
.related-experts {
  grid-template-columns: repeat(4, 1fr) !important;
  gap: var(--layout-gap-sm) !important;
}

.related-expert {
  padding: 16px 12px;
  border: 1px solid var(--h-line, #e4edf5);
  border-radius: var(--layout-radius);
  transition: transform 0.2s, box-shadow 0.2s;
}

.related-expert:hover {
  transform: translateY(-2px);
  box-shadow: var(--layout-shadow-sm);
}

/* 出诊表 */
.info-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.info-table th,
.info-table td {
  border: 1px solid var(--h-line, #e4edf5);
  padding: 12px 16px;
  text-align: center;
}

.info-table th {
  background: #f0f6fc;
  color: var(--h-primary, #044a8c);
  font-weight: 600;
}

.info-table tr:nth-child(even) td {
  background: #fafcfe;
}

/* 医生简介头部 */
.doctor-profile {
  gap: 36px !important;
}

.doctor-profile .photo {
  width: 200px !important;
  height: 266px !important;
}

/* 新闻详情 */
.article-wrap .article-title {
  margin-bottom: 16px;
}

.article-wrap .article-meta {
  padding-bottom: 20px;
  margin-bottom: 28px;
}

.article-wrap .rich-text {
  font-size: 16px;
  line-height: 2.1;
}

.article-wrap .rich-text p {
  margin-bottom: 18px;
  text-indent: 2em;
}

/* 首页科室卡片链接两列 */
.main .key_specialty .mobile_swiper div li p {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 0;
  justify-content: space-between;
}

.main .key_specialty .mobile_swiper div li p a {
  width: 48%;
  box-sizing: border-box;
  padding: 4px 0;
  line-height: 1.5;
}

.main .expert_team .title_box {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 28px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--h-line, #e4edf5);
}

.main .expert_team .title_box > span {
  font-size: 14px;
  color: var(--h-text-sub, #5c6f82);
}

/* ========== 首页响应式 ========== */

/* PC 大屏：内容居中，最大宽度 1334px */
@media screen and (min-width: 993px) {
  .main .expert_team .hidden_box {
    width: 100%;
    max-width: 1180px;
    transform: none !important;
    position: relative !important;
    left: auto !important;
  }

  .tab .tab_content .left_img_news {
    width: 55%;
  }

  .tab .tab_content ul {
    width: 42%;
  }
}

/* 平板 */
@media screen and (min-width: 768px) and (max-width: 992px) {
  .main .technology.container,
  .main .announcement.container {
    width: 100% !important;
    float: none !important;
    clear: both;
    margin-bottom: 24px;
  }

  .main .announcement .announcement_swiper .lists ul {
    width: 48% !important;
  }

  .main .key_specialty .mobile_swiper div li {
    width: 31%;
    height: auto;
    min-height: 280px;
  }

  .tab .tab_content .left_img_news,
  .tab .tab_content ul {
    width: 100%;
    float: none;
  }

  .tab .tab_content ul {
    margin-top: 16px;
  }

  .department_nav .left {
    width: 48%;
  }

  .department_nav .right {
    width: 50%;
  }
}

/* 手机端 */
@media screen and (max-width: 767px) {
  .main .technology.container,
  .main .announcement.container {
    width: 100% !important;
    float: none !important;
    clear: both;
    margin-bottom: 20px;
  }

  .main .announcement .announcement_swiper .lists ul {
    width: 100% !important;
    margin-bottom: 12px;
  }

  .main .key_specialty {
    margin-top: -20px;
    padding: 20px 12px 16px;
  }

  .main .key_specialty .mobile_swiper div {
    flex-wrap: wrap;
    gap: 16px 0;
  }

  .main .key_specialty .mobile_swiper div li {
    width: 100% !important;
    height: auto !important;
    min-height: auto;
    margin-top: 56px !important;
    padding-bottom: 16px;
  }

  .main .expert_team {
    height: auto;
    margin: 40px auto;
  }

  .main .expert_team .hidden_box {
    width: 100% !important;
    transform: none !important;
    position: relative !important;
    left: auto !important;
  }

  .main .expert_team .team_prev,
  .main .expert_team .team_next {
    display: none;
  }

  .tab.container {
    padding: 24px 12px 32px !important;
  }

  .tab .tab_content .left_img_news,
  .tab .tab_content ul {
    width: 100%;
    float: none;
  }

  .sub_nav_box .sub_nav a,
  .sub_nav_box .sub_nav i {
    width: calc(33.333% - 8px) !important;
    min-width: 0;
  }

  .department_nav.container {
    padding: 20px 12px;
  }

  .footer .content.container {
    flex-direction: column;
    text-align: center;
    gap: 16px;
  }

  .footer .content ul {
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
  }

  .banner .box {
    aspect-ratio: auto;
    min-height: 188px;
    max-height: none;
  }

  .banner .box .swiper-wrapper {
    min-height: 188px;
  }

  .map {
    padding: 0 12px;
  }

  .map #diTuContent {
    height: 240px;
  }

  .map ul {
    width: 300px;
    right: 3%;
  }
}

/* 平板：联系方式卡片略缩小 */
@media screen and (min-width: 768px) and (max-width: 992px) {
  .map ul {
    width: 280px;
    right: 2%;
    font-size: 14px;
  }

  .map ul li:nth-child(2) {
    font-size: 28px;
  }

  .map ul li:nth-child(6) span,
  .map ul li.switch_map span {
    width: auto;
    flex: 1;
    font-size: 13px;
    padding: 0 2px;
  }
}

/* 手机端头部搜索框自适应 */
@media screen and (max-width: 768px) {
  .modeheader .header_content .right_search .search,
  .modeheader .header_content1 .right_search .search {
    width: 100%;
    max-width: 280px;
  }

  .modeheader .header_content .logo img,
  .modeheader .header_content1 .logo img {
    max-width: 180px;
    height: auto;
  }

  .header .header_content .logo img {
    max-width: 220px;
    height: auto;
  }
}
