/* ================================
   福建水稻科普云平台 - 全局样式
   ================================ */

/* CSS Variables */
:root {
  --color-primary: #2d5a27;
  --color-primary-light: #4a8b3a;
  --color-primary-lighter: #6fae5e;
  --color-primary-dark: #1a3d16;
  --color-accent: #c9a227;
  --color-accent-light: #e0bd4a;
  --color-bg: #f8f9f6;
  --color-bg-alt: #eef2ea;
  --color-text: #1a2e1a;
  --color-text-muted: #5c6b5c;
  --color-white: #ffffff;
  --color-border: #e0e5dc;
  --color-border-light: #edf0ea;
  --color-shadow: rgba(45, 90, 39, 0.08);
  --color-shadow-hover: rgba(45, 90, 39, 0.15);
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.2s ease;
  --max-width: 1200px;
  --header-height: 72px;
  --font-sans: "Noto Sans SC", "Microsoft YaHei", "PingFang SC", -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Reset */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

img {
  max-width: 100%;
  display: block;
}

ul, ol {
  list-style: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  outline: none;
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  outline: none;
}

/* Layout */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 80px 0;
}

.section-sm {
  padding: 48px 0;
}

.section-title {
  text-align: center;
  margin-bottom: 12px;
}

.section-title h2 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-primary);
  letter-spacing: 2px;
}

.section-title .subtitle {
  display: block;
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-top: 8px;
  letter-spacing: 3px;
  text-transform: uppercase;
}

.section-title .divider {
  width: 48px;
  height: 3px;
  background: var(--color-accent);
  margin: 16px auto 0;
  border-radius: 2px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 32px;
  border-radius: var(--radius-full);
  font-size: 0.95rem;
  font-weight: 500;
  transition: var(--transition);
  white-space: nowrap;
}

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

.btn-primary:hover {
  background: var(--color-primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--color-shadow-hover);
}

.btn-outline {
  background: transparent;
  color: var(--color-primary);
  border: 1.5px solid var(--color-primary);
}

.btn-outline:hover {
  background: var(--color-primary);
  color: var(--color-white);
  transform: translateY(-2px);
}

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

.btn-accent:hover {
  background: #b08d1f;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(201, 162, 39, 0.3);
}

.btn-lg {
  padding: 16px 40px;
  font-size: 1.05rem;
}

/* Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 1000;
  transition: var(--transition);
  border-bottom: 1px solid transparent;
}

.site-header.scrolled {
  border-bottom-color: var(--color-border);
  box-shadow: 0 2px 20px var(--color-shadow);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary);
  border-radius: var(--radius-sm);
}

.logo-text {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-primary);
  letter-spacing: 1px;
}

.logo-text .sub {
  display: block;
  font-size: 0.65rem;
  font-weight: 400;
  color: var(--color-text-muted);
  letter-spacing: 2px;
}

/* Navigation */
.nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav a {
  position: relative;
  padding: 8px 16px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text);
  border-radius: var(--radius-sm);
}

.nav a::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: var(--color-accent);
  transition: var(--transition);
  border-radius: 1px;
}

.nav a:hover {
  color: var(--color-primary);
}

.nav a:hover::after,
.nav a.active::after {
  width: 24px;
}

.nav a.active {
  color: var(--color-primary);
}

/* Mobile menu toggle */
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: transparent;
  padding: 8px;
}

.menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-primary);
  transition: var(--transition);
  border-radius: 1px;
}

.menu-toggle.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Footer */
.site-footer {
  background: var(--color-primary-dark);
  color: rgba(255, 255, 255, 0.8);
  padding: 60px 0 24px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-brand .logo-text {
  color: var(--color-white);
}

.footer-brand .logo-text .sub {
  color: rgba(255, 255, 255, 0.6);
}

.footer-brand p {
  margin-top: 16px;
  font-size: 0.85rem;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.6);
}

.footer-col h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-white);
  margin-bottom: 20px;
}

.footer-col ul li {
  margin-bottom: 12px;
}

.footer-col ul li a {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
}

.footer-col ul li a:hover {
  color: var(--color-white);
}

.footer-contact li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 12px;
}

.footer-contact .icon {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin-top: 3px;
}

.footer-bottom {
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.4);
}

/* Cards */
.card {
  background: var(--color-white);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: var(--transition);
  border: 1px solid var(--color-border-light);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px var(--color-shadow-hover);
  border-color: var(--color-border);
}

.card-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: var(--color-bg-alt);
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-body {
  padding: 24px;
}

.card-body h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 8px;
}

.card-body p {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  line-height: 1.6;
}

/* Grid */
.grid {
  display: grid;
  gap: 24px;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* Page Banner */
.page-banner {
  margin-top: var(--header-height);
  padding: 60px 0;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  color: var(--color-white);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.page-banner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M30 30c0-5.5-4.5-10-10-10s-10 4.5-10 10 4.5 10 10 10 10-4.5 10-10zm10 0c0-5.5 4.5-10 10-10s10 4.5 10 10-4.5 10-10 10-10-4.5-10-10z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.page-banner h1 {
  position: relative;
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: 3px;
}

.page-banner .breadcrumb {
  position: relative;
  margin-top: 12px;
  font-size: 0.85rem;
  opacity: 0.8;
}

.page-banner .breadcrumb a {
  color: rgba(255, 255, 255, 0.8);
}

.page-banner .breadcrumb a:hover {
  color: var(--color-white);
}

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

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

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

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.animate-fade-up {
  animation: fadeInUp 0.8s ease forwards;
}

.animate-fade {
  animation: fadeIn 0.8s ease forwards;
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* Tags */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 500;
}

.tag-primary {
  background: rgba(45, 90, 39, 0.1);
  color: var(--color-primary);
}

.tag-accent {
  background: rgba(201, 162, 39, 0.12);
  color: #8a7019;
}

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

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: 8px;
}

.form-group label .required {
  color: #e53e3e;
  margin-left: 2px;
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  background: var(--color-white);
  transition: var(--transition-fast);
}

.form-control:focus {
  border-color: var(--color-primary-light);
  box-shadow: 0 0 0 3px rgba(74, 139, 58, 0.1);
}

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

/* Responsive */
@media (max-width: 968px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
  
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .nav {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: 100%;
    background: var(--color-white);
    flex-direction: column;
    align-items: stretch;
    padding: 16px 24px;
    gap: 0;
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    box-shadow: 0 8px 32px var(--color-shadow);
  }

  .nav.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .nav a {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
  }

  .nav a:hover {
    background: var(--color-bg-alt);
  }

  .nav a::after {
    display: none;
  }

  .menu-toggle {
    display: flex;
  }

  .section {
    padding: 56px 0;
  }

  .section-title h2 {
    font-size: 1.6rem;
  }

  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .page-banner h1 {
    font-size: 1.6rem;
  }

  .btn-lg {
    padding: 14px 32px;
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 16px;
  }

  .section {
    padding: 40px 0;
  }
}
