:root {
  --feedback-orange: #f3a11a;
  --feedback-orange-dark: #c86e00;
  --feedback-ink: #151512;
  --feedback-muted: #716e67;
  --feedback-line: rgba(21, 21, 18, 0.13);
  --feedback-surface: #fff;
  --feedback-soft: #f7f5f0;
  --feedback-danger: #b42318;
}

.feedback-launcher {
  position: fixed;
  z-index: 9970;
  right: 24px;
  bottom: calc(88px + env(safe-area-inset-bottom));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 78px;
  min-height: 44px;
  padding: 0 18px;
  color: #17150f;
  background: var(--feedback-orange);
  border: 0;
  border-radius: 999px;
  box-shadow: 0 14px 34px rgba(79, 48, 0, 0.2);
  cursor: pointer;
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  font-size: 14px;
  font-weight: 750;
  letter-spacing: 0.04em;
  transition: transform 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.feedback-launcher:hover,
.feedback-launcher:focus-visible {
  background: #ffad22;
  box-shadow: 0 17px 38px rgba(79, 48, 0, 0.26);
  transform: translateY(-2px);
}

.feedback-launcher:focus-visible,
.feedback-close:focus-visible,
.feedback-control:focus-visible,
.feedback-submit:focus-visible {
  outline: 3px solid rgba(243, 161, 26, 0.32);
  outline-offset: 3px;
}

.feedback-root {
  position: fixed;
  z-index: 9980;
  inset: 0;
  visibility: hidden;
  pointer-events: none;
}

.feedback-root.is-open {
  visibility: visible;
  pointer-events: auto;
}

.feedback-overlay {
  position: absolute;
  inset: 0;
  background: rgba(17, 17, 15, 0.42);
  opacity: 0;
  backdrop-filter: blur(5px);
  transition: opacity 220ms ease;
}

.feedback-root.is-open .feedback-overlay {
  opacity: 1;
}

.feedback-panel {
  position: absolute;
  display: flex;
  flex-direction: column;
  color: var(--feedback-ink);
  background: var(--feedback-surface);
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  box-shadow: 0 26px 80px rgba(17, 17, 15, 0.22);
  overscroll-behavior: contain;
}

.feedback-header {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 24px 17px;
  border-bottom: 1px solid var(--feedback-line);
}

.feedback-title {
  margin: 0;
  font-size: 20px;
  font-weight: 780;
  letter-spacing: -0.02em;
}

.feedback-close {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 44px;
  min-height: 44px;
  padding: 0;
  color: var(--feedback-muted);
  background: var(--feedback-soft);
  border: 1px solid transparent;
  border-radius: 50%;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.feedback-form {
  display: grid;
  gap: 16px;
  min-height: 0;
  padding: 20px 24px 24px;
  overflow-y: auto;
}

.feedback-field {
  display: grid;
  gap: 7px;
}

.feedback-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.feedback-label {
  color: #2e2d29;
  font-size: 13px;
  font-weight: 720;
}

.feedback-optional,
.feedback-count {
  color: #918d84;
  font-size: 11px;
  font-weight: 550;
}

.feedback-control {
  width: 100%;
  min-height: 44px;
  margin: 0;
  padding: 11px 12px;
  color: var(--feedback-ink);
  background: #fff;
  border: 1px solid var(--feedback-line);
  border-radius: 11px;
  font: inherit;
  font-size: 14px;
  line-height: 1.55;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.feedback-control:hover {
  border-color: rgba(21, 21, 18, 0.24);
}

.feedback-control:focus {
  border-color: var(--feedback-orange);
  box-shadow: 0 0 0 3px rgba(243, 161, 26, 0.12);
  outline: none;
}

.feedback-textarea {
  min-height: 116px;
  resize: vertical;
}

.feedback-control.is-invalid {
  border-color: var(--feedback-danger);
}

.feedback-field-error {
  min-height: 17px;
  margin: 0;
  color: var(--feedback-danger);
  font-size: 12px;
  line-height: 1.4;
}

.feedback-privacy {
  margin: 0;
  padding: 10px 12px;
  color: #6f6759;
  background: #fff8e9;
  border: 1px solid rgba(243, 161, 26, 0.2);
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.55;
}

.feedback-status {
  min-height: 20px;
  margin: 0;
  color: var(--feedback-muted);
  font-size: 13px;
  line-height: 1.5;
}

.feedback-status.is-success {
  color: #177245;
}

.feedback-status.is-error {
  color: var(--feedback-danger);
}

.feedback-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 20px;
  color: #17150f;
  background: var(--feedback-orange);
  border: 0;
  border-radius: 11px;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 760;
}

.feedback-submit:hover {
  background: #ffad22;
}

.feedback-submit:disabled {
  cursor: wait;
  opacity: 0.64;
}

.feedback-honeypot {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

body.feedback-dialog-open {
  overflow: hidden !important;
}

@media (min-width: 761px) {
  .feedback-panel {
    top: 50%;
    left: 50%;
    width: min(480px, calc(100vw - 48px));
    max-height: min(760px, calc(100svh - 48px));
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 22px;
    opacity: 0;
    transform: translate(-50%, -47%) scale(0.98);
    transition: opacity 220ms ease, transform 220ms ease;
  }

  .feedback-root.is-open .feedback-panel {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

@media (max-width: 760px) {
  .feedback-launcher {
    right: 14px;
    bottom: calc(18px + env(safe-area-inset-bottom));
    min-width: 64px;
    min-height: 46px;
    padding: 0 15px;
    font-size: 13px;
  }

  body.feedback-has-bottom-nav .feedback-launcher {
    bottom: calc(92px + env(safe-area-inset-bottom));
  }

  .feedback-panel {
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    max-height: min(88svh, 760px);
    padding-bottom: env(safe-area-inset-bottom);
    border-radius: 22px 22px 0 0;
    transform: translateY(102%);
    transition: transform 240ms cubic-bezier(0.2, 0.8, 0.2, 1);
  }

  .feedback-root.is-open .feedback-panel {
    transform: translateY(0);
  }

  .feedback-header {
    padding: 17px 18px 13px;
  }

  .feedback-form {
    gap: 13px;
    padding: 16px 18px 20px;
  }

  .feedback-textarea {
    min-height: 104px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .feedback-launcher,
  .feedback-overlay,
  .feedback-panel {
    transition: none !important;
  }
}
