/* ========== Sidebar (collapsible) ========== */
.sidebar {
  height: 100%;
  width: 60px; /* collapsed width */
  position: fixed;
  background-color: #f1f1f1;
  overflow: hidden;
  transition: width 0.3s ease;
}

/* Expand on hover */
.sidebar:hover {
  width: 200px;
}

/* ========== Sidebar Logo ========== */
#sidebar-logo {
  text-align: center;
  padding: 16px 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

#sidebar-logo img {
  width: 80px;
}

/* Show logo when expanded */
.sidebar:hover #sidebar-logo {
  opacity: 1;
  pointer-events: auto;
}

/* ========== Sidebar Links and Summary ========== */
.sidebar a,
.sidebar details summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  color: black;
  font-size: 16px;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.sidebar a.active,
.sidebar details[open] summary {
  background-color: #4CAF50;
  color: white;
}

.sidebar a:hover:not(.active),
.sidebar details summary:hover {
  background-color: #333; /* improved contrast */
  color: white;
}

/* ========== Icons ========== */
.sidebar a img,
.sidebar details summary img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  flex-shrink: 0;
}

/* ========== Text ========== */
.sidebar a p,
.sidebar details summary p {
  margin: 0;
  font-size: 16px;
  line-height: 24px;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

/* Show text on sidebar hover */
.sidebar:hover a p,
.sidebar:hover details summary p {
  opacity: 1;
  pointer-events: auto;
}

/* ========== Collapsible Sub-links ========== */
.sidebar details a {
  display: block;
  padding: 8px 32px;
  font-size: 14px;
  color: black;
}

.sidebar details a:hover {
  background-color: #e0e0e0;
  color: black;
}

/* ========== Main Content Offset ========== */
.content {
  margin-left: 60px; /* matches collapsed sidebar width */
  padding: 20px;
  transition: margin-left 0.3s ease;
  min-height: 100vh; /* ensure it fills screen height */
  background-color: #fff; /* for contrast */
}

/* Expand content margin when sidebar expands */
.sidebar:hover ~ .content {
  margin-left: 200px;
}

/* ========== Container (Your Custom Block) ========== */
.container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 85%;
  max-width: 700px;
  margin: 20px auto; /* reduced vertical gap */
  padding: 12px 16px; /* smaller padding */
  border: 3px solid #ccc; /* thinner border */
  border-radius: 10px;
  background-color: #fafafa;
  font-family: "Markazi Text", serif, "Times New Roman";
  font-size: 22px; /* smaller text */
  color: black;
  transition: background-color 0.3s, border-color 0.3s, color 0.3s, box-shadow 0.3s;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1); /* subtle shadow */
}

/* Hover effect */
.container:hover {
  color: #007BFF;
  border-color: #007BFF;
  background-color: #e6f7ff;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2); /* stronger hover shadow */
}

/* Image inside container */
.container img {
  width: 120px; /* smaller image */
  height: auto;
  margin-left: 15px;
  border-radius: 6px;
}

/* ========== Details summary (main title "历史类") ========== */
details summary.container {
  justify-content: center;
  font-size: 28px;
  font-weight: bold;
  background-color: #f1f1f1;
  border-color: #bbb;
  cursor: pointer;
}

/* Reduce spacing between containers inside details */
details .container {
  margin: 12px auto;
}

/* ========== Responsive Adjustments ========== */
@media (max-width: 600px) {
  .sidebar:hover {
    width: 150px;
  }

  .content {
    margin-left: 60px;
  }

  .container {
    flex-direction: column;
    text-align: center;
    font-size: 20px;
  }

  .container img {
    margin: 10px 0 0;
    width: 100%;
    max-width: 250px;
  }
}

/*
.slider {
  overflow: hidden;
  white-space: nowrap;
  width: 100%;
}

.slide-track {
  display: flex;
  animation: scroll 20s linear infinite;
}

.slide-track img {
  height: 200px;
  margin-right: 10px;
}

@keyframes scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
*/
.slideshow {
  position: relative;
  width: 100%;
  height: 400px;
  overflow: hidden;
}

.slide {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1s;
}