/*
 * 信息卡片优化版 CSS v3.0
 * 完美解决遮挡和美观问题
 */

/* ========== 信息卡片核心样式 ========== */
.info-card {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) translateY(100%);
  width: 82%;
  max-width: 1150px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(255, 255, 255, 0.98) 100%);
  backdrop-filter: blur(15px);
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -12px 35px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.06);
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 900;
  display: flex;
  flex-direction: row;
  overflow: hidden;
  opacity: 0;
  border: 1px solid rgba(255, 255, 255, 0.4);
  min-width: 300px;
  min-height: 150px;
}

.info-card.active {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ========== 唐风装饰元素 - 优化位置和透明度 ========== */
.info-card .right-decor {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  background: linear-gradient(180deg, #8B4513 0%, #6B8E23 50%, #8B4513 100%);
  opacity: 0.55;
  z-index: 1;
}

.info-card .corner-tl,
.info-card .corner-bl {
  position: absolute;
  width: 30px;
  height: 30px;
  border: 2px solid #8B4513;
  opacity: 0.35;
  pointer-events: none;
  z-index: 1;
}

.info-card .corner-tl {
  top: 15px;
  left: 15px;
  border-right: none;
  border-bottom: none;
}

.info-card .corner-bl {
  bottom: 15px;
  left: 15px;
  border-right: none;
  border-top: none;
}

/* ========== 图片容器 - 解决遮挡问题 ========== */
.info-image-container {
  width: 28%;
  min-width: 170px;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  z-index: 2;
}

.info-image {
  width: 100%;
  height: 100%;
  min-height: 310px;
  object-fit: cover;
  display: block;
  border-radius: 0;
}

/* 地点名称徽章 - 优化位置和样式 */
.location-name-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(0, 0, 0, 0.68);
  backdrop-filter: blur(8px);
  padding: 7px 12px;
  border-radius: 7px;
  z-index: 10;
}

.location-name {
  display: block;
  font-size: 19px;
  font-weight: bold;
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.location-pinyin {
  display: block;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.8);
  font-style: italic;
  margin-top: 3px;
}

/* ========== 内容容器 - 优化间距 ========== */
.info-content-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 2;
}

.info-content {
  padding: 22px 32px;
  overflow-y: auto;
  max-height: 370px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

/* 内容滚动条美化 */
.info-content::-webkit-scrollbar {
  width: 5px;
}

.info-content::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.02);
  border-radius: 3px;
}

.info-content::-webkit-scrollbar-thumb {
  background: rgba(107, 142, 35, 0.2);
  border-radius: 3px;
}

.info-content::-webkit-scrollbar-thumb:hover {
  background: rgba(107, 142, 35, 0.35);
}

/* ========== 内容排版 - 优化层次感 ========== */
.info-title {
  font-size: 28px;
  margin-bottom: 8px;
  color: #333;
  text-align: center;
  font-weight: bold;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  letter-spacing: 0.5px;
}

.info-year {
  font-size: 14px;
  color: #777;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid #f0f0f0;
  text-align: center;
  font-style: italic;
}

.info-description {
  margin-bottom: 20px;
  line-height: 1.85;
  font-size: 16px;
  color: #444;
  text-indent: 2em;
  letter-spacing: 0.3px;
}

/* 诗词样式 - 优化外观 */
.info-poem {
  color: #556B2F;
  margin-bottom: 16px;
  padding: 14px 18px;
  background-color: #F5F9F0;
  border-radius: 8px;
  font-style: italic;
  border-left: 3px solid #6B8E23;
  box-shadow: 0 2px 6px rgba(107, 142, 35, 0.06);
}

.poem-title {
  font-weight: bold;
  font-size: 18px;
  margin-bottom: 10px;
  color: #556B2F;
  text-align: center;
  font-style: normal;
  letter-spacing: 1px;
}

/* 双语文字样式 */
.bilingual-text {
  margin-bottom: 8px;
}

.bilingual-item {
  margin-bottom: 12px;
}

.chinese-text {
  font-family: 'Microsoft YaHei', 'PingFang SC', serif;
  font-size: 16px;
  color: #444;
  line-height: 1.85;
  margin-bottom: 6px;
  letter-spacing: 0.3px;
}

.english-text {
  font-family: 'Times New Roman', serif;
  font-size: 13px;
  color: #777;
  line-height: 1.55;
  font-style: italic;
  letter-spacing: 0.2px;
}

/* ========== 控制按钮 - 优化位置和样式 ========== */
.info-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  background-color: rgba(0, 0, 0, 0.15);
  color: #ffffff;
  border: none;
  border-radius: 50%;
  font-size: 17px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease, transform 0.2s ease;
  z-index: 100;
}

.info-close:hover {
  background-color: rgba(0, 0, 0, 0.3);
  transform: scale(1.08);
}

.info-close:focus {
  outline: 2px solid #6B8E23;
  outline-offset: 2px;
}

/* 主折叠按钮 */
.card-main-toggle {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.9);
  border: none;
  font-size: 15px;
  cursor: pointer;
  color: #6B8E23;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 3px 9px;
  border-radius: 12px;
  z-index: 100;
}

.card-main-toggle:hover {
  background: #ffffff;
}

.card-main-toggle:focus {
  outline: 2px solid #6B8E23;
  outline-offset: 2px;
}

.info-card.expanded .card-main-toggle {
  transform: translateX(-50%) rotate(180deg);
}

/* ========== 响应式设计 ========== */
@media (max-width: 1024px) {
  .info-card {
    width: 88%;
  }
  
  .info-image-container {
    width: 32%;
  }
}

@media (max-width: 768px) {
  .info-card {
    width: 94%;
    flex-direction: column;
    max-height: 50vh;
  }
  
  .info-image-container {
    width: 100%;
    min-width: 100%;
  }
  
  .info-image {
    min-height: 130px;
    max-height: 160px;
  }
  
  .info-content {
    padding: 14px 16px;
    max-height: 250px;
  }
  
  .info-title {
    font-size: 22px;
  }
  
  .info-description,
  .chinese-text {
    font-size: 15px;
  }
  
  .english-text {
    display: none;
  }
  
  .location-name-badge {
    top: 8px;
    left: 8px;
    padding: 4px 8px;
  }
  
  .location-name {
    font-size: 17px;
  }
  
  .location-pinyin {
    display: none;
  }
  
  .info-card .corner-tl,
  .info-card .corner-bl {
    width: 24px;
    height: 24px;
  }
}

@media (max-width: 480px) {
  .info-card {
    width: 100%;
    border-radius: 15px 15px 0 0;
  }
  
  .info-content {
    padding: 10px 13px;
    max-height: 220px;
  }
  
  .info-title {
    font-size: 19px;
  }
  
  .info-description,
  .chinese-text {
    font-size: 14px;
    line-height: 1.7;
  }
}

/* ========== 可访问性优化 ========== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (prefers-contrast: high) {
  .info-card {
    border: 2px solid #333;
  }
  
  .info-close {
    background-color: #333;
  }
}
