/**
 * 闪得 投诉举报弹窗（增量样式）
 *
 * 基础排版仍在 css/detail.css 的 .report-modal*，这里只补：
 * 开关动画、只读主体的排版、上传中状态、提交按钮的加载态。
 */

/* --------------------------------------------------------------------------
   开关动画
   弹窗由 JS 切 display:flex + .is-open：先上屏再加 class 才能触发过渡；
   关闭时先移除 class，等动画结束再 display:none。
   -------------------------------------------------------------------------- */
.report-modal {
  opacity: 0;
  transition: opacity .2s ease;
}

.report-modal.is-open {
  opacity: 1;
}

.report-modal__dialog {
  transform: translateY(12px) scale(.97);
  opacity: 0;
  transition: transform .24s cubic-bezier(.22, 1, .36, 1), opacity .24s ease;
}

.report-modal.is-open .report-modal__dialog {
  transform: none;
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .report-modal,
  .report-modal__dialog {
    transition: none;
  }
  .report-modal__dialog {
    transform: none;
    opacity: 1;
  }
}

/* --------------------------------------------------------------------------
   违规主体：只读信息
   原来用 <input readonly>，字号被浏览器默认样式撑大且看着像可填字段。
   改为普通文本块，字号与表单其余项对齐。
   -------------------------------------------------------------------------- */
.report-subject {
  margin: 0;
  padding: 9px 12px;
  font-size: 13px;
  line-height: 1.4;
  color: #4b5563;
  background: #f5f7fa;
  border: 1px solid #eef1f5;
  border-radius: 8px;
}

/* 违规类型未配置时的提示 */
.report-field__empty {
  margin: 0;
  font-size: 12.5px;
  color: #dc2626;
}

.report-legal {
  padding: 14px;
  background: #f8fafc;
  border: 1px solid #e5eaf0;
  border-radius: 10px;
}

.report-legal__title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 13px;
  color: #1f2937;
}

.report-legal__title span {
  font-size: 12px;
  color: #8a95a5;
}

.report-legal__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.report-legal .report-field { margin-bottom: 12px; }
.report-legal .report-field:last-of-type { margin-bottom: 0; }

.report-declaration {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 12px;
  font-size: 12.5px;
  line-height: 1.55;
  color: #5f6b7a;
  cursor: pointer;
}

.report-declaration input {
  width: 15px;
  height: 15px;
  margin: 2px 0 0;
  accent-color: #0878e8;
  flex: 0 0 auto;
}

@media (max-width: 640px) {
  .report-legal__grid { grid-template-columns: 1fr; gap: 0; }
  .report-legal__title { align-items: flex-start; flex-direction: column; gap: 3px; }
}

/* --------------------------------------------------------------------------
   证明材料上传中
   缩略图先出、地址后到；上传期间压暗并转圈，避免用户以为已经传好了。
   -------------------------------------------------------------------------- */
.report-upload-item.is-uploading img {
  filter: brightness(.6);
}

.report-upload-item__spin {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid rgba(255, 255, 255, .45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: sdReportSpin .7s linear infinite;
  display: none;
}

.report-upload-item.is-uploading .report-upload-item__spin {
  display: block;
}

@keyframes sdReportSpin {
  to { transform: rotate(360deg); }
}

/* --------------------------------------------------------------------------
   移除控件
   标签由 <button> 换成 <span> 后丢掉了浏览器默认行为，这里补回来：
   - user-select：button 的文字本来不可选，span 的「×」会被拖选中
   - font：button 用 UA 字体栈，span 继承正文字体，显式指定避免字形忽大忽小
   - focus-visible：默认焦点框压在深色圆底上几乎看不见，换成白环
   -------------------------------------------------------------------------- */
.report-upload-item__del {
  -webkit-user-select: none;
  user-select: none;
  font-family: Arial, sans-serif;
  font-weight: 400;
  transition: background .18s ease;
}

.report-upload-item__del:hover {
  background: rgba(0, 0, 0, .78);
}

.report-upload-item__del:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 1px;
  background: rgba(0, 0, 0, .78);
}

/* --------------------------------------------------------------------------
   提交按钮状态
   -------------------------------------------------------------------------- */
.report-btn[disabled] {
  opacity: .6;
  cursor: not-allowed;
}

.report-btn.is-loading {
  position: relative;
  color: transparent;
}

.report-btn.is-loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border: 2px solid rgba(255, 255, 255, .5);
  border-top-color: #fff;
  border-radius: 50%;
  animation: sdReportSpin .7s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
  .report-upload-item__spin,
  .report-btn.is-loading::after {
    animation: none;
  }
}
