* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'AaBeiYuLinShiDeXin', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: #ffd1dc; /* 恢复淡粉色背景 */
  color: #333;
  line-height: 1.6;
}

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

h1 {
  text-align: center;
  color: #333;
  margin-bottom: 30px;
  font-size: 2.5em;
}

.event-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  padding: 20px;
}

/* 当屏幕足够宽时，最多显示 6 列 */
@media (min-width: 1800px) {
 .event-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

/* 屏幕宽度稍窄时，显示 5 列 */
@media (min-width: 1500px) and (max-width: 1799px) {
 .event-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

/* 屏幕宽度再窄一点，显示 4 列 */
@media (min-width: 1200px) and (max-width: 1499px) {
 .event-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* 屏幕宽度继续变窄，显示 3 列 */
@media (min-width: 900px) and (max-width: 1199px) {
 .event-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* 屏幕宽度更窄，显示 2 列 */
@media (min-width: 600px) and (max-width: 899px) {
 .event-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* 屏幕宽度很窄时，显示 1 列 */
@media (max-width: 599px) {
 .event-grid {
    grid-template-columns: 1fr;
  }
}

.event-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  overflow: hidden;
  cursor: pointer;
}

.event-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.event-card-inner {
  padding: 20px;
}

.event-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.event-name {
  font-size: 1.3em;
  color: #333;
  margin: 0;
}

.event-description {
  color: #666;
  font-size: 0.95em;
}

.event-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
}

.event-status {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.9em;
  font-weight: 500;
}

.event-status:not(.completed) {
  background-color: #fff3e0;
  color: #f57c00;
}

.event-status.completed {
  background-color: #e8f5e9;
  color: #2e7d32;
}

.completion-date {
  font-size: 0.85em;
  color: #666;
}

.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal.show {
  opacity: 1;
}

.modal-content {
  background-color: #fefefe;
  margin: 15% auto;
  padding: 25px;
  border-radius: 12px;
  width: 90%;
  max-width: 600px;
  position: relative;
  transform: translateY(-20px);
  opacity: 0;
  transition: all 0.3s ease;
}

.modal.show .modal-content {
  transform: translateY(0);
  opacity: 1;
}

.close {
  position: absolute;
  right: 20px;
  top: 15px;
  color: #aaa;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.3s ease;
}

.close:hover {
  color: #333;
}

.modal h2 {
  color: #333;
  margin-bottom: 20px;
  padding-right: 30px;
}

.modal-info {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.modal-info p {
  color: #555;
  line-height: 1.6;
}

.modal-details {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid #eee;
}

.no-events {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px;
  background: white;
  border-radius: 10px;
  color: #666;
}

@media (max-width: 768px) {
 .event-grid {
    grid-template-columns: 1fr;
    padding: 10px;
  }

  h1 {
    font-size: 2em;
  }

 .modal-content {
    margin: 10% auto;
    width: 95%;
    padding: 20px;
  }
}