/* ===== 基础样式重置 ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: #333;
  line-height: 1.6;
  background: #f8fafc;
}
a { text-decoration: none; color: inherit; transition: color 0.3s; }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }
.container { width: 92%; max-width: 1200px; margin: 0 auto; }

/* ===== 变量定义 ===== */
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #dbeafe;
  --secondary: #0f766e;
  --accent: #f59e0b;
  --text: #1e293b;
  --text-light: #64748b;
  --bg: #f8fafc;
  --white: #fff;
  --shadow: 0 4px 20px rgba(0,0,0,0.08);
  --shadow-hover: 0 8px 30px rgba(0,0,0,0.12);
  --radius: 12px;
}

/* ===== 头部导航 ===== */
.header {
  background: var(--white);
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
  position: sticky;
  top: 0;
  z-index: 1000;
}
.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}
.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
}
.logo-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 1.1rem;
}
.nav-desktop { display: flex; gap: 2rem; }
.nav-desktop a {
  font-size: 0.95rem;
  color: var(--text);
  font-weight: 500;
  position: relative;
  padding: 0.25rem 0;
}
.nav-desktop a:hover,
.nav-desktop a.active { color: var(--primary); }
.nav-desktop a::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 0; height: 2px;
  background: var(--primary);
  transition: width 0.3s;
}
.nav-desktop a:hover::after,
.nav-desktop a.active::after { width: 100%; }

/* 下拉菜单 */
.nav-item { position: relative; }
.nav-submenu {
  position: absolute;
  top: 100%; left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: var(--white);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  padding: 0.5rem 0;
  min-width: 160px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
}
.nav-item:hover .nav-submenu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
.nav-submenu a {
  display: block;
  padding: 0.6rem 1.2rem;
  font-size: 0.9rem;
  white-space: nowrap;
}
.nav-submenu a:hover { background: var(--primary-light); }

/* 移动端菜单 */
.mobile-toggle {
  display: none;
  background: none; border: none;
  font-size: 1.5rem; color: var(--text);
  cursor: pointer;
}
.nav-mobile {
  display: none;
  background: var(--white);
  border-top: 1px solid #e2e8f0;
  padding: 1rem 0;
}
.nav-mobile a {
  display: block;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  color: var(--text);
}
.nav-mobile a:hover { color: var(--primary); background: #f8fafc; }

/* ===== Banner轮播 ===== */
.banner {
  position: relative;
  height: 520px;
  overflow: hidden;
}
.banner-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1s;
  display: flex;
  align-items: center;
  background-size: cover;
  background-position: center;
}
.banner-slide.active { opacity: 1; }
.banner-slide::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.2) 100%);
}
.banner-content {
  position: relative;
  z-index: 2;
  color: #fff;
  max-width: 600px;
}
.banner-content h2 {
  font-size: 2.8rem;
  font-weight: 700;
  margin-bottom: 1rem;
  line-height: 1.2;
}
.banner-content p {
  font-size: 1.15rem;
  opacity: 0.9;
  margin-bottom: 1.5rem;
}
.btn-primary {
  display: inline-block;
  padding: 0.85rem 2rem;
  background: var(--primary);
  color: #fff;
  border-radius: 50px;
  font-weight: 500;
  transition: all 0.3s;
}
.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(37,99,235,0.3);
}
.banner-dots {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.6rem;
  z-index: 10;
}
.banner-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,0.4);
  cursor: pointer;
  transition: all 0.3s;
}
.banner-dot.active {
  background: #fff;
  width: 28px;
  border-radius: 5px;
}

/* ===== 板块通用样式 ===== */
.section { padding: 5rem 0; }
.section-title {
  text-align: center;
  margin-bottom: 3rem;
}
.section-title h2 {
  font-size: 2rem;
  color: var(--text);
  margin-bottom: 0.5rem;
}
.section-title p {
  color: var(--text-light);
  font-size: 0.95rem;
}

/* ===== 首页关于板块 ===== */
.about-section {
  background: var(--white);
}
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}
.about-img {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.about-img img { width: 100%; }
.about-content h3 {
  font-size: 1.8rem;
  color: var(--text);
  margin-bottom: 1rem;
}
.about-content p {
  color: var(--text-light);
  margin-bottom: 1.5rem;
  line-height: 1.8;
}
.about-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 2rem;
}
.stat-item {
  text-align: center;
  padding: 1rem;
  background: var(--bg);
  border-radius: var(--radius);
}
.stat-item .num {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary);
}
.stat-item .label {
  font-size: 0.85rem;
  color: var(--text-light);
}

/* ===== 专科板块 ===== */
.specialty-section { background: var(--bg); }
.specialty-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}
.specialty-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  text-align: center;
  box-shadow: var(--shadow);
  transition: all 0.3s;
}
.specialty-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
}
.specialty-icon {
  width: 60px; height: 60px;
  margin: 0 auto 1rem;
  background: linear-gradient(135deg, var(--primary-light), #dbeafe);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--primary);
  font-size: 1.5rem;
}
.specialty-card h4 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}
.specialty-card p {
  font-size: 0.85rem;
  color: var(--text-light);
}

/* ===== 文章/新闻卡片 ===== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.card-item {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: all 0.3s;
}
.card-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}
.card-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  background: #e2e8f0;
}
.card-body { padding: 1.2rem; }
.card-body h4 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
  color: var(--text);
  line-height: 1.4;
}
.card-body p {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 0.75rem;
}
.card-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: #94a3b8;
}

/* ===== 新闻动态首页板块 ===== */
.news-section { background: var(--white); }
.news-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}
.news-item {
  display: flex;
  gap: 1rem;
  padding: 1.2rem;
  background: var(--bg);
  border-radius: var(--radius);
  transition: all 0.3s;
}
.news-item:hover { background: #e2e8f0; }
.news-date {
  width: 60px; height: 60px;
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.news-date .day { font-size: 1.3rem; font-weight: 700; line-height: 1; }
.news-date .month { font-size: 0.75rem; }
.news-info h4 {
  font-size: 0.95rem;
  margin-bottom: 0.3rem;
  color: var(--text);
}
.news-info p {
  font-size: 0.8rem;
  color: var(--text-light);
}

/* ===== 页面通用 banner ===== */
.page-banner {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  padding: 4rem 0;
  color: #fff;
  text-align: center;
}
.page-banner h1 {
  font-size: 2.2rem;
  margin-bottom: 0.5rem;
}
.page-banner p { opacity: 0.85; }

/* ===== 内容页面布局 ===== */
.content-section { padding: 3rem 0; }
.content-main {
  background: var(--white);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
}
.content-main h2 { font-size: 1.5rem; margin-bottom: 1rem; color: var(--text); }
.content-main h3 { font-size: 1.2rem; margin: 1.5rem 0 0.75rem; color: var(--primary); }
.content-main p { margin-bottom: 1rem; color: var(--text-light); line-height: 1.8; }
.content-main ul { margin: 1rem 0 1rem 1.5rem; }
.content-main ul li { margin-bottom: 0.5rem; color: var(--text-light); list-style: disc; }

/* ===== 关于我们页面 ===== */
.timeline {
  position: relative;
  padding-left: 2rem;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: var(--primary-light);
}
.timeline-item {
  position: relative;
  padding-bottom: 2rem;
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: -2rem; top: 0.3rem;
  width: 12px; height: 12px;
  background: var(--primary);
  border-radius: 50%;
  margin-left: -5px;
}
.timeline-year {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.3rem;
}

.branch-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.branch-item {
  background: var(--bg);
  padding: 1.5rem;
  border-radius: var(--radius);
  text-align: center;
}
.branch-item h4 { color: var(--primary); margin-bottom: 0.5rem; }

/* ===== 专科列表页 ===== */
.filter-bar {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}
.filter-bar a {
  padding: 0.5rem 1.2rem;
  background: #e2e8f0;
  border-radius: 50px;
  font-size: 0.9rem;
  transition: all 0.3s;
}
.filter-bar a:hover,
.filter-bar a.active {
  background: var(--primary);
  color: #fff;
}

/* ===== 列表页通用 ===== */
.list-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

/* ===== 分页 ===== */
.pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 2rem;
}
.page-item {
  padding: 0.5rem 1rem;
  background: var(--white);
  border-radius: 6px;
  font-size: 0.9rem;
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.page-item.active {
  background: var(--primary);
  color: #fff;
}
.page-item:hover:not(.active) { background: var(--bg); }

/* ===== 联系我们 ===== */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
}
.contact-info h3 { margin-bottom: 1.5rem; }
.contact-info-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.2rem;
}
.contact-icon {
  width: 44px; height: 44px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.contact-form .form-group { margin-bottom: 1.2rem; }
.contact-form label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.9rem;
  color: var(--text);
}
.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.95rem;
  transition: border-color 0.3s;
}
.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--primary);
}
.contact-form textarea { min-height: 120px; resize: vertical; }
.btn-submit {
  width: 100%;
  padding: 0.9rem;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.3s;
}
.btn-submit:hover { background: var(--primary-dark); }

/* ===== 底部 ===== */
.footer {
  background: var(--text);
  color: #94a3b8;
  padding: 3rem 0 1.5rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}
.footer-brand .logo { color: #fff; margin-bottom: 1rem; }
.footer-brand p { font-size: 0.9rem; line-height: 1.8; }
.footer h4 {
  color: #fff;
  font-size: 1rem;
  margin-bottom: 1.2rem;
}
.footer a {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 0.6rem;
  transition: color 0.3s;
}
.footer a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid #334155;
  padding-top: 1.5rem;
  text-align: center;
  font-size: 0.85rem;
}

/* ===== 懒加载占位 ===== */
img[data-src] { background: #e2e8f0; min-height: 120px; }

/* ===== 响应式适配 ===== */
@media (max-width: 992px) {
  .about-grid { grid-template-columns: 1fr; }
  .specialty-grid { grid-template-columns: repeat(2, 1fr); }
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .news-list { grid-template-columns: 1fr; }
  .branch-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
  .contact-grid { grid-template-columns: 1fr; }
  .list-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .nav-desktop { display: none; }
  .mobile-toggle { display: block; }
  .nav-mobile.active { display: block; }
  .banner { height: 380px; }
  .banner-content h2 { font-size: 1.8rem; }
  .section { padding: 3rem 0; }
  .specialty-grid { grid-template-columns: 1fr; }
  .card-grid { grid-template-columns: 1fr; }
  .about-stats { grid-template-columns: 1fr; }
  .branch-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .list-grid { grid-template-columns: 1fr; }
  .page-banner h1 { font-size: 1.6rem; }
}

/* ===== 返回顶部 ===== */
.back-top {
  position: fixed;
  bottom: 2rem; right: 2rem;
  width: 44px; height: 44px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
  z-index: 999;
  box-shadow: 0 4px 12px rgba(37,99,235,0.3);
}
.back-top.visible { opacity: 1; visibility: visible; }
.back-top:hover { background: var(--primary-dark); }
