/* ============================================
   feedback.css —— 反馈页专用样式
   复用 styles.css 的变量与 nav/footer
   ============================================ */

/* 反馈页整体背景略暖，衬托白色卡片 */
body.feedback-page {
  background: linear-gradient(180deg, #fff8ee 0%, #ffffff 100%);
  min-height: 100vh;
}

/* 主容器 */
.fb-main {
  padding-top: calc(var(--nav-height) + 60px);
  padding-bottom: 100px;
  min-height: calc(100vh - var(--nav-height));
}

.fb-container {
  width: 100%;
  max-width: 780px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---- 标题区 ---- */
.fb-header {
  text-align: center;
  margin-bottom: 40px;
}

.fb-title {
  font-size: 40px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
  margin: 0 0 12px;
  letter-spacing: -0.5px;
}

.fb-subtitle {
  font-size: 16px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}

/* ---- Tab 切换 ---- */
.fb-tabs {
  display: flex;
  gap: 32px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 28px;
  padding: 0 4px;
}

.fb-tab {
  background: none;
  border: none;
  padding: 14px 0;
  font-size: 16px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  position: relative;
  transition: color 0.2s ease;
  font-family: inherit;
}

.fb-tab:hover {
  color: var(--text-primary);
}

.fb-tab.active {
  color: var(--primary);
  font-weight: 600;
}

.fb-tab.active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 3px;
  background: var(--primary);
  border-radius: 3px 3px 0 0;
}

/* ---- Panel ---- */
.fb-panel {
  display: none;
  animation: fb-fade-in 0.25s ease;
}

.fb-panel.active {
  display: block;
}

@keyframes fb-fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---- 表单卡片 ---- */
.fb-form {
  background: #ffffff;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 4px 24px rgba(255, 149, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(255, 149, 0, 0.08);
}

/* 文本域 */
.fb-textarea-wrapper {
  position: relative;
}

.fb-textarea {
  width: 100%;
  min-height: 80px;
  padding: 16px 16px 36px 16px; /* 底部留出字数计数的位置 */
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-body);
  border: 1.5px solid #e5e7eb;
  border-radius: 12px;
  background: #fafafa;
  resize: vertical;
  font-family: inherit;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.fb-textarea::placeholder {
  color: #9ca3af;
}

.fb-textarea:hover {
  border-color: #d1d5db;
}

.fb-textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(255, 149, 0, 0.15);
}

/* 字数计数（绝对定位到 textarea 右下角） */
.fb-counter {
  position: absolute;
  right: 14px;
  bottom: 12px;
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  background: rgba(255, 255, 255, 0.9);
  padding: 2px 8px;
  border-radius: 10px;
  pointer-events: none;
  letter-spacing: 0.2px;
  transition: color 0.2s ease;
}

.fb-counter.warn {
  color: var(--accent);
  font-weight: 600;
}

/* 提交按钮 */
.fb-submit-row {
  margin-top: 22px;
}

.fb-submit-btn {
  width: 100%;
  padding: 14px 24px;
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
  background: var(--gradient-brand);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.15s ease, box-shadow 0.2s ease, opacity 0.2s ease;
  letter-spacing: 1px;
}

.fb-submit-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(255, 107, 107, 0.25);
}

.fb-submit-btn:active:not(:disabled) {
  transform: translateY(0);
}

.fb-submit-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.fb-submit-btn.loading {
  opacity: 0.7;
  cursor: wait;
}

/* 提示 Toast（屏幕中央） */
.fb-toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.94);
  z-index: 9999;
  min-width: 220px;
  max-width: 88vw;
  padding: 18px 28px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 500;
  text-align: center;
  line-height: 1.5;
  background: #ffffff;
  color: var(--text-body);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.18), 0 2px 8px rgba(0, 0, 0, 0.06);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.fb-toast.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.fb-toast.success {
  background: #ffffff;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.fb-toast.error {
  background: #ffffff;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

/* ---- 空状态（反馈历史） ---- */
.fb-empty {
  background: #ffffff;
  border-radius: 16px;
  padding: 80px 24px;
  text-align: center;
  border: 1px solid rgba(255, 149, 0, 0.08);
  box-shadow: 0 4px 24px rgba(255, 149, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
}

.fb-empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: #fff3e0;
  color: var(--primary);
  margin-bottom: 20px;
}

.fb-empty-text {
  font-size: 18px;
  color: var(--text-primary);
  font-weight: 600;
  margin: 0 0 6px;
}

.fb-empty-sub {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0;
}

/* ---- 响应式 ---- */
@media (max-width: 640px) {
  .fb-main {
    padding-top: calc(var(--nav-height) + 30px);
    padding-bottom: 60px;
  }

  .fb-container {
    padding: 0 16px;
  }

  .fb-title {
    font-size: 28px;
  }

  .fb-subtitle {
    font-size: 14px;
  }

  .fb-tabs {
    gap: 24px;
    margin-bottom: 20px;
  }

  .fb-tab {
    font-size: 15px;
  }

  .fb-form {
    padding: 18px;
    border-radius: 14px;
  }

  .fb-textarea {
    min-height: 60px;
    padding: 14px 14px 34px 14px;
    font-size: 14px;
  }

  .fb-counter {
    right: 12px;
    bottom: 10px;
    font-size: 11px;
    padding: 2px 7px;
  }

  .fb-submit-btn {
    padding: 13px 20px;
    font-size: 15px;
  }

  .fb-toast {
    min-width: 180px;
    padding: 14px 22px;
    font-size: 14px;
  }

  .fb-empty {
    padding: 60px 20px;
  }

  .fb-empty-icon {
    width: 80px;
    height: 80px;
  }
}
