*::-webkit-scrollbar {
  width: 6px;
}
*::-webkit-scrollbar-track {
  background: transparent;
}
*::-webkit-scrollbar-thumb {
  background-color: rgba(156, 163, 175, 0.5);
  border-radius: 3px;
  transition: background-color 0.2s;
}
*::-webkit-scrollbar-thumb:hover {
  background-color: rgba(156, 163, 175, 0.8);
}
.glass-effect {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}
#content {
  height: calc(100% - 3rem) !important;
  overflow-y: auto !important;
}
#result {
  overflow-y: auto;
  scrollbar-gutter: stable;
}
#initial-state {
  height: calc(100% - 3rem) !important;
}
#highlight-content .text-content {
  height: calc(100% - 3rem) !important;
  overflow-y: auto;
}
#loading-state {
  height: calc(100% - 3rem) !important;
  position: relative;
  overflow: hidden;
  min-height: 180px;
}
/* 移动端 */
@media (max-width: 1024px) {
  #highlight-content .text-content {
  height: calc(100% - 6rem) !important;
  overflow-y: auto;
}
.violation-count-wrapper{
  margin-bottom: 0.5rem !important;
}
  /* 移动端风险等级统计模块优化 */
  .risk-stats {
    flex-wrap: wrap;
    width: 100% !important;
    align-items: flex-start !important;
  }
  .risk-stats label {
    margin-bottom: 0.5rem !important;
  }
}
/* 添加message样式 */
.message-container {
  position: fixed;
  top: 8px;
  left: 0;
  right: 0;
  pointer-events: none;
  z-index: 1010;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.message-item {
  background: #fff;
  padding: 10px 16px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  pointer-events: all;
  margin: 4px 0;
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
  transform: translateY(-100%);
  transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
}
.message-item.show {
  opacity: 1;
  transform: translateY(0);
}
.message-content {
  color: rgba(0, 0, 0, 0.88);
  font-size: 14px;
}
.message-icon {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.message-icon.success {
  color: #52c41a;
}
.message-icon.error {
  color: #ff4d4f;
}
.message-icon.info {
  color: #1890ff;
}
.message-icon svg {
  width: 100%;
  height: 100%;
}
.highlight {
  padding: 2px 2px;
  border-radius: 4px;
  display: inline;
  cursor: pointer;
  position: relative;
  transition: all 0.2s;
  border-bottom: 1px dashed;
}
.highlight:hover {
  transform: scale(1.02);
}
/* 被过滤的高亮文本样式 */
.highlight[data-filtered="true"] {
  background-color: transparent !important;
  border-bottom-color: transparent !important;
  cursor: default !important;
  transform: none !important;
  box-shadow: none !important;
}
.highlight[data-filtered="true"]:hover {
  transform: none !important;
  background-color: transparent !important;
  box-shadow: none !important;
}
/* 高风险 */
.highlight[data-risk="high"] {
  background-color: #fff1f0;
  border-bottom-color: #ff4d4f;
}
.highlight[data-risk="high"]:hover {
  background-color: #ffccc7;
  box-shadow: 0 0 3px rgba(255, 77, 79, 0.3);
}
.highlight[data-risk="high"].active {
  background-color: #ffa39e;
  box-shadow: 0 0 0 2px rgba(255, 77, 79, 0.2);
}
/* 中等风险 */
.highlight[data-risk="medium"] {
  background-color: #fff7e6;
  border-bottom-color: #fa8c16;
}
.highlight[data-risk="medium"]:hover {
  background-color: #ffe7ba;
  box-shadow: 0 0 3px rgba(250, 140, 22, 0.3);
}
.highlight[data-risk="medium"].active {
  background-color: #ffd591;
  box-shadow: 0 0 0 2px rgba(250, 140, 22, 0.2);
}
/* 低风险 */
.highlight[data-risk="low"] {
  background-color: #f6ffed;
  border-bottom-color: #52c41a;
}
.highlight[data-risk="low"]:hover {
  background-color: #d9f7be;
  box-shadow: 0 0 3px rgba(82, 196, 26, 0.3);
}
.highlight[data-risk="low"].active {
  background-color: #b7eb8f;
  box-shadow: 0 0 0 2px rgba(82, 196, 26, 0.2);
}
.text-content::-webkit-scrollbar {
  width: 6px;
}
.text-content::-webkit-scrollbar-track {
  background: transparent;
}
.text-content::-webkit-scrollbar-thumb {
  background-color: rgba(156, 163, 175, 0.5);
  border-radius: 3px;
}
.text-content::-webkit-scrollbar-thumb:hover {
  background-color: rgba(156, 163, 175, 0.8);
}
/* 添加弹窗样式 */
.violation-popup {
  position: absolute;
  z-index: 100;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  padding: 16px;
  width: 350px;
  max-width: 90vw;
  font-size: 14px;
  display: none;
  max-height: 80vh;
  overflow: auto;
}
.violation-popup.show {
  display: block;
}
.violation-popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #f0f0f0;
}
.violation-popup-header .left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.violation-risk {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
}
.violation-risk.high {
  background-color: #fff1f0;
  color: #ff4d4f;
}
.violation-risk.medium {
  background-color: #fff7e6;
  color: #fa8c16;
}
.violation-risk.low {
  background-color: #f6ffed;
  color: #52c41a;
}
.violation-type-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: normal;
  background-color: #f5f5f5;
  color: #666;
}
.violation-type-tag.marketing {
  background-color: #fff7e6;
  color: #fa8c16;
}
.violation-type-tag.interaction {
  background-color: #f9f0ff;
  color: #722ed1;
}
.violation-type-tag.sensitive {
  background-color: #fff1f0;
  color: #ff4d4f;
}
.violation-type-tag.other {
  background-color: #e6f7ff;
  color: #1890ff;
}
.violation-popup-close {
  cursor: pointer;
  color: #999;
  transition: color 0.2s;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}
.violation-popup-close:hover {
  color: #666;
  background-color: #f5f5f5;
}
.violation-popup-content {
  margin-bottom: 12px;
}
.violation-reason, .violation-suggestion {
  padding: 10px;
  border-radius: 6px;
  margin-bottom: 12px;
  position: relative;
  padding-left: 32px;
}
.violation-reason {
  background-color: #fff2f0;
  border-left: 3px solid #ff4d4f;
}
.violation-suggestion {
  background-color: #e6f7ff;
  border-left: 3px solid #1890ff;
}
.violation-reason:before, .violation-suggestion:before {
  content: '';
  position: absolute;
  left: 10px;
  top: 10px;
  width: 16px;
  height: 16px;
  background-size: contain;
  background-repeat: no-repeat;
}
.violation-reason:before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23ff4d4f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cline x1='12' y1='8' x2='12' y2='12'%3E%3C/line%3E%3Cline x1='12' y1='16' x2='12.01' y2='16'%3E%3C/line%3E%3C/svg%3E");
}
.violation-suggestion:before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%231890ff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 9V5a3 3 0 0 0-3-3l-4 9v11h11.28a2 2 0 0 0 2-1.7l1.38-9a2 2 0 0 0-2-2.3z'%3E%3C/path%3E%3C/svg%3E");
}
.violation-reason .text-gray-500, .violation-suggestion .text-gray-500 {
  font-weight: 500;
  margin-bottom: 6px;
  font-size: 13px;
}
.violation-reason .text-gray-800, .violation-suggestion .text-gray-800 {
  margin-top: 4px;
  line-height: 1.6;
}
.violation-popup-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  flex-wrap: wrap;
}
.violation-popup-feedback {
  display: flex;
  gap: 12px;
  align-items: center;
}
.feedback-btn {
  cursor: pointer;
  color: #999;
  transition: all 0.2s;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background-color: #f5f5f5;
  position: relative;
}
.feedback-btn:hover {
  color: #666;
  background-color: #e8e8e8;
}
.feedback-btn.active {
  color: #1890ff;
  background-color: #e6f7ff;
}
.feedback-btn:focus {
  outline: 2px solid #1890ff;
  outline-offset: 2px;
}
.feedback-tooltip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background-color: rgba(0,0,0,0.75);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
  margin-bottom: 6px;
}
.feedback-btn:hover .feedback-tooltip {
  opacity: 1;
}
.popup-tip {
  font-size: 12px;
  color: #999;
  margin-top: 8px;
  text-align: center;
}
.apply-suggestion-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 8px;
  padding: 4px 12px;
  background-color: #1890ff;
  color: white;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
  transition: background-color 0.2s;
  margin-bottom: 4px;
}
.apply-suggestion-btn:hover {
  background-color: #40a9ff;
}
.apply-suggestion-btn:focus {
  outline: 2px solid #1890ff;
  outline-offset: 2px;
}
@media (max-width: 480px) {
  .violation-popup {
    width: calc(100% - 32px);
    padding: 12px;
  }
  .violation-reason, .violation-suggestion {
    padding: 8px 8px 8px 28px;
    border-left-width: 2px;
  }
  .violation-reason:before, .violation-suggestion:before {
    left: 8px;
    top: 8px;
    width: 14px;
    height: 14px;
  }
  .feedback-btn {
    width: 32px;
    height: 32px;
  }
}
.violation-type {
  display: none; /* 隐藏原来的违规类型区块 */
}

/* 自定义复选框样式 */
.risk-stats input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border: 1px solid;
  border-radius: 2px;
  position: relative;
  cursor: pointer;
  transition: all 0.05s ease;
}

/* 高风险复选框 */
.risk-stats input[type="checkbox"].border-red-500 {
  border-color: #ff4d4f;
}

.risk-stats input[type="checkbox"].border-red-500:checked {
  background-color: #ff4d4f;
  border-color: #ff4d4f;
}

/* 中风险复选框 */
.risk-stats input[type="checkbox"].border-orange-500 {
  border-color: #fa8c16;
}

.risk-stats input[type="checkbox"].border-orange-500:checked {
  background-color: #fa8c16;
  border-color: #fa8c16;
}

/* 低风险复选框 */
.risk-stats input[type="checkbox"].border-green-500 {
  border-color: #52c41a;
}

.risk-stats input[type="checkbox"].border-green-500:checked {
  background-color: #52c41a;
  border-color: #52c41a;
}

/* 复选框对勾样式 */
.risk-stats input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 3px;
  top: 1px;
  width: 4px;
  height: 7px;
  border: solid white;
  border-width: 0 1px 1px 0;
  transform: rotate(45deg);
}

/* 加载动画优化 */
.loading-state-transition {
  transition: opacity 0.3s ease-in-out;
}

/* 进度条动画优化 */
.progress-bar {
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  background: linear-gradient(90deg, #ff4d4f 0%, #ff7875 50%, #ffa39e 100%);
  background-size: 200% 100%;
  animation: gradientMove 2s linear infinite;
  position: relative;
  overflow: hidden;
}

.progress-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.3) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* 高亮内容动画优化 */
.highlight-content {
  transition: all 0.3s ease-in-out;
}

.highlight-content .text-content {
  transition: opacity 0.3s ease-in-out;
}

.highlight-content .text-content.highlight {
  animation: highlightFadeIn 0.5s ease-in-out;
}

@keyframes highlightFadeIn {
  0% { opacity: 0; transform: translateY(10px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* 按钮动画优化 */
.check-btn {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.check-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.check-btn:active {
  transform: translateY(0);
}

/* 加载状态文字动画 */
.loading-text {
  position: relative;
  display: inline-block;
}

.loading-text::after {
  content: '...';
  position: absolute;
  animation: loadingDots 1.5s infinite;
}

@keyframes loadingDots {
  0% { content: '.'; }
  33% { content: '..'; }
  66% { content: '...'; }
  100% { content: '.'; }
}

/* 错误状态优化 */
.error-state {
  animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shake {
  10%, 90% { transform: translate3d(-1px, 0, 0); }
  20%, 80% { transform: translate3d(2px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
  40%, 60% { transform: translate3d(4px, 0, 0); }
}

.fade-in {
  animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
