/* ============================================
   中国免疫学实验网 - 现代化样式
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #1a6fa0;
  --primary-dark: #135a82;
  --primary-light: #e8f4fc;
  --accent: #e8913a;
  --accent-light: #fef3e6;
  --text: #2c3e50;
  --text-light: #5a6a7a;
  --text-muted: #8899a6;
  --bg: #f5f8fa;
  --bg-white: #ffffff;
  --border: #dce6f0;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
  --radius: 8px;
  --radius-lg: 12px;
  --max-width: 1100px;
  --header-height: 70px;
  --nav-height: 52px;
  --transition: 0.25s ease;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover {
  color: var(--accent);
}

img {
  max-width: 100%;
  height: auto;
}

/* --- Header --- */
.site-header {
  background: linear-gradient(135deg, var(--primary) 0%, #2d8bc9 100%);
  color: #fff;
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 14px;
  color: #fff;
  text-decoration: none;
}

.logo-link:hover {
  color: #fff;
  opacity: 0.92;
}

.logo-img {
  height: 44px;
  width: auto;
  border-radius: 6px;
  background: #fff;
  padding: 3px;
}

.logo-text {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 1px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

.logo-sub {
  font-size: 12px;
  font-weight: 400;
  opacity: 0.85;
  letter-spacing: 0.5px;
}

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

.header-right a {
  color: rgba(255,255,255,0.9);
  font-size: 14px;
  padding: 6px 14px;
  border-radius: 20px;
  transition: all var(--transition);
}
.header-right a:hover {
  background: rgba(255,255,255,0.18);
  color: #fff;
}

/* --- Navigation --- */
.site-nav {
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
  position: sticky;
  top: var(--header-height);
  z-index: 99;
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  height: var(--nav-height);
  gap: 0;
  overflow-x: auto;
}

.nav-inner::-webkit-scrollbar {
  display: none;
}

.nav-link {
  display: flex;
  align-items: center;
  padding: 0 16px;
  height: var(--nav-height);
  color: var(--text);
  font-size: 14.5px;
  font-weight: 500;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  transition: all var(--transition);
  text-decoration: none;
}
.nav-link:hover,
.nav-link.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: var(--primary-light);
}
.nav-link.disabled {
  color: var(--text-muted);
  cursor: default;
  pointer-events: none;
}

/* --- Main Layout --- */
.site-main {
  flex: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 28px 24px;
  width: 100%;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 28px;
  align-items: start;
}

/* --- Sidebar --- */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sidebar-card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  border: 1px solid var(--border);
}

.sidebar-card-header {
  background: linear-gradient(135deg, var(--primary) 0%, #2d8bc9 100%);
  color: #fff;
  padding: 12px 18px;
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-card-header svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.sidebar-card-body {
  padding: 16px 18px;
}

.sidebar-card-body p {
  margin-bottom: 6px;
  line-height: 2;
}

.sidebar-card-body a {
  color: var(--text);
  font-size: 14px;
  display: inline-block;
  transition: all var(--transition);
}
.sidebar-card-body a:hover {
  color: var(--primary);
  padding-left: 4px;
}

.sidebar-notice {
  background: var(--accent-light);
  color: #b35c00;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  line-height: 1.6;
  text-align: center;
  border: 1px solid #f5d5a8;
}

/* --- Content Area --- */
.content {
  min-width: 0;
}

.content-card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  overflow: hidden;
}

.content-header {
  background: linear-gradient(135deg, var(--primary) 0%, #2d8bc9 100%);
  color: #fff;
  padding: 14px 24px;
  font-size: 17px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.content-header-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.content-header-title svg {
  width: 20px;
  height: 20px;
}

.content-header-url {
  font-size: 12px;
  opacity: 0.8;
  font-weight: 400;
}

.content-body {
  padding: 28px 32px;
}

/* --- Home page content tree --- */
.tree-section {
  margin-bottom: 28px;
}

.tree-section:last-child {
  margin-bottom: 0;
}

.tree-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--primary-light);
}

.tree-title svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.tree-children {
  padding-left: 24px;
  margin-top: 4px;
}

.tree-children a {
  display: inline-block;
  padding: 3px 0;
  color: var(--text);
  font-size: 14.5px;
  transition: all var(--transition);
}
.tree-children a:hover {
  color: var(--primary);
  padding-left: 6px;
}

.tree-children .badge-building {
  display: inline-block;
  font-size: 11px;
  background: #fef3e6;
  color: #b35c00;
  padding: 1px 8px;
  border-radius: 10px;
  margin-left: 6px;
  vertical-align: middle;
  border: 1px solid #f5d5a8;
}

/* --- About page --- */
.about-content {
  line-height: 1.9;
  color: var(--text);
}
.about-content p {
  margin-bottom: 16px;
  text-indent: 2em;
}
.about-content .highlight {
  color: #c0392b;
  font-weight: 600;
}

/* --- Content body headings, images, tables --- */
.content-body h3,
.about-content h3 {
  font-size: 19px;
  font-weight: 700;
  color: var(--primary);
  margin: 28px 0 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--primary-light);
  text-indent: 0;
}
.content-body h3:first-child,
.about-content h3:first-child {
  margin-top: 0;
}
.content-body h4,
.about-content h4 {
  font-size: 16px;
  font-weight: 600;
  color: var(--primary-dark);
  margin: 20px 0 10px;
  text-indent: 0;
}
.content-body img,
.about-content img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 16px auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.content-body p,
.about-content p {
  text-indent: 2em;
}
.content-body p:has(img),
.about-content p:has(img) {
  text-align: center;
  text-indent: 0;
}
.content-body .img-caption,
.about-content .img-caption {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  margin: -8px 0 16px;
  text-indent: 0;
}
.content-body a,
.about-content a {
  color: var(--primary);
  text-decoration: underline;
  text-decoration-color: rgba(26,111,160,0.3);
  text-underline-offset: 2px;
}
.content-body a:hover,
.about-content a:hover {
  color: var(--accent);
}

/* --- Modern tables --- */
.content-body table,
.about-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0;
  font-size: 14px;
  box-shadow: var(--shadow-sm);
  border-radius: var(--radius);
  overflow: hidden;
}
.content-body table th,
.about-content table th {
  background: linear-gradient(135deg, var(--primary) 0%, #2d8bc9 100%);
  color: #fff;
  font-weight: 600;
  padding: 10px 14px;
  text-align: left;
  text-indent: 0;
}
.content-body table td,
.about-content table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  text-indent: 0;
}
.content-body table tbody tr:nth-child(even),
.about-content table tbody tr:nth-child(even) {
  background: var(--primary-light);
}
.content-body table tbody tr:hover,
.about-content table tbody tr:hover {
  background: #d6ecf7;
}
.content-body table tbody tr:last-child td,
.about-content table tbody tr:last-child td {
  border-bottom: none;
}

/* --- Footer --- */
.site-footer {
  background: #2c3e50;
  color: rgba(255,255,255,0.7);
  padding: 24px;
  text-align: center;
  font-size: 13px;
  line-height: 1.8;
  margin-top: auto;
}
.site-footer a {
  color: rgba(255,255,255,0.85);
}
.site-footer a:hover {
  color: #fff;
}
.site-footer .copyright {
  margin-top: 6px;
  opacity: 0.6;
  font-size: 12px;
}

/* --- Banner (replaces Flash) --- */
.hero-banner {
  max-width: var(--max-width);
  margin: 28px auto 0;
  padding: 0 24px;
}

.hero-inner {
  background: linear-gradient(135deg, #1a6fa0 0%, #2d8bc9 50%, #45a5e0 100%);
  border-radius: var(--radius-lg);
  padding: 36px 40px;
  color: #fff;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.hero-inner::before {
  content: '';
  position: absolute;
  top: -30%;
  right: -5%;
  width: 300px;
  height: 300px;
  background: rgba(255,255,255,0.06);
  border-radius: 50%;
}
.hero-inner::after {
  content: '';
  position: absolute;
  bottom: -40%;
  left: 20%;
  width: 200px;
  height: 200px;
  background: rgba(255,255,255,0.04);
  border-radius: 50%;
}

.hero-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 10px;
  position: relative;
  z-index: 1;
}

.hero-desc {
  font-size: 15px;
  opacity: 0.9;
  max-width: 600px;
  line-height: 1.7;
  position: relative;
  z-index: 1;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
  position: relative;
  z-index: 1;
}

.hero-tag {
  background: rgba(255,255,255,0.18);
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 13px;
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,0.2);
}

/* --- Responsive --- */
@media (max-width: 860px) {
  .site-main {
    grid-template-columns: 1fr;
  }
  .sidebar {
    order: 2;
  }
  .content {
    order: 1;
  }
  .hero-title {
    font-size: 22px;
  }
  .content-body {
    padding: 20px;
  }
  .nav-link {
    padding: 0 10px;
    font-size: 13px;
  }
}

@media (max-width: 600px) {
  .header-inner {
    padding: 0 16px;
  }
  .logo-text {
    font-size: 17px;
  }
  .logo-sub {
    display: none;
  }
  .hero-inner {
    padding: 24px;
  }
  .hero-title {
    font-size: 19px;
  }
}