/* ══════════════════════════════════════════════════════════════
   反馈页样式 · 市集罗盘官网品牌扩展
   复用官网 CSS 变量、字体、色彩体系，仅定义反馈页特有样式
   ══════════════════════════════════════════════════════════════ */

/* ── 页面布局 ─────────────────────────────────────────────── */

.feedback-main {
  min-height: calc(100svh - var(--header-h) - 92px);
  padding: calc(var(--header-h) + 48px) var(--side) 64px;
  display: grid;
  place-items: start center;
}

.feedback-container {
  width: 100%;
  max-width: 680px;
}

/* ── 标题与引导 ──────────────────────────────────────────── */

.feedback-title {
  margin: 0 0 12px;
  color: #f0d99f;
  font-size: clamp(28px, 4vw, 48px);
  letter-spacing: -0.035em;
  line-height: 1.2;
}

.feedback-intro {
  margin: 0 0 40px;
  color: #9a917e;
  font-size: 14px;
  line-height: 1.7;
}

/* ── 表单通用 ────────────────────────────────────────────── */

.feedback-form {
  display: grid;
  gap: 28px;
}

.form-group {
  display: grid;
  gap: 8px;
}

.form-label {
  display: block;
  color: #c7ad70;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.form-fieldset {
  border: 0;
  padding: 0;
  margin: 0;
}

.form-hint {
  color: #5a5650;
  font-size: 11px;
  line-height: 1.5;
}

/* ── 输入框 ──────────────────────────────────────────────── */

.form-input,
.form-textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(214, 189, 133, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: #eee7d8;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.6;
  transition: border-color 180ms ease, box-shadow 180ms ease;
  resize: vertical;
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: rgba(214, 189, 133, 0.48);
  box-shadow: 0 0 0 3px rgba(214, 189, 133, 0.08);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: #5a5650;
}

.form-textarea--mono {
  font-family: "Cascadia Code", "Fira Code", "Consolas", monospace;
  font-size: 12px;
  line-height: 1.5;
}

/* ── 截图区域 ────────────────────────────────────────────── */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.screenshot-zone {
  min-height: 44px;
}

.screenshot-zone:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
  border-radius: 8px;
}

.screenshot-drop-target {
  min-height: 120px;
  display: grid;
  place-items: center;
  border: 2px dashed rgba(214, 189, 133, 0.18);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease;
}

.screenshot-drop-target:hover,
.screenshot-drop-target.drag-over {
  border-color: rgba(214, 189, 133, 0.42);
  background: rgba(214, 189, 133, 0.04);
}

.screenshot-prompt {
  margin: 0;
  display: grid;
  gap: 6px;
  justify-items: center;
  color: #5a5650;
  font-size: 13px;
  text-align: center;
  padding: 20px;
}

.screenshot-icon {
  font-size: 28px;
  opacity: 0.6;
}

.screenshot-formats {
  font-size: 11px;
  color: #3d3a35;
}

/* ── 截图缩略图列表 ──────────────────────────────────────── */

.screenshot-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.screenshot-item {
  position: relative;
  width: 120px;
  height: 90px;
  border: 1px solid rgba(214, 189, 133, 0.18);
  border-radius: 6px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.3);
}

.screenshot-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.screenshot-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.7);
  color: #eee7d8;
  font-size: 14px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 120ms ease;
}

.screenshot-item:hover .screenshot-remove,
.screenshot-item:focus-within .screenshot-remove {
  opacity: 1;
}

/* ── 提交按钮区 ──────────────────────────────────────────── */

.form-actions {
  display: grid;
  gap: 12px;
  justify-items: start;
}

.button-primary {
  min-width: 180px;
  min-height: 52px;
  padding: 0 28px;
  border: 1px solid #e7c779;
  border-radius: 10px;
  background: linear-gradient(135deg, #f2c762, #d99936);
  box-shadow: 0 12px 32px rgba(189, 126, 38, 0.18);
  color: #171109;
  font-size: 15px;
  font-weight: 850;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 120ms ease;
}

.button-primary:hover:not(:disabled) {
  opacity: 0.92;
}

.button-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.form-note {
  margin: 0;
  color: #5a5650;
  font-size: 12px;
  line-height: 1.6;
}

/* ── 结果提示 ────────────────────────────────────────────── */

.feedback-result {
  margin-top: 40px;
}

.result-card {
  padding: 40px 32px;
  border: 1px solid rgba(214, 189, 133, 0.18);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  text-align: center;
}

.result-card--error {
  border-color: rgba(219, 127, 50, 0.3);
}

.result-icon {
  margin: 0 0 16px;
  font-size: 36px;
  font-weight: 800;
  color: #d6bd85;
}

.result-card--error .result-icon {
  color: #db7f32;
}

.result-title {
  margin: 0 0 8px;
  color: #c7ad70;
  font-size: 20px;
  font-weight: 700;
}

.result-fid {
  margin: 0 0 16px;
  color: #f0d99f;
  font-size: 18px;
  font-weight: 750;
}

.result-note {
  margin: 0 0 20px;
  color: #7a7467;
  font-size: 13px;
}

.ui-button {
  min-height: 40px;
  padding: 8px 20px;
  border: 1px solid rgba(214, 189, 133, 0.24);
  border-radius: 8px;
  background: transparent;
  color: #c7ad70;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 120ms ease;
}

.ui-button:hover {
  background: rgba(214, 189, 133, 0.06);
}

/* ── 加载状态 ────────────────────────────────────────────── */

.button-primary.is-loading {
  position: relative;
  color: transparent;
}

.button-primary.is-loading::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(23, 17, 9, 0.3);
  border-top-color: #171109;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── 响应式 ──────────────────────────────────────────────── */

@media (max-width: 680px) {
  .feedback-main {
    padding: calc(var(--header-h) + 32px) var(--side) 48px;
  }

  .feedback-container {
    max-width: 100%;
  }

  .result-card {
    padding: 28px 20px;
  }
}

@media (max-width: 520px) {
  .feedback-title {
    font-size: 24px;
  }

  .screenshot-item {
    width: 90px;
    height: 68px;
  }

  .form-input,
  .form-textarea {
    font-size: 16px; /* 防止 iOS 缩放 */
  }
}

@media (max-width: 320px) {
  .feedback-main {
    padding: calc(var(--header-h) + 20px) 12px 32px;
  }

  .screenshot-drop-target {
    min-height: 96px;
  }
}

/* ── reduced motion ───────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .button-primary.is-loading::after {
    animation: none;
  }

  .screenshot-drop-target,
  .form-input,
  .form-textarea {
    transition: none;
  }
}
