/* ============================================
   背景
   ============================================ */
body {
  background: linear-gradient(135deg, #eef2ff 0%, #f0f9ff 30%, #faf5ff 60%, #fefce8 100%);
  min-height: 100dvh;
}

/* ============================================
   分段滑动条
   ============================================ */
.slider-track {
  position: relative;
  height: 8px;
  background: #e5e7eb;
  border-radius: 4px;
  cursor: pointer;
  touch-action: none;
  user-select: none;
  margin: 0 2px;
  outline: none;
}
.slider-track:focus-visible {
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.3);
}
.slider-track.slider-active .slider-thumb {
  box-shadow: 0 4px 18px rgba(79, 70, 229, 0.45);
  transform: translate(-50%, -50%) scale(1.15);
}

.slider-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: linear-gradient(90deg, #818cf8, #4f46e5);
  border-radius: 4px;
  transition: width 0.08s ease-out;
  pointer-events: none;
}

.slider-thumb {
  position: absolute;
  top: 50%;
  width: 24px;
  height: 24px;
  background: #fff;
  border: 3px solid #4f46e5;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.25);
  transition: left 0.08s ease-out, box-shadow 0.2s, transform 0.2s;
  cursor: grab;
  pointer-events: none;
}
.slider-thumb:active {
  cursor: grabbing;
}
@media (min-width: 640px) {
  .slider-thumb {
    width: 28px;
    height: 28px;
  }
}

/* 刻度线 */
.slider-ticks {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.slider-tick {
  position: absolute;
  top: 50%;
  width: 2px;
  height: 12px;
  background: #fff;
  transform: translate(-50%, -50%);
  border-radius: 1px;
}

/* 数值显示 */
.rating-value-display {
  font-size: 2rem;
  font-weight: 700;
  text-align: center;
  color: #d1d5db;
  transition: color 0.3s ease, transform 0.2s ease, opacity 0.2s ease;
  line-height: 1.2;
  margin-bottom: 0.25rem;
}
.rating-value-display.selected {
  color: #4f46e5;
}
@media (min-width: 640px) {
  .rating-value-display {
    font-size: 2.5rem;
  }
}

/* ============================================
   反馈标签
   ============================================ */
.feedback-tag {
  padding: 0.375rem 0.875rem;
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #4b5563;
  transition: all 0.2s ease-out;
  white-space: nowrap;
  outline: none;
}
.feedback-tag:hover {
  border-color: #a5b4fc;
  color: #4f46e5;
  background: #eef2ff;
}
.feedback-tag:focus-visible {
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.35);
}
.feedback-tag.tag-selected {
  background: #4f46e5;
  color: #fff;
  border-color: #4f46e5;
}
.feedback-tag.tag-selected:hover {
  background: #4338ca;
  border-color: #4338ca;
}

/* ============================================
   小费按钮
   ============================================ */
.tip-btn {
  padding: 0.625rem 1rem;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid #e5e7eb;
  background: #f9fafb;
  color: #374151;
  transition: all 0.2s ease-out;
  outline: none;
}
.tip-btn:hover {
  border-color: #a5b4fc;
  background: #eef2ff;
  color: #4f46e5;
}
.tip-btn:focus-visible {
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.35);
}
.tip-btn.tip-selected {
  background: #4f46e5;
  color: #fff;
  border-color: #4f46e5;
}
.tip-btn.tip-selected:hover {
  background: #4338ca;
  border-color: #4338ca;
}

/* ============================================
   提交按钮
   ============================================ */
.submit-btn {
  width: 100%;
  padding: 0.875rem;
  border-radius: 0.875rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  background: linear-gradient(135deg, #4f46e5, #6366f1);
  color: #fff;
  transition: all 0.25s ease-out;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  outline: none;
}
.submit-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #4338ca, #4f46e5);
  box-shadow: 0 8px 25px rgba(79, 70, 229, 0.3);
  transform: translateY(-1px);
}
.submit-btn:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}
.submit-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}
.submit-btn:focus-visible {
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.5);
}

/* loading spinner */
.spinner {
  display: inline-block;
  width: 1.125rem;
  height: 1.125rem;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.spinner.hidden {
  display: none;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============================================
   动画
   ============================================ */

/* 卡片入场 */
@keyframes card-in {
  from { opacity: 0; transform: translateY(32px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.main-card {
  opacity: 0;
  transform: translateY(32px) scale(0.96);
}
.main-card.card-entered {
  animation: card-in 0.55s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* 评分值弹出 */
@keyframes value-pop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.18); }
  100% { transform: scale(1); }
}
.value-pop {
  animation: value-pop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* 标签选中 */
@keyframes tag-pop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.08); }
  100% { transform: scale(1); }
}
.tag-pop {
  animation: tag-pop 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* 提交按钮就绪 */
@keyframes submit-ready-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.4); }
  50%      { box-shadow: 0 0 0 8px rgba(79, 70, 229, 0); }
}
.submit-ready {
  animation: submit-ready-glow 0.7s ease-out;
}

/* 小费按钮入场 */
@keyframes tip-stagger-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.tip-btn {
  opacity: 0;
  animation: tip-stagger-in 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* 摇动 */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%      { transform: translateX(-6px); }
  40%      { transform: translateX(6px); }
  60%      { transform: translateX(-4px); }
  80%      { transform: translateX(4px); }
}
.animate-shake {
  animation: shake 0.5s ease-in-out;
}

/* 成功页 */
@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(24px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.success-show {
  animation: fade-in-up 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes check-draw {
  from { stroke-dashoffset: 60; }
  to   { stroke-dashoffset: 0; }
}
.success-check {
  stroke-dasharray: 60;
  animation: check-draw 0.5s 0.2s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* 减弱动效 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================
   成功图标
   ============================================ */
.success-icon-wrap {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981, #34d399);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  box-shadow: 0 8px 30px rgba(16, 185, 129, 0.3);
}

/* ============================================
   语言选择
   ============================================ */
.lang-select {
  padding: 0.375rem 2rem 0.375rem 0.875rem;
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid #d1d5db;
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(8px);
  color: #4b5563;
  transition: all 0.2s ease-out;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
}
.lang-select:hover {
  background-color: #fff;
  border-color: #a5b4fc;
  color: #4f46e5;
}
.lang-select:focus-visible {
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.4);
}

/* ============================================
   卡片
   ============================================ */
.main-card {
  background: #fff;
  border-radius: 1.25rem;
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.05),
    0 10px 30px -5px rgba(0, 0, 0, 0.08),
    0 0 0 1px rgba(0, 0, 0, 0.04);
  padding: 1.75rem;
  transition: box-shadow 0.3s ease;
}
@media (min-width: 640px) {
  .main-card {
    padding: 2.25rem;
  }
}
.main-card:hover {
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.06),
    0 15px 40px -5px rgba(0, 0, 0, 0.1),
    0 0 0 1px rgba(0, 0, 0, 0.05);
}

/* 区块分隔 */
.section-divider {
  height: 1px;
  background: linear-gradient(to right, transparent, #e5e7eb, transparent);
  margin: 1.25rem 0;
}

/* 文本域 */
.feedback-textarea {
  width: 100%;
  min-height: 80px;
  padding: 0.75rem 0.875rem;
  border-radius: 0.75rem;
  border: 1.5px solid #e5e7eb;
  background: #f9fafb;
  font-size: 0.875rem;
  line-height: 1.6;
  color: #1f2937;
  resize: vertical;
  transition: all 0.2s ease-out;
  outline: none;
  font-family: inherit;
}
.feedback-textarea:focus {
  border-color: #a5b4fc;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.08);
}
.feedback-textarea::placeholder {
  color: #9ca3af;
}

/* 自定义金额 */
.tip-custom-input {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border-radius: 0.625rem;
  border: 1.5px solid #e5e7eb;
  background: #f9fafb;
  font-size: 1rem;
  font-weight: 600;
  color: #4f46e5;
  transition: all 0.2s ease-out;
  outline: none;
  min-width: 0;
}
.tip-custom-input:focus {
  border-color: #a5b4fc;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}
.tip-custom-input::placeholder {
  color: #9ca3af;
  font-weight: 400;
  font-size: 0.875rem;
}

/* 节标题 */
.section-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.section-title::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 18px;
  border-radius: 2px;
  background: linear-gradient(180deg, #6366f1, #a5b4fc);
}

/* 评分描述文字过渡 */
#rating-text {
  transition: opacity 0.2s ease, transform 0.2s ease, color 0.3s ease;
}

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.animate-fade-in {
  animation: fade-in 0.3s ease-out;
}
