/* ============================================
   更新日志 Modal 样式
   ============================================ */

.et-changelog-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: #0070f3;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 4px 8px;
  margin-left: 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
  text-decoration: none;
  outline: none;
}

.et-changelog-btn:hover {
  background: rgba(0, 112, 243, 0.08);
  color: #0053b3;
}

.et-changelog-btn:active {
  background: rgba(0, 112, 243, 0.12);
}

.et-changelog-btn:focus-visible {
  box-shadow: 0 0 0 3px rgba(0, 112, 243, 0.35);
}

/* 移动端轻量按钮（放在移动端版本信息下方） */
.et-changelog-btn-mobile {
  margin-top: 6px;
  font-size: 0.95rem;
}

/* 覆盖层 */
.et-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;                  /* 始终占位，用可见性与透明度控制显示，便于过渡动画 */
  align-items: center;
  justify-content: center;
  z-index: 20000;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.et-modal-overlay.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Modal 容器 */
.et-modal {
  position: relative;
  background: #fff;
  color: #333;
  width: 600px;
  height: 800px;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(10px) scale(0.98);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.et-modal-overlay.open .et-modal {
  opacity: 1;
  transform: none;
}

.et-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid #eee;
  background: #fafafa;
  overflow: hidden; /* 防止无意义的滚动条指示器 */
}

.et-modal-title {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: hidden; /* 防止无意义的滚动条指示器 */
  scrollbar-width: none; /* Firefox 隐藏多余指示器 */
}
.et-modal-title::-webkit-scrollbar { display: none; } /* WebKit 隐藏多余指示器 */

.et-modal-title-text {
  font-size: 21px;
  font-weight: 700;
  color: #222;
}

.et-modal-title-version {
  font-size: 14px;
  color: #666;
}

.et-modal-controls {
  display: flex;
  align-items: center;
  gap: 14px;
}

.et-select-label {
  font-size: 14px;
  color: #666;
}

.et-changelog-select {
  font-size: 16px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid #ddd;
  background: #fff;
  color: #333;
}

.et-modal-close {
  appearance: none;
  border: none;
  background: #f3f3f3;
  color: #333;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
  font-size: 18px;
}

.et-modal-close:hover {
  background: #e8e8e8;
}

.et-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 22px;
  -webkit-overflow-scrolling: touch; /* 仅在内容区启用惯性滚动 */
  overscroll-behavior: contain;      /* 防止滚动穿透 */
  scrollbar-gutter: stable;          /* 避免指示器覆盖布局（支持的浏览器） */
}

.et-changelog-meta {
  font-size: 14px;
  color: #888;
  margin-bottom: 12px;
  overflow: hidden; /* 防止无意义的滚动条指示器 */
  scrollbar-width: none; /* Firefox 隐藏多余指示器 */
}
.et-changelog-meta::-webkit-scrollbar { display: none; } /* WebKit 隐藏多余指示器 */

.et-changelog-content {
  font-size: 16px;
  color: #333;
  line-height: 1.85;
  white-space: normal;        /* 正常换行 */
  word-break: break-word;     /* 长单词/长链接强制换行 */
  overflow-wrap: anywhere;    /* 任意位置换行，避免溢出 */
}

.et-changelog-section {
  margin-bottom: 22px;
}

.et-changelog-section-title {
  font-weight: 700;
  margin-bottom: 10px;
  font-size: 16px;
  color: #111;
}

.et-changelog-list {
  padding-left: 18px;
  margin: 0;
}

.et-changelog-list li {
  margin: 8px 0;
  white-space: inherit;       /* 继承容器的换行策略 */
  word-break: inherit;
  overflow-wrap: inherit;
}

.et-modal-footer {
  padding: 16px 20px;
  border-top: 1px solid #eee;
  background: #fafafa;
  display: flex;
  justify-content: flex-end;
}

.et-modal-close-footer {
  width: auto;
  height: auto;
  padding: 10px 16px;
  border-radius: 8px;
}

/* 移动端全屏显示 */
@media (max-width: 768px) {
  .et-modal-overlay {
    padding: 0; /* 去除边距，确保严格全屏 */
  }
  .et-modal {
    width: 100%;
    height: 100%;
    border-radius: 0;
  }
  .et-modal-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: calc(12px + env(safe-area-inset-top)) 16px 12px; /* 顶部安全区 */
  }
  .et-modal-controls {
    width: 100%;
    gap: 10px;
    flex-wrap: nowrap; /* 避免换行挤压 */
  }
  .et-select-label {
    display: none; /* 移动端隐藏文本标签，保留ARIA标签 */
  }
  .et-changelog-select {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;   /* 防止溢出换行 */
  }
  .et-modal-close {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
  }
  .et-modal-body {
    padding: 12px 16px;
  }
  .et-modal-footer {
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); /* 底部安全区 */
  }
}

/* 打开弹窗时，模糊主页背景 */
.et-modal-open .et-fullpage-container {
  filter: blur(6px);
  -webkit-filter: blur(6px);
  transition: filter 0.25s ease;
}

/* 降级：减少动效 */
@media (prefers-reduced-motion: reduce) {
  .et-modal-overlay,
  .et-modal,
  .et-modal-open .et-fullpage-container {
    transition: none !important;
  }
}

/* 移动端不需要模糊（全屏弹窗） */
@media (max-width: 768px) {
  .et-modal-open .et-fullpage-container {
    filter: none !important;
    -webkit-filter: none !important;
  }
}
