/* 历史记录相关样式 */
#history-button {
  display: block;
  margin: 30px auto 10px auto;
  padding: 10px 20px;
  font-size: 16px;
  font-weight: bold;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  border: none;
  border-radius: 5px;
  background-color: #6c757d;
  color: white;
  transition: background-color 0.3s ease;
}

#history-button:hover {
  background-color: #5a6268;
}

#history-button:active {
  background-color: #545b62;
  transform: translateY(1px);
}

#history-button:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(108, 117, 125, 0.5);
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid #dee2e6;
}

.modal-header h2 {
  margin: 0;
  color: #343a40;
}

.close-btn {
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: #6c757d;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.close-btn:hover {
  background-color: #f8f9fa;
}

.clear-history-btn {
  padding: 5px 15px;
  font-size: 14px;
  background-color: #dc3545;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.clear-history-btn:hover {
  background-color: #c82333;
}

.history-list-container {
  max-height: 60vh;
  overflow-y: auto;
}

.history-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.history-item {
  padding: 12px;
  border-bottom: 1px solid #dee2e6;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background-color 0.2s;
}

.history-item:hover {
  background-color: #f8f9fa;
}

.history-link {
  color: #007bff;
  text-decoration: none;
  flex: 1;
  margin-right: 15px;
  font-size: 16px;
}

.history-link:hover {
  text-decoration: underline;
}

.history-time {
  font-size: 14px;
  color: #6c757d;
  white-space: nowrap;
}

.history-empty {
  text-align: center;
  padding: 40px;
  color: #6c757d;
  font-style: italic;
}

/* 保留原有的模态框样式 */
.custom-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-content {
  background-color: white;
  padding: 2.5rem 1.5rem 1rem 1.5rem;
  border-radius: 0.5rem;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  max-width: 90%;
  max-height: 90%;
  overflow-y: auto;
  position: relative;
}

.modal-link-btn {
  display: block;
  width: 100%;
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.5rem;
  border: none;
  border-radius: 0.25rem;
  background-color: #007bff;
  color: white;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.2s;
}

.modal-link-btn:hover {
  background-color: #0056b3;
}

.modal-close-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 1.75rem;
  height: 1.75rem;
  border: none;
  border-radius: 50%;
  background-color: #f8f9fa;
  color: #6c757d;
  font-size: 1.25rem;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}

.modal-close-btn:hover {
  background-color: #e2e6ea;
  color: #343a40;
}

/* 历史记录按钮样式（右上角小写H） */
#history-button {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  font-size: 18px;
  font-weight: normal;
  text-align: center;
  line-height: 40px;
  cursor: pointer;
  border: none;
  border-radius: 50%;
  background-color: #6c757d;
  color: white;
  transition: background-color 0.3s ease, transform 0.2s ease;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
}

#history-button:hover {
  background-color: #5a6268;
  transform: scale(1.1);
}

#history-button:active {
  background-color: #545b62;
  transform: scale(0.95);
}

#history-button:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(108, 117, 125, 0.5);
}

/* 保留原有的模态框样式 */
.custom-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-content {
  background-color: white;
  padding: 2.5rem 1.5rem 1rem 1.5rem;
  border-radius: 0.5rem;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  max-width: 90%;
  max-height: 90%;
  overflow-y: auto;
  position: relative;
}

.modal-link-btn {
  display: block;
  width: 100%;
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.5rem;
  border: none;
  border-radius: 0.25rem;
  background-color: #007bff;
  color: white;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.2s;
}

.modal-link-btn:hover {
  background-color: #0056b3;
}

.modal-close-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 1.75rem;
  height: 1.75rem;
  border: none;
  border-radius: 50%;
  background-color: #f8f9fa;
  color: #6c757d;
  font-size: 1.25rem;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}