/* Basic reset and global styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html, body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f9f9f9;
}
a {
  text-decoration: none;
  color: inherit;
}
ul {
  list-style-type: none;
}
.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
}

/* Header */
.site-header {
  background: #fff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
}
.logo span {
  font-weight: bold;
  font-size: 1.2rem;
  color: #8b0000;
}
.main-nav a {
  margin: 0 10px;
  padding: 8px 12px;
  border-radius: 4px;
  transition: background 0.2s;
}
.main-nav a:hover,
.main-nav a.active {
  background: #ffe6e6;
  color: #8b0000;
}
/* 统一主导航悬停颜色为淡红色，并更换文字颜色为深红 */
.main-nav a:hover {
  background: #ffe6e6;
  color: #8b0000;
}
.header-right {
  display: flex;
  align-items: center;
  gap: 6px;
}
.header-right input[type="text"] {
  padding: 6px 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
}
.header-right button {
  padding: 6px 10px;
  background: #8b0000;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s;
}
.header-right button:hover {
  background: #6b0000;
}

/* Hero Section */
.hero-section {
  position: relative;
  width: 100%;
  overflow: hidden;
  height: 300px;
}
.slider {
  position: relative;
  width: 100%;
  height: 100%;
}
.slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1s;
}
.slide.active {
  opacity: 1;
}
.slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.slider-indicators {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
}
.slider-indicators .indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,0.6);
  cursor: pointer;
  transition: background 0.3s;
}
.slider-indicators .indicator.active {
  background: #8b0000;
}

/* Section titles */
.section-title {
  font-size: 1.5rem;
  margin: 30px 0 15px;
  border-left: 4px solid #8b0000;
  padding-left: 10px;
}

/* Overview cards */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
}
.card {
  background: #fff;
  border-radius: 6px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.card-number {
  font-size: 2rem;
  font-weight: bold;
  color: #8b0000;
}
.card-label {
  margin-top: 5px;
  color: #666;
}

/* Feature grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}
.feature-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 15px;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  font-size: 24px;
  transition: transform 0.2s, box-shadow 0.2s;
}
.feature-item span {
  margin-top: 8px;
  font-size: 14px;
  color: #333;
}
.feature-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* News list */
.news-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}
.news-item {
  background: #fff;
  padding: 15px;
  border-radius: 6px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  transition: transform 0.2s;
}
.news-item:hover {
  transform: translateY(-2px);
}
.news-item h3 {
  font-size: 1rem;
  color: #8b0000;
  margin-bottom: 5px;
}
.news-item p {
  font-size: 0.9rem;
  color: #555;
}

/* Footer */
.site-footer {
  background: #f0f4f8;
  padding: 20px 0;
  margin-top: 40px;
  font-size: 0.9rem;
  color: #555;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 20px;
}
.footer-right ul li {
  margin-bottom: 4px;
}
.footer-right a {
  color: #8b0000;
}

/* Experts & Institutions pages */
.page-title {
  font-size: 1.8rem;
  margin: 20px 0 15px;
  color: #8b0000;
  text-align: left;
}
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}
.filters select,
.filters input[type="text"] {
  padding: 6px 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  min-width: 140px;
}
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}
.expert-card,
.institution-card {
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}
.expert-card:hover,
.institution-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
.expert-card img,
.institution-card img {
  width: 100%;
  height: 140px;
  object-fit: cover;
}
.expert-card .card-body,
.institution-card .card-body {
  padding: 15px;
}
.expert-card .card-body h3,
.institution-card .card-body h3 {
  font-size: 1rem;
  color: #8b0000;
  margin-bottom: 6px;
}
.expert-card .card-body p,
.institution-card .card-body p {
  font-size: 0.85rem;
  color: #666;
}

/* Expert detail page */
.expert-detail-layout {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 40px;
}
.expert-profile {
  flex: 1 1 250px;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  padding: 20px;
}
.expert-profile img {
  width: 100%;
  border-radius: 6px;
}
.expert-profile h2 {
  font-size: 1.4rem;
  margin-top: 10px;
  color: #8b0000;
}
.expert-profile ul {
  margin-top: 10px;
}
.expert-profile li {
  font-size: 0.9rem;
  color: #555;
  margin-bottom: 4px;
}
.expert-tabs {
  flex: 3 1 400px;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  padding: 20px;
}
.tab-header {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 15px;
}
.tab-header .tab-link {
  padding: 8px 12px;
  border: none;
  background: #ffe6e6;
  color: #8b0000;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s;
}
.tab-header .tab-link.active {
  background: #8b0000;
  color: #fff;
}
.tab-content {
  display: block;
}
.tab-content ul {
  list-style: disc inside;
  margin-left: 20px;
}
.tab-content li {
  margin-bottom: 6px;
  font-size: 0.9rem;
  color: #555;
}

/* Institution detail page */
.institution-detail-layout {
  background: #fff;
  padding: 20px;
  border-radius: 6px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.institution-detail-layout h2 {
  font-size: 1.4rem;
  color: #8b0000;
  margin-bottom: 10px;
}
.institution-detail-layout p {
  font-size: 0.9rem;
  color: #555;
  margin-bottom: 8px;
}
.institution-detail-layout .leaders {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}
.leader-card {
  flex: 1 1 150px;
  background: #f5f8fc;
  border-radius: 6px;
  padding: 10px;
  text-align: center;
}
.leader-card h4 {
  font-size: 1rem;
  color: #8b0000;
  margin-bottom: 4px;
}
.leader-card span {
  font-size: 0.85rem;
  color: #555;
}

/* Lawcase pages */
.lawcase-tabs {
  margin-bottom: 15px;
}
.lawcase-tabs .tab-link {
  padding: 8px 12px;
  border: none;
  border-radius: 4px;
  background: #ffe6e6;
  color: #8b0000;
  margin-right: 10px;
  cursor: pointer;
  transition: background 0.2s;
}
.lawcase-tabs .tab-link.active {
  background: #8b0000;
  color: #fff;
}
.lawcase-content {
  margin-top: 10px;
}
.law-item, .case-item {
  background: #fff;
  padding: 15px;
  margin-bottom: 10px;
  border-radius: 4px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.law-item h3, .case-item h3 {
  font-size: 1rem;
  color: #8b0000;
  margin-bottom: 6px;
}
.law-item p, .case-item p {
  font-size: 0.85rem;
  color: #555;
}

/* Reports page */
.report-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}
.report-card {
  background: #fff;
  padding: 15px;
  border-radius: 6px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  transition: transform 0.2s;
}
.report-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
.report-card h3 {
  font-size: 1rem;
  color: #8b0000;
  margin-bottom: 6px;
}
.report-card p {
  font-size: 0.85rem;
  color: #555;
}
.report-card a {
  display: inline-block;
  margin-top: 8px;
  color: #8b0000;
  text-decoration: underline;
  font-size: 0.85rem;
}

/* Map page */
.worldmap-wrapper {
  position: relative;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  border-radius: 6px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  background: #fff;
}
.worldmap-image {
  width: 100%;
  height: auto;
  display: block;
}
.map-markers {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}
.map-marker {
  position: absolute;
  transform: translate(-50%, -50%);
  background: rgba(139,0,0,0.8);
  color: #fff;
  border-radius: 50%;
  padding: 4px 6px;
  font-size: 0.7rem;
  text-align: center;
  white-space: nowrap;
}

/* Admin login */
.admin-container {
  max-width: 400px;
  margin: 0 auto;
  padding: 40px 0;
}
.login-form {
  background: #fff;
  padding: 20px;
  border-radius: 6px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.login-form label {
  font-weight: bold;
  font-size: 0.9rem;
  color: #8b0000;
}
.login-form input[type="text"],
.login-form input[type="password"] {
  padding: 6px 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
}
.login-form button {
  padding: 8px;
  background: #8b0000;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s;
}
.login-form button:hover {
  background: #6b0000;
}
.login-message {
  margin-top: 5px;
  font-size: 0.85rem;
  color: #f44336;
}

@media (max-width: 768px) {
  .header-inner {
    flex-wrap: wrap;
  }
  .main-nav {
    flex: 1 1 100%;
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }
  .main-nav a {
    flex: 1 1 calc(33.33% - 12px);
    text-align: center;
    margin: 0;
  }
  .header-right {
    width: 100%;
    margin-top: 10px;
    justify-content: center;
  }
  .expert-detail-layout,
  .institution-detail-layout {
    flex-direction: column;
  }
  .expert-tabs {
    flex: 1 1 100%;
  }
}