/**
 * 无障碍朗读功能样式
 */

/* 无障碍按钮 */
.accessibility-button {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.9);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1050;
  transition: all 0.3s ease;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.accessibility-button:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.accessibility-button i {
  font-size: 1.2rem;
  color: #555;
}

/* 深色模式适配 */
.dark-mode .accessibility-button {
  background-color: rgba(50, 50, 50, 0.9);
  border-color: rgba(255, 255, 255, 0.1);
}

.dark-mode .accessibility-button i {
  color: #eee;
}

/* 无障碍设置面板 */
.accessibility-panel {
  position: fixed;
  bottom: 70px;
  right: 20px;
  width: 300px;
  background-color: #fff;
  border-radius: 10px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
  z-index: 1050;
  overflow: hidden;
  transform: translateY(20px);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

.accessibility-panel.show {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
}

.accessibility-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 15px;
  border-bottom: 1px solid #eee;
}

.accessibility-panel-header h5 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.accessibility-panel-body {
  padding: 15px;
  max-height: 400px;
  overflow-y: auto;
}

.accessibility-panel-footer {
  padding: 10px 15px;
  border-top: 1px solid #eee;
  display: flex;
  justify-content: space-between;
}

.accessibility-panel .form-group {
  margin-bottom: 15px;
}

.accessibility-panel .form-range {
  width: 100%;
}

.accessibility-panel .form-check {
  margin-bottom: 8px;
}

/* 深色模式适配 */
.dark-mode .accessibility-panel {
  background-color: #333;
  color: #eee;
}

.dark-mode .accessibility-panel-header {
  border-bottom-color: #444;
}

.dark-mode .accessibility-panel-footer {
  border-top-color: #444;
}

.dark-mode .accessibility-panel .form-control,
.dark-mode .accessibility-panel .form-select {
  background-color: #444;
  color: #eee;
  border-color: #555;
}

.dark-mode .accessibility-panel .form-check-input {
  background-color: #444;
  border-color: #555;
}

.dark-mode .accessibility-panel .form-check-input:checked {
  background-color: #0d6efd;
  border-color: #0d6efd;
}

/* 文本高亮 */
.accessibility-highlight {
  position: fixed;
  bottom: 70px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 80%;
  padding: 10px 15px;
  background-color: rgba(255, 255, 255, 0.95);
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  z-index: 1040;
  font-size: 1rem;
  line-height: 1.5;
  text-align: center;
  animation: highlight-pulse 1s infinite alternate;
}

@keyframes highlight-pulse {
  from {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  }
  to {
    box-shadow: 0 4px 20px rgba(13, 110, 253, 0.4);
  }
}

/* 深色模式适配 */
.dark-mode .accessibility-highlight {
  background-color: rgba(50, 50, 50, 0.95);
  color: #eee;
}

/* 通知 */
.accessibility-notification {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 20px;
  background-color: rgba(13, 110, 253, 0.9);
  color: white;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  z-index: 1060;
  font-size: 0.9rem;
  transition: opacity 0.5s ease;
}

.accessibility-notification.fade-out {
  opacity: 0;
}

/* 移动端适配 */
@media (max-width: 768px) {
  .accessibility-button {
    bottom: 70px; /* 避免与底部导航栏重叠 */
  }
  
  .accessibility-panel {
    width: 90%;
    max-width: 350px;
    left: 50%;
    right: auto;
    transform: translate(-50%, 20px);
  }
  
  .accessibility-panel.show {
    transform: translate(-50%, 0);
  }
  
  .accessibility-highlight {
    max-width: 90%;
  }
}

/* iOS风格滑块 */
.accessibility-panel .form-range {
  -webkit-appearance: none;
  height: 6px;
  background: #e6e6e6;
  border-radius: 3px;
  outline: none;
}

.accessibility-panel .form-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  background: #0d6efd;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.2);
  transition: all 0.2s ease;
}

.accessibility-panel .form-range::-webkit-slider-thumb:hover {
  box-shadow: 0 0 0 6px rgba(13, 110, 253, 0.3);
}

.accessibility-panel .form-range::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: #0d6efd;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.2);
  transition: all 0.2s ease;
}

.accessibility-panel .form-range::-moz-range-thumb:hover {
  box-shadow: 0 0 0 6px rgba(13, 110, 253, 0.3);
}

/* 深色模式滑块 */
.dark-mode .accessibility-panel .form-range {
  background: #444;
}

/* 无障碍按钮动画 */
@keyframes pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  }
}

.accessibility-button.pulse {
  animation: pulse 2s infinite;
}
