/* ===================================
   深圳废品回收 - 自定义样式
   优化版本 v2.0
   =================================== */

/* === 1. 全局样式与性能优化 === */
:root {
  --primary-color: #4caf50;
  --primary-dark: #2e7d32;
  --primary-light: #81c784;
  --secondary-color: #ffd700;
  --accent-color: #ff9800;
  --text-dark: #212529;
  --text-light: #6c757d;
  --bg-light: #f8f9fa;
  --bg-white: #ffffff;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.16);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Microsoft YaHei', 'PingFang SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-dark);
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  overflow-x: hidden;
}

/* 性能优化：will-change */
.hero-section, .navbar-eco, .process-step, .service-card {
  will-change: transform;
}

/* === 2. Logo样式 === */
.logo-container {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.logo-container:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.logo-svg {
  width: 180px;
  height: auto;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

/* === 3. 导航栏增强 === */
.navbar-eco {
  background: rgba(255, 255, 255, 0.98) !important;
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  box-shadow: 0 4px 24px rgba(76, 175, 80, 0.15);
  border-bottom: 2px solid rgba(76, 175, 80, 0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: var(--transition);
}

.navbar-eco.scrolled {
  box-shadow: 0 6px 32px rgba(76, 175, 80, 0.2);
  border-bottom-color: var(--primary-color);
}

.nav-link {
  position: relative;
  font-weight: 500;
  color: var(--text-dark) !important;
  padding: 12px 20px !important;
  transition: var(--transition);
}

.nav-link::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-color), var(--primary-dark));
  transform: translateX(-50%);
  transition: width 0.3s ease;
  border-radius: 3px 3px 0 0;
}

.nav-link:hover::before,
.nav-link.active::before {
  width: 80%;
}

.nav-link:hover {
  color: var(--primary-color) !important;
  transform: translateY(-2px);
}

/* === 4. 主横幅区域 === */
.hero-section {
  background: linear-gradient(135deg, #1e5128 0%, #2e7d32 50%, #4caf50 100%);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  margin: 20px 0;
  border-radius: var(--radius-lg);
}

.hero-section::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
  animation: float 8s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(20px, -20px) rotate(5deg); }
  50% { transform: translate(0, -40px) rotate(10deg); }
  75% { transform: translate(-20px, -20px) rotate(5deg); }
}

.hero-content h1 {
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 800;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
  margin-bottom: 1rem;
}

.hero-content .lead {
  font-size: clamp(1rem, 2vw, 1.3rem);
  opacity: 0.95;
}

.feature-item {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  padding: 20px;
  border-radius: var(--radius-md);
  text-align: center;
  transition: var(--transition);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.feature-item:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.contact-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-lg);
  border: 2px solid var(--secondary-color);
}

.contact-card h3 {
  color: var(--primary-dark);
  font-weight: 700;
}

.contact-info .fw-bold {
  color: var(--primary-color);
  font-size: 1.8rem;
}

/* === 5. 服务流程 === */
.process-section {
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  border: 1px solid rgba(76, 175, 80, 0.1);
}

.process-step {
  transition: var(--transition);
  cursor: pointer;
}

.process-step:hover {
  transform: translateY(-10px);
}

.step-icon {
  width: 70px;
  height: 70px;
  font-size: 28px;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  position: relative;
}

.step-icon::after {
  content: '';
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  background: inherit;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: -1;
  filter: blur(10px);
}

.process-step:hover .step-icon::after {
  opacity: 0.6;
}

.process-step:hover .step-icon {
  transform: scale(1.1) rotate(5deg);
}

/* === 6. 服务卡片 === */
.service-card {
  background: var(--bg-white);
  border-radius: var(--radius-md);
  padding: 30px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  border: 1px solid rgba(0, 0, 0, 0.05);
  height: 100%;
}

.service-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-8px);
  border-color: var(--primary-color);
}

.service-icon {
  width: 70px;
  height: 70px;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  margin: 0 auto 20px;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
}

.service-card:hover .service-icon {
  transform: rotateY(360deg);
}

/* === 7. 手风琴优化 === */
.accordion-item {
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  margin-bottom: 16px !important;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  overflow: hidden;
}

.accordion-item:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--primary-color) !important;
}

.accordion-button {
  background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
  color: var(--text-dark);
  font-weight: 600;
  transition: var(--transition);
  border: none !important;
}

.accordion-button:not(.collapsed) {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: white;
  box-shadow: none;
}

.accordion-button:hover {
  background: linear-gradient(135deg, var(--primary-light), var(--primary-color));
  color: white;
}

.accordion-button:focus {
  box-shadow: 0 0 0 0.25rem rgba(76, 175, 80, 0.25);
}

.accordion-body {
  background: var(--bg-white);
  padding: 30px;
}

/* === 8. 按钮样式 === */
.btn {
  border-radius: var(--radius-sm);
  padding: 12px 28px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: var(--transition);
  border: none;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
  width: 300px;
  height: 300px;
}

.btn-success {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.btn-success:hover {
  background: linear-gradient(135deg, var(--primary-dark), #1b5e20);
  box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
  transform: translateY(-2px);
}

.btn-primary {
  background: linear-gradient(135deg, #2196f3, #1976d2);
  box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #1976d2, #1565c0);
  box-shadow: 0 6px 20px rgba(33, 150, 243, 0.4);
  transform: translateY(-2px);
}

/* === 9. 页脚样式 === */
footer {
  background: linear-gradient(135deg, #1e5128 0%, #2e7d32 100%);
  color: white;
  padding: 40px 0 20px;
  margin-top: 60px;
  position: relative;
}

footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--secondary-color), var(--accent-color), var(--secondary-color));
}

.footer-line {
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--secondary-color), transparent);
  margin: 40px 0 0;
}

footer a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  transition: var(--transition);
}

footer a:hover {
  color: var(--secondary-color);
  text-decoration: underline;
}

/* === 10. 回到顶部按钮 === */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 24px;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  box-shadow: var(--shadow-lg);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.back-to-top.show {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background: linear-gradient(135deg, var(--primary-dark), #1b5e20);
  transform: translateY(-5px);
  box-shadow: 0 10px 40px rgba(76, 175, 80, 0.4);
}

/* === 11. 加载动画 === */
.loading-spinner {
  display: inline-block;
  width: 50px;
  height: 50px;
  border: 4px solid rgba(76, 175, 80, 0.2);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* === 12. 卡片悬浮效果 === */
.card-hover {
  transition: var(--transition);
  cursor: pointer;
}

.card-hover:hover {
  transform: translateY(-10px) scale(1.02);
  box-shadow: var(--shadow-lg);
}

/* === 13. 渐变文字 === */
.gradient-text {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
}

/* === 14. 响应式优化 === */
@media (max-width: 991.98px) {
  .hero-section {
    padding: 30px 20px !important;
  }
  
  .contact-card {
    margin-top: 30px;
  }
  
  .process-section {
    padding: 30px 20px !important;
  }
}

@media (max-width: 767.98px) {
  .hero-content h1 {
    font-size: 1.8rem;
  }
  
  .hero-content .lead {
    font-size: 1rem;
  }
  
  .feature-item {
    margin-bottom: 15px;
  }
  
  .step-icon {
    width: 60px;
    height: 60px;
    font-size: 24px;
  }
  
  .back-to-top {
    width: 45px;
    height: 45px;
    bottom: 20px;
    right: 20px;
  }
  
  .logo-svg {
    width: 140px;
  }
}

/* === 15. 打印样式 === */
@media print {
  .navbar-eco, .back-to-top, footer {
    display: none;
  }
  
  body {
    background: white;
  }
  
  .hero-section {
    background: none;
    color: black;
  }
}

/* === 16. 无障碍优化 === */
.skip-to-content {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--primary-color);
  color: white;
  padding: 8px;
  text-decoration: none;
  z-index: 100;
}

.skip-to-content:focus {
  top: 0;
}

/* === 17. 性能优化 - 懒加载图片 === */
img[loading="lazy"] {
  opacity: 0;
  transition: opacity 0.3s;
}

img[loading="lazy"].loaded {
  opacity: 1;
}

/* === 18. 高对比度模式支持 === */
@media (prefers-contrast: high) {
  :root {
    --primary-color: #2e7d32;
    --text-dark: #000000;
  }
  
  .btn {
    border: 2px solid currentColor;
  }
}

/* === 19. 深色模式支持 === */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-light: #1a1a1a;
    --bg-white: #2a2a2a;
    --text-dark: #e0e0e0;
    --text-light: #b0b0b0;
  }
  
  body {
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
  }
  
  .navbar-eco {
    background: rgba(42, 42, 42, 0.98) !important;
  }
  
  .service-card,
  .accordion-body {
    background: var(--bg-white);
    color: var(--text-dark);
  }
}

/* === 20. 动画效果类 === */
.fade-in {
  animation: fadeIn 0.6s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.slide-in-left {
  animation: slideInLeft 0.6s ease-out;
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.slide-in-right {
  animation: slideInRight 0.6s ease-out;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
