/* ===== 全局变量和重置样式 ===== */
:root {
  --primary-color: #1A535C;
  --secondary-color: #4ECDC4;
  --accent-color: #FF6B6B;
  --light-color: #F7FFF7;
  --dark-color: #292F36;
  --transition: all 0.3s ease;
  --shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  --gradient: linear-gradient(135deg, var(--primary-color), var(--accent-color));
}

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

body {
  font-family: 'Arial', sans-serif;
  line-height: 1.6;
  color: var(--dark-color);
  background-color: var(--light-color);
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: var(--primary-color);
  transition: var(--transition);
}

a:hover {
  color: var(--accent-color);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.btn {
  display: inline-block;
  padding: 12px 30px;
  background: var(--gradient);
  color: white;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  font-size: 16px;
  font-weight: bold;
  transition: var(--transition);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

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

.btn-secondary {
  background: var(--secondary-color);
}

.section {
  padding: 80px 0;
}

.section-light {
  background-color: #f8f9fa;
}

.section-title {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 15px;
  position: relative;
  display: inline-block;
  left: 50%;
  transform: translateX(-50%);
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background: var(--gradient);
  border-radius: 2px;
}

.section-subtitle {
  text-align: center;
  font-size: 1.2rem;
  color: #666;
  margin-bottom: 50px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
  margin-top: 50px;
}

/* ===== 导航栏 ===== */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  background-color: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  z-index: 1000;
  transition: var(--transition);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 70px;
}

.logo {
  font-size: 1.8rem;
  font-weight: bold;
  color: var(--primary-color);
  display: flex;
  align-items: center;
}

.logo .emoji {
  margin-left: 10px;
  animation: bounce 2s infinite;
}

.nav-links {
  display: flex;
  list-style: none;
}

.nav-links li {
  margin-left: 30px;
}

.nav-links a {
  font-weight: 600;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gradient);
  transition: var(--transition);
}

.nav-links a:hover::after {
  width: 100%;
}

/* ===== 英雄区域 ===== */
.hero {
  height: 100vh;
  background: var(--gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: white;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="none"><polygon fill="rgba(255,255,255,0.1)" points="0,100 100,0 100,100"/></svg>');
  background-size: cover;
  opacity: 0.3;
}

.hero-content h1 {
  font-size: 4rem;
  margin-bottom: 20px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  animation: fadeInDown 1s ease;
}

.hero-content p {
  font-size: 1.5rem;
  margin-bottom: 30px;
  animation: fadeInUp 1s ease;
}

.hero-buttons {
  animation: fadeIn 1.5s ease;
}

.hero-buttons .btn {
  margin: 0 10px;
}

.scroll-indicator {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  color: rgba(255, 255, 255, 0.8);
  animation: bounce 2s infinite;
  font-size: 0.9rem;
}

/* ===== 卡片样式 ===== */
.card {
  background: white;
  border-radius: 15px;
  padding: 30px;
  text-align: center;
  box-shadow: var(--shadow);
  transition: var(--transition);
  opacity: 0;
  transform: translateY(30px);
}

.card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.card.fade-in {
  opacity: 1;
  transform: translateY(0);
}

.card.fade-in.delay-1 {
  transition-delay: 0.2s;
}

.card.fade-in.delay-2 {
  transition-delay: 0.4s;
}

.card.fade-in.delay-3 {
  transition-delay: 0.6s;
}

.card-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  background: var(--gradient);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: white;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.card h3 {
  font-size: 1.5rem;
  margin-bottom: 15px;
  color: var(--primary-color);
}

.card p {
  color: #666;
  font-size: 1rem;
}

/* ===== 项目区域 ===== */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 30px;
  margin-top: 50px;
}

.project-card {
  background: white;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
  opacity: 0;
  transform: translateY(30px);
}

.project-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.project-card.fade-in {
  opacity: 1;
  transform: translateY(0);
}

.project-card.fade-in.delay-1 {
  transition-delay: 0.2s;
}

.project-image {
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: bold;
  color: white;
  background: var(--gradient);
  position: relative;
  overflow: hidden;
}

.project-content {
  padding: 25px;
}

.project-title {
  font-size: 1.5rem;
  margin-bottom: 15px;
  color: var(--primary-color);
}

.project-description {
  color: #666;
  margin-bottom: 20px;
  font-size: 0.95rem;
  line-height: 1.6;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.tag {
  background: rgba(26, 83, 92, 0.1);
  color: var(--primary-color);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

/* ===== 工具容器 ===== */
.tool-container {
  background: #f8f9fa;
  border-radius: 10px;
  padding: 20px;
  margin: 20px 0;
  border-left: 4px solid var(--secondary-color);
}

.result-box {
  min-height: 60px;
  background: white;
  border-radius: 8px;
  padding: 15px;
  margin: 15px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  border: 1px dashed #eee;
  transition: all 0.3s ease;
}

.result-box:empty::before {
  content: '结果将显示在这里...';
  color: #ccc;
}

.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 1s linear infinite;
}

.cat-sound-buttons {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 15px 0;
}

.cat-sound-btn {
  padding: 12px;
  background: white;
  border: 2px solid var(--secondary-color);
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: var(--transition);
  color: var(--primary-color);
}

.cat-sound-btn:hover {
  background: var(--secondary-color);
  color: white;
  transform: translateY(-2px);
}

.user-foods-list {
  list-style: none;
  padding: 0;
  margin: 10px 0;
  max-height: 150px;
  overflow-y: auto;
}

.user-foods-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  background: #f8f9fa;
  border-radius: 8px;
  margin-bottom: 8px;
}

.deleteFoodBtn:hover {
  background: #ff4757 !important;
}

.food-image {
  font-size: 48px;
  text-align: center;
  margin: 15px 0;
  animation: pulse 0.5s;
}

/* ===== 联系区域 ===== */
.contact-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 50px;
  margin-top: 50px;
}

.contact-info h3 {
  font-size: 1.8rem;
  margin-bottom: 30px;
  color: var(--primary-color);
}

.contact-item {
  display: flex;
  margin-bottom: 25px;
}

.contact-icon {
  width: 50px;
  height: 50px;
  background: var(--gradient);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: white;
  margin-right: 15px;
  flex-shrink: 0;
}

.contact-item h4 {
  font-size: 1.2rem;
  margin-bottom: 5px;
  color: var(--primary-color);
}

.contact-item p {
  color: #666;
}

.social-links {
  display: flex;
  margin-top: 30px;
}

.social-icon {
  width: 45px;
  height: 45px;
  background: var(--gradient);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: white;
  margin-right: 15px;
  transition: var(--transition);
}

.social-icon:hover {
  transform: translateY(-5px);
}

.contact-form {
  background: white;
  padding: 30px;
  border-radius: 15px;
  box-shadow: var(--shadow);
}

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

.form-control {
  width: 100%;
  padding: 15px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 1rem;
  transition: var(--transition);
}

.form-control:focus {
  border-color: var(--secondary-color);
  outline: none;
  box-shadow: 0 0 0 3px rgba(78, 205, 196, 0.2);
}

textarea.form-control {
  min-height: 150px;
  resize: vertical;
}

/* ===== 页脚 ===== */
footer {
  background: var(--dark-color);
  color: white;
  padding: 60px 0 30px;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 40px;
  margin-bottom: 40px;
}

.footer-logo {
  font-size: 1.5rem;
  font-weight: bold;
  margin-bottom: 20px;
}

.footer-links h4 {
  font-size: 1.2rem;
  margin-bottom: 20px;
  position: relative;
  padding-bottom: 10px;
}

.footer-links h4::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 40px;
  height: 3px;
  background: var(--gradient);
  border-radius: 2px;
}

.footer-links ul {
  list-style: none;
}

.footer-links li {
  margin-bottom: 10px;
}

.footer-links a {
  color: #aaa;
  transition: var(--transition);
}

.footer-links a:hover {
  color: var(--secondary-color);
  padding-left: 5px;
}

.copyright {
  text-align: center;
  padding-top: 30px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: #aaa;
  font-size: 0.9rem;
}

/* ===== 动画 ===== */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-20px);
  }
  60% {
    transform: translateY(-10px);
  }
}

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

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes wiggle {
  0%, 100% {
    transform: rotate(0deg);
  }
  25% {
    transform: rotate(10deg);
  }
  75% {
    transform: rotate(-10deg);
  }
}

/* ===== 响应式设计 ===== */
@media (max-width: 768px) {
  .nav-links {
    display: none;
  }
  
  .hero-content h1 {
    font-size: 2.5rem;
  }
  
  .hero-content p {
    font-size: 1.2rem;
  }
  
  .section {
    padding: 60px 0;
  }
  
  .section-title {
    font-size: 2rem;
  }
  
  .grid {
    grid-template-columns: 1fr;
  }
  
  .project-grid {
    grid-template-columns: 1fr;
  }
  
  .contact-container {
    grid-template-columns: 1fr;
  }
  
  .hero-buttons .btn {
    display: block;
    margin: 10px auto;
    width: 80%;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 15px;
  }
  
  .hero-content h1 {
    font-size: 2rem;
  }
  
  .section-title {
    font-size: 1.8rem;
  }
  
  .card, .project-card {
    padding: 20px;
  }
}