:root {
  --primary: #0a6cb4;
  --primary-dark: #075a96;
  --accent: #16a085;
  --text: #333;
  --muted: #888;
  --bg: #f4f6f8;
  --border: #e3e7eb;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  color: var(--text); background: var(--bg); line-height: 1.7; font-size: 15px;
  display: flex; flex-direction: column; min-height: 100vh;
}
main { flex: 1 0 auto; }
.site-footer { flex-shrink: 0; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; display: block; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }

/* ---- 头部 ---- */
.site-header { background: #fff; box-shadow: 0 2px 12px rgba(0,0,0,.07);
  position: sticky; top: 0; z-index: 100; }

/* 品牌行 */
.header-top-inner { display: flex; align-items: center; justify-content: space-between;
  gap: 24px; min-height: 92px; padding: 10px 0; }
.logo { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.logo img { height: 54px; width: auto; max-width: 210px; object-fit: contain; }
.logo-name { font-size: 25px; font-weight: 700; color: var(--primary);
  white-space: nowrap; letter-spacing: 1px; }
.header-top-right { display: flex; align-items: center; gap: 32px; }
.header-contact { display: flex; gap: 28px; }
.contact-item { display: flex; align-items: center; gap: 10px; }
.ci-icon { width: 40px; height: 40px; border-radius: 50%; background: var(--primary);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 19px; flex-shrink: 0; }
.ci-icon-red { background: #e74c3c; }
.ci-text { display: flex; flex-direction: column; line-height: 1.35; }
.ci-text em { font-size: 12px; color: var(--muted); font-style: normal; }
.ci-text b { font-size: 19px; color: var(--text); font-weight: 700; }
.nav-toggle { display: none; font-size: 28px; background: none; border: none;
  cursor: pointer; color: var(--primary); line-height: 1; }

/* 搜索框（品牌行内） */
.nav-search { display: flex; flex-shrink: 0; }
.nav-search input { border: 1px solid var(--border); border-right: none;
  padding: 9px 16px; border-radius: 22px 0 0 22px; width: 200px; outline: none; font-size: 14px; }
.nav-search input:focus { border-color: var(--primary); }
.nav-search button { border: none; background: var(--primary); color: #fff;
  padding: 9px 18px; border-radius: 0 22px 22px 0; cursor: pointer; font-size: 14px; }
.nav-search button:hover { background: var(--primary-dark); }

/* 导航条：菜单项等宽平铺 */
.header-nav { background: linear-gradient(180deg, var(--primary), var(--primary-dark)); }
.nav-menu { display: flex; list-style: none; flex-wrap: wrap; }
.nav-menu > li { position: relative; flex: 1 1 0; min-width: 92px; }
.nav-menu > li > a { display: block; padding: 16px 12px; color: #fff;
  font-size: 15.5px; white-space: nowrap; text-align: center; transition: background .15s;
  border-left: 1px solid rgba(255,255,255,.08); }
.nav-menu > li:first-child > a { border-left: none; }
.nav-menu > li > a:hover { background: rgba(255,255,255,.16); color: #fff; }
.nav-menu > li.has-sub > a::after { content: "▾"; margin-left: 5px; font-size: 11px; opacity: .85; }
.sub-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: #fff;
  min-width: 160px; box-shadow: 0 10px 24px rgba(0,0,0,.16); list-style: none;
  border-radius: 0 0 8px 8px; overflow: hidden; z-index: 10; }
.has-sub:hover .sub-nav { display: block; }
.sub-nav li a { display: block; padding: 12px 18px; font-size: 14.5px;
  color: var(--text); white-space: nowrap; text-align: center; transition: background .12s; }
.sub-nav li a:hover { background: #e8f1fc; color: var(--primary); }

/* ---- 轮播 ---- */
.banner { overflow: hidden; position: relative; background: #000; }
.banner-track { display: flex; cursor: grab; user-select: none; }
.banner-track:active { cursor: grabbing; }
.banner-slide { min-width: 100%; position: relative; }
.banner-slide img { width: 100%; height: 420px; object-fit: cover;
  user-select: none; -webkit-user-drag: none; pointer-events: none; }
.banner-slide a { display: block; }
.banner-title { position: absolute; bottom: 0; left: 0; right: 0; padding: 16px 24px;
  background: linear-gradient(transparent, rgba(0,0,0,.6)); color: #fff; font-size: 18px; }
.banner-dots { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 10px; z-index: 3; }
.banner-dots span { width: 11px; height: 11px; border-radius: 50%;
  background: rgba(255,255,255,.5); cursor: pointer; transition: background .2s; }
.banner-dots span:hover { background: rgba(255,255,255,.8); }
.banner-dots span.active { background: #fff; }
.banner-arrow { position: absolute; top: 50%; transform: translateY(-50%); z-index: 3;
  width: 44px; height: 44px; border: none; border-radius: 50%; cursor: pointer;
  background: rgba(0,0,0,.35); color: #fff; font-size: 26px; line-height: 1;
  display: flex; align-items: center; justify-content: center; transition: background .2s; }
.banner-arrow:hover { background: rgba(0,0,0,.6); }
.banner-arrow.prev { left: 16px; }
.banner-arrow.next { right: 16px; }

/* ---- 通用区块 ---- */
.section-head { display: flex; justify-content: space-between; align-items: baseline;
  border-bottom: 2px solid var(--primary); padding-bottom: 8px; margin-bottom: 16px; }
.section-head h2 { font-size: 20px; color: var(--primary); }
.section-head a { font-size: 13px; color: var(--muted); }
.home-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; margin: 30px auto; }
.home-block { margin: 30px auto; }

/* ---- 文章列表 ---- */
.article-list { list-style: none; }
.article-list.compact li { display: flex; justify-content: space-between; padding: 9px 0;
  border-bottom: 1px dashed var(--border); }
.article-list.compact li a { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.article-list.compact li a:hover { color: var(--primary); }
.article-list.compact .date { color: var(--muted); font-size: 13px; flex-shrink: 0; margin-left: 12px; }

.article-item { display: flex; gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--border); }
.article-item .thumb img { width: 180px; height: 120px; object-fit: cover; border-radius: 6px; }
.article-meta h3 { font-size: 17px; margin-bottom: 8px; }
.ext-tag { font-size: 11px; background: var(--accent); color: #fff; padding: 1px 6px; border-radius: 3px; vertical-align: middle; }
.summary { color: var(--muted); font-size: 14px; margin-bottom: 8px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.meta-line { color: var(--muted); font-size: 13px; display: flex; gap: 16px; flex-wrap: wrap; }

/* ---- 卡片网格 ---- */
.card-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.dept-card, .doctor-card { background: #fff; border-radius: 8px; padding: 16px; text-align: center;
  box-shadow: 0 1px 6px rgba(0,0,0,.06); transition: transform .2s; }
.dept-card:hover, .doctor-card:hover { transform: translateY(-3px); }
.dept-card img { width: 100%; height: 130px; object-fit: cover; border-radius: 6px; margin-bottom: 10px; }
.dept-card h3 { font-size: 16px; color: var(--text); }
.tag { display: inline-block; font-size: 12px; background: var(--bg); color: var(--muted);
  padding: 2px 8px; border-radius: 3px; margin-top: 6px; }
.doctor-photo { width: 110px; height: 110px; margin: 0 auto 10px; border-radius: 50%; overflow: hidden; }
.doctor-photo img { width: 100%; height: 100%; object-fit: cover; }
.no-photo { width: 110px; height: 110px; background: var(--primary); color: #fff; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 32px; margin: 0 auto 10px; }
.no-photo.big { width: 160px; height: 160px; font-size: 48px; }
.doctor-card h3 { font-size: 16px; color: var(--text); }
.doctor-card p { font-size: 13px; color: var(--muted); }
.muted { color: var(--muted); }

/* ---- 内页 ---- */
.page-wrap { background: #fff; margin: 24px auto; padding: 24px 30px; border-radius: 8px;
  box-shadow: 0 1px 6px rgba(0,0,0,.06); min-height: 400px; }
.breadcrumb { font-size: 13px; color: var(--muted); margin-bottom: 16px; }
.page-title { font-size: 24px; color: var(--primary); padding-bottom: 12px;
  border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.group-title { font-size: 18px; color: var(--primary); margin: 24px 0 14px; }
.dept-group { margin-bottom: 24px; }

.article-detail h1 { font-size: 26px; text-align: center; margin-bottom: 12px; }
.article-detail .meta-line { justify-content: center; padding-bottom: 16px;
  border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.article-cover { margin: 0 auto 20px; border-radius: 6px; }
.article-content { font-size: 16px; line-height: 1.9; }
.article-content img { margin: 12px auto; border-radius: 4px; }
.article-content p { margin-bottom: 12px; }
.article-content h1,.article-content h2,.article-content h3 { margin: 18px 0 10px; }
.article-content table { border-collapse: collapse; width: 100%; margin: 12px 0; }
.article-content td, .article-content th { border: 1px solid var(--border); padding: 8px; }

.attachments { margin-top: 24px; padding: 16px; background: var(--bg); border-radius: 6px; }
.attachments h4 { margin-bottom: 8px; }
.attachments ul { list-style: none; }
.attachments li { padding: 4px 0; }
.attachments li a::before { content: "📎 "; }

.article-nav { display: flex; justify-content: space-between; gap: 16px; margin-top: 24px;
  padding-top: 16px; border-top: 1px solid var(--border); font-size: 14px; }

.dept-info { display: flex; gap: 18px; flex-wrap: wrap; color: var(--muted); font-size: 14px; margin-bottom: 16px; }
.doctor-detail { display: flex; gap: 28px; margin-bottom: 24px; flex-wrap: wrap; }
.doctor-detail-info h1 { font-size: 24px; }
.doctor-title { color: var(--accent); font-size: 16px; margin-bottom: 10px; }
.doctor-detail-info p { margin-bottom: 6px; }

/* ---- 搜索 / 表单 ---- */
.search-box, .search-summary { margin-bottom: 20px; }
.search-box { display: flex; max-width: 480px; }
.search-box input { flex: 1; border: 1px solid var(--border); padding: 9px 12px; border-radius: 4px 0 0 4px; outline: none; }
.search-box button { border: none; background: var(--primary); color: #fff; padding: 9px 20px; border-radius: 0 4px 4px 0; cursor: pointer; }
.search-summary { color: var(--muted); font-size: 14px; }

.message-form { max-width: 560px; }
.form-row { margin-bottom: 16px; }
.form-row label { display: block; margin-bottom: 6px; font-size: 14px; }
.form-row input, .form-row textarea { width: 100%; border: 1px solid var(--border);
  padding: 9px 12px; border-radius: 4px; outline: none; font-family: inherit; font-size: 14px; }
.form-row input:focus, .form-row textarea:focus { border-color: var(--primary); }
.req { color: #e74c3c; }
.hp-field { position: absolute; left: -9999px; height: 0; overflow: hidden; }
.btn-primary { background: var(--primary); color: #fff; border: none; padding: 10px 28px;
  border-radius: 4px; cursor: pointer; font-size: 15px; display: inline-block; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }

.pagination { display: flex; justify-content: center; align-items: center; gap: 14px; margin-top: 24px; }
.pagination a, .pagination span { padding: 6px 14px; border: 1px solid var(--border); border-radius: 4px; font-size: 14px; }
.pagination .disabled { color: var(--muted); }
.pagination .page-info { border: none; }

.empty { color: var(--muted); text-align: center; padding: 30px 0; }
.flash { padding: 10px 16px; border-radius: 4px; margin: 12px 0; font-size: 14px; }
.flash-success { background: #e6f7ed; color: #1a7f4b; }
.flash-error { background: #fdecea; color: #c0392b; }
.error-page { text-align: center; padding: 80px 0; }
.error-page h1 { font-size: 72px; color: var(--primary); }
.error-page p { color: var(--muted); margin-bottom: 24px; }

/* ---- 页脚 ---- */
.site-footer { background: #2c3e50; color: #bdc9d3; }
.footer-inner { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 30px; padding: 36px 16px; }
.site-footer h4 { color: #fff; margin-bottom: 12px; font-size: 16px; }
.footer-contact p { font-size: 14px; margin-bottom: 4px; }
.footer-qr { display: flex; gap: 16px; flex-wrap: wrap; }
.qr-item { text-align: center; }
.qr-item img { width: 96px; height: 96px; }
.qr-item span { font-size: 12px; }
.footer-links { display: flex; flex-direction: column; gap: 6px; }
.footer-links a { color: #bdc9d3; font-size: 14px; }
.footer-links a:hover { color: #fff; }
.footer-copy { text-align: center; padding: 14px; border-top: 1px solid rgba(255,255,255,.1); font-size: 13px; }
.footer-copy a { color: #bdc9d3; margin-left: 8px; }

/* ---- 响应式 ---- */
@media (max-width: 1024px) {
  .header-top-inner { min-height: 64px; gap: 14px; }
  .logo img { height: 42px; }
  .logo-name { font-size: 19px; letter-spacing: 0; }
  .header-contact { display: none; }
  .header-top-right { gap: 14px; }
  .nav-search input { width: 150px; }
  .nav-toggle { display: block; }
  .header-nav { position: absolute; left: 0; right: 0; display: none;
    box-shadow: 0 8px 16px rgba(0,0,0,.18); }
  body.nav-open .header-nav { display: block; }
  .header-nav > .container { padding: 6px 16px; }
  .nav-menu { flex-direction: column; }
  .nav-menu > li { flex: none; min-width: 0; }
  .nav-menu > li > a { padding: 13px 8px; text-align: left;
    border-left: none; border-bottom: 1px solid rgba(255,255,255,.15); }
  .nav-menu > li.has-sub > a::after { content: ""; }
  .sub-nav { position: static; display: block; box-shadow: none; min-width: auto;
    background: rgba(0,0,0,.14); border-radius: 0; }
  .sub-nav li a { color: #eaf2fb; padding-left: 28px; text-align: left; }
  .sub-nav li a:hover { background: rgba(255,255,255,.12); color: #fff; }
}
@media (max-width: 560px) {
  .nav-search { display: none; }
}
@media (max-width: 900px) {
  .home-grid { grid-template-columns: 1fr; gap: 20px; }
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-inner { grid-template-columns: 1fr; gap: 20px; }
  .banner-slide img { height: 220px; }
  .article-item { flex-direction: column; }
  .article-item .thumb img { width: 100%; height: 180px; }
  .page-wrap { padding: 18px 16px; }
}
@media (max-width: 520px) {
  .card-grid { grid-template-columns: 1fr; }
}
