/**
 * 首页增强样式
 * 标题动画、表单交互、按钮效果等
 */

/* ============ 标题区域增强 ============ */
.header {
  text-align: center;
  padding: 40px 20px 30px;
  position: relative;
}

.app-title {
  font-size: 2.2rem;
  font-weight: 700;
  color: white !important;
  -webkit-text-fill-color: white !important;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  margin-bottom: 8px;
  animation: titleFloat 3s ease-in-out infinite;
}

.app-subtitle {
  color: rgba(255, 255, 255, 0.85);
  font-size: 1rem;
  margin: 0;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

/* 标题图标浮动动画 */
.app-title::before {
  content: '🔮';
  display: inline-block;
  margin-right: 10px;
  animation: iconBounce 2s ease-in-out infinite;
}

@keyframes titleFloat {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

@keyframes iconBounce {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  25% {
    transform: translateY(-3px) rotate(-5deg);
  }
  75% {
    transform: translateY(-3px) rotate(5deg);
  }
}

/* ============ 表单交互增强 ============ */
.form-container {
  padding: 20px;
}

.picker-group {
  margin-bottom: 20px;
}

.picker-select {
  transition: all 0.3s ease;
}

.picker-select:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15);
  transform: scale(1.02);
}

.picker-select:active {
  transform: scale(0.98);
}

/* 标签动画 */
.label {
  display: inline-block;
  transition: color 0.3s ease;
}

.picker-group:hover .label {
  color: #667eea;
}

/* ============ 性别单选增强 ============ */
.gender-picker-row {
  position: relative;
}

.radio-label {
  position: relative;
  transition: all 0.3s ease;
}

.radio-label::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(102, 126, 234, 0.1);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: all 0.3s ease;
}

.radio-label:has(input:checked)::after {
  width: 120%;
  height: 120%;
}

.radio-label:has(input:checked) {
  color: #667eea;
}

.radio-custom {
  transition: all 0.3s ease;
}

.radio-label:has(input:checked) .radio-custom {
  border-color: #667eea;
  background: linear-gradient(135deg, #667eea, #764ba2);
  animation: radioPulse 1s ease-in-out infinite;
}

@keyframes radioPulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.4);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(102, 126, 234, 0);
  }
}

/* ============ 按钮效果增强 ============ */
.button-container {
  padding: 0 20px;
  margin-top: 24px;
}

.btn {
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
}

.btn:active::after {
  width: 300px;
  height: 300px;
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.btn-primary:active {
  transform: translateY(-1px);
}

.btn-secondary:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.btn-secondary:active {
  transform: translateY(-1px);
}

/* 按钮点击水波纹效果 */
.btn-ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  transform: scale(0);
  animation: ripple 0.6s linear;
  pointer-events: none;
}

@keyframes ripple {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* ============ 加载状态增强 ============ */
.btn-loading {
  position: relative;
}

.btn-loading::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ============ 入场动画 ============ */
.section {
  opacity: 0;
  transform: translateY(20px);
  animation: sectionFadeIn 0.6s ease forwards;
}

.section:nth-child(1) { animation-delay: 0.1s; }
.section:nth-child(2) { animation-delay: 0.2s; }
.section:nth-child(3) { animation-delay: 0.3s; }

@keyframes sectionFadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============ Toast 提示增强 ============ */
.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  padding: 14px 28px;
  border-radius: 30px;
  font-size: 0.95rem;
  font-weight: 500;
  box-shadow: 0 8px 30px rgba(102, 126, 234, 0.4);
  z-index: 1000;
  opacity: 0;
  transition: all 0.4s ease;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ============ 响应式增强 ============ */
@media (max-width: 480px) {
  .app-title {
    font-size: 1.8rem;
  }

  .app-title::before {
    font-size: 1.5rem;
  }

  .button-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .btn {
    width: 100%;
  }

  .ad-note {
    font-size: 0.8rem;
    margin-top: 12px;
  }
}

/* ============ 暗色模式支持 ============ */
@media (prefers-color-scheme: dark) {
  .app-subtitle {
    color: #aaa;
  }

  .form-container {
    background: rgba(30, 30, 30, 0.5);
    border-radius: 20px;
  }

  .radio-label {
    color: #ccc;
  }

  .ad-note {
    color: #777;
  }
}

/* ============ 触摸反馈 ============ */
@media (hover: none) {
  .btn:active {
    transform: scale(0.96);
  }

  .picker-select:active {
    transform: scale(0.98);
  }
}
