/**
 * ============================================
 * Stylesheet: appraisal-center.css
 * Area:   海豹鑑定所 毛氈質感主題
 * Version: v1.0
 * ============================================
 */

/* =============================================
   0. CSS Variables & Reset
   ============================================= */
:root {
  --felt-cream: #FFF8F0;
  --felt-warm-white: #FFFBF5;
  --felt-light-blue: #E8F4FD;
  --felt-soft-pink: #FFF0F5;
  --felt-mint: #F0FFF4;
  --felt-lavender: #F5F0FF;
  --felt-deep-ocean: #1B2D4F;
  --felt-ocean-mid: #2A4A6B;
  --felt-tiffany: #81D8D0;
  --felt-coral: #FF7F7F;
  --felt-gold: #FFD700;
  --felt-shadow: 0 4px 20px rgba(139, 115, 85, 0.1);
  --felt-noise: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  --stitch-border: 2px dashed rgba(180, 160, 140, 0.35);
  --grade-s: linear-gradient(135deg, #FFD700, #FFA500);
  --grade-a: linear-gradient(135deg, #81D8D0, #4ECDC4);
  --grade-b: linear-gradient(135deg, #87CEEB, #6BB3D9);
  --grade-c: linear-gradient(135deg, #DDA0DD, #C39BD3);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Nunito', 'Quicksand', -apple-system, sans-serif;
  background: var(--felt-cream);
  color: #4A3728;
  overflow-x: hidden;
  min-height: 100vh;
}

#appraisal-app {
  position: relative;
  background: var(--felt-cream);
  background-image: var(--felt-noise);
  background-size: 200px 200px;
}

/* =============================================
   1. Felt Particles Layer
   ============================================= */
.felt-particles {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.felt-particle {
  position: absolute;
  border-radius: 50%;
  opacity: 0;
  animation: feltParticleFall linear infinite;
}

@keyframes feltParticleFall {
  0% { transform: translateY(-20px) rotate(0deg) scale(0.5); opacity: 0; }
  10% { opacity: 0.6; transform: scale(1); }
  90% { opacity: 0.4; }
  100% { transform: translateY(100vh) rotate(720deg) scale(0.3); opacity: 0; }
}

/* =============================================
   2. Header
   ============================================= */
.ap-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: linear-gradient(135deg, var(--felt-deep-ocean), var(--felt-ocean-mid));
  background-image: var(--felt-noise), linear-gradient(135deg, var(--felt-deep-ocean), var(--felt-ocean-mid));
  background-size: 200px 200px, 100% 100%;
  border-bottom: 3px solid var(--felt-tiffany);
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.ap-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ap-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: white;
}

.ap-logo-img {
  width: 36px; height: 36px;
  border-radius: 50%;
  animation: ap-logo-breathe 3s ease-in-out infinite;
}

@keyframes ap-logo-breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

.ap-logo-text {
  font-family: 'ZCOOL KuaiLe', cursive;
  font-size: 1.3rem;
  color: var(--felt-tiffany);
  text-shadow: 0 2px 8px rgba(129, 216, 208, 0.3);
}

.ap-nav {
  display: flex;
  gap: 20px;
}

.ap-nav-link {
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 6px 14px;
  border-radius: 20px;
  transition: all 0.3s ease;
  border: 1px solid transparent;
}

.ap-nav-link:hover {
  color: white;
  background: rgba(129, 216, 208, 0.15);
  border-color: rgba(129, 216, 208, 0.3);
  transform: translateY(-1px);
}

/* =============================================
   3. Hero Section
   ============================================= */
.ap-hero {
  position: relative;
  padding: 80px 24px 60px;
  text-align: center;
  overflow: hidden;
  min-height: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ap-hero-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, var(--felt-deep-ocean) 0%, #2A4A6B 40%, var(--felt-light-blue) 100%);
  z-index: 0;
}

.ap-hero-felt-texture {
  position: absolute;
  inset: 0;
  background-image: var(--felt-noise);
  background-size: 200px 200px;
  opacity: 0.5;
}

.ap-hero-bubbles {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle 6px, rgba(255,255,255,0.15) 100%, transparent 100%),
    radial-gradient(circle 4px, rgba(129,216,208,0.2) 100%, transparent 100%),
    radial-gradient(circle 8px, rgba(255,255,255,0.1) 100%, transparent 100%),
    radial-gradient(circle 3px, rgba(255,182,193,0.15) 100%, transparent 100%);
  background-size: 8% 15%, 12% 20%, 6% 12%, 10% 18%;
  animation: ap-bubbles-rise 20s linear infinite;
}

@keyframes ap-bubbles-rise {
  0% { background-position: 20% 100%, 60% 100%, 40% 100%, 80% 100%; }
  100% { background-position: 20% -100%, 60% -100%, 40% -100%, 80% -100%; }
}

.ap-hero-content {
  position: relative;
  z-index: 1;
}

.ap-hero-seal {
  position: relative;
  display: inline-block;
  margin-bottom: 20px;
}

.ap-hero-seal-img {
  width: 140px; height: 140px;
  object-fit: contain;
  border-radius: 50%;
  filter: drop-shadow(0 8px 24px rgba(0,0,0,0.3));
}

.ap-hero-seal-glow {
  position: absolute;
  inset: -15px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(129,216,208,0.3) 0%, transparent 70%);
  animation: ap-glow-pulse 3s ease-in-out infinite;
}

@keyframes ap-glow-pulse {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.15); }
}

.ap-hero-title {
  font-family: 'ZCOOL KuaiLe', cursive;
  font-size: 2.8rem;
  color: white;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.ap-title-icon {
  font-size: 2.2rem;
  animation: ap-magnify 2s ease-in-out infinite;
}

@keyframes ap-magnify {
  0%, 100% { transform: rotate(0deg) scale(1); }
  25% { transform: rotate(-15deg) scale(1.1); }
  75% { transform: rotate(15deg) scale(1.1); }
}

.ap-title-badge {
  font-size: 0.6rem;
  background: var(--grade-s);
  color: #fff;
  padding: 4px 10px;
  border-radius: 12px;
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  letter-spacing: 1px;
  animation: ap-badge-shine 3s ease-in-out infinite;
}

@keyframes ap-badge-shine {
  0%, 100% { box-shadow: 0 0 8px rgba(255,215,0,0.3); }
  50% { box-shadow: 0 0 20px rgba(255,215,0,0.6); }
}

.ap-hero-subtitle {
  color: rgba(255,255,255,0.85);
  font-size: 1.1rem;
  margin-bottom: 24px;
  font-weight: 500;
}

.ap-hero-stats {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.ap-stat-pill {
  background: rgba(255,255,255,0.12);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 30px;
  padding: 10px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.3s ease;
}

.ap-stat-pill:hover {
  transform: translateY(-3px) scale(1.05);
  background: rgba(255,255,255,0.18);
}

.ap-stat-num {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--felt-tiffany);
}

.ap-stat-label {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.7);
}

/* =============================================
   4. Sections Common
   ============================================= */
.ap-section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 60px 24px;
  position: relative;
  z-index: 1;
}

.ap-section-title {
  font-family: 'ZCOOL KuaiLe', cursive;
  font-size: 1.8rem;
  color: var(--felt-deep-ocean);
  text-align: center;
  margin-bottom: 40px;
  position: relative;
  display: inline-block;
  width: 100%;
}

.felt-stitch-border::after {
  content: '';
  display: block;
  width: 80px;
  height: 3px;
  margin: 12px auto 0;
  background: repeating-linear-gradient(90deg, var(--felt-tiffany) 0, var(--felt-tiffany) 8px, transparent 8px, transparent 12px);
  border-radius: 2px;
}

.felt-card {
  background: var(--felt-warm-white);
  background-image: var(--felt-noise);
  background-size: 200px 200px;
  border-radius: 20px;
  border: var(--stitch-border);
  box-shadow: var(--felt-shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.felt-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(139, 115, 85, 0.15);
}

.felt-input {
  border: var(--stitch-border);
  border-radius: 12px;
  padding: 10px 16px;
  font-family: inherit;
  font-size: 0.95rem;
  background: var(--felt-warm-white);
  color: #4A3728;
  transition: border-color 0.3s, box-shadow 0.3s;
  width: 100%;
}

.felt-input:focus {
  outline: none;
  border-color: var(--felt-tiffany);
  box-shadow: 0 0 0 3px rgba(129, 216, 208, 0.2);
}

.felt-btn {
  background: linear-gradient(135deg, var(--felt-tiffany), #4ECDC4);
  color: white;
  border: none;
  border-radius: 30px;
  padding: 14px 36px;
  font-family: 'ZCOOL KuaiLe', cursive;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(78, 205, 196, 0.3);
  position: relative;
  overflow: hidden;
}

.felt-btn::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.2) 50%, transparent 70%);
  transform: rotate(45deg) translateX(-100%);
  transition: transform 0.6s ease;
}

.felt-btn:hover::before {
  transform: rotate(45deg) translateX(100%);
}

.felt-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(78, 205, 196, 0.4);
}

.felt-btn:active {
  transform: translateY(0) scale(0.98);
}

/* =============================================
   5. Process Steps
   ============================================= */
.ap-process-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.ap-step {
  text-align: center;
  position: relative;
  padding: 30px 16px;
  background: var(--felt-warm-white);
  background-image: var(--felt-noise);
  background-size: 200px 200px;
  border-radius: 20px;
  border: var(--stitch-border);
  box-shadow: var(--felt-shadow);
  transition: transform 0.3s ease;
}

.ap-step:hover {
  transform: translateY(-6px) scale(1.02);
}

.ap-step-icon {
  font-size: 2.5rem;
  margin-bottom: 16px;
  display: inline-block;
}

.ap-step-connector {
  position: absolute;
  top: 50%;
  right: -24px;
  width: 24px;
  height: 3px;
  background: repeating-linear-gradient(90deg, var(--felt-tiffany) 0, var(--felt-tiffany) 6px, transparent 6px, transparent 10px);
}

.ap-step:last-child .ap-step-connector { display: none; }

.ap-step-title {
  font-family: 'ZCOOL KuaiLe', cursive;
  font-size: 1.1rem;
  color: var(--felt-deep-ocean);
  margin-bottom: 8px;
}

.ap-step-desc {
  font-size: 0.85rem;
  color: #7A6B5D;
  line-height: 1.5;
}

/* =============================================
   6. Submit Form
   ============================================= */
.ap-submit-card {
  padding: 40px;
  max-width: 700px;
  margin: 0 auto;
}

.ap-upload-zone {
  border: 3px dashed rgba(129, 216, 208, 0.4);
  border-radius: 20px;
  padding: 50px 30px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  background: rgba(129, 216, 208, 0.03);
  margin-bottom: 20px;
}

.ap-upload-zone:hover, .ap-upload-zone.dragover {
  border-color: var(--felt-tiffany);
  background: rgba(129, 216, 208, 0.08);
  transform: scale(1.01);
}

.ap-upload-seal {
  width: 80px; height: 80px;
  object-fit: contain;
  margin-bottom: 12px;
}

.ap-upload-text {
  font-weight: 700;
  color: var(--felt-deep-ocean);
  margin-bottom: 6px;
}

.ap-upload-hint {
  font-size: 0.8rem;
  color: #9A8B7D;
}

.ap-upload-preview {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.ap-preview-item {
  position: relative;
  width: 100px; height: 100px;
  border-radius: 12px;
  overflow: hidden;
  border: var(--stitch-border);
  animation: ap-preview-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes ap-preview-pop {
  0% { transform: scale(0) rotate(-10deg); opacity: 0; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}

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

.ap-preview-remove {
  position: absolute;
  top: 4px; right: 4px;
  width: 22px; height: 22px;
  background: rgba(255,100,100,0.9);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ap-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.ap-form-group {
  margin-bottom: 16px;
}

.ap-label {
  display: block;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--felt-deep-ocean);
  margin-bottom: 6px;
}

.ap-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M6 8L1 3h10z' fill='%234A3728'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.ap-textarea {
  resize: vertical;
  min-height: 80px;
}

.ap-btn-submit {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* =============================================
   7. Grading Cards
   ============================================= */
.ap-grade-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.ap-grade-card {
  padding: 30px 20px;
  text-align: center;
}

.ap-grade-badge {
  width: 60px; height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'ZCOOL KuaiLe', cursive;
  font-size: 1.8rem;
  color: white;
  margin: 0 auto 16px;
  font-weight: 800;
  position: relative;
}

.ap-grade-s { background: var(--grade-s); }
.ap-grade-a { background: var(--grade-a); }
.ap-grade-b { background: var(--grade-b); }
.ap-grade-c { background: var(--grade-c); }

.ap-grade-name {
  font-family: 'ZCOOL KuaiLe', cursive;
  font-size: 1.1rem;
  color: var(--felt-deep-ocean);
  margin-bottom: 8px;
}

.ap-grade-desc {
  font-size: 0.82rem;
  color: #7A6B5D;
  line-height: 1.5;
  margin-bottom: 16px;
}

.ap-grade-bar {
  height: 6px;
  background: rgba(0,0,0,0.06);
  border-radius: 3px;
  overflow: hidden;
}

.ap-grade-fill {
  height: 100%;
  background: var(--felt-tiffany);
  border-radius: 3px;
  transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
  animation: ap-grade-fill-glow 2s ease-in-out infinite;
}

@keyframes ap-grade-fill-glow {
  0%, 100% { box-shadow: none; }
  50% { box-shadow: 0 0 8px rgba(129, 216, 208, 0.4); }
}

/* =============================================
   8. Recent Appraisals
   ============================================= */
.ap-recent-list {
  display: grid;
  gap: 16px;
}

.ap-recent-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--felt-warm-white);
  background-image: var(--felt-noise);
  background-size: 200px 200px;
  border-radius: 16px;
  border: var(--stitch-border);
  box-shadow: var(--felt-shadow);
  transition: transform 0.3s ease;
  animation: ap-item-slide-in 0.5s ease-out;
}

@keyframes ap-item-slide-in {
  0% { transform: translateX(-30px); opacity: 0; }
  100% { transform: translateX(0); opacity: 1; }
}

.ap-recent-item:hover {
  transform: translateX(6px);
}

.ap-recent-thumb {
  width: 60px; height: 60px;
  border-radius: 12px;
  object-fit: cover;
  border: var(--stitch-border);
}

.ap-recent-info {
  flex: 1;
}

.ap-recent-name {
  font-weight: 700;
  color: var(--felt-deep-ocean);
  margin-bottom: 4px;
}

.ap-recent-meta {
  font-size: 0.8rem;
  color: #9A8B7D;
}

.ap-recent-grade {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'ZCOOL KuaiLe', cursive;
  font-size: 1.2rem;
  color: white;
  font-weight: 800;
}

.ap-recent-result {
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 12px;
  font-weight: 700;
}

.ap-result-genuine {
  background: rgba(78, 205, 196, 0.15);
  color: #2A9D8F;
}

.ap-result-suspicious {
  background: rgba(255, 165, 0, 0.15);
  color: #E67E22;
}

.ap-result-fake {
  background: rgba(255, 100, 100, 0.15);
  color: #E74C3C;
}

/* =============================================
   9. Knowledge Cards
   ============================================= */
.ap-knowledge-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.ap-knowledge-card {
  padding: 28px;
}

.ap-knowledge-icon {
  font-size: 2rem;
  margin-bottom: 12px;
  display: inline-block;
  animation: ap-knowledge-wobble 4s ease-in-out infinite;
}

@keyframes ap-knowledge-wobble {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-5deg); }
  75% { transform: rotate(5deg); }
}

.ap-knowledge-card h3 {
  font-family: 'ZCOOL KuaiLe', cursive;
  font-size: 1.05rem;
  color: var(--felt-deep-ocean);
  margin-bottom: 8px;
}

.ap-knowledge-card p {
  font-size: 0.85rem;
  color: #7A6B5D;
  line-height: 1.6;
}

/* =============================================
   10. Footer
   ============================================= */
.ap-footer {
  text-align: center;
  padding: 40px 24px;
  background: linear-gradient(180deg, transparent, rgba(27, 45, 79, 0.05));
  position: relative;
}

.ap-footer-seal-img {
  width: 60px; height: 60px;
  object-fit: contain;
  margin-bottom: 12px;
  opacity: 0.6;
}

.ap-footer p {
  font-size: 0.85rem;
  color: #9A8B7D;
}

/* =============================================
   11. Animations
   ============================================= */
.ap-float {
  animation: ap-float 4s ease-in-out infinite;
}

@keyframes ap-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

.ap-pulse {
  animation: ap-pulse 2.5s ease-in-out infinite;
}

@keyframes ap-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}

.ap-bounce-gentle {
  animation: ap-bounce-gentle 3s ease-in-out infinite;
}

@keyframes ap-bounce-gentle {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.ap-shimmer {
  position: relative;
  overflow: hidden;
}

.ap-shimmer::after {
  content: '';
  position: absolute;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: linear-gradient(45deg, transparent 40%, rgba(255,255,255,0.3) 50%, transparent 60%);
  animation: ap-shimmer-move 3s ease-in-out infinite;
}

@keyframes ap-shimmer-move {
  0% { transform: translateX(-100%) rotate(45deg); }
  100% { transform: translateX(100%) rotate(45deg); }
}

.ap-fade-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.ap-fade-up.ap-visible {
  opacity: 1;
  transform: translateY(0);
}

.felt-text-shadow {
  text-shadow: 0 3px 12px rgba(0,0,0,0.2), 0 1px 3px rgba(0,0,0,0.1);
}

/* =============================================
   12. Responsive
   ============================================= */
@media (max-width: 768px) {
  .ap-process-steps {
    grid-template-columns: repeat(2, 1fr);
  }
  .ap-step-connector { display: none; }
  .ap-grade-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .ap-knowledge-grid {
    grid-template-columns: 1fr;
  }
  .ap-form-row {
    grid-template-columns: 1fr;
  }
  .ap-hero-title {
    font-size: 2rem;
  }
  .ap-submit-card {
    padding: 24px;
  }
}

@media (max-width: 480px) {
  .ap-process-steps {
    grid-template-columns: 1fr;
  }
  .ap-grade-grid {
    grid-template-columns: 1fr 1fr;
  }
  .ap-hero-stats {
    flex-direction: column;
    align-items: center;
  }
  .ap-nav {
    gap: 8px;
  }
  .ap-nav-link {
    font-size: 0.8rem;
    padding: 4px 10px;
  }
}
