/* 全局样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #2563eb;
  --text-dark: #1e293b;
  --text-light: #64748b;
  --bg-glass: rgba(255, 255, 255, 0.7);
  --bg-glass-hover: rgba(255, 255, 255, 0.9);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 24px;
}

body {
  font-family: 'Noto Sans SC', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text-dark);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* 背景层 */
.background-layer {
  position: fixed;
  inset: 0;
  background-image: url('../images/background-nature.webp');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: -2;
  animation: breathe 20s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* 光斑效果 */
.light-particles {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.light-particle {
  position: absolute;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, transparent 70%);
  filter: blur(40px);
  animation: float-slow 30s ease-in-out infinite;
}

.light-particle:nth-child(1) {
  width: 250px;
  height: 250px;
  top: -10%;
  left: 20%;
}

.light-particle:nth-child(2) {
  width: 380px;
  height: 380px;
  top: 10%;
  right: 10%;
}

.light-particle:nth-child(3) {
  width: 200px;
  height: 200px;
  bottom: 30%;
  left: 10%;
}

.light-particle:nth-child(4) {
  width: 280px;
  height: 280px;
  top: 40%;
  right: 30%;
}

@keyframes float-slow {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(20px, -20px); }
  50% { transform: translate(-15px, 15px); }
  75% { transform: translate(10px, -10px); }
}

/* 容器 */
.container {
  position: relative;
  z-index: 1;
  max-width: 1400px;
  margin: 0 auto;
  padding: 3rem 2rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* 头部 */
.header {
  text-align: center;
  margin-bottom: 3rem;
  animation: fadeInDown 0.8s ease-out;
}

.weather-widget {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  border-radius: 20px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  color: var(--text-light);
  box-shadow: var(--shadow-sm);
}

.weather-icon {
  font-size: 1.2rem;
}

.greeting {
  font-size: 1rem;
  color: var(--text-light);
  margin-bottom: 1rem;
  font-weight: 500;
}

.title {
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

.subtitle {
  font-size: 1.125rem;
  color: var(--text-light);
  font-weight: 500;
}

/* 搜索区域 */
.search-section {
  margin-bottom: 3rem;
  animation: fadeInUp 0.8s ease-out 0.2s both;
}

.search-container {
  max-width: 800px;
  margin: 0 auto;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  border-radius: var(--radius-lg);
  padding: 1rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 255, 255, 0.6);
}

.search-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  padding: 0 0.5rem;
}

.search-tab {
  padding: 0.5rem 1.25rem;
  border: none;
  background: transparent;
  color: var(--text-light);
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s;
  font-family: inherit;
}

.search-tab.active {
  background: var(--primary-color);
  color: white;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.search-tab:hover:not(.active) {
  background: rgba(0, 0, 0, 0.05);
}

.search-form {
  position: relative;
  display: flex;
  align-items: center;
  background: white;
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
  transition: all 0.3s;
}

.search-form:focus-within {
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05), 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-icon {
  width: 20px;
  height: 20px;
  color: var(--text-light);
  margin-right: 0.75rem;
  flex-shrink: 0;
  transition: color 0.3s;
}

.search-form:focus-within .search-icon {
  color: var(--primary-color);
}

.search-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 1rem;
  color: var(--text-dark);
  background: transparent;
  font-family: inherit;
}

.search-input::placeholder {
  color: var(--text-light);
}

.search-button {
  padding: 0.625rem 2rem;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
  font-family: inherit;
}

.search-button:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
}

.search-button:active {
  transform: translateY(0);
}

/* 快捷链接 */
.quick-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 3rem;
  animation: fadeInUp 0.8s ease-out 0.3s both;
}

.quick-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(12px);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text-dark);
  transition: all 0.3s;
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: var(--shadow-sm);
}

.quick-link:hover {
  background: var(--bg-glass-hover);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.quick-link-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}

.quick-link[data-color="blue"] .quick-link-icon {
  background: rgba(37, 99, 235, 0.1);
  color: #2563eb;
}

.quick-link[data-color="green"] .quick-link-icon {
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
}

.quick-link[data-color="purple"] .quick-link-icon {
  background: rgba(168, 85, 247, 0.1);
  color: #a855f7;
}

.quick-link[data-color="orange"] .quick-link-icon {
  background: rgba(249, 115, 22, 0.1);
  color: #f97316;
}

.quick-link[data-color="teal"] .quick-link-icon {
  background: rgba(20, 184, 166, 0.1);
  color: #14b8a6;
}

.quick-link:hover .quick-link-icon {
  transform: scale(1.1);
}

.quick-link-icon svg {
  width: 24px;
  height: 24px;
  stroke-width: 2;
}

.quick-link-text {
  font-size: 0.9375rem;
  font-weight: 600;
}

/* 资源区域 */
.resources-section {
  margin-bottom: 3rem;
  animation: fadeInUp 0.8s ease-out 0.5s both;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  padding: 0 0.5rem;
}

.section-icon {
  width: 24px;
  height: 24px;
  padding: 4px;
  background: rgba(20, 184, 166, 0.1);
  color: #14b8a6;
  border-radius: 8px;
  stroke-width: 2;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-dark);
}

.resources-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1rem;
}

.resource-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem 1rem;
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(8px);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text-dark);
  transition: all 0.3s;
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: var(--shadow-sm);
}

.resource-card:hover {
  background: white;
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.resource-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 12px;
  font-size: 1.5rem;
  transition: all 0.3s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.resource-card:hover .resource-icon {
  background: rgba(37, 99, 235, 0.1);
  transform: scale(1.1);
}

.resource-name {
  font-size: 0.875rem;
  font-weight: 500;
  text-align: center;
  transition: color 0.3s;
}

.resource-card:hover .resource-name {
  color: var(--primary-color);
}

/* 页脚 */
.footer {
  margin-top: auto;
  padding: 2rem 0;
  text-align: center;
  color: var(--text-light);
  font-size: 0.875rem;
  animation: fadeIn 0.8s ease-out 0.7s both;
}

/* 动画 */
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* 响应式 */
@media (max-width: 768px) {
  .container {
    padding: 2rem 1rem;
  }
  
  .quick-links {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .resources-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .search-container {
    padding: 0.75rem;
  }
  
  .search-button {
    padding: 0.5rem 1.5rem;
    font-size: 0.875rem;
  }
}

@media (max-width: 480px) {
  .resources-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .title {
    font-size: 2rem;
  }
  
  .subtitle {
    font-size: 1rem;
  }
}
