﻿:root {
  /* Цветовая схема в стиле деревообработки */
  --wood-dark: #5d4037; /* Тёмное дерево */
  --wood-medium: #8d6e63; /* Среднее дерево */
  --wood-light: #d7ccc8; /* Светлое дерево */
  --wood-accent: #a1887f; /* Акцентное дерево */
  --sawdust: #f5e9d9; /* Цвет опилок */
  --sawdust-light: #faf3e8;
  --tool-metal: #757575; /* Цвет металла инструментов */
  --tool-metal-light: #bdbdbd;
  --text-dark: #3e2723;
  --text-medium: #5d4037;
  --text-light: #8d6e63;
  --border-wood: #a1887f;
  --border-light: #d7ccc8;
  --white: #ffffff;
  --shadow: rgba(93, 64, 55, 0.1);
  --shadow-hover: rgba(93, 64, 55, 0.2);
}

/* SVG background с текстурой дерева и инструментами */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("data:image/svg+xml,%3Csvg width='400' height='300' viewBox='0 0 400 300' xmlns='http://www.w3.org/2000/svg'%3E%3Cdefs%3E%3Cpattern id='wood-grain' patternUnits='userSpaceOnUse' width='100' height='100'%3E%3Crect width='100' height='100' fill='%23f5e9d9'/%3E%3Cpath d='M0,0 L100,100' stroke='%238d6e63' stroke-width='0.5' stroke-opacity='0.1'/%3E%3Cpath d='M100,0 L0,100' stroke='%238d6e63' stroke-width='0.5' stroke-opacity='0.1'/%3E%3Cpath d='M50,0 L50,100' stroke='%238d6e63' stroke-width='0.3' stroke-opacity='0.05'/%3E%3Cpath d='M0,50 L100,50' stroke='%238d6e63' stroke-width='0.3' stroke-opacity='0.05'/%3E%3C/pattern%3E%3C/defs%3E%3Crect width='100%25' height='100%25' fill='url(%23wood-grain)'/%3E%3Cg fill='none' stroke='%235d4037' stroke-width='1' stroke-opacity='0.08'%3E%3C!-- Контуры инструментов --%3E%3Cpath d='M100 50 L150 100 L130 120 L80 70 Z'/%3E%3Cpath d='M250 80 L300 80 L280 120 L230 120 Z'/%3E%3Ccircle cx='350' cy='150' r='25'/%3E%3Cpath d='M50 200 L100 250 L80 270 L30 220 Z'/%3E%3C/g%3E%3Cg fill='%235d4037' fill-opacity='0.05'%3E%3C!-- Детали инструментов --%3E%3Ccircle cx='110' cy='85' r='3'/%3E%3Ccircle cx='270' cy='100' r='4'/%3E%3Ccircle cx='350' cy='150' r='10'/%3E%3Ccircle cx='65' cy='235' r='3'/%3E%3C/g%3E%3Ctext x='200' y='280' font-family='Georgia' font-size='24' fill='%235d4037' fill-opacity='0.03' text-anchor='middle'%3EWOODWORK%3C/text%3E%3C/svg%3E");
  background-size: 800px 600px;
  z-index: -1;
  pointer-events: none;
  opacity: 0.4;
}

/* Основной фон с эффектом деревянной мастерской */
body {
  background: linear-gradient(135deg, var(--sawdust-light) 0%, var(--sawdust) 50%, #f5f0eb 100%);
  min-height: 100vh;
  color: var(--text-dark);
  font: 14px 'Georgia', 'Times New Roman', serif;
  margin: 0;
  padding: 0;
  scrollbar-width: thick;
  scrollbar-color: var(--wood-medium) var(--sawdust);
  line-height: 1.6;
}

/* Кастомный скроллбар в стиле деревянной ручки */
::-webkit-scrollbar {
  width: 14px;
  background: var(--sawdust);
}

::-webkit-scrollbar-track {
  background: var(--sawdust);
  border: 2px solid var(--border-light);
  border-radius: 2px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(to bottom, var(--wood-medium), var(--wood-dark));
  border: 2px solid var(--border-light);
  border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(to bottom, var(--wood-accent), var(--wood-medium));
}

/* Общие стили таблиц */
.bodyline, .forumline {
  background: var(--white);
  border: 2px solid var(--border-wood);
  border-radius: 8px;
  box-shadow: 3px 3px 15px var(--shadow);
  margin: 20px auto;
  max-width: 1200px;
  position: relative;
  overflow: hidden;
}

.bodyline::before, .forumline::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(to right, var(--wood-dark), var(--wood-medium), var(--wood-accent));
}

/* Строки таблиц */
td.row1 {
  background: linear-gradient(90deg, var(--white) 0%, var(--sawdust-light) 100%);
  border-right: 1px solid var(--border-light);
  border-top: 1px solid var(--white);
  border-bottom: 1px solid var(--border-light);
  border-left: 1px solid var(--white);
  transition: all 0.3s ease;
}

td.row2 {
  background: linear-gradient(90deg, var(--white) 0%, #f9f5f0 100%);
  border-right: 1px solid var(--border-light);
  border-top: 1px solid var(--white);
  border-bottom: 1px solid var(--border-light);
  border-left: 1px solid var(--white);
  transition: all 0.3s ease;
}

td.row3, td.spaceRow, td.row3Right {
  background: linear-gradient(90deg, var(--sawdust) 0%, var(--white) 100%);
  border-right: 1px solid var(--border-light);
  border-top: 1px solid var(--white);
  border-bottom: 1px solid var(--border-light);
  border-left: 1px solid var(--white);
}

td.row1:hover, td.row2:hover {
  background: linear-gradient(90deg, var(--wood-light) 0%, var(--white) 100%);
  transform: translateX(3px);
}

td.rowpic {
  background: linear-gradient(90deg, var(--wood-light), transparent);
  border-right: 1px solid var(--border-light);
  border-top: 1px solid var(--white);
  border-bottom: 1px solid var(--border-light);
  border-left: 1px solid var(--white);
  position: relative;
}

td.rowpic::before {
  content: '🪚';
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.5;
}

/* Заголовки таблиц */
th, th.thHead, th.thSides, th.thTop, th.thLeft, th.thRight, th.thBottom, th.thCornerL, th.thCornerR {
  background: linear-gradient(135deg, var(--wood-dark), var(--wood-medium));
  color: var(--white);
  font: bold 15px 'Georgia', serif;
  height: 35px;
  border-right: 1px solid var(--wood-accent);
  border-top: 1px solid var(--wood-light);
  border-bottom: 1px solid var(--wood-dark);
  border-left: 1px solid var(--wood-light);
  text-align: center;
  position: relative;
  text-transform: uppercase;
  letter-spacing: 1px;
}

th::before {
  content: '🔨';
  position: absolute;
  left: 15px;
  opacity: 0.8;
}

/* Категории */
td.cat, td.catHead, td.catSides, td.catLeft, td.catRight, td.catBottom {
  background: linear-gradient(135deg, var(--wood-medium), var(--wood-accent));
  color: var(--white);
  font: bold 14px 'Georgia', serif;
  height: 32px;
  border-right: 1px solid var(--wood-accent);
  border-top: 1px solid var(--wood-light);
  border-bottom: 1px solid var(--wood-dark);
  border-left: 1px solid var(--wood-light);
  position: relative;
}

td.cat::before, td.catHead::before {
  content: '📋';
  margin-right: 10px;
}

/* Заголовки */
.maintitle, h1, h2 {
  font: bold 26px 'Georgia', 'Times New Roman', serif;
  color: var(--wood-dark);
  text-shadow: 1px 1px 3px rgba(93, 64, 55, 0.1);
  margin: 1.5em 0 1em 0;
  padding-bottom: 15px;
  border-bottom: 3px solid var(--wood-medium);
  position: relative;
}

.maintitle::after, h1::after {
  content: '🪵';
  position: absolute;
  right: 0;
  font-size: 24px;
  opacity: 0.6;
}

h2 {
  font-size: 22px;
  border-left: 4px solid var(--wood-accent);
  padding-left: 15px;
  border-bottom: none;
}

/* Ссылки */
a:link, a:active, a:visited, a.postlink {
  color: var(--wood-medium);
  text-decoration: none;
  font-weight: bold;
  border-bottom: 1px dotted var(--wood-medium);
  padding-bottom: 1px;
  transition: all 0.2s ease;
}

a:hover {
  color: var(--wood-dark);
  border-bottom: 2px solid var(--wood-dark);
  text-decoration: none;
}

a.gen, a.genmed, a.gensmall {
  color: var(--wood-medium);
}

a.gen:hover, a.genmed:hover, a.gensmall:hover {
  color: var(--wood-dark);
}

/* Меню */
.mainmenu, a.mainmenu {
  font: bold 18px 'Georgia', serif;
  color: var(--wood-dark);
}

a.mainmenu:hover {
  color: var(--wood-medium);
}

/* Категории */
.cattitle, a.cattitle {
  font: bold 18px 'Georgia', serif;
  color: var(--wood-dark);
  letter-spacing: 0;
}

a.cattitle:hover {
  color: var(--wood-medium);
}

/* Текст */
.gen, .genmed, .gensmall {
  color: var(--text-medium);
  font-family: 'Georgia', serif;
}

.gen { font-size: 14px; }
.genmed { font-size: 13px; }
.gensmall { font-size: 12px; }

/* Имена пользователей */
.name {
  font: bold 14px 'Georgia', serif;
  color: var(--wood-dark);
  position: relative;
}

.name::before {
  content: '👨‍🔧';
  margin-right: 5px;
}

/* Текст сообщений */
.postbody {
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-dark);
  font-family: 'Georgia', serif;
}

.postdetails {
  font-size: 12px;
  color: var(--text-light);
  font-style: italic;
  background: var(--sawdust);
  padding: 5px 10px;
  border-radius: 3px;
  display: inline-block;
  margin: 5px 0;
}

/* Горизонтальная линия */
hr {
  border: none;
  height: 2px;
  background: linear-gradient(to right, 
    transparent, 
    var(--border-wood), 
    transparent);
  margin: 25px 0;
}

/* Код - как чертежи по дереву */
.code {
  background: var(--sawdust);
  border: 2px solid var(--border-wood);
  border-left: 4px solid var(--wood-medium);
  color: var(--text-dark);
  font: 13px 'Courier New', 'Consolas', monospace;
  padding: 20px;
  margin: 20px 0;
  border-radius: 4px;
  position: relative;
  white-space: pre-wrap;
}

.code::before {
  content: '📐 Чертеж';
  display: block;
  font: bold 12px 'Georgia', serif;
  color: var(--wood-medium);
  margin-bottom: 10px;
  padding-bottom: 5px;
  border-bottom: 1px dotted var(--wood-medium);
}

/* Цитаты - как заметки мастера */
.quote {
  background: linear-gradient(135deg, var(--wood-light), var(--white));
  border: 2px solid var(--wood-accent);
  color: var(--text-dark);
  font: italic 14px 'Georgia', serif;
  line-height: 1.6;
  padding: 20px;
  margin: 20px 0;
  border-radius: 4px;
  position: relative;
  border-left: 5px solid var(--wood-medium);
}

.quote::before {
  content: '💭';
  position: absolute;
  left: -15px;
  top: -15px;
  background: var(--white);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  border: 2px solid var(--wood-accent);
  box-shadow: 0 2px 8px var(--shadow);
}

/* Формы ввода */
input, textarea, select {
  color: var(--text-dark);
  font: bold 13px 'Georgia', serif;
  background: var(--white);
  border: 2px solid var(--border-light);
  border-radius: 4px;
  padding: 10px 12px;
  transition: all 0.3s ease;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--wood-medium);
  box-shadow: 0 0 0 3px var(--wood-light);
}

input.post, textarea.post {
  background: var(--white);
  border: 2px solid var(--border-light);
  width: 100%;
  box-sizing: border-box;
}

textarea.post {
  min-height: 150px;
  resize: vertical;
  background-image: linear-gradient(transparent 39px, var(--border-light) 40px);
  background-size: 100% 40px;
  line-height: 40px;
  background-attachment: local;
  padding-left: 15px;
  font-family: 'Georgia', serif;
}

/* Кнопки */
input.button, input.liteoption, .fakebut, input.catbutton, input.mainoption {
  background: linear-gradient(135deg, var(--wood-medium), var(--wood-accent));
  color: var(--white);
  font: bold 14px 'Georgia', serif;
  border: 2px solid var(--wood-medium);
  border-radius: 4px;
  padding: 12px 24px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

input.button:hover, input.liteoption:hover, .fakebut:hover, input.catbutton:hover {
  background: linear-gradient(135deg, var(--wood-accent), var(--wood-dark));
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--shadow-hover);
}

input.mainoption {
  background: linear-gradient(135deg, var(--wood-dark), var(--wood-medium));
}

/* Пагинация - как годичные кольца */
.pgbutt a {
  font-family: 'Georgia', serif;
  text-decoration: none;
  border: 2px solid var(--border-light);
  background: var(--white);
  padding: 8px 12px;
  margin: 5px 3px 0 0;
  border-radius: 4px;
  color: var(--wood-medium);
  font-weight: bold;
  transition: all 0.2s ease;
  position: relative;
}

.pgbutt a:hover {
  border-color: var(--wood-medium);
  background: var(--wood-light);
  transform: translateY(-1px);
}

.pgbutt a[href*="start="]::after {
  content: '→';
  margin-left: 5px;
  font-weight: bold;
}

/* Бейджи для мастеров */
.wood-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 4px;
  font: bold 12px 'Georgia', serif;
  margin-left: 8px;
}

.badge-carpenter {
  background: linear-gradient(135deg, var(--wood-medium), var(--wood-dark));
  color: white;
}
.badge-carpenter::before { content: '🔨'; }

.badge-woodcarver {
  background: linear-gradient(135deg, #a1887f, #8d6e63);
  color: white;
}
.badge-woodcarver::before { content: '🗿'; }

.badge-furniture {
  background: linear-gradient(135deg, #d7ccc8, #bcaaa4);
  color: var(--wood-dark);
}
.badge-furniture::before { content: '🪑'; }

.badge-restoration {
  background: linear-gradient(135deg, #8d6e63, #5d4037);
  color: white;
}
.badge-restoration::before { content: '🔧'; }

/* Специальные иконки для разделов */
[class*="carving"]::before { content: '🗿 '; }
[class*="furniture"]::before { content: '🪑 '; }
[class*="tools"]::before { content: '🔨 '; }
[class*="wood"]::before { content: '🪵 '; }
[class*="joinery"]::before { content: '📐 '; }
[class*="finishing"]::before { content: '🎨 '; }
[class*="restoration"]::before { content: '🔧 '; }
[class*="turning"]::before { content: '⚙️ '; }

/* Адаптивность */
@media (max-width: 768px) {
  body {
    padding: 10px;
    font-size: 16px;
  }
  
  body::before {
    background-size: 600px 450px;
    opacity: 0.3;
  }
  
  .maintitle, h1 {
    font-size: 22px;
  }
  
  h2 {
    font-size: 20px;
  }
  
  .bodyline, .forumline {
    margin: 10px;
    border-radius: 6px;
  }
  
  th, td.cat, td.catHead, td.catBottom {
    padding: 8px 12px;
    font-size: 13px;
  }
}

/* Эффект деревянной текстуры при наведении */
.forumline:hover {
  background-image: 
    linear-gradient(135deg, var(--white), var(--sawdust-light)),
    repeating-linear-gradient(
      45deg,
      transparent,
      transparent 10px,
      rgba(141, 110, 99, 0.02) 10px,
      rgba(141, 110, 99, 0.02) 20px
    );
}

/* Копирайт в стиле деревообработки */
.copyright {
  font: 12px 'Georgia', serif;
  color: var(--text-light);
  text-align: center;
  padding: 20px;
  margin-top: 30px;
  border-top: 2px solid var(--border-light);
}

.copyright::before {
  content: '🪚';
  margin-right: 5px;
}