/* ===== 增强层次感和视觉优化 ===== */

/* ===== 深度和层次变量 ===== */
:root {
  /* Z-index 层级管理 */
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal-backdrop: 1040;
  --z-modal: 1050;
  --z-popover: 1060;
  --z-tooltip: 1070;
  --z-toast: 1080;
  
  /* 增强阴影系统 */
  --shadow-minimal: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-soft: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-medium: 0 4px 12px rgba(0, 0, 0, 0.12);
  --shadow-strong: 0 8px 24px rgba(0, 0, 0, 0.16);
  --shadow-dramatic: 0 16px 32px rgba(0, 0, 0, 0.24);
  --shadow-floating: 0 12px 40px rgba(0, 0, 0, 0.2);
  
  /* 彩色阴影 */
  --shadow-primary: 0 4px 16px rgba(0, 162, 255, 0.25);
  --shadow-success: 0 4px 16px rgba(76, 175, 80, 0.25);
  --shadow-warning: 0 4px 16px rgba(255, 193, 7, 0.25);
  --shadow-danger: 0 4px 16px rgba(244, 67, 54, 0.25);
  
  /* 渐变背景 */
  --gradient-primary: linear-gradient(135deg, #00A2FF 0%, #0082CC 100%);
  --gradient-secondary: linear-gradient(135deg, #4CAF50 0%, #45A049 100%);
  --gradient-accent: linear-gradient(135deg, #FF6B35 0%, #E55A2B 100%);
  --gradient-hero: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-card: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  
  /* 层次间距系统 */
  --space-section: 4rem;
  --space-component: 2.5rem;
  --space-element: 1.5rem;
  --space-item: 1rem;
  --space-detail: 0.5rem;
}

/* ===== 暗色主题增强 ===== */
[data-theme="dark"] {
  --shadow-minimal: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-soft: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-medium: 0 4px 12px rgba(0, 0, 0, 0.5);
  --shadow-strong: 0 8px 24px rgba(0, 0, 0, 0.6);
  --shadow-dramatic: 0 16px 32px rgba(0, 0, 0, 0.7);
  --shadow-floating: 0 12px 40px rgba(0, 0, 0, 0.8);
}

/* ===== 页面整体层次结构 ===== */
.page-wrapper {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.main-content {
  flex: 1;
  position: relative;
  z-index: 1;
}

/* ===== Header 增强层次 ===== */
.header {
  background: var(--gradient-primary);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-medium);
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.nav {
  position: relative;
}

.nav::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
}

.logo {
  font-weight: 700;
  font-size: 1.5rem;
  text-decoration: none;
  color: white;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  transition: var(--transition);
  position: relative;
}

.logo::before {
  content: '';
  position: absolute;
  top: -5px;
  left: -5px;
  right: -5px;
  bottom: -5px;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
  border-radius: 50%;
  opacity: 0;
  transition: var(--transition);
}

.logo:hover::before {
  opacity: 1;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 0.5rem;
}

.nav-link {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  padding: 0.75rem 1rem;
  border-radius: var(--border-radius);
  transition: var(--transition);
  position: relative;
  font-weight: 500;
  backdrop-filter: blur(5px);
}

.nav-link::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--border-radius);
  opacity: 0;
  transition: var(--transition);
  transform: scale(0.8);
}

.nav-link:hover::before,
.nav-link.active::before {
  opacity: 1;
  transform: scale(1);
}

.nav-link:hover,
.nav-link.active {
  color: white;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* ===== Hero Section 层次优化 ===== */
.hero-section {
  background: var(--gradient-hero);
  position: relative;
  padding: var(--space-section) 0;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="rgba(255,255,255,0.03)"/><circle cx="75" cy="75" r="1" fill="rgba(255,255,255,0.03)"/><circle cx="50" cy="50" r="0.5" fill="rgba(255,255,255,0.02)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
  opacity: 0.3;
  z-index: 0;
}

.hero-section::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(180deg, transparent 0%, var(--bg-primary) 100%);
  z-index: 1;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  color: white;
  text-align: center;
  margin-bottom: 1rem;
  text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  position: relative;
  z-index: 2;
  animation: heroFadeInUp 1s ease-out;
}

.hero-subtitle {
  font-size: clamp(1rem, 3vw, 1.25rem);
  color: rgba(255, 255, 255, 0.9);
  text-align: center;
  margin-bottom: 2rem;
  position: relative;
  z-index: 2;
  animation: heroFadeInUp 1s ease-out 0.2s both;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  position: relative;
  z-index: 2;
  animation: heroFadeInUp 1s ease-out 0.4s both;
}

.hero-stats {
  display: flex;
  gap: 2rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 1.5rem;
  position: relative;
  z-index: 2;
}

.hero-stats .stat-item {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border-radius: var(--border-radius-lg);
  padding: 1rem 1.5rem;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: var(--transition);
}

.hero-stats .stat-item:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.2);
  box-shadow: var(--shadow-floating);
}

.hero-stats .stat-number {
  font-size: 1.8rem;
  font-weight: 700;
  color: white;
  line-height: 1;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.hero-stats .stat-label {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.9);
  margin-top: 0.25rem;
  font-weight: 500;
}

/* ===== 卡片系统层次优化 ===== */
.card {
  background: var(--bg-card);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--border-color);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-primary);
  transform: scaleX(0);
  transition: var(--transition);
  transform-origin: left;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-floating);
}

.card:hover::before {
  transform: scaleX(1);
}

.card-elevated {
  box-shadow: var(--shadow-medium);
  transform: translateY(-2px);
}

.card-elevated:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-dramatic);
}

.card-header {
  padding: 1.5rem 1.5rem 1rem;
  border-bottom: 1px solid var(--border-color);
  background: linear-gradient(135deg, var(--bg-secondary) 0%, rgba(255,255,255,0.5) 100%);
  position: relative;
}

.card-header h2 {
  margin: 0;
  color: var(--primary-color);
  font-weight: 600;
  font-size: 1.25rem;
  position: relative;
}

.card-body {
  padding: 1.5rem;
}

/* ===== 按钮系统层次优化 ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--border-radius);
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  font-size: 0.95rem;
  line-height: 1.4;
  white-space: nowrap;
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transition: var(--transition);
  transform: translate(-50%, -50%);
}

.btn:hover::before {
  width: 300px;
  height: 300px;
}

.btn-primary {
  background: var(--gradient-primary);
  color: white;
  box-shadow: var(--shadow-primary);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-primary), var(--shadow-floating);
}

.btn-secondary {
  background: var(--gradient-secondary);
  color: white;
  box-shadow: var(--shadow-success);
}

.btn-secondary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-success), var(--shadow-floating);
}

.btn-outline {
  background: transparent;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
  box-shadow: var(--shadow-minimal);
}

.btn-outline:hover {
  background: var(--primary-color);
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-primary);
}

/* ===== 网格和列表层次优化 ===== */
.features-grid,
.plants-grid,
.tools-grid,
.tips-grid {
  display: grid;
  gap: 1.5rem;
  margin-top: 2rem;
}

.features-grid {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.plants-grid,
.tools-grid {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.tips-grid {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

/* ===== 特色卡片层次优化 ===== */
.feature-card,
.plant-card,
.tool-card,
.tip-card {
  background: var(--bg-card);
  border-radius: var(--border-radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--border-color);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.feature-card::after,
.plant-card::after,
.tool-card::after,
.tip-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(0,162,255,0.05) 0%, rgba(76,175,80,0.05) 100%);
  opacity: 0;
  transition: var(--transition);
  pointer-events: none;
}

.feature-card:hover::after,
.plant-card:hover::after,
.tool-card:hover::after,
.tip-card:hover::after {
  opacity: 1;
}

.feature-card:hover,
.plant-card:hover,
.tool-card:hover,
.tip-card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: var(--shadow-floating);
}

/* ===== 图标和表情符号层次优化 ===== */
.card-icon,
.plant-icon,
.tool-icon,
.tip-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  display: block;
  text-align: center;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
  transition: var(--transition);
}

.feature-card:hover .card-icon,
.plant-card:hover .plant-icon,
.tool-card:hover .tool-icon,
.tip-card:hover .tip-icon {
  transform: scale(1.1) rotate(5deg);
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

/* ===== 文字层次优化 ===== */
h1 {
  font-size: clamp(2rem, 4vw, 2.5rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
  color: var(--text-primary);
  position: relative;
}

h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 0.75rem;
  color: var(--primary-color);
  position: relative;
}

h3 {
  font-size: clamp(1.25rem, 2.5vw, 1.5rem);
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

h4 {
  font-size: 1.125rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

/* ===== 段落和文本层次 ===== */
p {
  line-height: 1.7;
  margin-bottom: 1rem;
  color: var(--text-secondary);
}

.lead {
  font-size: 1.125rem;
  font-weight: 400;
  color: var(--text-primary);
  line-height: 1.6;
}

.text-muted {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ===== 列表层次优化 ===== */
ul, ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

li {
  margin-bottom: 0.5rem;
  line-height: 1.6;
  color: var(--text-secondary);
  position: relative;
}

ul li::marker {
  color: var(--primary-color);
}

ol li::marker {
  color: var(--primary-color);
  font-weight: 600;
}

/* ===== 分隔线和装饰元素 ===== */
hr {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-color), transparent);
  margin: 2rem 0;
}

.divider-fancy {
  position: relative;
  text-align: center;
  margin: 3rem 0;
}

.divider-fancy::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
  z-index: 1;
}

.divider-fancy::after {
  content: '✦';
  background: var(--bg-primary);
  color: var(--primary-color);
  padding: 0 1rem;
  font-size: 1.2rem;
  position: relative;
  z-index: 2;
}

/* ===== Footer 层次优化 ===== */
.footer {
  background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
  position: relative;
  margin-top: var(--space-section);
}

.footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
}

/* ===== 动画效果 ===== */
@keyframes heroFadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes cardFloat {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-5px);
  }
}

.card-floating {
  animation: cardFloat 6s ease-in-out infinite;
}

.card-floating:nth-child(2n) {
  animation-delay: -2s;
}

.card-floating:nth-child(3n) {
  animation-delay: -4s;
}

/* ===== 响应式层次调整 ===== */
@media (max-width: 768px) {
  :root {
    --space-section: 2.5rem;
    --space-component: 1.5rem;
    --space-element: 1rem;
  }
  
  .hero-section {
    padding: 2rem 0;
  }
  
  .hero-actions {
    flex-direction: column;
    align-items: center;
  }
  
  .btn {
    width: 100%;
    max-width: 280px;
  }
  
  .features-grid,
  .plants-grid,
  .tools-grid,
  .tips-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .card {
    margin-bottom: 1rem;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 1.8rem;
  }
  
  .hero-subtitle {
    font-size: 1rem;
  }
  
  .card-header,
  .card-body {
    padding: 1rem;
  }
}

/* ===== 高对比度和可访问性增强 ===== */
@media (prefers-contrast: high) {
  :root {
    --shadow-soft: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-medium: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-floating: 0 12px 40px rgba(0, 0, 0, 0.5);
  }
  
  .card {
    border-width: 2px;
  }
  
  .btn {
    border-width: 2px;
    font-weight: 600;
  }
}

/* ===== 减少动画偏好 ===== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
