/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Microsoft YaHei', Arial, sans-serif;
  line-height: 1.6;
  color: #333;
  scroll-behavior: smooth;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header styles */
header {
  background-color: #8B4513;
  color: white;
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  transition: all 0.3s ease;
}

header.scrolled {
  padding: 0.5rem 0;
  background-color: rgba(139, 69, 19, 0.95);
  backdrop-filter: blur(10px);
}

header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo-image {
  width: 60px;
  height: 60px;
  border-radius: 5%;
}

.logo h1 {
  font-size: 1.8rem;
  font-weight: bold;
}

nav ul {
  display: flex;
  list-style: none;
}

nav ul li {
  margin-left: 1.5rem;
}

nav ul li a {
  color: white;
  text-decoration: none;
  transition: color 0.3s;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  position: relative;
}

nav ul li a:hover,
nav ul li a.active {
  color: #FFD700;
  background-color: rgba(255, 215, 0, 0.1);
}

nav ul li a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background-color: #FFD700;
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

nav ul li a:hover::after,
nav ul li a.active::after {
  width: 80%;
}

/* Mobile menu button */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
}

/* Main layout */
.main-content {
  display: flex;
  position: relative;
  max-width: 1900px;
  margin: 0 auto;
  padding: 0 20px;
}

.content-wrapper {
  flex: 1;
}

/* Sidebar */
.sidebar {
  width: 400px;
  padding: 20px;
  position: sticky;
  top: 100px;
  align-self: start;
  height: fit-content;
}

.sidebar-content {
  background-color: #f9f5f0;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.sidebar-content > div {
  margin-bottom: 10px;
}

.sidebar-content > div:last-child {
  margin-bottom: 0;
}

.sidebar h3 {
  color: #8B4513;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 2px solid #8B4513;
}

/* Calendar */
.calendar {
  text-align: center;
  padding: 10px;
  background-color: white;
  border-radius: 5px;
  font-size: 1rem;
  color: #8B4513;
  margin-bottom: 10px;
}

.calendar-date {
  font-weight: bold;
  margin-bottom: 5px;
}

.calendar-weekday {
  font-size: 0.9rem;
}

.calendar-duration {
  font-size: 0.85rem;
  line-height: 1.4;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed #8B4513;
}

/* Articles list */
.articles-list {
  list-style: none;
}

.articles-list li {
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px dashed #ddd;
}

.articles-list li:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.articles-list a {
  text-decoration: underline;
  color: #333;
  transition: color 0.3s;
  display: block;
  font-size: 0.9rem;
}

.articles-list a:hover {
  color: #8B4513;
}

/* Brand message */
.sidebar-brand-message h3 {
  margin-top: 10px;
}

.sidebar-brand-message p {
  font-size: 0.9rem;
  line-height: 1.8;
  color: #666;
}

/* Footer */
footer {
  background-color: #333;
  color: white;
  padding: 3rem 0 1.5rem;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.footer-section {
  flex: 1;
  min-width: 250px;
  margin-bottom: 1.5rem;
}

.footer-section h3 {
  margin-bottom: 1rem;
  color: #FFD700;
}

.footer-section img {
  width: 120px;
  height: 120px;
  border: 2px solid #FFD700;
  border-radius: 5px;
}

.footer-nav {
  margin-top: 1.5rem;
}

.footer-nav ul {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.footer-nav ul li {
  margin-bottom: 0.5rem;
}

.footer-nav ul li a {
  color: #ccc;
  text-decoration: none;
  transition: color 0.3s;
  display: block;
  padding: 0.5rem;
  text-align: center;
  border-radius: 4px;
}

.footer-nav ul li a:hover {
  color: #FFD700;
  background-color: rgba(255, 215, 0, 0.1);
}

.copyright {
  text-align: center;
  padding-top: 1.5rem;
  border-top: 1px solid #555;
  font-size: 0.9rem;
}

/* Back to top button */
.back-to-top {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: #8B4513;
  color: white;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 24px;
  text-decoration: none;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
  transition: all 0.3s ease;
  z-index: 99;
  opacity: 0;
  visibility: hidden;
}

.back-to-top.show {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background-color: #A0522D;
  transform: translateY(-3px);
}

/* Page header */
.page-header {
  background-color: #f9f5f0;
  padding: 3rem 0;
  text-align: center;
  margin-bottom: 3rem;
}

.page-header h1 {
  font-size: 2.5rem;
  color: #8B4513;
}

/* Responsive design */
@media (max-width: 1024px) {
  .main-content {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    position: static;
    padding: 20px 0;
  }

  @media (max-width: 768px) {
    /* Page header */
    .page-header {
      padding: 0.5rem 0;
      margin-bottom: 0.5rem;
    }

    header .container {
      flex-direction: column;
    }

    .menu-toggle {
      display: block;
      position: absolute;
      top: 1.8rem;
      right: 1rem;
    }

    nav ul {
      margin-top: 1rem;
      flex-direction: column;
      width: 100%;
      background-color: rgba(139, 69, 19, 0.95);
      border-radius: 5px;
      padding: 1rem;
      display: none;
    }

    nav ul.show {
      display: flex;
    }

    nav ul li {
      margin: 0.5rem 0;
      text-align: center;
    }

    .footer-content {
      flex-direction: column;
      align-items: center;
    }

    .footer-section {
      margin-bottom: 1.5rem;
      text-align: center;
    }
  }
}
