:root {
  /* Основная цветовая палитра - светлая тема */
  --primary-color: #1a6ca0;
  --secondary-color: #2cb5a0;
  --accent-color: #f9a826;
  --background-color: #f8fafc;
  --card-bg: #ffffff;
  --text-color: #333f4d;
  --text-muted: #647387;
  --border-color: #e0e9f2;
  --shadow-color: rgba(34, 84, 114, 0.07);
  --shadow-hover: rgba(34, 84, 114, 0.15);
  --nav-bg: #ffffff;
  --header-overlay: rgba(16, 76, 115, 0.85);
  --tag-bg: #e3f2fd;
  --tag-color: #1a6ca0;
  --code-bg: #f0f4f8;
}

[data-theme="dark"] {
  /* Темная тема */
  --primary-color: #3d93cf;
  --secondary-color: #35d1b7;
  --accent-color: #d4a070;
  --background-color: #1a2531;
  --card-bg: #253545;
  --text-color: #e6edf3;
  --text-muted: #9eafc0;
  --border-color: #384756;
  --shadow-color: rgba(0, 0, 0, 0.25);
  --shadow-hover: rgba(0, 0, 0, 0.35);
  --nav-bg: #253545;
  --header-overlay: rgba(10, 28, 45, 0.9);
  --tag-bg: #304358;
  --tag-color: #7ebef4;
  --code-bg: #1f2d3d;
}

/* Плавный переход между темами */
body {
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Базовые стили */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--background-color);
  font-size: 16px;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.2s, transform 0.2s;
}

a:hover {
  color: var(--secondary-color);
}

/* Заголовки */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 1rem;
  color: var(--text-color);
}

h1 {
  font-size: 2.5rem;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 2rem;
  letter-spacing: -0.01em;
}

h3 {
  font-size: 1.5rem;
}

p {
  margin-bottom: 1.5rem;
}

/* Современный header с градиентом */
.site-header {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  height: 70px;
  will-change: background;
  transition: background 0.3s ease;
}

.site-header.scrolled {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}

.site-logo img {
  height: 40px;
  width: auto;
  filter: brightness(1.1) contrast(1.1);
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.site-logo:hover {
  transform: translateY(-1px);
}

.site-logo:hover img {
  filter: brightness(1.2) contrast(1.2);
  transform: scale(1.05);
}

.site-logo span {
  font-size: 1.5rem;
  font-weight: 700;
  color: white;
  letter-spacing: -0.01em;
}

/* Современная навигация */
.main-nav ul {
  display: flex;
  list-style: none;
  gap: 1.5rem;
  margin: 0;
}

.main-nav a {
  color: white;
  text-decoration: none;
  position: relative;
  padding: 0.5rem 0;
  font-weight: 500;
  transition: all 0.2s;
}

.main-nav a:hover {
  color: rgba(255, 255, 255, 0.9);
}

.main-nav a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background-color: white;
  transition: width 0.2s ease;
}

.main-nav a:hover::after,
.main-nav a.active::after {
  width: 100%;
}

/* Мобильное меню */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 21px;
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 1001;
}

.mobile-menu-toggle span {
  display: block;
  width: 100%;
  height: 3px;
  background-color: white;
  transition: transform 0.3s, opacity 0.3s;
  border-radius: 3px;
}

.mobile-menu-toggle.active span:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}

.mobile-menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

/* Hero секция с волновым эффектом */
.hero-section {
  position: relative;
  background: linear-gradient(
    135deg,
    rgba(26, 108, 160, 0.9),
    rgba(44, 181, 160, 0.9)
  ), url('/images/aquaculture-hero.jpg') center center/cover;
  color: white;
  padding: 5rem 0;
  margin-bottom: 3rem;
  overflow: hidden;
}

.hero-section::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 60px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 120' preserveAspectRatio='none'%3E%3Cpath d='M321.39,56.44c58-10.79,114.16-30.13,172-41.86,82.39-16.72,168.19-17.73,250.45-.39C823.78,31,906.67,72,985.66,92.83c70.05,18.48,146.53,26.09,214.34,3V0H0V27.35A600.21,600.21,0,0,0,321.39,56.44Z' style='fill: %23f8fafc;'/%3E%3C/svg%3E") no-repeat;
  background-size: cover;
}

[data-theme="dark"] .hero-section::after {
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 120' preserveAspectRatio='none'%3E%3Cpath d='M321.39,56.44c58-10.79,114.16-30.13,172-41.86,82.39-16.72,168.19-17.73,250.45-.39C823.78,31,906.67,72,985.66,92.83c70.05,18.48,146.53,26.09,214.34,3V0H0V27.35A600.21,600.21,0,0,0,321.39,56.44Z' style='fill: %231a2531;'/%3E%3C/svg%3E") no-repeat;
  background-size: cover;
}



.hero-content {
  max-width: 700px;
  position: relative;
  z-index: 2;
  animation: fadeInUp 0.8s ease-out forwards;
}



.hero-title {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
  line-height: 1.2;
  color: white;
}

.hero-description {
  font-size: 1.25rem;
  margin-bottom: 2rem;
  opacity: 0.9;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.2s;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  text-decoration: none;
}

.btn-primary {
  background-color: var(--accent-color);
  color: #fff;
  box-shadow: 0 4px 12px rgba(230, 184, 132, 0.2);
}

.btn-primary:hover {
  background-color: #d4a070;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(230, 184, 132, 0.3);
}

.btn-outline {
  background-color: transparent;
  color: #fff;
  border: 2px solid #fff;
}

.btn-outline:hover {
  background-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

/* Карточки */
.card {
  background-color: var(--card-bg);
  border-radius: 12px;
  box-shadow: 0 8px 20px var(--shadow-color);
  transition: all 0.3s ease;
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: 0 16px 30px var(--shadow-hover);
}

.card-img-top {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.card-body {
  padding: 1.5rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.card-title {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
  color: var(--text-color);
  font-weight: 700;
}

.card-text {
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  flex-grow: 1;
}

.card-meta {
  display: flex;
  align-items: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

.card-meta svg {
  width: 16px;
  height: 16px;
  margin-right: 6px;
}

/* Теги */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  background-color: var(--tag-bg);
  color: var(--tag-color);
  border-radius: 20px;
  font-size: 0.85rem;
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
  font-weight: 500;
  transition: all 0.2s;
}

.tag:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 5px var(--shadow-color);
}

/* Секции */
.section {
  padding: 3.5rem 0;
}

.section-title {
  margin-bottom: 2rem;
  text-align: center;
  position: relative;
  padding-bottom: 0.75rem;
}

.section-title::after {
  content: '';
  position: absolute;
  width: 80px;
  height: 4px;
  background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 2px;
}

.section-description {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 3rem;
  color: var(--text-muted);
}

/* Строчная сетка для карточек */
.row {
  display: flex;
  flex-wrap: wrap;
  margin: 0 -15px;
}

.col-md-4 {
  width: 33.333333%;
  padding: 0 15px;
  margin-bottom: 30px;
}

.col-md-6 {
  width: 50%;
  padding: 0 15px;
  margin-bottom: 30px;
}

/* Поиск */
.search-section {
  background-color: var(--card-bg);
  border-radius: 12px;
  box-shadow: 0 5px 15px var(--shadow-color);
  padding: 2rem;
  margin-bottom: 2.5rem;
}

.search-form {
  margin-bottom: 1.5rem;
}

.search-input {
  position: relative;
  margin-bottom: 1.25rem;
}

.search-input input {
  width: 100%;
  padding: 0.9rem 1rem 0.9rem 3rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 1rem;
  background-color: var(--card-bg);
  color: var(--text-color);
  transition: all 0.2s;
}

.search-input input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(26, 108, 160, 0.1);
}

.search-input svg {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-muted);
}

.search-input button {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 0.5rem 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.search-input button:hover {
  background-color: var(--secondary-color);
}

.search-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 1rem;
}

.filter-group {
  flex-grow: 1;
  min-width: 200px;
}

.filter-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  font-size: 0.95rem;
}

.filter-group select {
  width: 100%;
  padding: 0.7rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background-color: var(--card-bg);
  color: var(--text-color);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%236b7280' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: calc(100% - 1rem) center;
  padding-right: 2.5rem;
}

.filter-group select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(26, 108, 160, 0.1);
}

.tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Переключатель темы */
.theme-switcher {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  font-size: 0.9rem;
  padding: 0.4rem 0.7rem;
  border-radius: 20px;
  margin-left: 1rem;
  transition: all 0.2s;
  background-color: rgba(255, 255, 255, 0.15);
}

.theme-switcher:hover {
  background-color: rgba(255, 255, 255, 0.25);
}

.theme-switcher svg {
  width: 16px;
  height: 16px;
  margin-right: 5px;
}

/* Страница контента */
.content-article {
  background-color: var(--card-bg);
  border-radius: 12px;
  box-shadow: 0 5px 15px var(--shadow-color);
  padding: 2.5rem;
  margin-bottom: 2.5rem;
}

.content-header {
  margin-bottom: 2.5rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1.5rem;
}

.content-meta {
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: 1rem;
}

.content-body {
  font-size: 1.1rem;
  line-height: 1.8;
}

.content-body h1,
.content-body h2 {
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.content-body h3,
.content-body h4 {
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.content-body ul,
.content-body ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}

.content-body li {
  margin-bottom: 0.5rem;
}

.content-body pre {
  background-color: var(--code-bg);
  padding: 1rem;
  border-radius: 8px;
  overflow-x: auto;
  margin-bottom: 1.5rem;
}

.content-body code {
  font-family: 'Fira Code', monospace;
  background-color: var(--code-bg);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-size: 0.9em;
}

.content-body blockquote {
  border-left: 4px solid var(--primary-color);
  padding-left: 1rem;
  margin-left: 0;
  margin-bottom: 1.5rem;
  color: var(--text-muted);
  font-style: italic;
}

/* Математические формулы */
.math-inline {
  display: inline;
  font-family: 'Times New Roman', serif;
  font-style: italic;
}

.math-display {
  display: block;
  text-align: center;
  margin: 1rem 0;
  font-family: 'Times New Roman', serif;
  font-style: italic;
}

/* Стили для длинных статей */
.content-article {
  max-width: 100%;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.content-body {
  line-height: 1.8;
}

/* Предотвращение горизонтальной прокрутки для длинных формул */
.content-body .math-display {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
  .content-body .math-display {
    font-size: 0.9em;
    margin: 0.5rem 0;
  }
}

.related-content {
  margin-top: 3rem;
}

/* Футер */
.site-footer {
  background-color: var(--card-bg);
  color: var(--text-color);
  padding: 3rem 0;
  margin-top: 4rem;
  border-top: 1px solid var(--border-color);
}

.footer-columns {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2rem;
}

.footer-column {
  flex: 1;
  min-width: 200px;
}

.footer-heading {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  color: var(--text-color);
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin-bottom: 0.75rem;
}

.footer-links a {
  color: var(--text-muted);
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--primary-color);
}

.footer-bottom {
  text-align: center;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.9rem;
}



/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-up {
  opacity: 0;
  animation: fadeInUp 0.6s ease-out forwards;
}

.fade-in-up-1 { animation-delay: 0.1s; }
.fade-in-up-2 { animation-delay: 0.2s; }
.fade-in-up-3 { animation-delay: 0.3s; }
.fade-in-up-4 { animation-delay: 0.4s; }

/* Пагинация */
.pagination {
  display: flex;
  justify-content: center;
  margin-top: 2rem;
  gap: 0.25rem;
}

.pagination-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background-color: var(--card-bg);
  color: var(--text-color);
  transition: all 0.2s;
}

.pagination-link:hover {
  background-color: var(--primary-color);
  color: white;
}

.pagination-link.active {
  background-color: var(--primary-color);
  color: white;
  font-weight: 600;
}

.pagination-ellipsis {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  color: var(--text-muted);
}

/* Breadcrumbs */
.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  margin-top: 2rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.breadcrumbs a {
  color: var(--text-muted);
}

.breadcrumbs a:hover {
  color: var(--primary-color);
}

.breadcrumbs .separator {
  color: var(--text-muted);
}

/* Адаптивность */
@media (max-width: 991px) {
  .col-md-4, .col-md-6 {
    width: 50%;
  }
  
  .hero-title {
    font-size: 2.5rem;
  }
}

@media (max-width: 768px) {
  .mobile-menu-toggle {
    display: flex;
  }
  
  .main-nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 75%;
    height: 100vh;
    background-color: var(--card-bg);
    padding: 5rem 2rem 2rem;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    z-index: 1000;
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.15);
    overflow-y: auto;
  }
  
  .main-nav.active {
    right: 0;
  }
  
  .main-nav ul {
    flex-direction: column;
    gap: 0;
  }
  
  .main-nav ul li {
    width: 100%;
    border-bottom: 1px solid var(--border-color);
  }
  
  .main-nav ul li a {
    display: block;
    padding: 1rem 0;
    color: var(--text-color);
  }
  
  .main-nav ul li a::after {
    display: none;
  }
  
  .col-md-4, .col-md-6 {
    width: 100%;
  }
  
  .hero-title {
    font-size: 2rem;
  }
  
  .search-filters {
    flex-direction: column;
    gap: 1rem;
  }
  
  .content-article {
    padding: 1.5rem;
  }
  
  .card-img-top {
    height: 200px;
  }
}

/* Стили для iOS и Safari */
@supports (-webkit-touch-callout: none) {
  .hero-section::after {
    bottom: -1px;
  }
}

/* Анимация для карточек на странице результатов поиска */
.search-result-item {
  transition: transform 0.3s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 0.3s;
}

/* Анимация карточек в поиске при наведении */
.search-result-item:hover {
  transform: translateY(-8px);
  box-shadow: 0 16px 30px var(--shadow-hover);
}

/* Отступ между результатами поиска и блоками материалов */
.search-results-container {
  margin-top: 2rem;
}

/* Стили для формы обратной связи */
.feedback-section {
  background: linear-gradient(135deg, var(--card-bg), rgba(var(--primary-color), 0.05));
  padding: 4rem 0;
  margin: 4rem 0;
  border-radius: 16px;
  position: relative;
  overflow: hidden;
}

.feedback-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  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='%23f9a826' fill-opacity='0.03'%3E%3Ccircle cx='30' cy='30' r='4'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") repeat;
  opacity: 0.3;
  z-index: 0;
}

.feedback-form-container {
  position: relative;
  z-index: 1;
  max-width: 800px;
  margin: 0 auto;
  background: var(--card-bg);
  border-radius: 12px;
  padding: 3rem;
  box-shadow: 0 10px 40px var(--shadow-color);
}

.feedback-title {
  text-align: center;
  margin-bottom: 0.5rem;
  color: var(--text-color);
  font-size: 2.5rem;
  font-weight: 700;
}

.feedback-description {
  text-align: center;
  margin-bottom: 2.5rem;
  color: var(--text-muted);
  font-size: 1.1rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* Группы рейтинга */
.rating-group {
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: rgba(var(--background-color), 0.5);
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.rating-label {
  display: block;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-color);
  font-size: 1.1rem;
}

/* Кнопки рейтинга */
.rating-buttons {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  max-width: 300px;
  margin-left: auto;
  margin-right: auto;
}

.rating-btn {
  aspect-ratio: 1;
  padding: 0.75rem;
  border: 2px solid #e0e0e0;
  background: #f8f9fa;
  color: #666;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1.5rem;
  text-align: center;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
}

.rating-btn:hover {
  border-color: var(--accent-color);
  background: rgba(var(--primary-color), 0.05);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.rating-btn.active {
  border-color: var(--accent-color);
  background: var(--accent-color);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(26, 108, 160, 0.3);
}

.rating-btn.active:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(26, 108, 160, 0.4);
}

.rating-text {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

/* Поля формы */
.form-group {
  margin-bottom: 2rem;
}

.form-label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--text-color);
  font-size: 1rem;
}

.form-input,
.form-textarea {
  width: 100%;
  padding: 1rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--background-color);
  color: var(--text-color);
  font-size: 1rem;
  transition: all 0.2s ease;
  font-family: inherit;
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(var(--primary-color), 0.1);
}

.form-textarea {
  resize: vertical;
  min-height: 120px;
}

/* Кнопки формы */
.form-actions {
  text-align: center;
  margin-top: 2rem;
}

.feedback-submit-btn {
  padding: 1rem 2.5rem;
  font-size: 1.1rem;
  font-weight: 600;
  min-width: 200px;
}

/* Сообщение об успехе */
.feedback-success {
  text-align: center;
  padding: 2rem;
  background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
  color: white;
  border-radius: 12px;
  animation: fadeInUp 0.5s ease-out;
}

.success-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  display: inline-block;
  animation: bounce 0.6s ease-out;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px);
  }
  60% {
    transform: translateY(-5px);
  }
}

/* Темная тема для формы */
[data-theme="dark"] .rating-group {
  background: rgba(var(--card-bg), 0.8);
}

[data-theme="dark"] .feedback-success {
  background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
}

/* Мобильная адаптация формы */
@media (max-width: 768px) {
  .feedback-form-container {
    padding: 2rem 1.5rem;
    margin: 0 1rem;
  }

  .feedback-title {
    font-size: 2rem;
  }

  .rating-group {
    padding: 1rem;
  }

  .rating-buttons {
    grid-template-columns: repeat(5, 1fr);
    gap: 0.4rem;
    max-width: 280px;
  }

  .rating-btn {
    padding: 0.6rem;
    font-size: 1.3rem;
    min-height: 44px; /* Для удобства касаний на мобильных */
    aspect-ratio: 1;
  }

  .feedback-submit-btn {
    width: 100%;
  }

  /* Мобильная версия логотипа */
  .site-logo {
    gap: 0.25rem;
  }

  .site-logo img {
    height: 32px;
  }

  .site-logo span {
    font-size: 1.2rem;
  }
}

/* Очень маленькие экраны */
@media (max-width: 480px) {
  .rating-buttons {
    grid-template-columns: repeat(5, 1fr);
    gap: 0.3rem;
    max-width: 250px;
  }

  .rating-btn {
    padding: 0.5rem;
    font-size: 1.2rem;
    min-height: 40px;
  }

  .rating-group {
    padding: 0.75rem;
  }

  /* Логотип на очень маленьких экранах */
  .site-logo img {
    height: 28px;
  }

  .site-logo span {
    font-size: 1rem;
  }
}

mark {
  background-color: rgba(var(--accent-color-rgb, 230, 184, 132), 0.2);
  padding: 0 3px;
  border-radius: 3px;
  color: inherit;
}

/* Стили для анимации волны в футере */
.wave-footer {
  position: relative;
  margin-top: 4rem;
}

.wave-footer::before {
  content: '';
  position: absolute;
  top: -60px;
  left: 0;
  width: 100%;
  height: 60px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 120' preserveAspectRatio='none'%3E%3Cpath d='M0,0V46.29c47.79,22.2,103.59,32.17,158,28,70.36-5.37,136.33-33.31,206.8-37.5C438.64,32.43,512.34,53.67,583,72.05c69.27,18,138.3,24.88,209.4,13.08,36.15-6,69.85-17.84,104.45-29.34C989.49,25,1113-14.29,1200,52.47V0Z' opacity='.25' fill='%232cb5a0'/%3E%3Cpath d='M0,0V15.81C13,36.92,27.64,56.86,47.69,72.05,99.41,111.27,165,111,224.58,91.58c31.15-10.15,60.09-26.07,89.67-39.8,40.92-19,84.73-46,130.83-49.67,36.26-2.85,70.9,9.42,98.6,31.56,31.77,25.39,62.32,62,103.63,73,40.44,10.79,81.35-6.69,119.13-24.28s75.16-39,116.92-43.05c59.73-5.85,113.28,22.88,168.9,38.84,30.2,8.66,59,6.17,87.09-7.5,22.43-10.89,48-26.93,60.65-49.24V0Z' opacity='.5' fill='%232cb5a0'/%3E%3Cpath d='M0,0V5.63C149.93,59,314.09,71.32,475.83,42.57c43-7.64,84.23-20.12,127.61-26.46,59-8.63,112.48,12.24,165.56,35.4C827.93,77.22,886,95.24,951.2,90c86.53-7,172.46-45.71,248.8-84.81V0Z' fill='%232cb5a0'/%3E%3C/svg%3E") no-repeat;
  background-size: cover;
}

[data-theme="dark"] .wave-footer::before {
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 120' preserveAspectRatio='none'%3E%3Cpath d='M0,0V46.29c47.79,22.2,103.59,32.17,158,28,70.36-5.37,136.33-33.31,206.8-37.5C438.64,32.43,512.34,53.67,583,72.05c69.27,18,138.3,24.88,209.4,13.08,36.15-6,69.85-17.84,104.45-29.34C989.49,25,1113-14.29,1200,52.47V0Z' opacity='.25' fill='%2335d1b7'/%3E%3Cpath d='M0,0V15.81C13,36.92,27.64,56.86,47.69,72.05,99.41,111.27,165,111,224.58,91.58c31.15-10.15,60.09-26.07,89.67-39.8,40.92-19,84.73-46,130.83-49.67,36.26-2.85,70.9,9.42,98.6,31.56,31.77,25.39,62.32,62,103.63,73,40.44,10.79,81.35-6.69,119.13-24.28s75.16-39,116.92-43.05c59.73-5.85,113.28,22.88,168.9,38.84,30.2,8.66,59,6.17,87.09-7.5,22.43-10.89,48-26.93,60.65-49.24V0Z' opacity='.5' fill='%2335d1b7'/%3E%3Cpath d='M0,0V5.63C149.93,59,314.09,71.32,475.83,42.57c43-7.64,84.23-20.12,127.61-26.46,59-8.63,112.48,12.24,165.56,35.4C827.93,77.22,886,95.24,951.2,90c86.53-7,172.46-45.71,248.8-84.81V0Z' fill='%2335d1b7'/%3E%3C/svg%3E") no-repeat;
  background-size: cover;
}

.btn-outline {
  background-color: transparent;
  color: #ff5733; /* Новый цвет текста */
  border: 2px solid #ff5733; /* Соответствующий цвет границы */
}

.btn-outline:hover {
  background-color: rgba(255, 87, 51, 0.15);
  color: #ff5733;
  transform: translateY(-2px);
}

/* Стили для оглавления статей */
.table-of-contents {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.5rem;
  margin: 2rem 0;
  box-shadow: 0 2px 10px var(--shadow-color);
}

.table-of-contents h3 {
  margin-bottom: 1rem;
  color: var(--text-color);
  font-size: 1.25rem;
}

.table-of-contents ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.table-of-contents li {
  margin-bottom: 0.5rem;
}

.table-of-contents a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.2s;
  font-weight: 500;
}

.table-of-contents a:hover {
  color: var(--secondary-color);
  text-decoration: underline;
}

/* Стили для якорей в заголовках */
.content-body h2 a,
.content-body h3 a,
.content-body h4 a {
  color: inherit;
  text-decoration: none;
}

.content-body h2 a:hover::after,
.content-body h3 a:hover::after,
.content-body h4 a:hover::after {
  content: " 🔗";
  font-size: 0.8em;
  opacity: 0.7;
}

/* Кнопка "Наверх" для длинных статей */
.scroll-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 50px;
  height: 50px;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.scroll-to-top.show {
  opacity: 1;
  visibility: visible;
}

.scroll-to-top:hover {
  background-color: var(--secondary-color);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.scroll-to-top svg {
  width: 24px;
  height: 24px;
}

/* Стили для раздела О нас */
.about-container {
  margin-top: 2rem;
}

.about-image {
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 10px 30px var(--shadow-color);
}

.about-image img {
  transition: transform 0.5s ease;
  width: 100%;
}

.about-image:hover img {
  transform: scale(1.03);
}

.about-content {
  font-size: 1.1rem;
  line-height: 1.8;
}

/* Стили для FAQ */
/* Стили для FAQ аккордеона */
.faq-container {
  max-width: 800px;
  margin: 2rem auto 0;
}

.faq-item {
  margin-bottom: 1rem;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 10px var(--shadow-color);
  background-color: var(--card-bg);
  transition: box-shadow 0.3s ease;
}

.faq-item:hover {
  box-shadow: 0 5px 15px var(--shadow-hover);
}

.faq-question {
  padding: 1.25rem;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-color);
  transition: all 0.3s;
}

.faq-question:hover {
  background-color: rgba(0, 0, 0, 0.03);
}

.faq-icon {
  font-size: 1.5rem;
  line-height: 1;
  transition: transform 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s ease, padding 0.3s ease;
  padding: 0 1.25rem;
}

.faq-answer.active {
  max-height: 500px; /* достаточное значение для большинства ответов */
  padding: 0 1.25rem 1.25rem;
}

.faq-question[aria-expanded="true"] .faq-icon {
  transform: rotate(45deg);
}

.faq-answer p:last-child {
  margin-bottom: 0;
}

/* Обеспечение работы на мобильных устройствах */
@media (max-width: 768px) {
  .faq-question {
    padding: 1rem;
    font-size: 0.95rem;
  }
  
  .faq-answer {
    padding: 0 1rem;
  }
  
  .faq-answer.active {
    padding: 0 1rem 1rem;
  }
}

/* Модификации для мобильной версии */
@media (max-width: 768px) {
  /* Перемещаем переключатель темы */
  .theme-switcher {
    position: absolute;
    top: 10px;
    right: 60px;
    margin-left: 0;
    z-index: 1002;
  }
  
  /* Стиль для кнопки закрытия мобильного меню */
  .mobile-menu-toggle.active {
    position: fixed;
    right: 15px;
    z-index: 1002;
  }
  
  /* Крестик для закрытия меню */
  .mobile-menu-toggle.active span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
  }
  
  .mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
  }
  
  .mobile-menu-toggle.active span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
  }
  
  /* Улучшение видимости крестика */
  .mobile-menu-toggle.active span {
    background-color: var(--text-color);
  }
}

.btn-primary {
  background-color: var(--accent-color); /* Цвет как у "Искать материалы" */
  color: #fff;
  box-shadow: 0 4px 12px rgba(230, 184, 132, 0.2);
}

.btn-primary:hover {
  background-color: #d4a070; /* Немного темнее при наведении */
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(230, 184, 132, 0.3);
}

.btn-outline {
  background-color: transparent;
  color: var(--accent-color); /* Цвет текста как у "Искать материалы" */
  border: 2px solid var(--accent-color); /* Цвет границы как у "Искать материалы" */
}

.btn-outline:hover {
  background-color: rgba(230, 184, 132, 0.15);
  color: var(--accent-color);
  transform: translateY(-2px);
}

.filter-group select option:checked {
  background-color: var(--primary-color);
  color: white;
}

/* Более насыщенные кнопки "читать" в темной теме */
[data-theme="dark"] .btn-primary {
  background-color: var(--accent-color);
  box-shadow: 0 4px 12px #d4a070;
}

[data-theme="dark"] .btn-primary:hover {
  background-color: var(--accent-color);
  filter: brightness(1.15) saturate(1.3);
  box-shadow: 0 8px 20px rgba(230, 184, 132, 0.4);
}

/* Дополнительное выделение активного типа в фильтре */
.search-section .filter-group select {
  border-color: var(--border-color);
}

.search-section .filter-group select:focus {
  border-color: var(--primary-color);
}

/* Стили для главной картинки материала */
.content-image {
  text-align: center;
  margin: 2rem 0;
}

.content-image img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 8px 25px var(--shadow-color);
  display: block;
  margin: 0 auto;
}

/* Стили для изображений в контенте статьи */
.content-body img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 2rem auto;
  border-radius: 8px;
  box-shadow: 0 5px 15px var(--shadow-color);
}

/* Подпись к изображению */
.content-body img + em {
  display: block;
  text-align: center;
  margin-top: -1rem;
  margin-bottom: 2rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Адаптация для мобильных устройств */
@media (max-width: 768px) {
  .content-body img {
    margin: 1.5rem auto;
  }
}

/* Исправление для изображений на мобильных устройствах */
@media (max-width: 768px) {
  .content-article img,
  .card-img-top,
  .content-body img,
  .content-image img {
    width: 100%;
    height: auto;
    max-width: 100%;
    object-fit: contain;
  }

  .content-image {
    margin: 1rem 0;
  }

  /* Дополнительно добавляем ограничение контейнера */
  .content-article,
  .card,
  .content-body {
    overflow-x: hidden;
    width: 100%;
  }

  /* Убедимся, что основной контейнер также не допускает переполнений */
  .container {
    padding-left: 15px;
    padding-right: 15px;
    overflow-x: hidden;
    width: 100%;
    box-sizing: border-box;
  }
}

/* Дополнительные правила для длинных статей */
.content-article {
  max-width: 100%;
  word-wrap: break-word;
  overflow-wrap: break-word;
  overflow-x: hidden;
}

.content-body {
  line-height: 1.8;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Обеспечиваем правильное отображение всех типов изображений в длинных статьях */
.content-article img,
.content-body img,
.content-image img {
  width: 100%;
  height: auto;
  max-width: 100%;
  object-fit: contain;
  box-sizing: border-box;
}

/* Специальные правила для изображений в длинных статьях */
.content-body figure {
  margin: 2rem 0;
  text-align: center;
}

.content-body figure img {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  height: auto;
}

/* Предотвращение переполнения контейнеров в длинных статьях */
.container,
.content-article,
.content-body {
  overflow-x: hidden;
  width: 100%;
  box-sizing: border-box;
}

/* Мобильная адаптация для длинных статей */
@media (max-width: 768px) {
  .content-article {
    padding: 1rem;
    margin-bottom: 1.5rem;
  }

  .content-body {
    font-size: 1rem;
    line-height: 1.7;
  }

  .content-body h1,
  .content-body h2,
  .content-body h3 {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    line-height: 1.3;
  }

  .content-body p {
    margin-bottom: 1.2rem;
  }

  .content-body ul,
  .content-body ol {
    margin-bottom: 1.2rem;
    padding-left: 1rem;
  }

  .content-body li {
    margin-bottom: 0.5rem;
  }

  /* Математические формулы на мобильных */
  .math-display {
    font-size: 0.9em;
    margin: 0.5rem 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .math-inline {
    font-size: 0.95em;
  }
}

/* Очень маленькие экраны */
@media (max-width: 480px) {
  .content-article {
    padding: 0.75rem;
  }

  .content-body {
    font-size: 0.95rem;
    line-height: 1.6;
  }

  .content-header h1 {
    font-size: 1.8rem;
  }

  .content-meta {
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
  }
}

